/* callingscore.com: the coming-soon page, the workspace chooser at /admin and
   the 404 page. One stylesheet, no build step. The pages carry no inline
   styles or scripts, so the server can send a strict Content-Security-Policy. */

@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/instrument-sans-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  --bg: #F5F5F7;
  --ink: #172B4D;
  --ink-soft: #4A5571;
  --ink-quiet: #5A6478;
  --ink-faint: #8A93A6;
  --line: #DFE2E8;
  --accent: #325AC2;
  --accent-strong: #2447A3;
  --danger: #BA2B2E;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
.dark {
  --bg: #15161B;
  --ink: #F5F8FF;
  --ink-soft: #C4C9D6;
  --ink-quiet: #A9AEBD;
  --ink-faint: #8A8F9E;
  --line: #2A2C34;
  --accent: #79A1FC;
  --accent-strong: #9BB9FF;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Instrument Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.accent { color: var(--accent); }

.page {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1336px;
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px) 32px;
  display: flex;
  flex-direction: column;
}
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.logo:hover { color: var(--ink); }
.logo img { display: block; width: 34px; height: 22px; }
.back-link { font-size: 14.5px; color: var(--ink-soft); }
.back-link:hover { color: var(--ink); }
.foot { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes appear { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Coming soon ---------------------------------------------------------- */

.pill-link {
  height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid #3A3C46;
  color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
  font-size: 14.5px; font-weight: 500; transition: border-color .2s;
}
.pill-link:hover { border-color: var(--accent); color: var(--ink); }

.soon {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: clamp(24px, 3vw, 36px); padding: clamp(64px, 12vh, 140px) 0;
}
.eyebrow {
  display: flex; align-items: center; gap: 10px; font-family: var(--mono);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-quiet);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #63D99B; animation: pulse 1.6s ease-in-out infinite; }
.soon-title { margin: 0; font-size: clamp(72px, 15vw, 220px); line-height: .88; letter-spacing: -0.06em; font-weight: 600; }
.soon-title .line { display: block; overflow: hidden; padding-bottom: .16em; margin-bottom: -.1em; }
.soon-title .line > span { display: block; animation: rise 1.15s cubic-bezier(.2, .8, .2, 1) 140ms both; }
.soon-title .line + .line > span { animation-delay: 270ms; }
.lede { margin: 0; max-width: 560px; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); column-gap: 24px; }
.step { position: relative; padding: 18px 0 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.step-bar { position: absolute; left: 0; top: -1px; height: 2px; width: 0; background: var(--accent); }
.step-n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.step-label { font-size: 15px; font-weight: 600; color: var(--ink); transition: color .4s; }
/* The script walks through the four steps: earlier ones stay lit, the current one fills. */
.steps.is-running .step-label { color: #6E7383; }
.steps.is-running .step.is-done .step-label,
.steps.is-running .step.is-current .step-label { color: var(--ink); }
.step.is-done .step-bar { width: 100%; }
.step.is-filling .step-bar { width: 100%; transition: width 2.6s linear; }
.soon-page .foot { margin-top: 20px; }

/* --- 404 ------------------------------------------------------------------ */

.lost { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 28px; padding: clamp(56px, 10vh, 120px) 0; }
.call-bar {
  width: 100%; max-width: 720px; background: #1B1C21; color: #F5F8FF; border-radius: 16px;
  padding: 14px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  box-shadow: 0 30px 60px -36px rgba(23, 43, 77, .6); font-family: var(--mono); font-size: 13px;
}
.call-state { display: flex; align-items: center; gap: 8px; color: #FF8880; }
.call-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #FF8880; animation: pulse 1.4s infinite; }
.call-path { color: #D5D9E3; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-rule { flex: 1 1 80px; height: 1px; background: repeating-linear-gradient(90deg, #4A4C57 0 6px, transparent 6px 10px); }
.call-time { color: #A9AEBD; }
.lost-title { margin: 0; font-size: clamp(44px, 7.4vw, 112px); line-height: .96; letter-spacing: -0.045em; font-weight: 600; max-width: 13ch; text-wrap: balance; }
.lost .lede { font-size: clamp(18px, 1.5vw, 21px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.button {
  height: 52px; padding: 0 24px; border-radius: 999px; display: inline-flex; align-items: center;
  font-weight: 500; font-size: 16px; transition: background .2s, border-color .2s;
}
.button-primary { background: var(--accent); color: #FFFFFF; }
.button-primary:hover { background: var(--accent-strong); color: #FFFFFF; }
.button-quiet { border: 1px solid #C9CFDB; background: #FFFFFF; color: var(--ink); }
.button-quiet:hover { border-color: var(--accent); color: var(--ink); }

/* --- Admin: choose a workspace ---------------------------------------------- */

.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); transition: width .9s cubic-bezier(.2, .7, .2, 1); z-index: 10; }
.is-busy .progress { width: 85%; }
.signin { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: clamp(56px, 11vh, 140px) 0; }
.signin-form { width: 100%; max-width: 920px; display: flex; flex-direction: column; gap: clamp(32px, 4vw, 44px); }
.signin-head { display: flex; flex-direction: column; gap: 16px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.signin-title { margin: 0; font-size: clamp(40px, 6vw, 84px); line-height: 1; letter-spacing: -0.045em; font-weight: 600; text-wrap: balance; }
.signin .lede { font-size: clamp(17px, 1.4vw, 20px); }

.recent { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; animation: appear .4s ease both; }
.recent-label { font-size: 14.5px; color: var(--ink-quiet); }
.recent-chip {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px 0 7px; border-radius: 999px;
  border: 1px solid var(--line); background: #FFFFFF; color: var(--ink); font-size: 15.5px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.recent-chip:hover { border-color: var(--accent); box-shadow: 0 8px 20px -12px rgba(50, 90, 194, .5); }
.recent-initial { width: 32px; height: 32px; border-radius: 50%; background: #E8EEFB; color: var(--accent); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.recent-name { font-weight: 600; }
.recent-domain { color: var(--ink-faint); }
.text-button { height: 46px; padding: 0 6px; border: 0; background: transparent; color: var(--ink-quiet); font-size: 14.5px; cursor: pointer; }
.text-button:hover { color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 14px; }
.field-label { font-size: 14.5px; font-weight: 600; }
.address { display: flex; flex-wrap: wrap; align-items: baseline; gap: .12em .2em; font-size: clamp(30px, 4.6vw, 60px); line-height: 1.2; letter-spacing: -0.03em; font-weight: 500; }
/* The box grows with what is typed: a hidden copy of the text sets its width. */
.address-box {
  display: inline-grid; grid-template-columns: minmax(0, max-content); max-width: 100%; min-width: 3.5ch;
  padding: .1em .32em; border-radius: .24em; border: 2px solid #D5DAE3; background: #FFFFFF;
  transition: border-color .2s, box-shadow .2s;
}
.address-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px rgba(50, 90, 194, .13); }
.field.is-error .address-box { border-color: var(--danger); box-shadow: 0 0 0 5px rgba(186, 43, 46, .12); }
.address-sizer { grid-area: 1 / 1; visibility: hidden; white-space: pre; overflow: hidden; }
.address-box input { grid-area: 1 / 1; width: 100%; min-width: 0; border: 0; outline: none; padding: 0; margin: 0; background: transparent; font: inherit; letter-spacing: inherit; color: var(--ink); }
.address-box input::placeholder { color: #B4BBC8; opacity: 1; }
.address-domain { color: var(--ink-faint); }
.field-hint { font-family: var(--mono); font-size: 13.5px; line-height: 1.5; color: var(--ink-quiet); overflow-wrap: anywhere; }
.field-hint b { font-weight: 400; color: var(--ink); }
.field-error { font-size: 15px; line-height: 1.45; color: var(--danger); }

.signin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.submit {
  height: 56px; min-width: 180px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--accent); color: #FFFFFF;
  font-size: 16.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: background .2s;
}
.submit:hover { background: var(--accent-strong); }
.submit:disabled { cursor: default; }
.submit-part { display: inline-flex; align-items: center; gap: 12px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #FFFFFF; animation: spin .8s linear infinite; }
.help-toggle { height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 15.5px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.help-toggle:hover { color: var(--accent-strong); }
.help { max-width: 640px; display: flex; flex-direction: column; border-top: 1px solid var(--line); animation: appear .35s ease both; }
.help-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.5; color: var(--ink-soft); }
.help-row .mono { font-size: 12px; color: var(--accent); padding-top: 3px; }
.help-row b { color: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
