/* base.css: reset, page chrome (skip link, header, footer) and utilities. */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; -webkit-text-size-adjust: 100%; scrollbar-color: #3a3a3a var(--color-bg); }

::selection { background: var(--color-cream); color: var(--color-bg); }

/* ---------- Page moves (pages.js) ----------
   Opening a page from a tile, and coming back, is one same-document view transition: pages.js
   names the tile's picture and the page's hero "hero" for the move, so the browser animates one
   frame from the tile's box to the hero's box (html[data-move] says which way) while the rest
   of the page crossfades. The header holds still. Reduced motion and older browsers get a plain
   swap, so nothing here needs a fallback. */
.site-header { view-transition-name: site-header; }

::view-transition-group(*),
::view-transition-old(*),
::view-transition-new(*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* The tile's picture and the hero have different shapes: fill the moving frame edge to edge. */
::view-transition-old(hero),
::view-transition-new(hero) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The frame keeps the tile's 4px frame radius while small and squares off as it fills the screen. */
::view-transition-image-pair(hero) {
  overflow: clip;
  animation: 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both move-open;
}
html[data-move="close"]::view-transition-image-pair(hero) { animation-name: move-close; }
@keyframes move-open { from { border-radius: var(--frame-radius); } to { border-radius: 0; } }
@keyframes move-close { from { border-radius: 0; } to { border-radius: var(--frame-radius); } }

/* The section panel never pops: it slides up from below the screen as a page opens, and slides
   back down as the page closes. Named here in CSS because every section page has exactly one. */
.panel { view-transition-name: panel; }
::view-transition-new(panel):only-child { animation: 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both panel-in; }
::view-transition-old(panel):only-child { animation: 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both panel-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(100vh); } to { opacity: 1; transform: none; } }
@keyframes panel-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(100vh); } }

body {
  margin: 0;
  padding-inline: var(--gutter);
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-cream);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
}

/* Static film grain over the whole page: texture only, never moves, never takes clicks. */
body::after {
  content: "";
  position: fixed;
  z-index: 100;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

img, svg, video { display: block; max-width: 100%; }

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 0.2em; }

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }
/* Outfit reads best set tight at display sizes. */
h1 { font-size: var(--step-3); line-height: 1; letter-spacing: -0.025em; }
h2 { font-size: var(--step-2); letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); }

:focus-visible { outline: var(--ring-width) solid var(--accent); outline-offset: var(--ring-gap); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: var(--gutter);
  z-index: 20;
  padding: 0.5rem 1rem;
  background: var(--color-cream);
  color: var(--color-ink);
  transform: translateY(-120%);
}
.skip-link:focus { transform: none; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* minimum comfortable tap target */
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-cream);
  border-radius: 999px;
  color: var(--color-cream);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }

.pill--lg { min-height: 56px; padding: 0.75rem 1.25rem; text-wrap: balance; }
@media (min-width: 30em) {
  .pill--lg { padding-inline: 2rem; font-size: var(--step-1); }
}

/* The one filled button (where to buy). Cream, never accent: accent is never a fill. */
.pill--solid { background: var(--color-cream); color: var(--color-bg); font-weight: 600; }
.pill--solid:hover { background: transparent; border-color: var(--color-cream); color: var(--color-cream); }

/* ---------- Specialties and ring label ----------
   .spec is the dotted specialties line (a tile nameplate, a panel); .note is a ring label,
   a small ring and a word, where a badge or tag used to be. Both take their dot and ring
   from the accent in force. */
.spec { display: flex; flex-wrap: wrap; font-size: 0.68rem; letter-spacing: 0.06em; color: var(--color-muted); }
.spec > span + span::before { content: "·"; padding-inline: 0.3em; color: var(--accent); }

.note {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--color-cream);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgb(0 0 0 / 0.6);
}
.note::before { content: ""; flex: none; width: 0.55em; aspect-ratio: 1; border: var(--ring-width) solid var(--accent); border-radius: 50%; }

/* ---------- Wolf mark ----------
   wolf-outline.svg is inlined wherever the outline wolf appears. Lines and features follow
   currentColor; the monocle takes the section accent. The lines don't scale with the drawing:
   each spot sets --wolf-line, and the outer edge and monocle ring stay heavier in proportion. */
.wolf-line,
.wolf-edge,
.wolf-ring { vector-effect: non-scaling-stroke; }
.wolf-line { stroke-width: var(--wolf-line, 1px); }
.wolf-edge { stroke-width: calc(var(--wolf-line, 1px) * 1.75); }
.wolf-ring { stroke-width: calc(var(--wolf-line, 1px) * 1.25); }
.wolf-monocle { fill: var(--accent); }

/* ---------- Header ----------
   One header everywhere: no bar, just round blurred controls floating over the page (mark or
   back arrow, the nav in a pill on wide screens, contact, and the menu button on phones), like a
   case study you have stepped into. Only the controls take clicks; the strip between them lets
   the page through. On section pages the header takes no height, so the hero starts at the top. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-inline: calc(var(--gutter) * -1);
  padding: 0.75rem var(--gutter);
  min-height: var(--header-h);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
body:has(.hero) .site-header { margin-bottom: calc(var(--header-h) * -1); }

.mark,
.back,
.nav-toggle,
.site-header .pill {
  border: 0;
  background: var(--control-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--color-cream);
}
.mark,
.back,
.nav-toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; transition: background-color 0.2s; }
.mark svg,
.back svg,
.nav-toggle svg { width: 22px; height: 22px; }
.mark { width: 52px; height: 52px; }
.mark svg { width: 38px; height: 38px; --wolf-line: 0.6px; }
.mark:hover,
.back:hover { background: var(--control-bg-hover); color: var(--color-cream); }
/* The contact pill takes the standard pill hover (accent line and text), on its blurred backing. */
.site-header .pill { border: 1px solid transparent; }
.site-header .pill:hover { border-color: var(--accent); color: var(--accent); }
.back svg { transition: transform 0.2s; }
.back:hover svg { transform: translateX(-3px); }
.site-header .pill { margin-left: auto; }

/* Contact pill: the address, swapped for "Copied" for a moment after a click (nav.js). Both sit in
   one grid cell, so the pill keeps the address's width and nothing beside it moves. */
.site-header .contact { display: inline-grid; place-items: center; }
.contact > span { grid-area: 1 / 1; transition: opacity 0.2s; }
.contact-copied { opacity: 0; }
.contact[data-copied] .contact-address { opacity: 0; }
.contact[data-copied] .contact-copied { opacity: 1; }
/* The smallest phones: a tighter pill, so the address, the mark and the menu button share one row. */
@media (max-width: 22.5em) {
  .site-header .contact { padding-inline: 0.85rem; font-size: 0.875rem; }
}

.nav-toggle { display: none; cursor: pointer; }
html.js .nav-toggle { display: grid; }

/* Without JS the nav list is always visible; only html.js hides it. */
#site-nav { flex-basis: 100%; }
#site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
#site-nav a { display: inline-block; padding: 0.4rem 0; text-decoration: none; }
#site-nav a:hover,
#site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Phones: the menu is a solid sheet over the page, starting behind the header controls, so
   opening it never moves the page. It stays rendered and is only hidden, so it can animate both
   ways: the sheet unrolls from the top and the links ease in after it. */
@media (max-width: 47.99em) {
  html.js #site-nav {
    position: absolute;
    inset: 0 0 auto;
    z-index: -1; /* under the controls, still inside the header */
    padding: var(--header-h) var(--gutter) 1rem;
    border-bottom: 1px solid var(--color-ink);
    background: var(--color-bg);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s 0.3s;
  }
  html.js #site-nav[data-open="true"] { clip-path: inset(0); visibility: visible; transition-delay: 0s; }
  html.js #site-nav ul { flex-direction: column; gap: 0; }
  html.js #site-nav a { padding-block: 0.6rem; font-size: var(--step-1); }
  html.js #site-nav li { opacity: 0; transform: translateY(-8px); transition: opacity 0.2s, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
  html.js #site-nav[data-open="true"] li { opacity: 1; transform: none; }
  html.js #site-nav[data-open="true"] li:nth-child(2) { transition-delay: 0.03s; }
  html.js #site-nav[data-open="true"] li:nth-child(3) { transition-delay: 0.06s; }
}

@media (min-width: 48em) {
  .site-header { flex-wrap: nowrap; }
  .site-header .pill { order: 3; margin-left: 0; }
  #site-nav { flex-basis: auto; margin-left: auto; }
  html.js .nav-toggle { display: none; }
}

/* With no nav (landing page), the contact pill keeps to the right on wide screens too. */
@media (min-width: 48em) {
  .site-header--bare .pill { margin-left: auto; }
}

/* Wide screens: the nav sits in its own blurred pill. */
@media (min-width: 48em) {
  #site-nav ul {
    gap: 0 0.25rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    background: var(--control-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  #site-nav a { padding: 0.6rem 0.6rem; }
}

/* ---------- Footer ----------
   Brand block (outline wolf, wordmark, one line), then Site / Follow / Say hello columns with
   small uppercase labels like the section panels' facts, and the copyright line under a rule.
   Phones: the brand and email columns run full width, Site and Follow sit side by side. */
.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 1.5rem;
  margin-top: 5rem;
  padding-block: 3rem 2rem;
  border-top: 1px solid var(--color-ink);
  color: var(--color-muted);
}
.footer-brand,
.footer-contact,
.footer-meta { grid-column: 1 / -1; }
.footer-logo { display: inline-flex; align-items: center; gap: 0.9rem; color: var(--color-cream); }
.footer-mark { display: block; width: 44px; }
.footer-mark svg { display: block; width: 100%; height: auto; --wolf-line: 0.6px; }
.footer-logo > svg { width: 170px; height: auto; }
.footer-line { max-width: 30ch; margin-top: 1rem; }
.footer-heading {
  margin: 0 0 0.9rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-footer ul { display: grid; gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.site-footer ul a { color: var(--color-cream); text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.footer-social { display: inline-flex; align-items: center; gap: 0.55rem; }
.footer-social svg { width: 20px; height: 20px; flex: none; }
.site-footer p { margin: 0; }
.footer-meta { padding-top: 1.5rem; border-top: 1px solid var(--color-ink); font-size: 0.875rem; }

/* Wide screens: the brand block and three columns on one row. */
@media (min-width: 48em) {
  .site-footer { grid-template-columns: 1.6fr repeat(3, auto); column-gap: clamp(2.5rem, 6vw, 6rem); }
  .footer-brand,
  .footer-contact { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .pill,
  .back,
  .back svg,
  .site-header,
  .contact > span,
  html.js #site-nav,
  html.js #site-nav li { transition: none; }
}
