/* Fastlog base + welcome styles. Tokens live in tokens.css. */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  font-size: 15px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, p { margin: 0; }
a { color: var(--teal); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- icons ---------- */
.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic.s16 { width: 16px; height: 16px; stroke-width: 2; }
.ic.s20 { width: 20px; height: 20px; stroke-width: 2; }
.ic.s28 { width: 28px; height: 28px; stroke-width: 2.25; }

.mark { width: 32px; height: 32px; flex: none; display: block; }
.mark-lg { width: 64px; height: 64px; }
.mark-bg { fill: var(--s1); }
.mark-track { stroke: var(--s3); }
.mark-arc { stroke: var(--teal); }
.mark-dot { fill: var(--t1); }

/* ---------- type ---------- */
.display {
  font-family: var(--font-display);
  font-size: 34px; line-height: 41px; font-weight: 700;
  letter-spacing: -.4px;
  text-wrap: balance;
}
.title1 {
  font-family: var(--font-display);
  font-size: 28px; line-height: 34px; font-weight: 700;
  letter-spacing: -.2px;
  text-wrap: balance;
}
.headline { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.2px; }
.pitch { font-size: 17px; line-height: 24px; color: var(--t2); text-wrap: pretty; }
.body2 { font-size: 15px; line-height: 20px; letter-spacing: -.1px; color: var(--t2); text-wrap: pretty; }

/* ---------- controls ---------- */
.btn {
  min-height: var(--tap-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 0 var(--sp-6);
  border-radius: var(--r-pill);
  font: inherit; font-size: 17px; font-weight: 600; line-height: 22px;
  text-decoration: none; text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--press), filter var(--press);
}
.btn.primary { background: var(--teal); color: var(--teal-ink); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); filter: brightness(.85); }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.note {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  font-size: 13px; line-height: 18px; color: var(--t2);
}
.note .ic { margin-top: 1px; }

/* ---------- page shell ---------- */
.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  padding-bottom: max(var(--sp-6), env(safe-area-inset-bottom));
}

.welcome .brand {
  min-height: 56px;
  padding-top: max(var(--sp-3), env(safe-area-inset-top));
  display: flex; align-items: center; gap: var(--sp-3);
}
.wordmark { font-size: 20px; line-height: 25px; font-weight: 700; letter-spacing: -.3px; }

/* ---------- welcome ---------- */
.welcome .hero {
  display: flex; flex-direction: column;
  gap: var(--sp-6);
  padding-top: var(--sp-4);
}
.welcome .hero-text { display: flex; flex-direction: column; gap: var(--sp-3); }
.welcome .hero-text .pitch { max-width: 34em; }

.welcome .cta { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-5); }
.welcome .cta .btn { width: 100%; }
.welcome .cta .note { justify-content: center; text-align: left; }

/* ring: 320 box = 240 ring (r113, stroke 14) + badge orbit r146 */
.ringwrap {
  order: -1;
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: var(--sp-2) auto 0;
}
.ringwrap svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ring-track { stroke: var(--track); }
.ring-arc { stroke: var(--teal); animation: ring-fill .9s var(--ease-out) .1s both; }
.ring-arc2 { stroke: var(--st4); animation: fade .3s .85s both; }
.notch { fill: var(--bg); animation: fade .3s .85s both; }
.badge-passed { fill: var(--teal-tint); stroke: var(--teal); }
.badge-check { fill: none; stroke: var(--teal); stroke-linecap: round; stroke-linejoin: round; }
.badge-current { fill: var(--st4); }
.badge-current-icon { fill: none; stroke: var(--st-ink); stroke-linecap: round; stroke-linejoin: round; }
.flag-bg { fill: var(--bg); stroke: var(--t1); }
.flag { fill: none; stroke: var(--t1); stroke-linecap: round; stroke-linejoin: round; }
.nowdot { animation: fade .3s .95s both; }
.now { fill: #fff; stroke: var(--st4); }
.pulse {
  fill: var(--st4);
  transform-box: fill-box; transform-origin: center;
  animation: pulse 2s ease-out 1.2s infinite;
  opacity: 0;
}
@keyframes ring-fill { from { stroke-dashoffset: 532.5; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse {
  0% { transform: scale(.6); opacity: .6; }
  100% { transform: scale(1.7); opacity: 0; }
}

.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  animation: fade .5s .2s both;
}
.ring-center > * { max-width: 62%; }
.state {
  height: 28px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--teal-tint); color: var(--teal);
  font-size: 13px; font-weight: 700; letter-spacing: .8px;
}
.state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lbl { font-size: 13px; line-height: 18px; color: var(--t2); margin-top: var(--sp-2); }
.timer {
  font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -.8px;
  white-space: nowrap; margin-top: 2px;
}
.timer .u { font-size: 18px; font-weight: 500; color: var(--t2); letter-spacing: 0; margin: 0 6px 0 2px; }
.timer .u:last-child { margin-right: 0; }
.left { font-size: 15px; line-height: 20px; color: var(--t2); margin-top: var(--sp-1); }
.left b { color: var(--t1); font-weight: 600; }

.welcome .features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-10);
}
.card { background: var(--s1); border-radius: var(--r-card); padding: var(--sp-4); }
.feature {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: var(--sp-3);
  row-gap: var(--sp-1);
  align-items: start;
}
.feature .tile { grid-row: span 2; }
.feature .headline { align-self: center; min-height: 22px; }
.tile {
  width: 40px; height: 40px;
  border-radius: var(--r-tile);
  display: grid; place-items: center;
}
.tile.teal { background: var(--teal-tint); color: var(--teal); }
.tile.amber { background: var(--amber-tint); color: var(--amber); }
.tile.green { background: var(--green-tint); color: var(--green); }

.welcome .foot {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
  margin-top: var(--sp-8);
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--sep);
  font-size: 13px; line-height: 18px; color: var(--t2);
  text-align: center;
}

/* ---------- notice pages (login placeholder, 404) ---------- */
.navbar {
  min-height: 44px;
  padding-top: max(var(--sp-2), env(safe-area-inset-top));
  margin: 0 -8px;
  display: flex; align-items: center;
}
.back {
  min-height: var(--tap-min); min-width: var(--tap-min);
  display: inline-flex; align-items: center; gap: 2px;
  padding-right: var(--sp-2);
  color: var(--teal); font-size: 17px; text-decoration: none;
  border-radius: var(--r-tile);
}
.notice-main {
  min-height: calc(100dvh - 140px);
  max-width: 420px;
  margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-4);
  text-align: center;
}
.notice-main .mark-lg { margin-bottom: var(--sp-2); }
.notice-main .note { margin-top: var(--sp-2); }

/* ---------- larger screens ---------- */
@media (min-width: 600px) {
  .page { padding-left: var(--sp-8); padding-right: var(--sp-8); }
  .ringwrap { width: 320px; }
  .welcome .cta { flex-direction: row; align-items: center; gap: var(--sp-5); }
  .welcome .cta .btn { width: auto; min-width: 200px; }
  .welcome .cta .note { justify-content: flex-start; }
}

@media (min-width: 900px) {
  .welcome .brand { min-height: 72px; }
  .welcome .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--sp-16);
    padding-top: var(--sp-12);
  }
  .ringwrap { order: 0; width: 380px; margin: 0; }
  .display { font-size: 52px; line-height: 58px; letter-spacing: -1.2px; }
  .pitch { font-size: 19px; line-height: 28px; }
  .welcome .hero-text { gap: var(--sp-4); }
  .welcome .cta { margin-top: var(--sp-6); }
  .welcome .features { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-16); }
  .feature { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-6); }
  .feature .tile { margin-bottom: var(--sp-2); }
  .feature .headline { align-self: stretch; }
  .welcome .foot { margin-top: var(--sp-12); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .pulse { display: none; }
}
