/* ============================================================
   v6 core — reset, stage, chrome (year slider), toast, power
   Frames live in machines.css. OS looks live in os-*.css.
   ============================================================ */
:root {
  --accent: #0FB5A9;
  --mono: "IBM Plex Mono", "Space Mono", ui-monospace, Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --crt: 1;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: #0a0a0b; color: #e8e8e6; font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#blackout { position: absolute; inset: 0; background: #000; z-index: 55; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .24s ease; }
#blackout.go { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .16s ease; }

/* era-true screen off/on — applied to the active OS layer */
.os-collapse { transform-origin: 50% 50%; animation: crt-collapse .34s cubic-bezier(.75, 0, .95, 1) forwards !important; }
@keyframes crt-collapse {
  0%   { transform: scaleY(1); filter: brightness(1); }
  55%  { transform: scaleY(.02) scaleX(1.05); filter: brightness(2.6); }
  100% { transform: scaleY(.002) scaleX(.25); filter: brightness(7); }
}
.os-fadeoff { animation: lcd-off .22s ease forwards !important; }
@keyframes lcd-off { to { opacity: 0; filter: brightness(.55); } }
.os-warm { animation: crt-warm .75s ease-out; }
@keyframes crt-warm {
  0%   { filter: brightness(0) contrast(1.8); transform: scaleY(.86); }
  45%  { filter: brightness(1.65); transform: scaleY(1.015); }
  100% { filter: brightness(1); transform: scaleY(1); }
}
.os-fadein { animation: os-fadein .4s ease; }
@keyframes os-fadein { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .os-collapse, .os-fadeoff, .os-warm, .os-fadein { animation: none !important; }
}

/* stage */
#frame {
  position: fixed; inset: 0 0 72px 0;
  padding: 22px 18px 32px;
  transition: background .6s ease;
}

/* ============ CHROME: ⏻ · ▶ · year slider · ♪ ============ */
#chrome {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: min(680px, calc(100vw - 20px));
  height: 54px; z-index: 80;
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(13, 14, 16, .74);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
}
#chrome.on { opacity: 1; pointer-events: auto; }
#ch-power, #ch-play, #ch-sound {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  color: #a9adb2; display: grid; place-items: center;
  transition: color .2s, background-color .2s;
}
#ch-power:hover, #ch-play:hover, #ch-sound:hover { color: #fff; background: rgba(255, 255, 255, .09); }
#ch-power { color: #7c8085; }
#ch-play.pulse { color: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(15, 181, 169, .16); } }
#ch-sound .slash { display: none; }
#ch-sound.off .slash { display: block; }
#ch-sound.off { color: #6d7176; }

#yl { flex: 1; min-width: 0; position: relative; height: 44px; touch-action: none; cursor: pointer; margin: 0 8px; }
#yl::before { content: ""; position: absolute; left: 0; right: 0; top: 21px; height: 2px; background: rgba(255, 255, 255, .16); border-radius: 2px; }
#yl-fill { position: absolute; left: 0; top: 21px; height: 2px; background: var(--accent); width: 0; border-radius: 2px; }
#yl .tick { position: absolute; top: 20px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: rgba(255, 255, 255, .4); pointer-events: none; }
#yl-thumb {
  position: absolute; top: 13px; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%; background: #fff; pointer-events: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
#yl-year {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11.5px; color: #050505;
  background: #fff; border-radius: 6px; padding: 1.5px 7px; white-space: nowrap; font-weight: 600;
}
#yl-ends { position: absolute; left: 2px; right: 2px; top: 31px; display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: #8e9197; pointer-events: none; letter-spacing: .06em; }

/* ============ toast ============ */
#toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 95; background: rgba(12, 12, 12, .92); border: 1px solid rgba(255, 255, 255, .18);
  color: #ddd; font-family: var(--mono); font-size: 12.5px;
  padding: 8px 14px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .25s ease; max-width: calc(100vw - 40px); text-align: center;
}
#toast.on { opacity: 1; }

/* ============ POWER ============ */
#era-power { position: absolute; inset: 0; background: #000; display: none; place-items: center; z-index: 60; }
#era-power.on { display: grid; }
.power-btn {
  width: 92px; height: 92px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .22);
  display: grid; place-items: center;
  color: rgba(255, 255, 255, .6); font-size: 34px;
  transition: color .3s, border-color .3s, box-shadow .3s;
  animation: breathe 3.2s ease-in-out infinite;
}
.power-btn:hover { color: #dfe3df; border-color: #dfe3df; box-shadow: 0 0 34px rgba(220, 228, 220, .25); }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 6px rgba(255, 255, 255, .06); opacity: .75; } 50% { box-shadow: 0 0 26px rgba(255, 255, 255, .16); opacity: 1; } }
.power-hint { position: absolute; bottom: 9vh; left: 0; right: 0; text-align: center; color: #90948f; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }

/* ============ small & odd screens ============ */
@media (max-width: 620px) {
  #frame { inset: 0 0 64px 0; padding: 10px 8px 8px; }
  #chrome { height: 50px; gap: 0; padding: 0 6px; }
  #ch-power, #ch-play, #ch-sound { width: 38px; height: 38px; }
  #yl { margin: 0 6px; }
  #yl-ends { display: none; }
}
@media (max-height: 520px) {
  #frame { inset: 0 0 56px 0; padding: 8px; }
  #chrome { height: 46px; bottom: calc(6px + env(safe-area-inset-bottom)); }
  #ch-power, #ch-play, #ch-sound { width: 36px; height: 36px; }
  #yl-ends { display: none; }
  #toast { top: 6px; font-size: 11.5px; }
}
@media (max-width: 350px) {
  #ch-power { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .power-btn, #ch-play.pulse { animation: none; }
}

/* ============ v7.2 fixes ============ */
/* iOS zooms the page when focusing inputs under 16px — keep era inputs readable on touch */
@media (pointer: coarse) {
  #screen input[type="text"], #screen input[type="email"], #screen input:not([type]), #screen textarea {
    font-size: 16px !important;
  }
}
/* agents + privacy: one clean row from the very first screen (wraps to two lines on narrow screens) */
.power-links {
  position: absolute; bottom: 4.6vh; left: 12px; right: 12px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  column-gap: 16px; row-gap: 7px; text-align: center;
}
.power-agents, .power-privacy {
  color: #8d9196; font-family: var(--mono); letter-spacing: .08em;
  text-decoration: underline; text-underline-offset: 3px;
}
.power-agents { font-size: 11px; }
.power-privacy { font-size: 10.5px; opacity: .6; }
.power-agents:hover, .power-privacy:hover { color: #c9cdd1; opacity: 1; }
