/* Coral Springs countdown. Layout: white shore over an orange sea, split by a slow wave. Two colours and one ink. */
@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url("assets/fonts/BarlowCondensed-800i.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/Barlow-600.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/Barlow-700.woff2") format("woff2");
}

:root {
  --orange: #ec5800;       /* white on this reads at large sizes */
  --orange-deep: #c94a00;  /* white on this reads at any size */
  --orange-text: #b23c00;  /* this on white reads at any size */
  --ink: #1f1a16;
  --white: #fff;
  --display: "Barlow Condensed", "Arial Narrow", Impact, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side: max(20px, 6vw, env(safe-area-inset-left, 0px));
  --side-right: max(20px, 6vw, env(safe-area-inset-right, 0px));
  --digit: clamp(88px, min(17vw, 30vh), 420px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--orange-deep); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--ink);
  font-family: var(--body);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
p, h1 { margin: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* The shore: name and headline on white. It overlaps the sea slightly, so rounding on scaled screens can't leave a hairline between them */
.shore {
  position: relative;
  z-index: 1;
  margin-bottom: -2px;
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vh, 30px);
  padding: clamp(20px, 4.5vh, 44px) var(--side-right) clamp(12px, 2.4vh, 26px) var(--side);
  padding-top: max(clamp(20px, 4.5vh, 44px), env(safe-area-inset-top, 0px));
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(24px, 1.9vw, 36px);
  letter-spacing: 0.02em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--orange);
}
.brand img { width: 1.8em; height: auto; flex: none; }
h1 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(44px, min(9vw, 11.5vh), 170px);
  line-height: 0.98;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--ink);
}

/* The sea: the countdown on orange */
.sea {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  overflow: hidden;
  background: var(--orange);
  color: var(--white);
}
/* Starts above the clip edge, so the layer's own top edge never shows as a hairline.
   The tide settles once on load and then stays still, so nothing moves for longer than five seconds. */
.wave {
  position: absolute;
  top: -6px;
  left: 0;
  width: 200%;
  height: clamp(26px, 5vh, 54px);
  fill: var(--white);
  animation: settle 4.8s cubic-bezier(0.16, 0.7, 0.3, 1) both;
}
@keyframes settle {
  from { transform: translateX(-25%); }
  to { transform: translateX(0); }
}
.faint {
  position: absolute;
  right: -6%;
  bottom: -24%;
  width: min(58%, 1100px);
  height: auto;
  opacity: 0.12;           /* the most it can be while white text on top still reads */
  pointer-events: none;
}
.inner {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(14px, 2.8vh, 28px);
  padding: clamp(40px, 7.5vh, 76px) var(--side-right) clamp(20px, 3.6vh, 40px) var(--side);
}

.countdown {
  display: flex;
  gap: clamp(12px, 3vw, 60px);
}
/* Holds its space until the script has the real numbers, so nobody sees a flash of zeros */
.countdown:not(.ready) { visibility: hidden; }
@media (scripting: none) {
  .countdown:not(.ready) { display: none; }
}
.unit {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}
.num {
  display: flex;
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: var(--digit);
  line-height: 0.92;
}
/* Each digit sits in its own fixed cell, so the numbers never jitter as they change */
.num i {
  display: block;
  width: 0.5em;
  font-style: italic;
  text-align: center;
}
.label {
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.open-word {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(96px, min(20vw, 38vh), 480px);
  line-height: 0.9;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 34px;
  border-radius: 8px;
  background: var(--white);
  color: var(--orange-text);
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgb(120 40 0 / 28%); }
.button:active { transform: translateY(0); box-shadow: none; }
.button:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.button.ghost { background: var(--orange-deep); color: var(--white); box-shadow: inset 0 0 0 2px var(--white); }
.button.ghost:hover { background: var(--orange-text); box-shadow: inset 0 0 0 2px var(--white); }
.when {
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.25;
}
.when time { font-style: normal; }

.foot {
  background: var(--orange-deep);
  color: var(--white);
  padding: 10px var(--side-right) max(10px, env(safe-area-inset-bottom, 0px)) var(--side);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.35;
}

/* Phones and narrow windows: two rows of big numbers */
@media (max-width: 700px) and (min-height: 481px), (max-width: 519px) {
  :root { --digit: clamp(84px, min(32vw, 15.5vh), 190px); }
  h1 { font-size: clamp(34px, 11.8vw, 92px); }
  .countdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .wave { width: 400%; }
  .faint { width: 112%; right: -24%; bottom: -6%; }
  .actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .open-word { font-size: clamp(96px, 38vw, 240px); }
}

/* Phones held sideways: the headline takes one line, so the button stays on the first screen */
@media (max-height: 480px) and (min-width: 520px) {
  h1 { font-size: clamp(30px, 5.6vw, 60px); }
  h1 br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wave { animation: none; }
  .button { transition: none; }
}
