/*
 * Countdown page for jayasri.org until 1 January 2027.
 * Tokens and fonts are copied from the Jayaśrī design system (src/styles/ds/tokens);
 * this page stands alone so it can be deployed as its own small Cloudflare Pages project.
 */

/* ---------- Fonts (design system files, latin + latin-ext for diacritics) ---------- */
@font-face{font-family:'DM Serif Display';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/DMSerifDisplay-normal-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'DM Serif Display';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/DMSerifDisplay-normal-400-latin.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:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('/fonts/CormorantGaramond-italic-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Cormorant Garamond';font-style:italic;font-weight:400;font-display:swap;src:url('/fonts/CormorantGaramond-italic-400-latin.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:'Raleway';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/Raleway-normal-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Raleway';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/Raleway-normal-400-latin.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:'Raleway';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/Raleway-normal-500-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Raleway';font-style:normal;font-weight:500;font-display:swap;src:url('/fonts/Raleway-normal-500-latin.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:'Raleway';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/Raleway-normal-600-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Raleway';font-style:normal;font-weight:600;font-display:swap;src:url('/fonts/Raleway-normal-600-latin.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:'Gentium Book Plus';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/GentiumBookPlus-normal-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Gentium Book Plus';font-style:normal;font-weight:400;font-display:swap;src:url('/fonts/GentiumBookPlus-normal-400-latin.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:'Gentium Book Plus';font-style:italic;font-weight:400;font-display:swap;src:url('/fonts/GentiumBookPlus-italic-400-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Gentium Book Plus';font-style:italic;font-weight:400;font-display:swap;src:url('/fonts/GentiumBookPlus-italic-400-latin.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}

/* ---------- Tokens (from the design system) ---------- */
:root {
  --cream-50: #F9F3E6;
  --surface-card: #FCF7EC;
  --espresso-800: #2B211A;
  --sepia-600: #4A3A2D;
  --sepia-500: #62503F;
  --sepia-350: #968470;
  --saffron-800: #6F4E12;
  --saffron-700: #8A6118;
  --saffron-600: #A5751F;
  --saffron-300: #DFC98F;
  --saffron-200: #EBD9AE;
  --logo-brand: #FAB20F;
  --border-hairline: #E2D8C6;

  --font-display: 'DM Serif Display', 'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  --font-heading: 'Cormorant Garamond', 'Gentium Book Plus', Georgia, 'Times New Roman', serif;
  --font-body: 'Raleway', 'Gentium Book Plus', 'Helvetica Neue', Arial, sans-serif;

  --ease-quiet: cubic-bezier(.2, .6, .2, 1);
  --dur-base: 200ms;
  --dur-slow: 400ms;
  --dur-veil: 700ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--cream-50) url('/paper.jpg') repeat;
  background-size: 512px;
  color: var(--espresso-800);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--saffron-200); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  min-height: 100svh;
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 20px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.when-waiting, .when-open { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* ---------- The mark: logo with a slowly breathing marigold glow ---------- */
.mark {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 32px;
}
.logo {
  position: relative;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: veil 1400ms var(--ease-quiet) forwards;
}
.halo {
  position: absolute;
  inset: -70%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250, 178, 15, .30), rgba(250, 178, 15, .12) 45%, rgba(250, 178, 15, 0) 100%);
  opacity: 0;
  animation: veil 2200ms var(--ease-quiet) 300ms forwards, breathe 7s ease-in-out 2500ms infinite;
}

/* ---------- Type ---------- */
.eyebrow {
  margin: 0 0 20px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--saffron-700);
  font-variant-numeric: lining-nums tabular-nums;
}
.title {
  margin: 0;
  max-width: 13em;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 9vw, 72px);
  line-height: 1.07;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.offering {
  margin: 16px 0 0;
  max-width: 24em;
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(23px, 4.6vw, 30px);
  line-height: 1.3;
  color: var(--sepia-600);
  text-wrap: balance;
}

/* ---------- Countdown ---------- */
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: 680px;
  margin: 48px 0 0;
  border-top: 2px solid var(--espresso-800);
  border-bottom: 1px solid var(--border-hairline);
}
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 4px 16px;
}
.unit + .unit { border-left: 1px solid var(--border-hairline); }
.num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(40px, 12vw, 104px);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--espresso-800);
}
.num.tick { animation: settle var(--dur-slow) var(--ease-quiet); }
.label {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sepia-500);
}

/* A saffron hairline that fills as the day approaches. */
.progress {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 2px;
  margin-top: 0;
  background: transparent;
  overflow: hidden;
}
.progress .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--saffron-600);
  transition: width 1s linear;
}
.when {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--sepia-500);
  font-variant-numeric: lining-nums tabular-nums;
}

/* On phones the visitor's own time takes a line of its own. */
@media (max-width: 719px) {
  .when .sep { display: none; }
  .when .here { display: block; }
}

/* The opening heading is focused for screen readers; it is not a control, so no ring. */
#open-title:focus { outline: none; }

/* ---------- Email ---------- */
.notify {
  width: 100%;
  max-width: 520px;
  margin-top: 56px;
  text-align: left;
}
.notify-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sepia-600);
}
.notify-row { display: flex; gap: 12px; align-items: stretch; }
.notify input[type=email] {
  flex: 1;
  min-width: 0;
  padding: 12px 2px;
  font: inherit;
  font-size: 16px; /* 16px stops phones from zooming in on focus */
  color: var(--espresso-800);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--sepia-350);
  border-radius: 0;
  transition: border-color var(--dur-base) var(--ease-quiet);
}
.notify input[type=email]::placeholder { color: var(--sepia-500); opacity: 1; }
.notify input[type=email]:focus { outline: none; border-bottom: 2px solid var(--saffron-700); padding-bottom: 11px; }
.notify input[aria-invalid=true] { border-bottom-color: var(--saffron-800); }
.notify-help { margin: 10px 0 0; font-size: 14px; color: var(--sepia-500); }
.notify-status { margin: 6px 0 0; min-height: 1.6em; font-size: 14px; color: var(--sepia-600); }
.notify-status.is-done { color: var(--saffron-800); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: #FCF7EC;
  background: var(--saffron-700);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-quiet);
}
.button:hover { background: var(--saffron-800); }
.button:active { transform: translateY(1px); }
.button:focus-visible, a:focus-visible { outline: 2px solid var(--saffron-700); outline-offset: 3px; }
.button[disabled] { cursor: progress; }
.button-large { margin-top: 40px; padding: 16px 32px; font-size: 13px; }

/* ---------- The opening ---------- */
.page[data-state=open] .halo { animation: veil 1600ms var(--ease-quiet) forwards, breathe 5s ease-in-out 1600ms infinite; inset: -110%; }
.page[data-state=open] .when-open > * { opacity: 0; animation: rise var(--dur-veil) var(--ease-quiet) forwards; }
.page[data-state=open] .when-open > :nth-child(2) { animation-delay: 250ms; }
.page[data-state=open] .when-open > :nth-child(3) { animation-delay: 600ms; }

/* ---------- First paint: each line fades and settles in turn ---------- */
.reveal { opacity: 0; animation: rise var(--dur-veil) var(--ease-quiet) forwards; animation-delay: calc(400ms + var(--i, 0) * 160ms); }

@keyframes veil { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: .15; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .85; } 50% { transform: scale(1.06); opacity: 1; } }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  .page { padding-top: 64px; padding-bottom: 64px; }
  .mark { width: 132px; height: 132px; margin-bottom: 40px; }
  .eyebrow { margin-bottom: 24px; }
  .offering { margin-top: 20px; }
  .countdown { margin-top: 64px; }
  .unit { padding: 28px 8px 22px; }
  .label { font-size: 11.5px; margin-top: 14px; }
  .notify { margin-top: 64px; }
}

/* ---------- Small phones ---------- */
@media (max-width: 380px) {
  .notify-row { flex-direction: column; }
  .button { width: 100%; }
  .label { letter-spacing: .1em; font-size: 10.5px; }
}

/* ---------- Visitors who turn motion off: everything simply appears ---------- */
@media (prefers-reduced-motion: reduce) {
  .logo, .halo, .reveal, .num.tick,
  .page[data-state=open] .halo,
  .page[data-state=open] .when-open > * { animation: none; opacity: 1; transform: none; }
  .progress .fill { transition: none; }
}
