/* Shell for every page: tokens, fonts, base, film grain, labels, the wordmark, the fixed mark and nav, the
   phone menu and the footer. Ported from concepts/1-portrait-open/index.html without changes; the home page's
   own rules are in home.css (loaded after this file, in the concept's order). */
@font-face {
  font-family: "Archivo Expanded";
  src: url("/fonts/ArchivoExpanded-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/Inter-VF.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --black: #0B0B0A;
  --grain: #18171A;
  --paper: #EEEAE2;
  --ash: #8C877E;
  --yellow: #FFD900;
  --line: rgba(238, 234, 226, .12);
  --gutter: clamp(16px, 4vw, 48px);
  --top: 30px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --err: #F2937F;
  --display: "Archivo Expanded", "Arial Black", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--black); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; border-radius: 2px; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Film grain over everything */
.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Labels and type ---------- */
.label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ash);
}
.h2 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(34px, 4.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -.02em;
  text-align: center;
}

/* ---------- Wordmark ---------- */
.name {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .24em;
  line-height: 1;
  white-space: nowrap;
  font-size: clamp(40px, 5.4vw, 92px);
}
.name > span { display: inline; }

/* Fixed wordmark: big in the hero (desktop morph), small at top left afterwards */
.mark {
  position: fixed; left: var(--gutter); top: var(--top); z-index: 60;
  color: var(--paper);
  font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity .5s var(--ease);
}
.mark span { margin-right: -.24em; }
.scrolled .mark { opacity: 1; pointer-events: auto; }
.morph .mark {
  left: 0; top: 0;
  transform-origin: 0 0;
  font-size: clamp(40px, 5.4vw, 92px);
  opacity: 1;
  transition: none;
  will-change: transform;
}
.morph .mark .mark-in { display: inline-block; }
.morph:not(.scrolled) .mark { pointer-events: none; }

/* Top scrim keeps the fixed wordmark and nav clean over scrolling content */
.topscrim {
  position: fixed; left: 0; right: 0; top: 0; height: 124px; z-index: 55;
  pointer-events: none;
  background: linear-gradient(180deg, #0B0B0A 0%, #0B0B0A 50%, rgba(11, 11, 10, 0) 100%);
  opacity: 0; transition: opacity .5s var(--ease);
}
.scrolled .topscrim { opacity: 1; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: calc(var(--top) - 4px); right: var(--gutter); z-index: 60;
  display: flex; gap: 30px;
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
}
.nav a {
  color: rgba(238, 234, 226, .78);
  padding: 4px 0;
  position: relative;
  transition: color .3s var(--ease);
}
.nav a:hover { color: var(--paper); }
.nav a.is-active { color: var(--yellow); }

/* ---------- Mobile menu ---------- */
.menu-btn {
  position: fixed; top: calc(var(--top) - 11px); right: calc(var(--gutter) - 12px); z-index: 61;
  display: none;
  background: none; border: 0; cursor: pointer;
  color: var(--paper);
  font: 600 10.5px/1 var(--display);
  text-transform: uppercase; letter-spacing: .3em;
  padding: 12px 9px 12px 12px;
}
.menu-btn:focus-visible, .menu-close:focus-visible { outline: 2px solid var(--yellow); outline-offset: 0; border-radius: 4px; }
.menu {
  position: fixed; inset: 0; z-index: 80;
  background: var(--black);
  display: flex; flex-direction: column;
  padding: 0 var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility 0s linear .35s;
}
.menu.is-open { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.menu-top { height: 60px; display: flex; align-items: center; justify-content: space-between; flex: none; }
.menu-mark { font-size: 12px; }
.menu-mark span { margin-right: -.24em; }
.menu-close {
  background: none; border: 0; cursor: pointer; color: var(--paper);
  font: 600 10.5px/1 var(--display); text-transform: uppercase; letter-spacing: .3em;
  padding: 12px 9px 12px 12px; margin-right: -12px;
}
.menu nav { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 60px; }
.menu nav a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 36px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.menu nav a:first-child { border-top: 1px solid var(--line); }
.menu nav a .label { font-size: 10px; letter-spacing: .3em; transform: translateY(-8px); }
.menu.is-open nav a { opacity: 1; transform: none; }
.menu.is-open nav a:nth-child(2) { transition-delay: .05s; }
.menu.is-open nav a:nth-child(3) { transition-delay: .1s; }
.menu.is-open nav a:nth-child(4) { transition-delay: .15s; }

.foot {
  position: absolute; left: 0; right: 0; bottom: 32px;
  display: flex; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--ash);
  padding: 0 var(--gutter);
}
.foot a:hover { color: var(--paper); }

/* ---------- Mobile ---------- */
@media (max-width: 899px) {
  :root { --top: 22px; }
  .nav {
    left: 0; right: 0; top: 16px;
    justify-content: center; gap: 22px;
    font-size: 12.5px;
    transition: opacity .4s var(--ease);
  }
  .scrolled .nav { opacity: 0; pointer-events: none; visibility: hidden; }
  .menu-btn { display: block; opacity: 0; visibility: hidden; transition: opacity .4s var(--ease), visibility 0s linear .4s; }
  .scrolled .menu-btn { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
  .foot { bottom: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  * { scroll-behavior: auto !important; }
}
