/* ============================================================
   chichinwanoku.com — coming soon
   Palette and type follow the Kwenu asset handoff.
   ============================================================ */

:root{
  --cream:      #F7EFE1;
  --ink:        #102A22;
  --terracotta: #D45A36;
  --teal:       #0B5C5D;
  --mustard:    #E7A23B;
  --blush:      #EFC9C0;

  /* The supplied artwork sits on a warmer cream (#EADBC2) than palette.json
     declares (#F7EFE1). Anywhere a flat fill meets the artwork it has to use
     the artwork's tone, or the join shows as a band. */
  --cream-art:  #EADBC2;

  --ink-soft: color-mix(in srgb, var(--ink) 66%, var(--cream));
  --rule:     color-mix(in srgb, var(--ink) 26%, transparent);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --gutter: clamp(1.5rem, 5vw, 5rem);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ -webkit-text-size-adjust: 100%; height: 100%; }

body{
  margin: 0;
  height: 100%;
  /* one screen, no scroll; overscroll-behavior kills the iOS rubber-band */
  overflow: hidden;
  overscroll-behavior: none;
  background-color: var(--cream-art);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;
}

/* ---------- stage ----------
   Desktop: the supplied artwork already contains its own cream field, so it
   is the full-bleed background and the copy sits in the cream half of it.
--------------------------------- */
.stage{
  position: relative;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 52%) minmax(0, 1fr);
  align-items: center;

  background-color: var(--cream-art);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: cover;
  background-image: url("assets/artwork-landscape-v2.png");
  background-image: image-set(
    url("assets/artwork-landscape-v2.webp") type("image/webp"),
    url("assets/artwork-landscape-v2.png")  type("image/png")
  );
}

.panel{
  grid-column: 2;
  position: relative;
  z-index: 2;
  padding-block: clamp(2.5rem, 6vw, 5rem);
  padding-left: clamp(1rem, 2.5vw, 2rem);
  padding-right: var(--gutter);
  max-width: 46rem;
}

/* ---------- type ---------- */
.headline{
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 6.4vw, 5.6rem);
  line-height: 0.92;          /* per the handoff: 0.88–0.94 */
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.sub{
  margin: clamp(1rem, 2vw, 1.6rem) 0 0;
  font-size: clamp(.95rem, 1.15vw, 1.05rem);
  color: var(--ink-soft);
}

/* ---------- countdown ---------- */
.countdown{ margin-top: clamp(2rem, 4.5vw, 3.25rem); }

.clock{
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.6vw, 2.25rem);
  margin: 0; padding: 0; list-style: none;
}

.unit{
  position: relative;
  padding-right: clamp(1rem, 2.6vw, 2.25rem);
  min-width: 3.4ch;            /* stops the layout jittering as digits change */
}
.unit:not(:last-child)::after{
  content: "";
  position: absolute;
  right: 0; top: .1em; bottom: .8em;
  border-right: 1px solid var(--rule);
}

.unit__num{
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.6vw, 3.8rem);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1;
}

.unit__label{
  display: block;
  margin-top: .55em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .18em;       /* per the handoff */
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- sign-up ---------- */
.signup{ margin-top: clamp(1.75rem, 3.5vw, 2.5rem); }

.signup__row{ display: flex; gap: .5rem; max-width: 31rem; flex-wrap: wrap; }

.signup__input{
  flex: 1 1 14rem;
  min-width: 0;
  padding: .9rem 1rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--cream) 45%, #fff);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color .18s ease, background .18s ease;
}
.signup__input::placeholder{ color: color-mix(in srgb, var(--ink-soft) 72%, transparent); }
.signup__input:focus-visible{ outline: none; border-color: var(--ink); background: #fff; }
.signup__input[aria-invalid="true"]{ border-color: var(--terracotta); }

.signup__btn{
  flex: 0 0 auto;
  padding: .9rem 1.6rem;
  font: inherit;
  font-size: .9rem;
  color: var(--cream);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.signup__btn:hover{ background: color-mix(in srgb, var(--ink) 82%, var(--teal)); }
.signup__btn:active{ transform: translateY(1px); }
.signup__btn[disabled]{ opacity: .55; cursor: default; transform: none; }

.signup__msg{
  margin: .8rem 0 0;
  min-height: 1.25em;
  font-size: .82rem;
  color: var(--ink-soft);
}
.signup__msg[data-state="error"]{ color: var(--terracotta); }
.signup__msg[data-state="ok"]{ color: var(--teal); }

.hp{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

.social{
  display: flex; gap: 1.25rem; list-style: none;
  margin: clamp(1.5rem, 2.8vw, 2.25rem) 0 0; padding: 0; font-size: .74rem;
}
.social a{ color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule); }
.social a:hover{ color: var(--ink); border-color: var(--ink); }

/* ---------- phones ----------
   The landscape artwork can't crop down to portrait, so the stage drops its
   background and shows the purpose-composed 4:5 file over the paper texture.
--------------------------------- */
@media (max-width: 860px){
  .stage{
    grid-template-columns: 1fr;
    /* Artwork takes whatever height is left once the copy has claimed what
       it needs; the copy is never squeezed and never covered. */
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    background-color: var(--cream-art);
    /* The artwork IS the background here — it was composed as a full screen,
       paint across the top with the lower half left clear for the copy, so
       there is no seam between "artwork" and "page". */
    background-image: url("assets/artwork-mobile-v3.png");
    background-image: image-set(
      url("assets/artwork-mobile-v3.webp") type("image/webp"),
      url("assets/artwork-mobile-v3.png")  type("image/png")
    );
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
  }
  .panel{
    grid-row: 2;
    align-self: end;
    grid-column: 1;
    padding: clamp(1.5rem, 6vw, 2.5rem) var(--gutter) clamp(2rem, 8vw, 3.5rem);
    max-width: none;
  }
  .headline{ font-size: clamp(2.6rem, 11vw, 3.8rem); }
  .clock{ gap: clamp(.65rem, 3.5vw, 1.25rem); }
  .unit{ padding-right: clamp(.65rem, 3.5vw, 1.25rem); }
  .unit__num{ font-size: clamp(2rem, 8vw, 2.8rem); }
  .signup__row{ max-width: none; }
  .signup__input, .signup__btn{ flex: 1 1 100%; }
}

/* Viewports WIDER than the artwork's own 0.563 aspect (tablets in portrait,
   short windows): `cover` must scale by width there, which drags the paint
   down over the copy. So the artwork goes back into a box above the copy,
   where it cannot overlap. Phones are narrower than this and keep the
   full-bleed version above. */
@media (max-width: 860px) and (min-aspect-ratio: 563/1000){
  .stage{ background-image: none; }
  .stage::before{
    content: "";
    grid-area: 1 / 1;
    background-image: url("assets/artwork-mobile-v3.png");
    background-image: image-set(
      url("assets/artwork-mobile-v3.webp") type("image/webp"),
      url("assets/artwork-mobile-v3.png")  type("image/png")
    );
    background-size: 130% auto;
    background-position: 45% top;
    background-repeat: no-repeat;
  }
}

/* Locked page: on short screens type compresses rather than overflowing. */
@media (max-height: 700px){
  .headline{ font-size: clamp(2rem, 7.5vw, 2.8rem); }
  .countdown{ margin-top: 1.25rem; }
  .unit__num{ font-size: clamp(1.8rem, 6vw, 2.3rem); }
  .signup{ margin-top: 1.25rem; }
  .sub{ margin-top: .6rem; }
}

/* Phone held sideways: this is a wide, short viewport, so it wants the
   landscape artwork and the two-column split back — not the 9:16 file the
   width-based mobile rule above would otherwise leave in place. */
@media (max-height: 560px) and (orientation: landscape){
  .stage{
    grid-template-columns: minmax(0, 52%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    background-image: url("assets/artwork-landscape-v2.png");
    background-image: image-set(
      url("assets/artwork-landscape-v2.webp") type("image/webp"),
      url("assets/artwork-landscape-v2.png")  type("image/png")
    );
    background-position: left center;
  }
  .panel{
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding-block: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more){
  :root{ --ink-soft: #16342A; --rule: #102A22; }
}
