/* Opening-soon page (index.php). Same kasavu palette as styles.css, kept separate so it stays light. */
:root {
  --ivory: #f6f0e1;
  --paper: #fffcf4;
  --ink: #1b2620;
  --muted: #56605a;
  --green: #1f4a3a;
  --green-deep: #123128;
  --gold: #c39a3c;
  --gold-ink: #80601d;
  --line-strong: rgba(27, 38, 32, 0.2);
  --radius: 6px;
  --zari:
    linear-gradient(var(--gold) 0 0) 0 0 / 100% 3px no-repeat,
    linear-gradient(var(--gold) 0 0) 0 6px / 100% 1px no-repeat;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.65;
}
a { color: inherit; }

/* Full-height page framed by the kasavu border top and bottom. */
.soon {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 64px 16px 32px;
  text-align: center;
  background:
    var(--zari),
    radial-gradient(ellipse at 50% 30%, var(--paper), transparent 70%);
  position: relative;
}
.soon::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  background: var(--zari);
  transform: scaleY(-1);
}
.soon-inner { width: min(640px, 100%); }

.brand { display: block; width: clamp(120px, 30vw, 170px); height: auto; margin: 0 auto 2.25rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold-ink);
  margin-bottom: 0.75rem;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.05;
  font-size: clamp(3rem, 11vw, 6rem);
  letter-spacing: -0.01em;
  color: var(--green-deep);
}
h1 em { font-style: italic; font-weight: 500; color: var(--gold-ink); }
.lead {
  margin: 1.25rem auto 0;
  max-width: 34rem;
  font-size: 1.1rem;
  color: var(--muted);
  text-wrap: balance;
}

/* Countdown: four tiles under the lead, each framed by a thin zari line. */
.countdown { margin-top: 2.25rem; }
.countdown-date { font-size: 0.95rem; color: var(--muted); }
.countdown-date :is(time, strong) { color: var(--green-deep); font-weight: 400; }
.countdown-units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 26rem;
  margin: 1rem auto 0;
}
.countdown-units[hidden] { display: none; }
.countdown-units div {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.75rem 0.25rem 0.6rem;
}
.countdown-units span {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 600;
  line-height: 1;
  color: var(--green-deep);
  font-variant-numeric: lining-nums tabular-nums;
}
.countdown-units small {
  display: block;
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.62rem;
  color: var(--gold-ink);
}

.soon-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 2.25rem; }
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  background: var(--green);
  color: var(--paper);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-decoration: none;
  border: 1px solid var(--green);
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--green-deep); }
.btn-outline { background: transparent; color: var(--green-deep); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--paper); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.soon-contact { list-style: none; margin-top: 2.5rem; display: grid; gap: 0.4rem; font-size: 0.95rem; color: var(--muted); }
.soon-contact li { text-wrap: balance; }
.soon-contact strong {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.7rem;
  color: var(--gold-ink);
  margin-right: 0.6rem;
}
.soon-contact a { color: var(--green); text-underline-offset: 3px; }

.soon-foot { margin-top: 3rem; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 480px) {
  .soon-actions .btn { width: 100%; }
}

[hidden] { display: none !important; }

/* "We're open" view rises in as the doors part. */
.soon-open > * { animation: soon-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.soon-open > :nth-child(2) { animation-delay: 0.45s; }
.soon-open > :nth-child(3) { animation-delay: 1.1s; }
.soon-open > :nth-child(4) { animation-delay: 1.25s; }
.soon-open > :first-child { animation-delay: 0.3s; }
@keyframes soon-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* Boutique doors: two backwater-green leaves with a kasavu border on the meeting edge,
   hinged at the sides. Shut by default; .is-open swings them out (timings mirrored in soon.js). */
.doors {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  perspective: 1800px;
  cursor: pointer;
}
.door {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(255, 252, 244, 0.025) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, var(--green), var(--green-deep));
  transition: transform 1.3s cubic-bezier(0.65, 0, 0.25, 1), opacity 1.3s ease;
  backface-visibility: hidden;
}
/* Raised panel outline inside each leaf. */
.door::before {
  content: "";
  position: absolute;
  inset: clamp(18px, 5vw, 48px);
  border: 1px solid rgba(195, 154, 60, 0.45);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 6px rgba(18, 49, 40, 0.35), inset 0 0 0 7px rgba(195, 154, 60, 0.2);
}
/* Gold handle near the meeting edge. */
.door::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: clamp(56px, 12vh, 96px);
  translate: 0 -50%;
  border-radius: 3px;
  background: linear-gradient(var(--gold), var(--gold-ink));
}
.door-left {
  transform-origin: left center;
  border-right: 3px solid var(--gold);
  box-shadow: inset -7px 0 0 -6px var(--gold);
}
.door-left::after { right: calc(clamp(110px, 24vw, 150px) / 2 + 28px); }
.door-right {
  transform-origin: right center;
  border-left: 3px solid var(--gold);
  box-shadow: inset 7px 0 0 -6px var(--gold);
}
.door-right::after { left: calc(clamp(110px, 24vw, 150px) / 2 + 28px); }

.doors.is-open .door { opacity: 0; transition-duration: 1.6s; }
.doors.is-open .door-left { transform: rotateY(-100deg); }
.doors.is-open .door-right { transform: rotateY(100deg); }

/* Gold seal across the seam: settles on once the doors are shut, lifts off as they open. */
.doors-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: clamp(110px, 24vw, 150px); /* door handles sit just past this, see .door-left::after */
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  gap: 0.2rem;
  text-align: center;
  background: radial-gradient(circle at 35% 30%, #e2c06a, var(--gold) 55%, var(--gold-ink));
  color: var(--green-deep);
  box-shadow: 0 0 0 4px rgba(18, 49, 40, 0.5), 0 0 0 5px var(--gold), 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: opacity 0.5s ease 0.9s, scale 0.5s ease 0.9s;
}
.doors-seal img { width: 52%; height: auto; margin-inline: auto; }
.doors-seal small {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.62rem;
  font-weight: 500;
}
.doors.is-open .doors-seal { opacity: 0; scale: 1.25; transition-delay: 0s; transition-duration: 0.4s; }

/* Motion: starlight behind the page (js/site/stars.js), the page rising in on load,
   a slow glow on the logo and a sheen running along the zari borders. */
.sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.soon > :not(.sky) { position: relative; z-index: 1; }

.brand { animation: soon-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both, brand-glow 7s ease-in-out 1.2s infinite; }
.soon-closed > * { animation: soon-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.soon-closed > :nth-child(1) { animation-delay: 0.3s; }
.soon-closed > :nth-child(2) { animation-delay: 0.42s; }
/* The rest waits for the heading to finish writing (js/site/soon.js splits it into letters). */
.soon-closed > :nth-child(3) { animation-delay: 1.35s; }
.soon-closed > :nth-child(4) { animation-delay: 1.5s; }
.soon-closed > :nth-child(n + 5) { animation-delay: 1.62s; }
.soon-contact, .soon-foot { animation: soon-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 1.75s both; }

/* Heading writes itself in: letter by letter, each sharpening from a blur with a brief gold glint. */
.soon h1.writes { animation: none; }
.writes .ch { animation: ch-write 0.7s cubic-bezier(0.3, 0.6, 0.2, 1) calc(0.45s + var(--i) * 70ms) both; }
.soon-open h1.writes .ch { animation-delay: calc(0.4s + var(--i) * 70ms); }
@keyframes ch-write {
  0% { opacity: 0; filter: blur(6px); text-shadow: none; }
  45% { opacity: 1; filter: blur(0); text-shadow: 0 0 18px rgba(195, 154, 60, 0.75); }
  100% { opacity: 1; filter: none; text-shadow: none; }
}
@keyframes brand-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(195, 154, 60, 0)); }
  50% { filter: drop-shadow(0 0 14px rgba(195, 154, 60, 0.38)); }
}

/* A pale gold sheen that travels along the top and bottom zari, masked to their threads. */
.soon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 44%, rgba(255, 246, 214, 0.95) 50%, transparent 56%) 100% 0 / 300% 100% no-repeat;
  -webkit-mask:
    linear-gradient(#000 0 0) 0 0 / 100% 3px no-repeat,
    linear-gradient(#000 0 0) 0 6px / 100% 1px no-repeat,
    linear-gradient(#000 0 0) 0 100% / 100% 3px no-repeat,
    linear-gradient(#000 0 0) 0 calc(100% - 6px) / 100% 1px no-repeat;
  mask:
    linear-gradient(#000 0 0) 0 0 / 100% 3px no-repeat,
    linear-gradient(#000 0 0) 0 6px / 100% 1px no-repeat,
    linear-gradient(#000 0 0) 0 100% / 100% 3px no-repeat,
    linear-gradient(#000 0 0) 0 calc(100% - 6px) / 100% 1px no-repeat;
  animation: zari-sheen 8s ease-in-out 1.5s infinite;
}
@keyframes zari-sheen {
  0% { background-position: 100% 0; }
  40%, 100% { background-position: 0% 0; }
}

/* While the welcome doors are shut, the page waits: its entrance plays as they part. */
.doors-intro .soon :is(.brand, .soon-closed > *, .soon-open > *, .soon-contact, .soon-foot, .ch),
.doors-intro .soon::before { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .soon-open > *, .soon-closed > *, .writes .ch, .brand, .soon-contact, .soon-foot, .soon::before { animation: none; }
}
