/* Design pass: redesign-existing-projects.
   Fraunces, Outfit, IBM Plex Mono — SIL Open Font License 1.1. See /fonts/OFL.txt. */

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 620;
  font-display: swap;
  src: url("/fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 520;
  font-display: swap;
  src: url("/fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/outfit.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/plex-500.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/plex-600.woff2") format("woff2");
}

:root {
  --ink: #161310;
  --paper: #f6f0e6;
  --mute: #cfc3b3;
  --line: #3c342c;
  --card: #1e1a16;
  --blood: #e85a48;
  --blood-soft: #f3b0a4;
  --gold: #e2b15c;
  --moss: #93c07e;
  --font-geist-sans: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-instrument: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-geist-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  background-image:
    radial-gradient(880px 420px at -5% -8%, rgba(232, 90, 72, 0.16), transparent 58%),
    radial-gradient(640px 320px at 108% -4%, rgba(226, 177, 92, 0.07), transparent 52%),
    linear-gradient(180deg, #1a1613 0%, #100e0c 42%, #12100e 100%);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  min-height: 100dvh;
}

::selection {
  background: rgba(232, 90, 72, 0.35);
  color: var(--paper);
}

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

h1, h2, h3 {
  overflow-wrap: normal;
  word-break: normal;
}

p { text-wrap: pretty; }

.font-serif {
  font-weight: 560;
  font-optical-sizing: auto;
}

h1.font-serif,
h2.font-serif,
h3.font-serif {
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1.font-serif { line-height: 1.02; }
h2.font-serif,
h3.font-serif { line-height: 1.14; }

.mono,
.badge,
.font-serif.text-3xl {
  font-variant-numeric: tabular-nums;
}

.grain { opacity: 0.045; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0;
  z-index: 80;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  transform: translateY(0.75rem);
}
main:focus { outline: none; }

/* Landing masthead: a floating pill, not an edge-glued bar. */
main > header:not(.sticky) {
  position: sticky;
  top: 0.7rem;
  z-index: 45;
  width: min(72rem, calc(100% - 1.5rem));
  margin: 0.7rem auto 0;
  padding: 0.45rem 0.45rem 0.45rem 1rem;
  border: 1px solid color-mix(in oklab, var(--paper) 14%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 14px 36px rgba(8, 6, 4, 0.32);
}
main > header:not(.sticky) .btn-ghost {
  border-color: transparent;
  background: transparent;
}
main > header:not(.sticky) .btn-ghost:hover {
  border-color: color-mix(in oklab, var(--paper) 22%, transparent);
  background: color-mix(in oklab, var(--paper) 5%, transparent);
}

header.sticky {
  background: color-mix(in oklab, var(--ink) 84%, transparent);
  border-bottom-color: color-mix(in oklab, var(--paper) 12%, transparent);
}
header.sticky nav[aria-label="Primary"] a,
header.sticky button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.seal {
  background: radial-gradient(circle at 35% 30%, #ffd0c8, var(--blood) 46%, #8c2c22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 6px 14px rgba(232, 90, 72, 0.28);
}

section.md\:pt-16 {
  padding-top: 2.6rem;
  padding-bottom: 1.25rem;
}
section.md\:pt-16 > p.mono {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 0.14em;
  font-size: 11px;
}
section.md\:pt-16 > p.mono::before {
  content: "";
  width: 1.6rem;
  height: 1px;
  background: var(--blood);
  flex: none;
}
section.md\:pt-16 > p.text-lg {
  max-width: 38rem;
  color: color-mix(in oklab, var(--paper) 82%, var(--mute));
  line-height: 1.6;
}

h1.md\:text-7xl {
  max-width: none;
  font-size: clamp(2.45rem, 5.5vw, 5.35rem);
  line-height: 0.9;
  letter-spacing: -0.036em;
  font-weight: 560;
}
h1.md\:text-7xl em {
  font-style: italic;
  font-weight: 520;
  color: color-mix(in oklab, var(--paper) 84%, var(--blood));
}

label span.mono { letter-spacing: 0.12em; }

.card {
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--paper) 10%, var(--line));
  background:
    linear-gradient(180deg, rgba(246, 240, 230, 0.045), transparent 40%),
    color-mix(in oklab, var(--card) 94%, black);
  box-shadow:
    inset 0 1px 0 rgba(246, 240, 230, 0.06),
    0 18px 34px rgba(8, 6, 4, 0.28);
}
a.card {
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.22s ease;
}
@media (hover: hover) {
  a.card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in oklab, var(--paper) 24%, var(--line));
  }
}

.btn-primary,
.btn-ghost {
  min-height: 44px;
  font-weight: 600;
  letter-spacing: -0.011em;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}
.btn-primary {
  box-shadow: 0 8px 18px rgba(232, 90, 72, 0.28);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active,
.btn-ghost:active { transform: translateY(1px) scale(0.98); }
.btn-ghost:hover {
  background: color-mix(in oklab, var(--paper) 4%, transparent);
}

.badge {
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 0.32rem 0.55rem;
  font-weight: 600;
}
.badge-live {
  background: rgba(226, 177, 92, 0.14);
  border-color: rgba(226, 177, 92, 0.38);
}
.badge-kept {
  background: rgba(147, 192, 126, 0.14);
  border-color: rgba(147, 192, 126, 0.36);
}
.badge-snitched {
  background: rgba(232, 90, 72, 0.14);
  border-color: rgba(232, 90, 72, 0.4);
}

.field {
  min-height: 3rem;
  font-size: 1rem;
  border-radius: 14px;
  background: #120f0c;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
textarea.field { min-height: 6.5rem; padding-top: 0.8rem; }
.field::placeholder { color: color-mix(in oklab, var(--mute) 72%, transparent); }
.field:focus {
  border-color: color-mix(in oklab, var(--blood) 70%, var(--line));
  box-shadow: 0 0 0 3px rgba(232, 90, 72, 0.2);
}
select.field option { background: var(--ink); color: var(--paper); }

/* Steps: one tall oath, two stacked consequences. Not three equal cards. */
@media (min-width: 48rem) {
  section.md\:pt-16 { padding-top: 4.25rem; padding-bottom: 2.5rem; }
  section.grid.md\:grid-cols-3 {
    grid-template-columns: 1.2fr 0.9fr;
    gap: 0.9rem;
    align-items: stretch;
  }
  section.grid.md\:grid-cols-3 > article:first-child {
    grid-row: span 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.6rem 1.6rem 1.7rem;
    background:
      radial-gradient(420px 240px at 0% 0%, rgba(232, 90, 72, 0.18), transparent 62%),
      linear-gradient(180deg, rgba(246, 240, 230, 0.04), transparent 36%),
      color-mix(in oklab, var(--card) 94%, black);
  }
  section.grid.md\:grid-cols-3 > article:first-child > p.mono {
    margin-bottom: auto;
    font-size: 3.4rem;
    line-height: 0.85;
    letter-spacing: -0.05em;
    color: color-mix(in oklab, var(--blood) 78%, var(--paper));
  }
  section.grid.md\:grid-cols-3 > article:first-child > h2 {
    font-size: 2.35rem;
  }
}

section.py-8 h2.font-serif { font-size: clamp(1.85rem, 3vw, 2.45rem); }

section.py-8 > ul {
  margin-top: 1.35rem;
}
section.py-8 > ul > li {
  padding: 0.8rem 0 0.8rem 0.8rem;
  border-left: 2px solid var(--line);
  line-height: 1.45;
}
section.py-8 > ul > li:first-child { border-left-color: var(--blood); }

@media (min-width: 68.75rem) {
  section.py-8 > ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
  }
  section.py-8 > ul > li {
    border-left: 0;
    border-top: 2px solid var(--line);
    padding: 0.75rem 0.15rem 0;
  }
  section.py-8 > ul > li:first-child { border-top-color: var(--blood); }
}

main > footer {
  max-width: 76rem;
  margin-top: 0.25rem;
  padding-top: 1.35rem;
  padding-bottom: 2.75rem;
  border-top: 1px solid var(--line);
}

section.grid-cols-2 > .card:last-child {
  border-color: color-mix(in oklab, var(--blood) 42%, var(--line));
  background:
    radial-gradient(180px 80px at 100% 0%, rgba(232, 90, 72, 0.16), transparent 70%),
    color-mix(in oklab, var(--card) 94%, black);
}

.loading-state {
  gap: 0.85rem;
  letter-spacing: 0.01em;
}
.loading-state::before,
.loading-inline::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  border-top-color: var(--blood);
  animation: snitch-spin 0.7s linear infinite;
}
.loading-inline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.loading-inline::before { width: 0.8rem; height: 0.8rem; }

.card.empty-state {
  text-align: center;
  padding: 2.6rem 1.4rem;
  background:
    radial-gradient(260px 90px at 50% 0%, rgba(232, 90, 72, 0.16), transparent 72%),
    color-mix(in oklab, var(--card) 94%, black);
}
.card.empty-state::before,
p.empty-state::before {
  content: "";
  display: block;
  width: 2rem;
  height: 2px;
  margin: 0 auto 1rem;
  background: var(--blood);
}
p.empty-state {
  padding-top: 0.25rem;
}
p.empty-state::before { margin-left: 0; }

@keyframes snitch-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
main > section {
  animation: snitch-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
main > section:nth-of-type(2) { animation-delay: 0.06s; }
main > section:nth-of-type(3) { animation-delay: 0.12s; }

@keyframes snitch-spin { to { transform: rotate(360deg); } }

body:has(.next-error-h1) {
  background: var(--ink) !important;
  color: var(--paper) !important;
}
body:has(.next-error-h1) .next-error-h1,
body:has(.next-error-h1) .next-error-h1 + div {
  display: block !important;
}
body:has(.next-error-h1) .next-error-h1 {
  border: 0 !important;
  margin: 0 0 0.35rem !important;
  padding: 0 !important;
  font-family: Fraunces, Georgia, serif !important;
  font-size: clamp(4.5rem, 16vw, 7rem) !important;
  font-weight: 560 !important;
  line-height: 0.88 !important;
  letter-spacing: -0.04em !important;
  color: var(--paper) !important;
}
body:has(.next-error-h1) h2 {
  font-family: Outfit, system-ui, sans-serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  color: var(--mute) !important;
  margin: 0 !important;
}
a.snitch-home { margin-top: 1.4rem; }

@media (max-width: 720px) {
  main > header:not(.sticky) {
    border-radius: 22px;
    width: calc(100% - 1.25rem);
    top: 0.45rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 0.55rem;
    padding: 0.7rem;
  }
  main > header:not(.sticky) > div {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-left: 0;
  }
  main > header:not(.sticky) .btn-primary,
  main > header:not(.sticky) .btn-ghost {
    width: 100%;
    padding-inline: 0.6rem;
    font-size: 13px;
  }
  main > header:not(.sticky) .btn-ghost {
    border-color: color-mix(in oklab, var(--paper) 18%, var(--line));
  }
  section.md\:pt-16 > div.mt-8 {
    display: grid;
    grid-template-columns: 1fr;
  }
  section.md\:pt-16 .btn-primary,
  section.md\:pt-16 .btn-ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
