/* PANTAU public shell.
   Shared by the landing page, the article pages, the onboarding form and its
   confirmation. Tokens, chrome, and the reading surface live here; anything that
   belongs to one page only lives in that page's own stylesheet.
   The direction this implements is documented in DIRECTION.md at the repo root. */

:root {
  /* Ground */
  --paper: #F5F5F0;
  --paper-2: #EDEEE8;
  --ink: #0B1F33;
  --ink-2: #16283B;
  --ink-deep: #071B2D;
  --ink-3: #071827;

  /* Brand. --teal fills, --teal-ink is teal set as type on paper (6.1:1),
     --mint is the same accent at the brightness navy needs. */
  --teal: #0E7C86;
  --teal-hover: #0A5C64;
  --teal-ink: #0A6670;
  --mint: #2FD4C4;

  /* Type and rules */
  --muted: #57666F;
  --rule: #D3DBDA;
  --rule-dark: #294356;

  /* One stepped scale for the whole public site. */
  --step-6: clamp(44px, 5.4vw, 74px);
  --step-5: clamp(31px, 3.4vw, 46px);
  --step-4: clamp(23px, 2vw, 29px);
  --step-3: 19px;
  --step-2: 17px;
  --step-1: 15px;
  --step-0: 13px;

  --display: Archivo, "Archivo", system-ui, sans-serif;
  --text: "IBM Plex Sans", system-ui, sans-serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: 24px;
}

* { box-sizing: border-box; }

/* A single fixed grain plate over the whole page. Fixed and pointer-events:none
   on purpose: on a scrolling container it would repaint every frame. */
.grain {
  position: fixed; inset: -50%; z-index: 60;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--step-1);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.04;
  margin: 0;
}

/* The landing page sets its own accents; other public pages keep the older
   coloured-phrase treatment their copy was written around. */
h1 em, h2 em { font-style: normal; color: var(--teal-ink); }

p { margin: 0; }

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

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: min(1160px, calc(100% - (var(--gutter) * 2))); margin-inline: auto; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  font: 600 var(--step-0)/1 var(--text);
  transition: top 160ms var(--ease);
}
.skip-link:focus { top: 12px; }

/* Masthead credit. PANTAU is a research project and says so before it sells. */
.research-banner {
  background: var(--ink);
  color: #C6D3DB;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  padding: 9px 0;
}
.research-banner a { color: var(--mint); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex; gap: 10px; align-items: center;
  font: 700 15px/1 var(--display);
  letter-spacing: .08em;
}
.brand small {
  display: block;
  font: 500 10px/1 var(--text);
  color: #556B78;
  letter-spacing: .13em;
  margin-top: 3px;
}
.logo {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  color: #fff; background: linear-gradient(135deg, #0A6670, var(--mint));
  font-size: 14px;
  flex: 0 0 auto;
}

.navlinks { display: flex; gap: 30px; font-size: var(--step-0); }
.navlinks a { padding: 6px 0; border-bottom: 1px solid transparent; }
.navlinks a:hover { color: var(--teal-ink); border-bottom-color: var(--teal); }

.navcta { display: flex; align-items: center; gap: 8px; }

.text-link {
  font-size: var(--step-0); font-weight: 600;
  padding: 12px 14px;
  min-height: 44px; display: inline-flex; align-items: center;
}
.text-link:hover { color: var(--teal-ink); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 44px;
  padding: 13px 22px;
  background: var(--teal); color: #fff;
  border: 1px solid var(--teal);
  border-radius: 3px;
  font: 600 var(--step-0)/1 var(--text);
  cursor: pointer;
  transition: background 160ms var(--ease), transform 120ms var(--ease);
}
.button:hover { background: var(--teal-hover); border-color: var(--teal-hover); }
.button:active { transform: translateY(1px); }
.button.small { padding: 10px 15px; }
.button.ghost { background: transparent; color: var(--ink); border-color: #9FADB4; }
.button.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.lightbtn { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.lightbtn:hover { background: #5FE3D6; border-color: #5FE3D6; color: var(--ink); }

.section-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  color: var(--teal-ink);
}
.section-kicker.light { color: var(--mint); }

/* Closing call. Shared by the landing page and every article. */
.final-cta { padding: 96px 0 108px; border-top: 1px solid var(--rule); }
.final-cta h2 { font-size: var(--step-5); margin: 18px 0 14px; max-width: 15ch; }
.final-cta p { color: var(--muted); font-size: var(--step-2); line-height: 1.65; max-width: 46ch; margin-bottom: 30px; }

/* Article reading surface */
.article-detail { max-width: 68ch; padding: 76px 0 40px; }
.article-meta { display: flex; gap: 16px; align-items: baseline; margin-bottom: 20px; }
.article-meta span:last-child { font-size: var(--step-0); color: var(--muted); }
.article-tag {
  display: inline-block;
  font: 700 11px/1 var(--display); letter-spacing: .1em;
  color: var(--teal-ink);
}
.article-detail > h1 { font-size: clamp(32px, 4vw, 46px); line-height: 1.12; margin: 0 0 36px; }
.article-detail h2 { font-size: var(--step-4); margin: 44px 0 14px; }
.article-detail p { color: #22384A; font-size: var(--step-2); line-height: 1.8; margin: 0 0 20px; }

.article-related { max-width: 68ch; padding: 20px 0 64px; border-top: 1px solid var(--rule); }
.article-related h3 { font-size: var(--step-0); letter-spacing: .06em; color: var(--muted); margin: 30px 0 16px; }
.article-related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.article-related a { font-size: var(--step-2); font-weight: 600; color: var(--teal-ink); }
.article-related a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Onboarding confirmation */
.success-body { min-height: 100vh; min-height: 100dvh; background: var(--ink); display: grid; place-items: center; padding: 30px; }
.success-card { background: var(--paper); max-width: 660px; padding: 56px; text-align: center; }
.success-card .brand { justify-content: center; margin-bottom: 44px; }
.success-icon {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 50%; background: #DDF3EE; color: #0F6B52; font-size: 25px;
  margin: 0 auto 24px;
}
.success-card h1 { font-size: clamp(32px, 4vw, 42px); line-height: 1.1; margin: 18px 0 20px; }
.success-card p { color: var(--muted); font-size: var(--step-2); line-height: 1.7; margin: 0 auto 30px; max-width: 46ch; }

/* Footer */
footer { background: var(--ink-3); color: #fff; }
.footer {
  min-height: 130px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  padding: 32px 0;
}
.footer p { font-size: var(--step-0); color: #93A8B6; max-width: 34ch; }
footer .brand small { color: #8DA2B0; }
.footer > div { display: flex; gap: 10px; font-size: var(--step-0); }
.footer > div a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.footer a:hover { color: var(--mint); }

.research-credit { border-top: 1px solid #16303F; padding: 24px 0 30px; text-align: center; }
.research-credit p { margin: 0 auto; font-size: 12px; line-height: 1.8; color: #8AA0B0; max-width: 76ch; }
.research-credit a { color: var(--mint); font-weight: 600; }
.research-credit a:hover { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 800px) {
  :root { --gutter: 18px; }
  .navlinks { display: none; }
  /* Nothing in the masthead may wrap: a two-line wordmark or a two-line button
     is the first thing a visitor sees go wrong. */
  .nav { height: 64px; gap: 10px; }
  .brand { font-size: 13px; }
  .brand small { white-space: nowrap; }
  .navcta { gap: 2px; flex: 0 0 auto; }
  .text-link { padding: 12px 8px; }
  .button.small { padding: 10px 13px; white-space: nowrap; }
  .research-banner { text-align: left; }
  .research-banner { font-size: 11px; padding: 10px 16px; }
  .final-cta { padding: 72px 0 80px; }
  .article-detail { padding: 52px 0 32px; }
  .success-card { padding: 36px 24px; }
  .footer { flex-direction: column; align-items: flex-start; padding: 40px 0; }
}
