/* ============================================================
   Thomas Arthur — thomasarthur.me
   Palette: #FAA948 (accent) · #5B7A8F (slate) · #CFCBCA (hairline) · #F5F5F4 (paper)
   Type: Fraunces (display) · Archivo (body) · Spline Sans Mono (labels)
   ============================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces-var-italic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Spline Sans Mono';
  src: url('../fonts/spline-sans-mono-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --ink: #0E1216;            /* page background — deep slate-black */
  --ink-2: #141A20;          /* raised panels */
  --ink-3: #1B232B;          /* borders on dark */
  --paper: #F5F5F4;          /* primary text */
  --slate: #5B7A8F;          /* secondary / structural */
  --slate-bright: #8FAEC2;   /* readable slate on dark */
  --hairline: #CFCBCA;       /* light hairlines (used at low alpha) */
  --accent: #FAA948;         /* orange */
  --accent-soft: rgba(250, 169, 72, 0.14);

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Archivo', Helvetica, Arial, sans-serif;
  --font-mono: 'Spline Sans Mono', 'SF Mono', Menlo, monospace;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --measure: 38rem;
  --header-h: 4.25rem;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-weight: 380;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100vh;
}

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

a { color: inherit; }

.mono {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 0.8125rem;
  text-transform: uppercase;
}

em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 480;
  letter-spacing: 0;
}

section { position: relative; }

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

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.preloader__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}
.preloader__coords {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2.4vw, 1.15rem);
  letter-spacing: 0.08em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.preloader__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--slate-bright);
}

/* ---------- Grain ---------- */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 1%); }
  50% { transform: translate(1%, -2%); }
  75% { transform: translate(-1%, 2%); }
  100% { transform: translate(2%, -1%); }
}

/* ---------- Cursor ---------- */
.cursor {
  position: fixed;
  z-index: 55;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.3s ease, background-color 0.25s ease;
  mix-blend-mode: exclusion;
}
.cursor.is-active { opacity: 1; }
.cursor.is-link { width: 44px; height: 44px; background: var(--paper); }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 var(--gutter);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(14, 18, 22, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(207, 203, 202, 0.09);
}
.site-header__brand {
  font-family: var(--font-display);
  font-weight: 520;
  font-size: 1.05rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.site-header__mark {
  color: var(--accent);
  font-size: 0.9em;
  display: inline-block;
}
.site-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--slate-bright);
  font-variant-numeric: tabular-nums;
}
.site-header__cta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  border: 1px solid rgba(207, 203, 202, 0.25);
  border-radius: 999px;
  padding: 0.55em 1.2em;
  white-space: nowrap;
  transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.site-header__cta:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--ink);
}
@media (max-width: 720px) {
  .site-header__meta { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 5.5rem;
  overflow: clip;
}
.hero__globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}
.hero__content { position: relative; z-index: 1; max-width: 72rem; }
.hero__overline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--slate-bright);
  margin-bottom: clamp(1.25rem, 3vh, 2.5rem);
}
.hero__overline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 460;
  font-size: clamp(3.4rem, 14.5vw, 11.5rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.hero__title-line { display: block; overflow: hidden; }
.hero__title-line--indent { padding-left: clamp(1.5rem, 9vw, 9rem); }
.hero__title-word { display: inline-block; }
.hero__title-line--indent .hero__title-word {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero__lede {
  max-width: var(--measure);
  margin-top: clamp(1.5rem, 3.5vh, 2.75rem);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  color: rgba(245, 245, 244, 0.86);
}
.hero__lede a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  transition: color 0.2s ease;
}
.hero__lede a:hover { color: var(--accent); }
.hero__codes {
  position: absolute;
  right: var(--gutter);
  bottom: 2rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--slate-bright);
  font-variant-numeric: tabular-nums;
}
.hero__code { letter-spacing: 0.18em; }
.hero__code--home { color: var(--accent); }
.hero__code-sep { opacity: 0.4; }
.hero__scrollcue {
  position: absolute;
  left: var(--gutter);
  bottom: 2rem;
  z-index: 1;
  color: var(--paper);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero__scrollcue-arrow {
  display: inline-block;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}
@media (max-width: 720px) {
  .hero__codes { display: none; }
}

/* ---------- Section tag ---------- */
.section-tag {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  color: var(--slate-bright);
  margin-bottom: clamp(1.75rem, 4vh, 3rem);
}
.section-tag::after {
  content: '';
  flex: 0 1 6rem;
  height: 1px;
  background: rgba(207, 203, 202, 0.25);
  align-self: center;
}
.section-tag__num { color: var(--accent); }

/* ---------- Thesis ---------- */
.thesis {
  padding: clamp(6rem, 16vh, 11rem) var(--gutter);
  max-width: 68rem;
  margin: 0 auto;
}
.thesis__statement {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: clamp(1.9rem, 5vw, 3.9rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  max-width: 20ch;
}
.thesis__statement .word { display: inline-block; }
.thesis__em {
  position: relative;
  color: var(--accent);
  white-space: nowrap;
}
.thesis__underline {
  position: absolute;
  left: -1%;
  bottom: -0.18em;
  width: 102%;
  height: 0.16em;
  color: var(--accent);
  overflow: visible;
}
.thesis__support {
  margin-top: clamp(2rem, 5vh, 3.25rem);
  max-width: var(--measure);
  color: rgba(245, 245, 244, 0.72);
  font-size: 1.0625rem;
}

/* ---------- Route ---------- */
.route {
  padding: clamp(5rem, 14vh, 10rem) var(--gutter);
  background:
    radial-gradient(90rem 40rem at 70% 0%, rgba(91, 122, 143, 0.10), transparent 60%),
    var(--ink-2);
  border-top: 1px solid rgba(207, 203, 202, 0.07);
  border-bottom: 1px solid rgba(207, 203, 202, 0.07);
}
.route__head { max-width: 68rem; margin: 0 auto; }
.route__title,
.work__title {
  font-family: var(--font-display);
  font-weight: 440;
  font-size: clamp(2rem, 5.5vw, 4rem);
  letter-spacing: -0.015em;
  line-height: 1.08;
}
.route__title em, .work__title em, .north__title em { color: var(--accent); }

.route__body {
  position: relative;
  max-width: 68rem;
  margin: clamp(3rem, 8vh, 5.5rem) auto 0;
  padding-left: clamp(2.25rem, 6vw, 4.5rem);
}
.route__line {
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  left: clamp(0.4rem, 1.4vw, 1rem);
  width: 2px;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(207, 203, 202, 0.22) 0 2px,
    transparent 2px 8px
  );
}
.route__line-draw {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top center;
  box-shadow: 0 0 10px rgba(250, 169, 72, 0.35);
}
.route__marker {
  position: absolute;
  left: clamp(0.4rem, 1.4vw, 1rem);
  top: 0;
  transform: translate(-50%, -50%) rotate(180deg);
  color: var(--accent);
  font-size: 1.1rem;
  text-shadow: 0 0 14px rgba(250, 169, 72, 0.7);
  will-change: top;
}
.route__stops {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 9vh, 6rem);
}
.route__stop { position: relative; max-width: 40rem; }
.route__node {
  position: absolute;
  left: calc(-1 * clamp(2.25rem, 6vw, 4.5rem) + clamp(0.4rem, 1.4vw, 1rem));
  top: 0.45rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--slate-bright);
  background: var(--ink-2);
  transform: translateX(-50%);
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.route__stop.is-passed .route__node {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(250, 169, 72, 0.55);
}
.route__coords {
  color: var(--slate-bright);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.65rem;
}
.route__stop-title {
  font-family: var(--font-display);
  font-weight: 470;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.route__stop--home .route__stop-title { color: var(--accent); font-style: italic; font-weight: 430; }
.route__stop-place {
  color: rgba(207, 203, 202, 0.75);
  margin-bottom: 0.9rem;
}
.route__stop-copy {
  color: rgba(245, 245, 244, 0.74);
  max-width: 36rem;
}

/* ---------- Skyline traces (test/concept) ---------- */
.route__scape-wrap {
  margin: 1.75rem 0 0;
  width: min(100%, 26rem);
}
.route__scape {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.route__scape path {
  fill: none;
  stroke: var(--slate-bright);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.5;
}
.route__scape .a {
  stroke: var(--accent);
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(250, 169, 72, 0.35));
}
@media (min-width: 1120px) {
  .route__scape-wrap {
    position: absolute;
    left: 42rem;
    top: -0.5rem;
    width: 26rem;
    margin: 0;
  }
}

/* ---------- Work ---------- */
.work {
  padding: clamp(6rem, 15vh, 11rem) var(--gutter);
  max-width: 76rem;
  margin: 0 auto;
}
.work__grid {
  margin-top: clamp(2.5rem, 7vh, 4.5rem);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(207, 203, 202, 0.12);
  border: 1px solid rgba(207, 203, 202, 0.12);
}
@media (max-width: 860px) {
  .work__grid { grid-template-columns: 1fr; }
}
.work-card {
  position: relative;
  background: var(--ink);
  padding: clamp(1.75rem, 4vw, 3rem);
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  overflow: hidden;
  transition: background-color 0.35s ease;
}
.work-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(28rem 16rem at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.work-card:hover::after { opacity: 1; }
.work-card:hover { background: var(--ink-2); }
.work-card__num {
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.25em;
}
.work-card__title {
  font-family: var(--font-display);
  font-weight: 470;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.15;
}
.work-card__copy { color: rgba(245, 245, 244, 0.72); max-width: 30rem; }
.work-card__arrow {
  margin-top: auto;
  align-self: flex-end;
  color: var(--accent);
  font-size: 1.3rem;
  transform: translateX(-6px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.work-card:hover .work-card__arrow { transform: translateX(0); opacity: 1; }

/* ---------- Proof ---------- */
.proof {
  padding: clamp(6rem, 16vh, 11rem) var(--gutter);
  background:
    radial-gradient(70rem 30rem at 30% 100%, rgba(250, 169, 72, 0.06), transparent 65%),
    var(--ink-2);
  border-top: 1px solid rgba(207, 203, 202, 0.07);
  border-bottom: 1px solid rgba(207, 203, 202, 0.07);
}
.proof > * { max-width: 68rem; margin-left: auto; margin-right: auto; }
.proof__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2rem, 6vw, 5rem);
}
.proof__stat { display: flex; flex-direction: column; gap: 0.6rem; }
.proof__value {
  font-size: clamp(3.4rem, 10vw, 7.5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.proof__value--accent { color: var(--accent); }
.proof__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate-bright);
}
.proof__note {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  max-width: var(--measure);
  color: rgba(245, 245, 244, 0.74);
}
.proof__note em { color: var(--paper); }

/* ---------- True North ---------- */
.north {
  min-height: 88svh;
  padding: clamp(6rem, 16vh, 12rem) var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: clip;
}
.north .section-tag { justify-content: center; }
.north .section-tag::after { display: none; }
/* Split-flap departure board */
.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vh, 3.25rem);
}
.board__meta {
  color: var(--slate-bright);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
}
.board__row {
  display: flex;
  gap: clamp(3px, 0.7vw, 7px);
}
.board__cell {
  position: relative;
  width: clamp(1.4rem, 4.4vw, 2.5rem);
  height: clamp(2rem, 6.2vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3.1vw, 1.8rem);
  font-weight: 500;
  color: var(--accent);
  background: linear-gradient(180deg, #1D2630 0%, #161C23 48%, #12171D 52%, #171D24 100%);
  border: 1px solid rgba(207, 203, 202, 0.13);
  border-radius: 5px;
  box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.35), 0 3px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.board__cell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background: rgba(0, 0, 0, 0.6);
}
.board__cell--space {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.board__cell--space::after { display: none; }
.board__cell.is-flipping { animation: flap 0.11s linear infinite; }
@keyframes flap {
  0% { transform: scaleY(1); }
  50% { transform: scaleY(0.86); filter: brightness(1.25); }
  100% { transform: scaleY(1); }
}
.board__cell.is-set { animation: settle 0.28s ease-out; }
@keyframes settle {
  0% { transform: scaleY(0.8); filter: brightness(1.6); }
  100% { transform: scaleY(1); filter: brightness(1); }
}
.north__title {
  font-family: var(--font-display);
  font-weight: 430;
  font-size: clamp(2.1rem, 5.6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  max-width: 18ch;
}
.north__cta {
  margin-top: clamp(2.25rem, 6vh, 3.5rem);
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 1.05em 1.9em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 0 0 rgba(250, 169, 72, 0);
}
.north__cta:hover {
  transform: translateY(-2px);
  background: #FFBE6E;
  box-shadow: 0 14px 44px rgba(250, 169, 72, 0.28);
}
.north__cta-arrow { font-size: 1.15em; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  padding: 2rem var(--gutter) 2.25rem;
  border-top: 1px solid rgba(207, 203, 202, 0.09);
  color: var(--slate-bright);
}
.site-footer__name { font-family: var(--font-display); font-weight: 480; color: var(--paper); }
.site-footer__coords, .site-footer__legal { font-variant-numeric: tabular-nums; font-size: 0.75rem; }

/* ---------- Reveal defaults (JS enhances) ---------- */
.js .reveal { opacity: 0; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .grain { animation: none; }
}
