/* Shared by the home page and the 404 page: tokens, surfaces, and the parts both
   pages use. Token names match card.css (BRAND.md section 12 and the depth
   kit's depth-tokens.css). Every value comes from the approved reference build,
   so sizes are in cqw against the .page container. Fonts are the system
   installs of Baskerville and Helvetica Neue; no webfonts are licensed yet. */
:root {
  --ivory:  #F5F1E8;
  --ink:    #242824;
  --forest: #173F35;
  --brass:  #B49A64;
  --stone:  #D9D5CB;

  --serif: "Baskerville", "Baskerville Old Face", Georgia, serif;
  --sans:  "Helvetica Neue", Helvetica, Arial, sans-serif;
  /* Japanese characters. Hiragino Sans W3 is the face of the 匠 in the heritage
     lockup (BRAND.md section 5); the rest are its nearest system stand ins. */
  --kanji: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;

  --radius: 4px;

  /* Tonal values: only inside the falloff and the foil, never as fills or text. */
  --forest-lift:  #1D4A3E;
  --forest-shade: #11302A;
  --brass-light:  #D8C08A;
  --brass-shade:  #8F7744;

  --brass-foil: linear-gradient(135deg, var(--brass-shade) 0%, var(--brass) 35%, var(--brass-light) 50%, var(--brass) 65%, var(--brass-shade) 100%);
  --surface-forest: radial-gradient(ellipse at 28% 22%, var(--forest-lift) 0%, var(--forest) 55%, var(--forest-shade) 100%);
  --grain-on-light: url("/brand/textures/grain-dark-tile.webp");
  --grain-on-dark:  url("/brand/textures/grain-light-tile.webp");
  --grain-size: 512px;

  --gutter: clamp(24px, 6.5cqw, 96px);
  --text-section: clamp(32px, 3.8cqw, 48px);
}

body { margin: 0; }
a { color: inherit; }

.page,
.menu-panel {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  container-type: inline-size;
  background: var(--ivory);
  color: var(--ink);
}

/* Every surface larger than a button carries grain (BRAND.md section 4). */
.surface-ivory {
  background-color: var(--ivory);
  background-image: var(--grain-on-light);
  background-size: var(--grain-size);
}
.surface-stone {
  background-color: var(--stone);
  background-image: var(--grain-on-light);
  background-size: var(--grain-size);
}
.surface-forest {
  background-color: var(--forest);
  background-image: var(--grain-on-dark), var(--surface-forest);
  background-size: var(--grain-size), cover;
}

:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.surface-forest :focus-visible { outline-color: var(--ivory); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.wrap { max-width: 1200px; margin: 0 auto; }

/* Spaced capitals, for labels of three words or fewer. */
.label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.link {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s ease;
}
.link:hover { text-decoration-color: currentColor; }

/* Secondary action on Ivory: a small handscroll, opened to its label. The link
   itself is the paper, Ivory between two bands of Stone cloth, lying on the
   page with the paper shadow. Each end is a roll of the same cloth, a little
   taller than the paper, with a brass knob above and below.

   The rolls rest on top of the paper's ends. On hover and focus they slide
   6px apart and the paper they covered comes into view, so the scroll opens
   without the button changing size or moving anything around it.

   Roll layers, front to back: two knobs, the round of the roll (light on its
   left shoulder, shade on its right), the cloth. */
.button-scroll {
  position: relative;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 30px;
  border: 0;
  border-top: 3px solid var(--stone);
  border-bottom: 3px solid var(--stone);
  background-color: var(--ivory);
  background-image: var(--grain-on-light);
  background-size: var(--grain-size);
  box-shadow: 0 1px 2px rgb(36 40 36 / 0.08), 0 8px 18px rgb(36 40 36 / 0.1);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  transition: translate 0.15s ease;
}
.button-scroll::before,
.button-scroll::after {
  content: "";
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 13px;
  border-radius: 2px;
  background:
    var(--brass-foil) center top / 7px 4px no-repeat,
    var(--brass-foil) center bottom / 7px 4px no-repeat,
    linear-gradient(90deg, rgb(36 40 36 / 0.16), rgb(245 241 232 / 0.7) 32%, rgb(245 241 232 / 0) 55%, rgb(36 40 36 / 0.3)) center / 100% calc(100% - 8px) no-repeat,
    linear-gradient(var(--stone), var(--stone)) center / 100% calc(100% - 8px) no-repeat;
  transition: translate 0.4s cubic-bezier(0.6, 0, 0.2, 1);
}
/* Each roll shades the paper beside it. */
.button-scroll::before { left: 0; filter: drop-shadow(2px 1px 2px rgb(36 40 36 / 0.22)); }
.button-scroll::after { right: 0; filter: drop-shadow(-1px 1px 2px rgb(36 40 36 / 0.22)); }
.button-scroll:hover::before,
.button-scroll:focus-visible::before { translate: -6px 0; }
.button-scroll:hover::after,
.button-scroll:focus-visible::after { translate: 6px 0; }
.button-scroll:active { translate: 0 1px; }
/* The rolls stand outside the paper, so the focus ring is set clear of them. */
.button-scroll:focus-visible { outline-offset: 12px; }

/* The one filled button on a page. */
.button {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--radius);
  background-color: var(--ivory);
  color: var(--forest);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.3s ease;
}
.button:hover { background-color: var(--stone); }

.rule-foil { width: 96px; height: 2px; background: var(--brass-foil); }

/* Tone on tone brush, cropped off the right edge of a Forest opening. On the
   home page it shows only when WebGL is missing, in place of the landscape and
   never with it. */
.tone-brush {
  position: absolute;
  z-index: -1;
  right: -17cqw;
  bottom: -15cqw;
  width: clamp(440px, 70cqw, 1010px);
  aspect-ratio: 390 / 300;
  background-color: var(--ivory);
  opacity: 0.08;
  pointer-events: none;
  -webkit-mask: url("/brand/emblem-brushed-tone.svg") center / contain no-repeat;
          mask: url("/brand/emblem-brushed-tone.svg") center / contain no-repeat;
}
.tone-brush[hidden] { display: none; }

/* The extra 1px is the height of the rule the bar once carried. The landscape
   is placed from the bar's lower edge, so the bar keeps its height. */
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding-bottom: calc(clamp(14px, 1.8cqw, 24px) + 1px);
}
.bar-logo { display: block; flex: none; }

/* The negative margin trims the file's own side padding so the lockup lines up
   with the text column. */
.logo {
  --logo-w: clamp(180px, 14.5cqw, 208px);
  width: var(--logo-w);
  height: auto;
  display: block;
  margin-left: calc(var(--logo-w) * -0.031);
}

.hero-copy {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(24px, 2.6cqw, 36px);
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 5.4cqw, 64px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.hero-lede {
  margin: 0;
  max-width: 33em;
  font-size: clamp(17px, 1.5cqw, 19px);
  line-height: 1.5;
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .link, .button, .button-scroll, .button-scroll::before, .button-scroll::after { transition: none; }
}
