/* ============================================================
   Fonts — self-hosted
   ============================================================ */
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --shell:        #F4ECD9;
  --albumen:      #FBF7EC;
  --paper:        #FFFCF4;
  --yolk:         #F4B43A;
  --yolk-deep:    #C8821A;
  --yolk-soft:    #FAD98A;
  --coop:         #17120D;
  --coop-soft:    #3A2F25;
  --sand:         #8B7B68;
  --hay:          #C9B898;
  --clay:         #C04A2A;
  --moss:         #5C6B3A;

  --line:         rgba(23,18,13,0.10);
  --line-soft:    rgba(23,18,13,0.06);
  --line-strong:  rgba(23,18,13,0.18);

  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-sans:    "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ============================================================
   Reset + base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--shell);
  color: var(--coop);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
::selection { background: var(--yolk); color: var(--coop); }

/* ============================================================
   Accessibility
   ============================================================ */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Page layout — full viewport, no scroll on desktop
   ============================================================ */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 56px;
}

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 24px 0;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--coop);
}
.wordmark-mark { flex-shrink: 0; }
.wordmark-text {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-style: normal;
}
.wordmark-num {
  font-feature-settings: "ss01";
}
.wordmark-text em {
  font-style: italic;
}

.status-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sand);
}

/* ============================================================
   Main — two-column on desktop
   ============================================================ */
.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 64px 0 48px 0;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 7vw, 88px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0 0 24px 0;
  color: var(--coop);
}
.hero em {
  font-style: italic;
}

.sub {
  font-size: 17px;
  line-height: 1.45;
  color: var(--coop-soft);
  max-width: 38ch;
  margin: 0 0 32px 0;
  text-wrap: pretty;
}
.sub-year {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--coop);
}

/* ============================================================
   Form
   ============================================================ */
.form { margin: 0; }

.form-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 5px 5px 20px;
  max-width: 380px;
  transition: border-color 150ms;
}
.form-pill:focus-within {
  border-color: var(--coop);
  outline: 2px solid var(--yolk-soft);
  outline-offset: 2px;
}

.form-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--coop);
  outline: none;
  min-width: 0;
  padding: 0;
}
.form-input::placeholder {
  color: var(--sand);
  font-style: italic;
}

.form-submit {
  flex-shrink: 0;
  background: var(--yolk);
  color: var(--coop);
  border: none;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}
.form-submit:hover { background: var(--yolk-deep); color: var(--paper); }
.form-submit:focus-visible {
  outline: 2px solid var(--yolk-soft);
  outline-offset: 2px;
}
.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--sand);
  margin: 10px 0 0 0;
}

.form-error {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clay);
  margin: 8px 0 0 0;
  letter-spacing: 0.02em;
}

/* ============================================================
   Thank-you state
   ============================================================ */
.thankyou {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}
.thankyou[hidden] { display: none; }

.thankyou-line {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--coop);
  margin: 0;
}
.thankyou-line em { font-style: italic; }

/* ============================================================
   Egg grid
   ============================================================ */
.grid-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.egg-grid {
  display: grid;
  grid-template-columns: repeat(10, 16px);
  gap: 7px;
}

/* Each egg is an inline SVG injected by JS */
.egg-grid svg {
  display: block;
}

/* Breathing animation — JS toggles this class on individual eggs */
@media (prefers-reduced-motion: no-preference) {
  .egg-breathing {
    animation: egg-fill-fade 3s ease-in-out forwards;
  }
  @keyframes egg-fill-fade {
    0%   { opacity: 1; }
    15%  { opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    95%  { opacity: 0; }
    100% { opacity: 1; }
  }
}

.grid-legend {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--sand);
  margin: 0;
  text-transform: lowercase;
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 28px 0;
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.footer-email {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--sand);
  text-decoration: none;
  text-transform: lowercase;
}
.footer-email:hover { text-decoration: underline; }
.footer-email:focus-visible {
  outline: 2px solid var(--yolk-soft);
  outline-offset: 2px;
  border-radius: 2px;
}

.footer-mark {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--sand);
  text-transform: lowercase;
}

/* ============================================================
   Mobile — single column
   ============================================================ */
@media (max-width: 768px) {
  .page { padding: 0 24px; }

  .topbar { padding: 20px 0 18px 0; }
  .status-pill { display: none; }

  .main {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 40px 0 32px 0;
  }

  .hero { font-size: clamp(48px, 14vw, 72px); margin-bottom: 20px; }
  .sub { font-size: 16px; max-width: 100%; }

  .form-pill { max-width: 100%; }
  .form-input { font-size: 16px; } /* prevents iOS zoom */

  .grid-col { order: -1; }
  .egg-grid {
    grid-template-columns: repeat(10, 14px);
    gap: 5px;
  }
}

@media (max-width: 400px) {
  .page { padding: 0 16px; }
  .egg-grid {
    grid-template-columns: repeat(10, 12px);
    gap: 4px;
  }
}
