/* ─────────────────────────────────────────────
   Candent Co. — one-screen landing page
   ───────────────────────────────────────────── */

:root {
  --black: #000;
  --ivory: #f5f1e8;
  --ivory-soft: rgba(245, 241, 232, .82);
  --ivory-dim: rgba(245, 241, 232, .6);
  --ivory-faint: rgba(245, 241, 232, .38);
  --rule: rgba(245, 241, 232, .26);
  --emerald: #23a066;

  --serif: 'Cormorant Garamond', 'Cormorant', 'Hoefler Text', Garamond, Georgia, serif;
  --sans: 'Jost', Futura, 'Century Gothic', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(1.5rem, 5vw, 4rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-light: cubic-bezier(.33, 0, .15, 1);
}

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

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, p { margin: 0; }
img { display: block; }
[hidden] { display: none !important; }

::selection { background: #0c3a24; color: var(--ivory); }
:focus-visible { outline: 1px solid var(--ivory-soft); outline-offset: 6px; }

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

/* ───────── Page frame: exactly one screen ───────── */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

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

/* ───────── Masthead ───────── */

.masthead {
  position: relative;
  z-index: 2; /* the photograph's black reaches up behind it */
  padding: calc(clamp(1.75rem, 4.5vh, 3rem) + env(safe-area-inset-top)) var(--gutter) 0;
  text-align: center;
}

.wordmark {
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.4375rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: .42em;
  margin-right: -.42em; /* trailing tracking would push it off-centre */
  text-transform: uppercase;
  white-space: nowrap;
}

/* ───────── The stage ─────────
   The photograph's background is pure black, so the case sits directly on the page.
   Measurements below are taken from silver-noir.webp (1122 × 1402):
     case, horizontally: 30.9% → 66.5% of the width (centre 48.7%)
     case, vertically:   27.2% → 78.2% of the height (centre 52.7%)
     green band:         39.8% of the height
   The image is placed so the case is centred on the stage, then scaled by --z.
   The two hairlines sit on the band's line and stop just short of the case. */

.stage {
  --z: 1.45;
  --h: min(100cqh, 46rem);           /* the photograph's height before scaling */
  --case-half: calc(.1423 * var(--h) * var(--z));
  --gap: calc(.022 * var(--h) * var(--z));

  position: relative;
  flex: 1 1 0;
  min-height: 17rem;
  container-type: size;
}

.object {
  position: absolute;
  top:  calc(50% - .5268 * var(--h));
  left: calc(50% - .4871 * .80029 * var(--h));
  height: var(--h);
  aspect-ratio: 1122 / 1402;
  transform: scale(var(--z));
  transform-origin: 48.71% 52.68%;
  /* fade the velvet's edges into the page */
  -webkit-mask-image:
    linear-gradient(to right, transparent 2%, #000 25%, #000 75%, transparent 98%),
    linear-gradient(to bottom, #000 79%, transparent 97%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 2%, #000 25%, #000 75%, transparent 98%),
    linear-gradient(to bottom, #000 79%, transparent 97%);
  mask-composite: intersect;
}

.object img {
  width: 100%;
  height: 100%;
}

/* a single slow pass of light across the metal */
.sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 43%, rgba(255, 255, 255, .5) 50%, transparent 57%);
  background-size: 300% 100%;
  background-position: 0% 0;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.horizon {
  position: absolute;
  top: calc(50% - .1291 * var(--h) * var(--z));
  height: 1px;
  margin-top: -.5px;
  width: max(0px, calc(50% - var(--case-half) - var(--gap)));
  box-shadow: 0 0 8px rgba(35, 160, 102, .25);
}
.horizon--left {
  left: 0;
  background: linear-gradient(to left, var(--emerald), rgba(35, 160, 102, .35) 55%, transparent);
  transform-origin: 100% 50%;
}
.horizon--right {
  right: 0;
  background: linear-gradient(to right, var(--emerald), rgba(35, 160, 102, .35) 55%, transparent);
  transform-origin: 0 50%;
}

/* ───────── Copy ───────── */

.copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
  text-align: center;
}

.label {
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .34em;
  margin-right: -.34em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

h1 {
  margin-top: clamp(.75rem, 2vh, 1.25rem);
  font-family: var(--serif);
  font-size: clamp(2.375rem, min(4.4vw, 7.6vh), 4.75rem);
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: -.005em;
}
h1 em { font-style: italic; font-weight: 300; }

/* ───────── Waitlist ───────── */

.waitlist {
  position: relative;
  display: flex;
  align-items: stretch;
  width: min(100%, 27rem);
  margin-top: clamp(1.5rem, 4.5vh, 2.75rem);
  border-bottom: 1px solid var(--rule);
  transition: border-color .5s var(--ease);
}
.waitlist:focus-within { border-bottom-color: var(--ivory-soft); }

.waitlist input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  font-weight: 400;
  letter-spacing: .03em;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.waitlist input[type="email"]::placeholder { color: var(--ivory-faint); }
.waitlist input[type="email"]:-webkit-autofill {
  -webkit-text-fill-color: var(--ivory);
  -webkit-box-shadow: 0 0 0 100px var(--black) inset;
  caret-color: var(--ivory);
}

.waitlist button {
  flex: none;
  position: relative;
  padding: 1rem 0 1rem 1.5rem;
  border: 0;
  background: none;
  color: var(--ivory);
  font-family: var(--sans);
  font-size: .6875rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .3em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  opacity: .86;
  transition: opacity .3s, color .4s var(--ease);
}
.waitlist button:hover { opacity: 1; color: #fff; }
.waitlist button:focus-visible { outline-offset: 2px; }
.waitlist button[disabled] { opacity: .5; cursor: default; }

.status {
  min-height: 1.6em;
  margin-top: .85rem;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--ivory-dim);
}
.status.is-error { color: #f0c3ae; }

.thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.5rem, 4.5vh, 2.75rem);
  outline: none;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
}
.thanks em { font-style: italic; }

/* the green cabochon, as an ornament */
.cabochon {
  display: block;
  width: 13px; height: 13px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #8ff0b8 0%, #1f8f5a 26%, #0b4a30 64%, #04180f 100%);
  box-shadow: 0 0 0 2px #e4e4df, 0 0 0 3px #8d8d86, 0 0 18px rgba(35, 160, 102, .35);
}

/* ───────── Colophon ───────── */

.colophon {
  padding: clamp(1.25rem, 3.5vh, 2.25rem) var(--gutter) calc(clamp(1.25rem, 3.5vh, 2.25rem) + env(safe-area-inset-bottom));
  text-align: center;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ivory-faint);
}

/* ───────── Small screens ───────── */

@media (max-width: 345px) {
  .waitlist { flex-direction: column; border-bottom: 0; }
  .waitlist input[type="email"] { border-bottom: 1px solid var(--rule); text-align: center; }
  .waitlist input[type="email"]:focus { border-bottom-color: var(--ivory-soft); }
  .waitlist button { padding: 1.25rem 0 .25rem; }
}

/* ───────── The lights come up ───────── */

@media (prefers-reduced-motion: no-preference) {
  .object {
    animation: lights-up 2.6s var(--ease-light) .15s both;
  }
  .sheen {
    animation: sheen 2.8s cubic-bezier(.45, 0, .2, 1) 2.7s both;
  }
  .horizon {
    animation: draw 1.9s var(--ease) 1.25s both;
  }
  .wordmark {
    animation: track-in 2.2s var(--ease) .35s both;
  }
  .label   { animation: rise 1.4s var(--ease) 1.15s both; }
  h1       { animation: rise 1.5s var(--ease) 1.3s both; }
  .waitlist,
  .status  { animation: rise 1.4s var(--ease) 1.6s both; }
  .colophon { animation: fade 1.6s var(--ease) 2s both; }
  .thanks  { animation: rise 1.2s var(--ease) both; }
}

@keyframes lights-up {
  from {
    opacity: 0;
    filter: brightness(.2);
    transform: scale(calc(var(--z) * 1.04));
  }
  to {
    opacity: 1;
    filter: brightness(1);
    transform: scale(var(--z));
  }
}

@keyframes sheen {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

@keyframes draw {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

@keyframes track-in {
  from { opacity: 0; letter-spacing: .62em; margin-right: -.62em; }
  to   { opacity: 1; letter-spacing: .42em; margin-right: -.42em; }
}

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

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
