/* Quaintscience — the site. A sibling of Akshouini: the same book face and craft, in daylight.
   Navy ink from the mark on warm white paper; brass for the instrument's moving parts. Matte, no glow. */
@font-face { font-family: 'EBG'; font-weight: 400; font-display: swap; src: url('../fonts/ebgaramond-regular.woff2') format('woff2'); }
@font-face { font-family: 'EBG'; font-weight: 500; font-display: swap; src: url('../fonts/ebgaramond-medium.woff2') format('woff2'); }
@font-face { font-family: 'EBG'; font-weight: 600 700; font-display: swap; src: url('../fonts/ebgaramond-semibold.woff2') format('woff2'); }
@font-face { font-family: 'EBG'; font-style: italic; font-weight: 400 600; font-display: swap; src: url('../fonts/ebgaramond-italic.woff2') format('woff2'); }

:root {
  --serif: 'EBG', 'EB Garamond', Georgia, 'Times New Roman', serif;
  --paper: #f7f5f0; --paper-hi: #fdfcf9;
  --ink: #062743; --ink-soft: rgba(6, 39, 67, 0.7); --ink-dim: rgba(6, 39, 67, 0.5); --rule: rgba(6, 39, 67, 0.16);
  --brass: #94641f; --brass-hi: #b8862f;
  --verm: #e23b1a;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; scroll-snap-type: y proximity; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 19px/1.55 var(--serif);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: lining-nums; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
i { font-style: italic; font-weight: 400; }
button { font: inherit; color: inherit; }

/* paper tooth */
body::after { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05; mix-blend-mode: multiply;
  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='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ------------------------------------------------------------ the dial behind everything */
.dial { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; max-width: none; }
main { position: relative; z-index: 2; }

/* ------------------------------------------------------------ nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter); transition: background 0.4s, box-shadow 0.4s; }
.nav.scrolled { background: rgba(247, 245, 240, 0.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--rule); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 500; font-size: 15px;
  letter-spacing: 0.22em; text-transform: uppercase; }
.brand img { width: 36px; height: 36px; }
.links { display: flex; gap: clamp(20px, 2.6vw, 40px); margin-left: auto; margin-right: clamp(20px, 2.6vw, 40px); }
.links a { font-size: 15px; letter-spacing: 0.08em; text-decoration: none; color: var(--ink-soft); padding: 6px 0; position: relative; transition: color 0.3s; }
.links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--brass); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.links a:hover, .links a:focus-visible, .links a.on { color: var(--ink); }
.links a:hover::after, .links a:focus-visible::after, .links a.on::after { transform: scaleX(1); }
@media (max-width: 860px) { .links { display: none; } }
.nav-link { font-size: 15px; letter-spacing: 0.08em; text-decoration: none; padding: 8px 16px; border: 1px solid var(--rule); border-radius: 999px;
  transition: border-color 0.3s, color 0.3s; }
.nav-link:hover, .nav-link:focus-visible { border-color: var(--brass); color: var(--brass); }

/* ------------------------------------------------------------ slides */
.slide { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 22px; padding: 96px var(--gutter) clamp(96px, 16vh, 150px); scroll-snap-align: start; position: relative; }

/* ------------------------------------------------------------ type */
.caps { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.caps.xs { font-size: 14px; letter-spacing: 0.34em; font-weight: 500; color: var(--brass); }
.line { font-weight: 500; font-size: clamp(28px, 4vw, 60px); line-height: 1.12; letter-spacing: -0.005em; margin: 0; }
.line.lg { font-size: clamp(30px, 4.6vw, 70px); }
.line.xl { font-size: clamp(40px, 7.4vw, 124px); line-height: 1.02; }
.line.sm { font-size: clamp(20px, 2.2vw, 32px); }
.soft { color: var(--ink-soft); }

/* ------------------------------------------------------------ hero */
.hero { flex-direction: row; gap: clamp(28px, 5vw, 96px); text-align: left; }
.hero-mark { position: relative; width: min(64vh, 42vw); aspect-ratio: 1; flex: none; }
.hero-mark > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark-cv { display: none; }
.js .mark-cv { display: block; }
.js.mark-live .mark-img { visibility: hidden; }
.hero-text { display: flex; flex-direction: column; gap: 14px; max-width: 46vw; }
.word { font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; font-size: clamp(30px, 4.3vw, 76px); line-height: 1; margin: 0; white-space: nowrap; }
.hero .caps.xs { letter-spacing: 0.62em; font-size: clamp(13px, 1.2vw, 18px); }
.hero .line { margin-top: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------ what we do */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 110px); max-width: 1320px; text-align: left; }
.pair > div { border-top: 1px solid var(--rule); padding-top: 22px; }
.num { display: block; font-size: 15px; letter-spacing: 0.3em; color: var(--brass); margin-bottom: 18px; font-weight: 500; }

/* ------------------------------------------------------------ the core */
.values { max-width: 17em; text-wrap: balance; }

/* ------------------------------------------------------------ the record */
.stats { display: flex; gap: clamp(40px, 10vw, 180px); align-items: flex-end; }
.stat { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat .n { font-weight: 500; font-size: clamp(88px, 15vw, 230px); line-height: 0.9; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }

/* ------------------------------------------------------------ platforms */
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 32px); width: min(880px, 100%); margin-top: clamp(16px, 4vh, 44px); }
.platform { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; text-decoration: none;
  padding: 22px 26px; border: 1px solid var(--rule); border-radius: 14px; background: rgba(253, 252, 249, 0.6);
  transition: border-color 0.35s, transform 0.5s var(--ease), background 0.35s; }
.platform:hover, .platform:focus-visible { border-color: var(--brass); transform: translateY(-3px); background: var(--paper-hi); }
.pname { display: inline-flex; align-items: center; font-weight: 600; font-size: clamp(20px, 2vw, 26px); letter-spacing: 0.2em; text-transform: uppercase; }
.pname .drop { width: 11px; height: 17px; fill: var(--verm); margin: 0 2px; }
.pname .arrow { width: 22px; height: 22px; margin-left: 8px; fill: none; stroke: var(--brass); stroke-width: 1.6; transition: transform 0.4s var(--ease); }
.platform:hover .arrow { transform: translate(2px, -2px); }
.pline { color: var(--ink-soft); font-size: clamp(17px, 1.5vw, 21px); font-style: italic; }

/* ------------------------------------------------------------ contact */
.addr-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; }
.addr { font-size: clamp(22px, 2.6vw, 36px); letter-spacing: 0.02em; user-select: all; }
.copy { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: 8px 16px; cursor: pointer; font-size: 15px; letter-spacing: 0.06em; transition: border-color 0.3s, color 0.3s; }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.copy:hover, .copy:focus-visible, .copy.done { border-color: var(--brass); color: var(--brass); }
.foot { position: absolute; left: 0; right: 0; bottom: 132px; display: flex; justify-content: center; gap: 6px 22px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-dim); letter-spacing: 0.04em; }
.foot p { margin: 0; }
.foot a { text-underline-offset: 3px; }

/* ------------------------------------------------------------ reveal (only with JS, never under reduced motion) */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease) var(--d, 0s), transform 1.1s var(--ease) var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .brand span { font-size: 13px; letter-spacing: 0.18em; }
  .hero { flex-direction: column; text-align: center; gap: 22px; padding-top: 84px; }
  .hero-mark { width: min(74vw, 38svh); }
  .hero-text { max-width: none; align-items: center; }
  .hero .caps.xs { letter-spacing: 0.5em; margin-right: -0.5em; }
  .hero .line { margin-top: 8px; }
  .pair { grid-template-columns: 1fr; gap: 40px; }
  .platforms { grid-template-columns: 1fr; }
  .platform { padding: 18px 20px; }
  .stats { gap: 48px; }
  .foot { bottom: 92px; font-size: 12px; padding: 0 16px; }
  .foot p { flex-basis: 100%; text-align: center; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .slide { padding-top: 80px; }
  .line.xl { font-size: clamp(40px, 10vh, 100px); }
}
