/* YHORIZON shared surface system.
   Loaded after each product stylesheet. Product CSS owns layout and interaction;
   this file owns identity: type, colour, header/footer skin and controls. */

@font-face {
  font-family: "Archivo";
  src: url("./fonts/Archivo-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("./fonts/NotoSansSC-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url("./fonts/NotoSansSC-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("./fonts/GeistMono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

:root {
  --yh-paper: #f3f1ec;
  --yh-paper-hi: #fbfaf7;
  --yh-paper-lo: #e7e3db;
  --yh-ink: #171719;
  --yh-ink-soft: #36353a;
  --yh-muted: #5f5d60;
  --yh-line: rgba(23, 23, 25, .16);
  --yh-line-strong: rgba(23, 23, 25, .44);
  --yh-red: #c51e2f;
  --yh-red-deep: #8f1220;
  --yh-yellow: #f2c94c;
  --yh-dark: #171719;
  --yh-dark-2: #1e1d20;
  --yh-silk: #fafaf7;
  --yh-silk-muted: #b9b5ae;
  --yh-silk-line: rgba(250, 250, 247, .16);
  --yh-silk-line-strong: rgba(250, 250, 247, .38);
  --yh-horizon: linear-gradient(90deg, var(--yh-red) 0%, var(--yh-red) 62%, var(--yh-yellow) 100%);
  --yh-font-sans: "Archivo", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --yh-font-display: "Archivo", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --yh-font-mono: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  --yh-nav-h: 68px;
  --yh-gutter: clamp(20px, 5.55vw, 80px);
  --yh-max: 1320px;
  --yh-radius: 0;

  /* Existing products consume these names; keep one source of truth. */
  --paper: var(--yh-paper);
  --paper-hi: var(--yh-paper-hi);
  --paper-lo: var(--yh-paper-lo);
  --ink: var(--yh-ink);
  --ink-soft: var(--yh-ink-soft);
  --muted: var(--yh-muted);
  --line: var(--yh-line);
  --line-strong: var(--yh-line-strong);
  --red: var(--yh-red);
  --signal-yellow: var(--yh-yellow);
  --accent: var(--yh-red);
  --copper: var(--yh-red);
  --copper-hi: #ff6b75;
  --yellow: var(--yh-yellow);
  --dark: var(--yh-dark);
  --dark-2: var(--yh-dark-2);
  --silk: var(--yh-silk);
  --silk-muted: var(--yh-silk-muted);
  --silk-line: var(--yh-silk-line);
  --silk-line-strong: var(--yh-silk-line-strong);
  --horizon: var(--yh-horizon);
  --font-sans: var(--yh-font-sans);
  --font-display: var(--yh-font-display);
  --font-text: var(--yh-font-sans);
  --font-mono: var(--yh-font-mono);
  --nav-h: var(--yh-nav-h);
  --header-height: var(--yh-nav-h);
  --nav-height: var(--yh-nav-h);
  --page-gutter: var(--yh-gutter);
  --pad: var(--yh-gutter);
  --max: var(--yh-max);
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--yh-font-sans);
  background: var(--yh-paper);
  color: var(--yh-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--yh-font-display);
}

::selection {
  background: var(--yh-red);
  color: var(--yh-silk);
}

:focus-visible {
  outline: 2px solid var(--yh-red);
  outline-offset: 4px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--yh-red) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--yh-red); }
*::-webkit-scrollbar-track { background: transparent; }

/* One content width for the portal and every product page. */
.wrap,
.page-width {
  width: min(calc(100% - 2 * var(--yh-gutter)), var(--yh-max));
  margin-inline: auto;
}

/* ---------------------------------------------------------------- header */

:is(.nav, .site-header, .topbar) {
  background: var(--yh-paper);
  border-bottom: 1px solid var(--yh-line);
  font-family: var(--yh-font-sans);
}
:is(.nav, .site-header) { height: var(--yh-nav-h); }
.topbar { min-height: var(--yh-nav-h); padding-block: 10px; }

:is(.nav, .site-header, .topbar) .brand {
  gap: 10px;
  color: var(--yh-ink);
  font-family: var(--yh-font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  text-decoration: none;
}
:is(.nav, .site-header, .topbar) .brand > span { line-height: 1.05; }
:is(.nav, .site-header, .topbar) .brand-mark,
:is(.nav, .site-header, .topbar) .brand__icon,
:is(.nav, .site-header, .topbar) .brand img {
  display: flex;
  width: auto !important;
  height: 24px !important;
  flex: 0 0 auto;
  object-fit: contain;
}
:is(.nav, .site-header, .topbar) .brand-icon {
  display: flex;
  width: auto;
  height: auto;
  background: transparent;
}
:is(.nav, .site-header, .topbar) .brand small {
  margin-top: 4px;
  color: var(--yh-muted);
  font-family: var(--yh-font-sans);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .14em;
  text-transform: uppercase;
}
:is(.nav, .site-header, .topbar) .brand__mark {
  padding: 2px 4px;
  border: 1px solid var(--yh-red);
  color: var(--yh-red);
  font-family: var(--yh-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .04em;
}
:is(.nav, .site-header, .topbar) .brand__name {
  font-family: var(--yh-font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.02em;
}

:is(.nav__links, .site-nav, .topbar nav) a {
  color: var(--yh-muted);
  font-family: var(--yh-font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
}
:is(.nav__links, .site-nav, .topbar nav) a:hover,
:is(.nav__links, .site-nav, .topbar nav) a[aria-current="page"],
:is(.nav__links, .site-nav, .topbar nav) a.is-current {
  color: var(--yh-ink);
}
.site-nav a[aria-current="page"] {
  background-image: var(--yh-horizon);
  background-repeat: no-repeat;
  background-size: 100% 2px;
  background-position: left 0 bottom 0;
}
.topbar nav a:last-child {
  border-bottom: 2px solid var(--yh-red);
}
.nav__links a.is-current::after {
  height: 2px;
  background: var(--yh-horizon);
}
.lang,
.nav__github,
.menu-btn {
  color: var(--yh-muted);
  font-family: var(--yh-font-sans);
  font-size: 12px;
}
.nav__github:hover { color: var(--yh-red); }
.menu-btn { border-color: var(--yh-line-strong); }
.menu-btn__bars i { background: var(--yh-ink); }

/* Wiki header shares the same masthead height, mark and type. */
.wk-header-inner { min-height: var(--yh-nav-h); }
.wk-header .brand { font-family: var(--yh-font-display); font-size: 15px; font-weight: 700; }
.wk-header .brand img { width: auto; height: 24px; }
.wk-header nav a { font-family: var(--yh-font-sans); font-size: 13px; }

/* ---------------------------------------------------------------- controls */

:is(.btn--solid, .primary):not(.btn--footer) {
  border: 1px solid var(--yh-ink);
  background: var(--yh-ink);
  color: var(--yh-silk);
  font-family: var(--yh-font-sans);
  font-weight: 600;
}
:is(.btn--solid, .primary):not(.btn--footer):hover {
  border-color: var(--yh-red);
  background: var(--yh-red);
  color: var(--yh-silk);
}
:is(.btn--secondary, .quiet):not(.project-link) {
  border: 1px solid var(--yh-line-strong);
  background: transparent;
  color: var(--yh-ink);
  font-family: var(--yh-font-sans);
  font-weight: 600;
}
:is(.btn--secondary, .quiet):not(.project-link):hover {
  border-color: var(--yh-ink);
  background: var(--yh-paper-hi);
  color: var(--yh-ink);
}
.btn--footer {
  border-color: var(--yh-silk);
  background: var(--yh-silk);
  color: var(--yh-ink);
}
.footer a.btn--footer { color: var(--yh-ink); }
.footer a.btn--footer:hover {
  border-color: var(--yh-red);
  background: var(--yh-red);
  color: var(--yh-silk);
}

/* ---------------------------------------------------------------- footer */

.footer,
.site-footer {
  border-top: 1px solid var(--yh-silk-line);
  background: var(--yh-dark);
  color: var(--yh-silk-muted);
  font-family: var(--yh-font-sans);
}
.site-footer {
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 26px var(--yh-gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.site-footer .footer-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.footer .brand,
.site-footer .brand {
  color: var(--yh-silk);
  font-family: var(--yh-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-decoration: none;
}
.footer .brand small,
.site-footer .brand small {
  color: var(--yh-silk-muted);
  font-family: var(--yh-font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.footer .brand-mark,
.site-footer .brand-mark {
  width: auto;
  height: 22px;
}
.footer a,
.site-footer a {
  color: var(--yh-silk-muted);
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}
.footer a:hover,
.site-footer a:hover {
  color: var(--yh-yellow);
  text-decoration-color: var(--yh-yellow);
}
.site-footer .site-filing,
.site-footer .site-filing a { color: var(--yh-silk-muted); }
.footer__parent { color: var(--yh-silk); font-size: 11px; font-weight: 700; }
.site-footer .footer-brand {
  color: var(--yh-silk);
  font-family: var(--yh-font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
}

@media (max-width: 720px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-block: 24px;
  }
  .site-footer .footer-info { align-items: flex-start; }
}


.shop-support {
  margin-top: clamp(28px, 5vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--line, #dcd8d0);
}

.shop-support h2 { margin: 0; font-size: 20px; }
.shop-support dl { display: grid; gap: 8px; margin: 12px 0 0; }
.shop-support dl div { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 10px; align-items: baseline; }
.shop-support dt { color: var(--yh-muted); }
.shop-support dd { margin: 0; overflow-wrap: anywhere; }
.shop-support a { text-decoration: underline; text-underline-offset: .22em; }
.shop-support a:hover { color: var(--yh-red); }

@media (max-width: 560px) {
  .buy-page .nav__links, .buy-page .nav__github, .buy-page .nav__tools .lang { display: none; }
  .buy-page .nav__tools { gap: 14px; }
  .buy-page .nav__tools .nav__tool { display: inline-flex; white-space: nowrap; }
}
