:root {
  --bg-0: #07060a;
  --bg-1: #0d0b08;
  --bg-2: #14110c;
  --line: rgba(184, 149, 74, 0.18);
  --line-strong: rgba(184, 149, 74, 0.4);
  --gold-1: #c9a461;
  --gold-2: #b8954a;
  --gold-3: #8a6d3a;
  --gold-4: #5c4824;
  --parchment: #e8dcc4;
  --parchment-dim: #b8ad95;
  --muted: #6b6354;
  --error: #c97064;
  --success: #9bb88a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg-1);
  color: var(--parchment);
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Atmosphere layers */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 50% 35%, rgba(184,149,74,0.085) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(92,72,36,0.12) 0%, transparent 65%),
    var(--bg-1);
}

.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grainShift 8s steps(8) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 100% 70% at 50% 50%, transparent 50%, rgba(0,0,0,0.7) 100%);
}

/* Frame */
.frame {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 4vw, 56px);
}

/* Corner ornaments */
.corner {
  position: fixed; width: 32px; height: 32px; z-index: 12; pointer-events: none;
  border-color: var(--gold-3);
  border-style: solid; border-width: 0;
}
.corner.tl { top: 22px; left: 22px;    border-top-width: 1px;    border-left-width: 1px; }
.corner.tr { top: 22px; right: 22px;   border-top-width: 1px;    border-right-width: 1px; }
.corner.bl { bottom: 22px; left: 22px; border-bottom-width: 1px; border-left-width: 1px; }
.corner.br { bottom: 22px; right: 22px; border-bottom-width: 1px; border-right-width: 1px; }

/* Top nav */
header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

.wordmark {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.45em;
  color: var(--gold-2);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 14px;
}
.wordmark::before {
  content: ""; width: 32px; height: 1px; background: var(--gold-3);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--parchment-dim);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(20, 17, 12, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold-2);
  box-shadow: 0 0 0 0 rgba(201,164,97,0.6);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,164,97,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(201,164,97,0); }
}

/* Hero */
main.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 0 24px;
  gap: 28px;
}

.logo-wrap {
  position: relative;
  width: clamp(200px, 24vw, 290px);
  aspect-ratio: 1;
  opacity: 0;
  animation: rise 1.4s 0.25s ease-out forwards;
  will-change: transform;
}
.logo-wrap img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 10px 40px rgba(184,149,74,0.18));
}

.headline {
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(36px, 5.8vw, 72px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--parchment);
  max-width: none;
  white-space: nowrap;
  opacity: 0;
  animation: rise 1.4s 0.45s ease-out forwards;
}

@media (max-width: 720px) {
  .headline {
    white-space: normal;
    font-size: clamp(32px, 9vw, 50px);
    max-width: 22ch;
  }
}
.headline em {
  font-style: italic;
  color: var(--gold-1);
  font-weight: 400;
}

.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  width: min(440px, 80vw);
  color: var(--gold-3);
  opacity: 0;
  animation: rise 1.4s 0.55s ease-out forwards;
}
.divider .line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-4), transparent); }
.divider .glyph {
  width: 10px; height: 10px;
  transform: rotate(45deg);
  border: 1px solid var(--gold-2);
  background: var(--bg-1);
}

.sub {
  max-width: 60ch;
  font-size: 17px;
  color: var(--parchment-dim);
  line-height: 1.7;
  letter-spacing: 0.015em;
  opacity: 0;
  animation: rise 1.4s 0.65s ease-out forwards;
}

.tagline {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 25px);
  letter-spacing: 0.02em;
  color: var(--gold-1);
  margin-top: -8px;
  opacity: 0;
  animation: rise 1.4s 0.72s ease-out forwards;
}

/* Countdown */
.countdown {
  display: flex;
  align-items: stretch;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  animation: rise 1.4s 0.80s ease-out forwards;
}
.cd-cell {
  padding: 20px 32px;
  min-width: 124px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-right: 1px solid var(--line);
}
.cd-cell:last-child { border-right: none; }

.cd-num {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: 50px;
  line-height: 1;
  color: var(--gold-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.cd-num .flip {
  display: inline-block;
  animation: flip 0.5s ease-out;
}
@keyframes flip {
  0%   { transform: translateY(-6px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
.cd-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Signup */
.signup-wrap {
  width: min(520px, 92vw);
  margin-top: 12px;
  opacity: 0;
  animation: rise 1.4s 0.95s ease-out forwards;
}
.signup-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.signup {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(20, 17, 12, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.signup:focus-within {
  border-color: var(--gold-3);
  box-shadow: 0 0 0 1px var(--gold-4), 0 8px 30px rgba(184,149,74,0.08);
}
.signup input {
  flex: 1;
  background: transparent;
  border: none; outline: none;
  color: var(--parchment);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.02em;
  padding: 18px 22px;
  min-width: 0;
}
.signup input::placeholder { color: var(--muted); font-style: italic; }
.signup button {
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  color: var(--gold-1);
  font-family: "JetBrains Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0 32px;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex; align-items: center; gap: 10px;
  min-width: 168px; justify-content: center;
}
.signup button:hover:not(:disabled) {
  background: rgba(184,149,74,0.08);
  color: var(--parchment);
}
.signup button:disabled { cursor: not-allowed; opacity: 0.7; }
.signup button .arrow { transition: transform 0.3s ease; }
.signup button:hover:not(:disabled) .arrow { transform: translateX(4px); }

.form-msg {
  margin-top: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  min-height: 14px;
  text-align: left;
  color: var(--muted);
  transition: color 0.3s ease;
}
.form-msg.error   { color: var(--error); }
.form-msg.success { color: var(--success); }

/* Spinner */
.spin {
  width: 12px; height: 12px;
  border: 1.5px solid var(--gold-4);
  border-top-color: var(--gold-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Check */
.check {
  width: 14px; height: 14px;
  stroke: var(--success); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  animation: draw 0.5s 0.05s ease-out forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Footer */
footer.bottom {
  margin-top: auto;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
footer .meta { display: flex; gap: 28px; flex-wrap: wrap; }
footer .meta span { display: inline-flex; align-items: center; gap: 8px; }
footer .meta span::before {
  content: ""; width: 4px; height: 4px; background: var(--gold-4); border-radius: 50%;
}
footer .meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color 0.3s ease, border-color 0.3s ease;
}
footer .meta a:hover {
  color: var(--gold-1);
  border-bottom-color: var(--line-strong);
}

.footer-tagline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-3);
}
.footer-tagline .rule {
  width: 28px;
  height: 1px;
  background: var(--gold-4);
}

@media (max-width: 720px) {
  .footer-tagline .rule { width: 18px; }
}

.socials { display: flex; align-items: center; gap: 4px; }
.socials a {
  color: var(--parchment-dim);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}
.socials a:hover {
  border-color: var(--line-strong);
  color: var(--gold-1);
  background: rgba(184,149,74,0.05);
}
.socials a svg { width: 14px; height: 14px; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile */
@media (max-width: 720px) {
  .corner { width: 22px; height: 22px; }
  .cd-cell { min-width: 78px; padding: 16px 12px; }
  .cd-num { font-size: 34px; }
  .signup { flex-direction: column; }
  .signup button {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 14px 20px;
  }
  footer.bottom { justify-content: center; text-align: center; }
  .wordmark::before { width: 16px; }
}

/* Focus */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 1px solid var(--gold-1);
  outline-offset: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .grain,
  .status-pill .dot {
    animation: none;
  }
  .eyebrow,
  .logo-wrap,
  .headline,
  .divider,
  .sub,
  .countdown,
  .signup-wrap {
    animation-duration: 0.01ms;
    animation-delay: 0ms;
    transform: none;
    opacity: 1;
  }
  .cd-num .flip { animation: none; }
}
