/* Sunrunner Labs — first light.
   One variable font, one accent, one signature moment. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
/* Georgia, metric-adjusted to Fraunces — no reflow when the webfont swaps in */
@font-face {
  font-family: "Fraunces-fallback";
  src: local("Georgia");
  size-adjust: 84.7%;
  ascent-override: 115.5%;
  descent-override: 30.1%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light dark;
  --paper: #fbf6ed;
  --ink: #201710;
  --muted: #695740;
  --line: rgba(32, 23, 16, 0.16);
  --accent: #b8460a;
  --sun-core: #ffc46b;
  --sun-mid: #ff9e4f;
  --sun-deep: #f2701d;
  --sun-glow: rgba(255, 158, 79, 0.38);
  --sky-glow: rgba(255, 178, 102, 0.26);
  --grain-opacity: 0.05;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171009;
    --ink: #f4e9d8;
    --muted: #b39b76;
    --line: rgba(244, 233, 216, 0.17);
    --accent: #ff8c42;
    --sun-core: #ffb347;
    --sun-mid: #e8590c;
    --sun-deep: #9a3412;
    --sun-glow: rgba(232, 89, 12, 0.3);
    --sky-glow: rgba(232, 89, 12, 0.16);
    --grain-opacity: 0.07;
  }
}

* { margin: 0; box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  font-family: "Fraunces", "Fraunces-fallback", Georgia, serif;
  font-variation-settings: "opsz" 18;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* fine grain over everything, barely there */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="220" height="220"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" stitchTiles="stitch"/><feColorMatrix type="saturate" values="0"/></filter><rect width="220" height="220" filter="url(%23n)"/></svg>');
  background-size: 220px 220px;
}

::selection {
  background: var(--sun-mid);
  color: #201710;
}

a {
  color: inherit;
  text-decoration-color: var(--line);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.25s ease;
}
a:hover { text-decoration-color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- masthead ---------- */

.masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 5vw, 3rem);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.mark {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
}
.mark circle { fill: var(--accent); stroke: none; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(100% - clamp(1.25rem, 5vw, 3rem) - clamp(1.25rem, 5vw, 3rem), 56rem);
  margin-inline: auto;
  padding-bottom: clamp(6rem, 16vh, 11rem);
  padding-bottom: clamp(6rem, 16svh, 11rem);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 540;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

h1 {
  font-size: clamp(3rem, 8.5vw, 6rem);
  font-weight: 470;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.015em;
  line-height: 1.02;
  text-wrap: balance;
}

.lede {
  margin-top: 1.75rem;
  max-width: 34ch;
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

/* the signature moment: a sun rising over the horizon */

.dawn {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    var(--sky-glow) 100%
  );
  will-change: transform;
}

.sun {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(clamp(300px, 44vw, 580px), 62vh);
  width: min(clamp(300px, 44vw, 580px), 62svh);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 32%,
    var(--sun-core) 0%,
    var(--sun-mid) 52%,
    var(--sun-deep) 100%
  );
  box-shadow: 0 0 120px 40px var(--sun-glow);
  transform: translate(-50%, 58%);
  animation: sunrise 2.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sunrise {
  from { transform: translate(-50%, 96%); }
  to   { transform: translate(-50%, 58%); }
}

.horizon {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  border-top: 1px solid var(--line);
  height: 0;
}

/* load-time reveal for hero copy — pure CSS, works before JS */

.reveal-load {
  opacity: 0;
  animation: fade-up 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- shared column ---------- */

.beliefs,
.work,
footer {
  width: min(100% - clamp(1.25rem, 5vw, 3rem) - clamp(1.25rem, 5vw, 3rem), 42rem);
  margin-inline: auto;
}

.label {
  font-size: 0.8125rem;
  font-weight: 540;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- beliefs ---------- */

.beliefs { padding-top: clamp(5rem, 12vw, 8.5rem); }

.beliefs ol {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  counter-reset: belief;
}

.beliefs li {
  counter-increment: belief;
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  column-gap: 1rem;
  padding-block: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}

@media (max-width: 600px) {
  .beliefs li { grid-template-columns: 2.25rem 1fr; column-gap: 0.75rem; }
}
.beliefs li:first-child { border-top: none; padding-top: 1.5rem; }

.beliefs h3,
.beliefs p { grid-column: 2; }

.beliefs li::before {
  grid-column: 1;
  grid-row: 1;
  content: "0" counter(belief);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 0.5em;
}

.beliefs h3 {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  font-weight: 500;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.beliefs p {
  margin-top: 0.6rem;
  max-width: 44ch;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- work ---------- */

.work { padding-top: clamp(5rem, 12vw, 8.5rem); }

.work-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  margin-top: 1.25rem;
  text-decoration: none;
}

.work-name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 480;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.015em;
  line-height: 1;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 2px;
  transition: background-size 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-arrow {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--accent);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-link:hover .work-name,
.work-link:focus-visible .work-name { background-size: 100% 2px; }
.work-link:hover .work-arrow,
.work-link:focus-visible .work-arrow { transform: translate(0.12em, -0.12em); }

.work-note {
  margin-top: 1rem;
  max-width: 40ch;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- footer ---------- */

footer {
  margin-top: clamp(4rem, 9vw, 6.5rem);
  padding-block: 2rem clamp(2rem, 5vw, 3rem);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- scroll reveal (JS adds .js to <html>) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sun { animation: none; }
  .reveal-load { animation: none; opacity: 1; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .dawn { transform: none !important; }
}
