/* cassidysolutions.net — a single screen that extends the TPO film's world.
   Palette and type are the film's own: see src/film/tpo-film.jsx (C). */

:root {
  --ink: #0B0E10;
  --paper: #E6E1D7;
  --dim: #78848A;
  --faint: #3C464B;
  --teal: #4FD3B4;
  --gold: #FFDE8C;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --gutter: max(clamp(24px, 6vw, 76px), env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--gold); }
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.hero {
  position: relative;
  height: 100svh;
  min-height: 440px;
  overflow: hidden;
}

#film {
  position: absolute;
  inset: 0;
}

/* the film's own vignette, applied over the whole hero so the
   stage edge and any letterboxing dissolve into the page */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%,
    transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-chrome {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.hero-chrome a,
.hero-chrome button { pointer-events: auto; }

.wordmark {
  position: absolute;
  top: clamp(22px, 4vh, 44px);
  left: var(--gutter);
  font: 500 12px var(--mono);
  letter-spacing: 0.28em;
  color: var(--paper);
}
.wordmark em {
  font-style: normal;
  color: var(--dim);
}

.chrome-right {
  position: absolute;
  top: clamp(22px, 4vh, 44px);
  right: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* the point of contact — a quiet echo of the film's Point of Control */
.contact {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 500 12px var(--mono);
  letter-spacing: 0.08em;
}

/* sign-in chrome: empty until /auth/status.php says auth exists */
.auth {
  display: flex;
  flex-direction: column;
  align-items: inherit;
  gap: 10px;
  min-height: 15px;
  font: 500 11px var(--mono);
  letter-spacing: 0.22em;
}
.auth-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.auth a { color: var(--dim); }
.auth a:hover { color: var(--gold); }
.auth .who {
  color: var(--paper);
  letter-spacing: 0.08em;
}

/* the opt-in toggle: quiet text button; a teal dot marks the on state,
   echoing the POC dot on the contact line */
.updates {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  color: var(--dim);
  cursor: pointer;
}
.updates:hover { color: var(--gold); }
.updates:disabled { opacity: 0.5; }
.updates::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--faint);
  background: transparent;
}
.updates[data-on="1"] {
  color: var(--teal);
}
.updates[data-on="1"]::before {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 8px rgba(79, 211, 180, 0.5);
}
.contact::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(79, 211, 180, 0.5);
}

.hero h1 {
  position: absolute;
  left: var(--gutter);
  bottom: calc(clamp(56px, 11vh, 108px) + var(--safe-b));
  max-width: 17em;
  font: 500 clamp(1.6rem, 3.4vw, 2.7rem)/1.18 var(--sans);
  letter-spacing: -0.015em;
  text-wrap: balance;
  /* stays legible when a cropped chart runs behind it on short screens */
  text-shadow: 0 1px 22px rgba(11, 14, 16, 0.95), 0 0 6px rgba(11, 14, 16, 0.8);
}
.hero h1 .years { color: var(--teal); white-space: nowrap; }

.ticker {
  position: absolute;
  left: var(--gutter);
  bottom: calc(clamp(26px, 5vh, 48px) + var(--safe-b));
  display: flex;
  gap: 22px;
  font: 500 12px var(--mono);
  letter-spacing: 0.2em;
  color: var(--faint);
}
.ticker .lit { color: var(--dim); }

/* portrait phones/tablets: the camera keeps the action centered on the
   stage, so let the film overflow the viewport width and crop its edges —
   the chart renders large instead of shrinking to a strip */
@media (orientation: portrait) and (max-width: 1024px) {
  #film {
    left: 50%;
    right: auto;
    width: 150vw;
    transform: translateX(-50%);
  }
}
@media (orientation: portrait) and (max-width: 720px) {
  #film { width: 215vw; }
}

@media (max-width: 720px) {
  .ticker { gap: 14px; letter-spacing: 0.14em; }
  .ticker span:nth-child(3) { display: none; }
  .chrome-right { top: auto; bottom: calc(clamp(26px, 5vh, 48px) + var(--safe-b)); right: var(--gutter); }
}
@media (max-width: 520px) {
  .chrome-right {
    left: var(--gutter);
    right: auto;
    bottom: auto;
    top: calc(clamp(22px, 4vh, 44px) + 34px);
    align-items: flex-start;
  }
}
