/* Stofa — pre-launch site
   Palette and motif carried over from the STOFA deck.
   Single committed dark look: no light theme by design. */

:root {
  --ink:        #1B2233;  /* page ground            */
  --ink-2:      #232B3C;  /* panels, line cells     */
  --ink-3:      #2E3648;  /* hairlines on dark      */
  --ember:      #C8462B;  /* accent                 */
  --ember-soft: #E8927C;  /* accent on dark         */
  --muted:      #667085;  /* de-emphasised headline */
  --body:       #A7AFBE;  /* body copy              */
  --slate:      #5F6775;  /* fine print             */
  --faint:      #4C5568;  /* legal, cell numbers    */
  --field:      #333C50;  /* input border           */
  --white:      #FFFFFF;

  --sans: 'IBM Plex Sans', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --gutter: clamp(1.5rem, 5.2vw, 5.5rem);
  --maxw: 1440px;

  color-scheme: dark;
}

/* Chinese pages: no CJK webfont — system faces render instantly everywhere,
   including networks where Google Fonts is unreachable. */
html[lang^="zh"] {
  --display: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif;
}

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

/* .signup-done / .signup use display:flex, which would otherwise beat [hidden]. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ember-soft); text-decoration: none; }
a:hover { color: var(--white); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ember-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 10;
  padding: 12px 20px; background: var(--ember); color: var(--white);
}
.skip:focus { left: 0; }

/* ---------- atmosphere ---------- */
.bg-rule, .bg-glow, .bg-floor {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.bg-rule {
  background-image: repeating-linear-gradient(90deg,
    rgba(255,255,255,.038) 0 1px, transparent 1px calc(100% / 12));
  background-size: 100% 100%;
}
.bg-glow  { background: radial-gradient(900px 620px at 82% 6%,  rgba(200,70,43,.20), transparent 62%); }
.bg-floor { background: radial-gradient(700px 500px at 6% 92%, rgba(46,54,72,.85),  transparent 70%); }

.page {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(1.5rem, 2.6vw, 2.375rem) 0 0;
}
.wordmark {
  margin: 0;
  font-size: clamp(.9375rem, 1.2vw, 1.0625rem);
  font-weight: 600; letter-spacing: .34em; color: var(--white);
}
a.wordmark:hover { color: var(--white); }
.lang {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--ink-3); border-radius: 999px; padding: 4px;
}
.lang-on, .lang-off {
  display: block; padding: 7px 15px; border-radius: 999px;
  font-size: .75rem; letter-spacing: .1em; line-height: 1;
}
.lang-on  { background: var(--ember); color: var(--white); font-weight: 600; }
.lang-off { color: #8E97A8; }
.lang-off:hover { color: var(--white); }

/* ---------- hero ---------- */
.hero { padding: clamp(3.5rem, 7vw, 6.5rem) 0 0; }
.eyebrow {
  margin: 0 0 clamp(1.25rem, 1.8vw, 1.625rem);
  font-family: var(--mono); font-size: .6875rem;
  letter-spacing: .26em; text-transform: uppercase; color: var(--ember);
}
html[lang^="zh"] .eyebrow { font-family: var(--sans); letter-spacing: .22em; }

h1 { margin: 0; font-weight: 400; letter-spacing: -.015em; line-height: 1.12; }
h1 span { display: block; font-family: var(--display); font-size: clamp(2.375rem, 5.3vw, 4.75rem); }
.h1-a { color: var(--muted); }
.h1-b { color: var(--white); margin-top: .1em; }
html[lang^="zh"] h1 { font-weight: 600; letter-spacing: 0; line-height: 1.2; }
html[lang^="zh"] h1 span { font-size: clamp(2rem, 4.3vw, 3.875rem); }

.lede {
  max-width: 41rem;
  margin: clamp(1.5rem, 2.5vw, 2.25rem) 0 0;
  font-size: clamp(.9375rem, 1.2vw, 1.0625rem);
  line-height: 1.72; color: var(--body); text-wrap: pretty;
}

/* ---------- signup ---------- */
.signup {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: clamp(1.75rem, 3vw, 2.75rem) 0 0;
}
.signup input[type="email"] {
  flex: 1 1 20.625rem; max-width: 20.625rem;
  height: 54px; padding: 0 20px;
  border: 1px solid var(--field); border-radius: 8px;
  background: rgba(255,255,255,.03); color: var(--white);
  font-family: var(--sans); font-size: .9375rem;
}
.signup input::placeholder { color: var(--slate); }
.signup input:focus { outline: none; border-color: var(--ember-soft); }
.signup button {
  height: 54px; padding: 0 30px; border: 0; border-radius: 8px;
  background: var(--ember); color: var(--white);
  font-family: var(--sans); font-size: .9375rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: filter .15s ease;
}
.signup button:hover { filter: brightness(1.12); }
.signup button[disabled] { opacity: .6; cursor: default; }

.signup-done {
  display: flex; align-items: center; gap: 12px; width: fit-content;
  margin: clamp(1.75rem, 3vw, 2.75rem) 0 0;
  padding: 15px 24px; border: 1px solid var(--ink-3); border-radius: 8px;
  background: rgba(200,70,43,.10); color: var(--ember-soft);
  font-size: .9375rem;
}
.signup-msg { margin: 12px 0 0; font-size: .8125rem; color: var(--ember-soft); min-height: 1.2em; }
.signup-msg:empty { margin: 0; min-height: 0; }
.fine { margin: 18px 0 0; font-size: .8125rem; color: var(--slate); }

/* ---------- production line ---------- */
.line { padding: clamp(4rem, 7.5vw, 6.75rem) 0 0; }
.cells { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cells li { flex: 1 1 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cells i {
  display: block; position: relative; height: clamp(2.75rem, 4.6vw, 4.125rem);
  border-radius: 7px; background: var(--ink-2); overflow: hidden;
}
.cells i::before {
  content: ""; position: absolute; inset: 0; background: var(--ember); opacity: 0;
  animation: run 5s linear infinite;
}
.cells .last i { background: var(--ember); }
.cells b {
  font-family: var(--mono); font-weight: 400; font-size: .625rem;
  letter-spacing: .1em; color: var(--faint); text-align: center;
}
.cells li:nth-child(1)  i::before { animation-delay: 0s; }
.cells li:nth-child(2)  i::before { animation-delay: .36s; }
.cells li:nth-child(3)  i::before { animation-delay: .72s; }
.cells li:nth-child(4)  i::before { animation-delay: 1.08s; }
.cells li:nth-child(5)  i::before { animation-delay: 1.44s; }
.cells li:nth-child(6)  i::before { animation-delay: 1.8s; }
.cells li:nth-child(7)  i::before { animation-delay: 2.16s; }
.cells li:nth-child(8)  i::before { animation-delay: 2.52s; }
.cells li:nth-child(9)  i::before { animation-delay: 2.88s; }
.cells li:nth-child(10) i::before { animation-delay: 3.24s; }
.cells li:nth-child(11) i::before { animation-delay: 3.6s; }
.cells li:nth-child(12) i::before { animation: none; }

@keyframes run {
  0%   { opacity: 0; }
  6%   { opacity: 1; }
  26%  { opacity: .14; }
  100% { opacity: 0; }
}

.line-caption {
  margin: clamp(1.5rem, 2.8vw, 2.5rem) 0 0;
  font-family: var(--display); font-size: clamp(1.375rem, 2.1vw, 1.875rem);
  line-height: 1.35; color: var(--white);
}
html[lang^="zh"] .line-caption { font-weight: 600; }

/* ---------- the shift ---------- */
.shift {
  display: flex; align-items: stretch; gap: 20px;
  padding: clamp(3.5rem, 6.6vw, 6rem) 0 0;
}
.panel { flex: 1 1 0; padding: 30px 32px; border-radius: 12px; }
.panel.from { background: var(--ink-2); }
.panel.to   { flex-grow: 1.35; background: var(--ember); }
.panel-label {
  margin: 0 0 14px; font-family: var(--mono);
  font-size: .625rem; letter-spacing: .22em; text-transform: uppercase;
}
html[lang^="zh"] .panel-label { font-family: var(--sans); letter-spacing: .18em; }
.from .panel-label { color: var(--slate); }
.to   .panel-label { color: rgba(255,255,255,.62); }
.panel-text { margin: 0; font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.5; }
.from .panel-text { color: #8E97A8; }
.to   .panel-text { color: var(--white); font-weight: 500; }
.panel-arrow { display: flex; align-items: center; color: var(--slate); }
.panel-arrow svg { width: 30px; height: 30px; }

/* ---------- footer ---------- */
.foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: clamp(4rem, 7.2vw, 6.5rem) 0 clamp(3rem, 4.4vw, 4rem);
}
.foot p { margin: 0; }
.foot-l { display: flex; flex-direction: column; gap: 10px; }
.foot-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: right; }
.foot-tag { font-size: .8125rem; color: var(--slate); }
.status { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; color: var(--ember-soft); }
html[lang^="zh"] .status { font-family: var(--sans); }
.copy { font-size: .75rem; color: var(--faint); }

/* ---------- phone ---------- */
@media (max-width: 860px) {
  .bg-rule { background-image: repeating-linear-gradient(90deg,
      rgba(255,255,255,.03) 0 1px, transparent 1px calc(100% / 4)); }
  .lede { max-width: none; }
  .signup { flex-direction: column; gap: 10px; }
  .signup input[type="email"] { flex: 0 0 auto; max-width: none; height: 52px; }
  .signup button { height: 52px; width: 100%; }
  .signup-done { width: auto; align-items: flex-start; }

  .cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .cells li { display: block; position: relative; }
  .cells i { height: 62px; }
  .cells b { position: absolute; left: 8px; top: 6px; color: rgba(255,255,255,.34); }

  .shift { flex-direction: column; gap: 12px; }
  .panel { padding: 22px; }
  .panel-arrow { justify-content: center; }
  .panel-arrow svg { width: 24px; height: 24px; transform: rotate(90deg); }

  .foot { flex-direction: column; align-items: flex-start; gap: 28px; }
  .foot-r { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .cells i::before { animation: none; }
  * { transition: none !important; }
}
