/* ==========================================================================
   Avintheria — site.css
   Tokens → Base → Layout → Nav → Components → Pages → Footer → Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Fonts — self-hosted, subset to Latin. No third-party requests.
   Newsreader & Inter: SIL Open Font License 1.1
   IBM Plex Mono: SIL Open Font License 1.1
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader.woff2") format("woff2");
  font-weight: 300 450;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 380 560;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Ink */
  --ink:        #0a0a0a;
  --ink-70:     #3a3a3d;
  --ink-50:     #55555b;
  --ink-35:     #6e6e75;

  /* Paper */
  --paper:      #ffffff;
  --paper-alt:  #f5f5f3;

  /* Rules */
  --rule:       #e4e4e0;
  --rule-soft:  #efefec;

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Rhythm */
  --gutter: 32px;
  --measure: 1360px;
  --nav-h: 72px;

  --space-section: clamp(96px, 13vw, 200px);
  --space-block:   clamp(48px, 6vw, 88px);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 620ms;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 380;
  font-optical-sizing: auto;
  letter-spacing: -0.021em;
  line-height: 1.06;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
}

ul { margin: 0; padding: 0; list-style: none; }

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 1px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.skip-link:focus { top: 16px; }

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

/* --------------------------------------------------------------------------
   3. Layout
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-section);
}
.section--tight { padding-block: var(--space-block); }
.section--alt { background: var(--paper-alt); }
.section--ruled { border-top: 1px solid var(--rule); }

/* Editorial two-column: label rail + content */
.rail {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 0 64px;
  align-items: start;
}

.measure-lg { max-width: 30ch; }
.measure-md { max-width: 62ch; }
.measure-sm { max-width: 48ch; }

/* --------------------------------------------------------------------------
   4. Typographic primitives
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-35);
  margin: 0;
}

.display {
  font-size: clamp(2.75rem, 7.4vw, 5.75rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
}

.headline {
  font-size: clamp(2rem, 4.3vw, 3.25rem);
  letter-spacing: -0.024em;
}

.subhead {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  line-height: 1.22;
  letter-spacing: -0.018em;
}

.lede {
  font-size: clamp(1.0625rem, 1.35vw, 1.25rem);
  line-height: 1.58;
  color: var(--ink-70);
  letter-spacing: -0.008em;
}

.body-text { color: var(--ink-70); }
.body-text + .body-text { margin-top: 1.35em; }

.note {
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-50);
}

.stack-xs > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 20px; }
.stack-md > * + * { margin-top: 32px; }
.stack-lg > * + * { margin-top: 48px; }

/* Text link with a hairline that draws in */
.link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  position: relative;
  padding-bottom: 4px;
  font-size: 15px;
  letter-spacing: 0.002em;
  color: var(--ink);
}
.link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 460ms var(--ease);
}
.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); }
.link .arrow {
  font-family: var(--mono);
  font-size: 13px;
  transition: transform 460ms var(--ease);
}
.link:hover .arrow { transform: translateX(4px); }

.link-plain { color: var(--ink); border-bottom: 1px solid var(--rule); }
.link-plain:hover { border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background 320ms ease, border-color 320ms ease, backdrop-filter 320ms ease;
}

.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.76);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom-color: var(--rule-soft);
}

.nav.is-open {
  background: var(--paper);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: var(--rule-soft);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
}
.brand .mark { width: 30px; height: auto; }
.brand .brand-wordmark { display: none; width: 174px; height: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 38px;
}

.nav-link {
  position: relative;
  font-size: 14.5px;
  letter-spacing: 0.004em;
  color: var(--ink-50);
  transition: color 260ms ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--ink);
}

.nav-toggle {
  display: none;
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 0 8px 16px;
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 99;
  background: var(--paper);
  padding: 40px var(--gutter) 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 380ms var(--ease), transform 380ms var(--ease), visibility 380ms;
  overflow-y: auto;
}
.drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.drawer-links li + li { border-top: 1px solid var(--rule-soft); }
.drawer-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-family: var(--serif);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.drawer-link .idx {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-35);
}

.drawer-foot {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  padding-top: calc(var(--nav-h) + clamp(80px, 15vh, 176px));
  padding-bottom: clamp(72px, 10vw, 136px);
}

.hero-title {
  margin-top: 28px;
  max-width: 15ch;
}

.hero-lede {
  margin-top: 36px;
  max-width: 54ch;
}

.hero-actions {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.status-line {
  margin-top: clamp(64px, 9vw, 112px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
}

/* Page header (interior pages) */
.page-head {
  padding-top: calc(var(--nav-h) + clamp(72px, 11vh, 140px));
  padding-bottom: clamp(56px, 8vw, 96px);
}
.page-head .headline { margin-top: 24px; max-width: 18ch; }
.page-head .lede { margin-top: 30px; max-width: 58ch; }

/* --------------------------------------------------------------------------
   7. Index rows — the division / content index
   -------------------------------------------------------------------------- */
.index-list { border-top: 1px solid var(--rule); }

.index-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 260px) minmax(0, 1fr) 40px;
  gap: 0 40px;
  align-items: baseline;
  padding: 34px 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  transition: padding-left 520ms var(--ease);
}
a.index-row:hover { padding-left: 12px; }

.index-row::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 620ms var(--ease);
}
a.index-row:hover::before,
a.index-row:focus-visible::before { transform: scaleX(1); }

.index-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-35);
}

.index-name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.index-desc {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-50);
}

.index-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-35);
  justify-self: end;
  transition: transform 520ms var(--ease), color 320ms ease;
}
a.index-row:hover .index-arrow {
  transform: translateX(5px);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   8. Statement + grids
   -------------------------------------------------------------------------- */
.statement {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.3vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.024em;
  max-width: 20ch;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 48px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px 72px;
}

.cell-title {
  font-family: var(--serif);
  font-size: 1.375rem;
  letter-spacing: -0.018em;
  line-height: 1.2;
  margin-bottom: 12px;
}

.cell-ruled {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}

/* Definition rows (specs / facts) */
.deflist { border-top: 1px solid var(--rule); }
.defrow {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 48px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
}
.defrow dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-35);
  padding-top: 5px;
}
.defrow dd {
  margin: 0;
  color: var(--ink-70);
  font-size: 16px;
  line-height: 1.6;
}

/* Legal / long-form prose */
.prose { max-width: 68ch; }
.prose h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-top: 56px;
  margin-bottom: 14px;
}
.prose h2:first-child { margin-top: 0; }
.prose p {
  color: var(--ink-70);
  font-size: 16.5px;
  line-height: 1.7;
}
.prose p + p { margin-top: 1.1em; }
.prose ul {
  margin-top: 14px;
  color: var(--ink-70);
  font-size: 16.5px;
  line-height: 1.7;
}
.prose li {
  position: relative;
  padding-left: 22px;
}
.prose li + li { margin-top: 8px; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.72em;
  width: 10px; height: 1px;
  background: var(--ink-35);
}

/* Contact */
.contact-mail {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 5.2vw, 3rem);
  letter-spacing: -0.026em;
  line-height: 1.1;
  display: inline-block;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  transition: border-color 320ms ease;
  overflow-wrap: anywhere;
}
.contact-mail:hover { border-bottom-color: var(--ink); }

/* --------------------------------------------------------------------------
   9. Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--paper-alt);
  border-top: 1px solid var(--rule);
  padding-top: clamp(64px, 8vw, 104px);
  padding-bottom: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px 48px;
}

.footer-brand svg.mark { width: 34px; height: auto; color: var(--ink); }
.footer-desc {
  margin-top: 24px;
  max-width: 34ch;
  font-size: 15px;
  line-height: 1.62;
  color: var(--ink-50);
}

.footer-heading {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-35);
  margin-bottom: 18px;
}

.footer-link {
  display: inline-block;
  font-size: 15px;
  color: var(--ink-70);
  transition: color 260ms ease;
}
.footer-link:hover { color: var(--ink); }
.footer-list li + li { margin-top: 10px; }

.social {
  display: flex;
  align-items: center;
  gap: 20px;
}
.social a {
  display: block;
  line-height: 0;
}
.social img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.footer-wordmark {
  margin-top: clamp(64px, 8vw, 96px);
  width: 100%;
  max-width: 560px;
  color: var(--ink);
}
.footer-wordmark svg { width: 100%; height: auto; }

.footer-bottom {
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 32px;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-35);
}


/* --------------------------------------------------------------------------
   9b. Seam — unlisted entrance. Reads as punctuation, behaves as a link.
   -------------------------------------------------------------------------- */
.seam {
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: text;
}
.seam::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.seam:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* --------------------------------------------------------------------------
   9c. Inverted theme — used by the unlisted page only
   -------------------------------------------------------------------------- */
body.inverted {
  --ink:        #f7f7f5;
  --ink-70:     #c9c9c5;
  --ink-50:     #a3a39f;
  --ink-35:     #8a8a90;
  --paper:      #0a0a0a;
  --paper-alt:  #141414;
  --rule:       #2b2b2b;
  --rule-soft:  #1f1f1f;
  background: var(--paper);
  color: var(--ink);
}
body.inverted .nav.is-scrolled { background: rgba(10, 10, 10, 0.76); }
body.inverted .nav.is-open,
body.inverted .drawer { background: var(--paper); }
body.inverted .social img { filter: invert(1); }
body.inverted .skip-link { background: var(--ink); color: var(--paper); }

/* --------------------------------------------------------------------------
   10. Reveal animation
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
}
.js-ready .reveal {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
.no-js .reveal { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   11. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .rail { grid-template-columns: 150px minmax(0, 1fr); gap: 0 40px; }
  .index-row { grid-template-columns: 64px minmax(0, 200px) minmax(0, 1fr) 32px; gap: 0 28px; }
  .grid-3 { gap: 48px 36px; }
  .defrow { grid-template-columns: 180px minmax(0, 1fr); gap: 8px 32px; }
}

@media (min-width: 881px) {
  .brand .mark { display: none; }
  .brand .brand-wordmark { display: block; }
}

@media (max-width: 880px) {
  :root { --gutter: 24px; --nav-h: 64px; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .rail { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .grid-3,
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 44px; }

  .index-row {
    grid-template-columns: minmax(0, 1fr) 24px;
    gap: 10px 16px;
    padding: 28px 0;
  }
  .index-num { grid-column: 1 / -1; }
  .index-name { grid-column: 1; }
  .index-arrow { grid-column: 2; grid-row: 2; align-self: center; }
  .index-desc { grid-column: 1 / -1; }
  a.index-row:hover { padding-left: 0; }

  .defrow { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 22px 0; }
  .defrow dt { padding-top: 0; }

  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .statement { max-width: 100%; }
  .hero-title { max-width: 100%; }
}

@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .hero-actions { gap: 20px; flex-direction: column; align-items: flex-start; }
  .status-line { gap: 6px 20px; }
  .drawer-link { font-size: 1.5rem; }
}

/* --------------------------------------------------------------------------
   12. Preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .drawer, .footer { display: none; }
  body { color: #000; }
}
