/* Fonts: Sora and JetBrains Mono, SIL Open Font License 1.1 (see /assets/fonts). */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/sora-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/sora-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/sora-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Theme ---------- */

:root {
  color-scheme: light dark;
  --font-sans: "Sora", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --gutter: clamp(20px, 5vw, 48px);
  --nav-height: 74px;
  --radius: 16px;

  /* Dawn */
  --paper: #fffaf3;
  --paper-tint: #fff3e5;
  --surface: #ffffff;
  --ink: #1f1727;
  --ink-soft: #6b5045;
  --ink-faint: #85654f;
  --line: #f0dcc6;
  --accent: #c4461a;
  --accent-strong: #a93a14;
  --on-accent: #ffffff;
  --sky: linear-gradient(180deg, #fff4e6 0%, #ffe4c4 55%, #ffb877 100%);
  --stars: none;
  --glow: rgb(255 148 71 / 0.5);
  --sun-top: #ff8f2e;
  --sun-bottom: #f2542d;
  --ground: #231a2c;
  --ground-ink: #ffc38c;
  --horizon: #ff7a33;
  --reflect-1: #ff9a4d;
  --reflect-2: #ef6f31;
  --reflect-3: #b9472b;
  --shadow: 0 1px 2px rgb(31 23 39 / 0.06), 0 18px 40px -18px rgb(120 60 20 / 0.35);
}

@media (prefers-color-scheme: dark) {
  /* Dusk */
  :root {
    --paper: #100c19;
    --paper-tint: #150f20;
    --surface: #1a1424;
    --ink: #fff1e2;
    --ink-soft: #cdb2a2;
    --ink-faint: #a48b7c;
    --line: #2d2337;
    --accent: #ff9a52;
    --accent-strong: #ffb27a;
    --on-accent: #1f1727;
    --sky: linear-gradient(180deg, #100c19 0%, #1f142a 50%, #43202f 82%, #86392c 100%);
    --stars:
      radial-gradient(1.6px 1.6px at 52% 14%, rgb(255 233 210 / 0.7), transparent),
      radial-gradient(1.2px 1.2px at 58% 30%, rgb(255 233 210 / 0.45), transparent),
      radial-gradient(1.4px 1.4px at 64% 9%, rgb(255 233 210 / 0.55), transparent),
      radial-gradient(1.8px 1.8px at 71% 22%, rgb(255 233 210 / 0.75), transparent),
      radial-gradient(1.2px 1.2px at 77% 6%, rgb(255 233 210 / 0.4), transparent),
      radial-gradient(1.4px 1.4px at 88% 15%, rgb(255 233 210 / 0.6), transparent),
      radial-gradient(1.2px 1.2px at 94% 28%, rgb(255 233 210 / 0.4), transparent),
      radial-gradient(1.6px 1.6px at 97% 8%, rgb(255 233 210 / 0.65), transparent),
      radial-gradient(1px 1px at 83% 33%, rgb(255 233 210 / 0.35), transparent),
      radial-gradient(1px 1px at 46% 36%, rgb(255 233 210 / 0.3), transparent);
    --glow: rgb(255 106 42 / 0.32);
    --sun-top: #ffc274;
    --sun-bottom: #ff6a2a;
    --ground: #15101b;
    --ground-ink: #ffb778;
    --horizon: #ff8a3d;
    --reflect-1: #ffb262;
    --reflect-2: #f57b36;
    --reflect-3: #b4462a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 20px 48px -20px rgb(0 0 0 / 0.7);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img {
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

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

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

.nowrap {
  white-space: nowrap;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

/* ---------- Brand ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.brand-soft {
  font-weight: 400;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0 1.3em;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost {
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  background: color-mix(in srgb, var(--paper) 40%, transparent);
  color: var(--ink);
}

.button.ghost:hover {
  border-color: color-mix(in srgb, var(--ink) 45%, transparent);
}

/* ---------- Hero ---------- */

.hero {
  --sun: clamp(176px, 30vw, 360px);
  --mark-gap: clamp(24px, 5vw, 72px);
}

.hero-sky {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--stars), var(--sky);
}

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
}

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

.nav-links {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

.hero-main,
.hero-base {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sun);
  column-gap: var(--mark-gap);
}

.hero-main {
  align-items: end;
  padding-top: calc(var(--nav-height) + clamp(40px, 8vw, 104px));
}

.hero-copy {
  padding-bottom: clamp(48px, 7vw, 96px);
}

/* "Open-source tools," is about 9.3em wide; the size keeps it on one line beside the sun. */
.hero h1 {
  font-size: clamp(2.2rem, 5.6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 36ch;
  margin: 24px 0 36px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.sun-slot {
  position: relative;
  width: var(--sun);
  height: calc(var(--sun) / 2);
}

.sun-slot::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: -1;
  width: calc(var(--sun) * 3);
  height: calc(var(--sun) * 1.5);
  transform: translateX(-50%);
  background: radial-gradient(closest-side at 50% 100%, var(--glow), transparent);
  animation: fade-in 2s ease 0.3s both;
}

.sun-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: var(--sun) var(--sun) 0 0;
}

.sun {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--sun-top) 0%, var(--sun-bottom) 50%);
  animation: rise 1.6s cubic-bezier(0.16, 0.84, 0.3, 1) 0.1s both;
}

.hero-ground {
  position: relative;
  background: var(--ground);
}

.hero-ground::before,
.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--horizon) 15%, transparent),
    var(--horizon) 78%,
    color-mix(in srgb, var(--horizon) 35%, transparent)
  );
}

.hero-base {
  align-items: center;
  min-height: calc(var(--sun) * 0.44);
}

.prompt {
  margin: 0;
  color: var(--ground-ink);
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.5vw, 1rem);
  font-weight: 500;
}

.cursor {
  display: inline-block;
  width: 0.58em;
  height: 1.1em;
  margin-left: 0.3em;
  border-radius: 2px;
  vertical-align: -0.2em;
  background: var(--horizon);
  animation: blink 1.1s steps(1, end) infinite;
}

/* Reflection rows mirror the brand mark: widths and depths are fractions of the sun diameter. */
.reflection {
  position: relative;
  align-self: start;
  height: calc(var(--sun) * 0.4);
}

.reflection .row {
  position: absolute;
  left: 50%;
  height: calc(var(--sun) * 0.0475);
  transform: translateX(-50%);
}

.reflection .row:nth-child(1) { --w: 0.8; --t: 0.09; --c: var(--reflect-1); --d: 0.9s; }
.reflection .row:nth-child(2) { --w: 0.56; --t: 0.2; --c: var(--reflect-2); --d: 1.05s; }
.reflection .row:nth-child(3) { --w: 0.33; --t: 0.31; --c: var(--reflect-3); --d: 1.2s; }

.reflection .row {
  top: calc(var(--sun) * var(--t));
  width: calc(var(--sun) * var(--w));
}

.reflection i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--a) * 100%);
  width: calc((var(--b) - var(--a)) * 100%);
  border-radius: 999px;
  background: var(--c);
  transform-origin: left center;
  animation: stretch 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d) both;
}

.row:nth-child(1) i:nth-child(1) { --a: 0; --b: 0.5; }
.row:nth-child(1) i:nth-child(2) { --a: 0.58; --b: 0.76; }
.row:nth-child(1) i:nth-child(3) { --a: 0.84; --b: 1; }
.row:nth-child(2) i:nth-child(1) { --a: 0; --b: 0.28; }
.row:nth-child(2) i:nth-child(2) { --a: 0.38; --b: 1; }
.row:nth-child(3) i:nth-child(1) { --a: 0; --b: 0.6; }
.row:nth-child(3) i:nth-child(2) { --a: 0.74; --b: 1; }

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.section h2 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: center;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.project-head img {
  width: 56px;
  height: 56px;
}

.project-lede {
  max-width: 46ch;
  margin: 22px 0 28px;
  color: var(--ink-soft);
  font-size: 1.125rem;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 28px;
  margin: 0 0 32px;
  padding: 22px 0;
  border-block: 1px solid var(--line);
}

.facts dt {
  margin-bottom: 4px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
}

.project-more {
  margin: 22px 0 0;
}

.project-more a,
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  text-decoration: none;
}

.project-more a:hover,
.footer-links a:hover {
  text-decoration: underline;
}

.project-shot {
  margin: 0;
}

.project-shot img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f3ef;
  box-shadow: var(--shadow);
}

.project-shot figcaption {
  margin-top: 14px;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: right;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(56px, 8vw, 96px) 0 0;
  padding: 0;
  list-style: none;
}

.highlights li {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.highlights h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.highlights p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}

.fineprint {
  max-width: 72ch;
  margin: 40px 0 0;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.contribute {
  border-top: 1px solid var(--line);
  background: var(--paper-tint);
}

.section-lede {
  max-width: 52ch;
  margin: 18px 0 40px;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.paths a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 20px;
  height: 100%;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.paths a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.path-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.paths strong {
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.path-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.paths .icon {
  grid-row: 1 / span 3;
  grid-column: 2;
  align-self: center;
  width: 22px;
  height: 22px;
  color: var(--accent);
  transition: transform 0.2s;
}

.paths a:hover .icon {
  transform: translateX(3px);
}

/* ---------- Footer ---------- */

.footer {
  position: relative;
  padding-block: 48px 36px;
  background: var(--ground);
  color: #cdb2a2;
}

.footer-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
}

.footer .brand {
  color: #fff1e2;
}

.footer .brand-soft {
  color: #c7a28c;
}

.footer-brand p {
  margin: 10px 0 0;
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links a {
  color: var(--ground-ink);
}

.copyright {
  width: 100%;
  margin: 8px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  color: #a48b7c;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

/* ---------- Not found page ---------- */

.not-found .hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.not-found .hero-sky {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.not-found .hero-main {
  flex: 1;
}

.not-found .hero-copy {
  padding-bottom: clamp(56px, 8vw, 104px);
}

.not-found .eyebrow {
  margin-bottom: 20px;
}

/* ---------- Motion ---------- */

@keyframes rise {
  from { transform: translateY(50%); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes stretch {
  from { transform: scaleX(0); opacity: 0; }
}

@keyframes blink {
  50% { opacity: 0; }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero-main {
    grid-template-columns: minmax(0, 1fr);
    padding-top: calc(var(--nav-height) + 28px);
  }

  .hero h1 {
    font-size: clamp(2rem, 9.2vw, 3.4rem);
  }

  .hero-copy {
    padding-bottom: 40px;
  }

  .sun-slot {
    justify-self: end;
  }

  .paths {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .nav-links li:not(:last-child) {
    display: none;
  }

  .highlights,
  .facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .actions .button {
    flex: 1 1 auto;
    justify-content: center;
  }
}
