/* =========================================================
   TutorialCloud — "Launching soon" teaser
   HTML + CSS only. Tokens shared with designs/landing-v1.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  color-scheme: light dark;

  --bg:          light-dark(oklch(99.2% 0.003 280), oklch(16.5% 0.018 280));
  --surface:     light-dark(#fff,                   oklch(21% 0.022 280));
  --text:        light-dark(oklch(21% 0.03 280),    oklch(95.5% 0.008 280));
  --text-muted:  light-dark(oklch(47% 0.025 280),   oklch(72% 0.02 280));
  --border:      light-dark(oklch(91.5% 0.01 280),  oklch(30% 0.025 280));

  --brand:       light-dark(oklch(54% 0.24 285), oklch(72% 0.16 285));
  --brand-soft:  color-mix(in oklch, var(--brand) 12%, transparent);
  --gradient:    linear-gradient(100deg, oklch(56% 0.25 290), oklch(62% 0.2 255) 45%, oklch(72% 0.14 205));

  --c-ai:   oklch(58% 0.23 292);
  --c-py:   #3776ab;
  --c-js:   #f0db4f;
  --c-go:   #00add8;
  --c-php:  #777bb4;
  --c-html: #e34f26;
  --c-green: oklch(72% 0.17 150);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --shadow-lg: 0 24px 60px -12px light-dark(oklch(30% 0.1 280 / 0.25), oklch(0% 0 0 / 0.65));
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

body {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ---------- Background: colour glows + faded grid ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(45% 55% at 18% 18%, color-mix(in oklch, var(--c-ai) 24%, transparent), transparent 70%),
    radial-gradient(40% 50% at 85% 30%, color-mix(in oklch, var(--c-go) 20%, transparent), transparent 70%),
    radial-gradient(50% 45% at 55% 95%, color-mix(in oklch, var(--brand) 16%, transparent), transparent 70%);

  &::after {
    content: ""; position: absolute; inset: 0;
    background-image:
      linear-gradient(to right, color-mix(in oklch, var(--text) 7%, transparent) 1px, transparent 1px),
      linear-gradient(to bottom, color-mix(in oklch, var(--text) 7%, transparent) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 65% 60% at 50% 45%, #000 25%, transparent 75%);
  }
}

/* ---------- Header & footer ---------- */
.top { padding: 1.25rem var(--gutter); }

.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient);
  box-shadow: 0 4px 12px -4px color-mix(in oklch, var(--c-ai) 60%, transparent);
  & svg { width: 21px; height: 21px; fill: #fff; }
}
.brand-name span { color: var(--brand); }

.foot { padding: 1.25rem var(--gutter); text-align: center; font-size: .85rem; color: var(--text-muted); }

/* ---------- Stage ---------- */
.stage {
  position: relative; display: grid; place-items: center;
  width: min(100%, 1200px); margin-inline: auto;
  padding: clamp(1rem, 4vh, 3rem) var(--gutter);
}

.content { position: relative; z-index: 1; max-width: 760px; text-align: center; }

.pill {
  display: inline-flex; align-items: center; gap: .6rem; padding: .4rem 1rem .4rem .8rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 80%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand);
}
.pulse {
  position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--c-green);
  &::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c-green); }
}

h1 {
  margin: 1.5rem 0 1.25rem;
  font-size: clamp(2.6rem, 1.4rem + 5.2vw, 5.25rem);
  font-weight: 750; line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance;
}
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lede {
  max-width: 36rem; margin-inline: auto;
  font-size: clamp(1.05rem, .98rem + .35vw, 1.25rem); color: var(--text-muted); text-wrap: pretty;
}

/* ---------- Terminal ---------- */
.terminal {
  width: min(100%, 460px); margin: 2.25rem auto 0; text-align: left;
  border-radius: 16px; overflow: hidden;
  background: oklch(19% 0.03 280); color: oklch(90% 0.02 280);
  border: 1px solid oklch(100% 0 0 / .08);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-mono); font-size: clamp(.8rem, .75rem + .2vw, .9rem);
}
.term-bar {
  display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem;
  background: oklch(23% 0.03 280); border-bottom: 1px solid oklch(100% 0 0 / .06);
}
.dots { display: flex; gap: 6px;
  & i { width: 11px; height: 11px; border-radius: 50%; }
  & i:nth-child(1) { background: #ff5f57; } & i:nth-child(2) { background: #febc2e; } & i:nth-child(3) { background: #28c840; } }
.term-title { font-size: .78rem; color: oklch(70% 0.02 280); }

.term-body { padding: 1.1rem 1.2rem 1.25rem; display: grid; gap: .35rem; }
.cmd { display: flex; align-items: center; white-space: nowrap; }
.prompt { color: oklch(75% 0.16 320); margin-right: .7ch; }
.typed { display: inline-block; overflow: hidden; width: 22ch; color: oklch(80% 0.13 210); }
.cursor { display: inline-block; width: .55em; height: 1.15em; margin-left: 2px; background: oklch(85% 0.02 280); }

.out { color: oklch(78% 0.02 280); display: flex; align-items: center; gap: .6ch; }
.out strong { color: #fff; font-weight: 600; }
.ok { color: oklch(78% 0.17 150); font-weight: 700; }
.spin {
  flex: none; width: 12px; height: 12px; margin-inline: 1px 2px; border-radius: 50%;
  border: 2px solid oklch(80% 0.13 210); border-right-color: transparent;
}

/* ---------- Floating topic tiles ---------- */
.tiles { position: absolute; inset: 0; pointer-events: none; }
.tile {
  position: absolute; display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 16px;
  background: var(--accent); color: #fff;
  font-family: var(--font-mono); font-weight: 600; font-size: 1rem;
  box-shadow: 0 14px 30px -12px var(--accent), inset 0 1px 0 oklch(100% 0 0 / .25);
  rotate: var(--r, 0deg);
  &.dark-text { color: oklch(22% 0.03 90); }
}
.t1 { left: 6%;   top: 14%; --r: -8deg; }
.t2 { left: 12%;  top: 72%; --r: 6deg;  width: 50px; height: 50px; }
.t3 { right: 7%;  top: 12%; --r: 10deg; }
.t4 { right: 4%;  top: 56%; --r: -6deg; width: 64px; height: 64px; }
.t5 { left: 1%;   top: 44%; --r: 4deg;  width: 52px; height: 52px; font-size: .85rem; }
.t6 { right: 15%; top: 84%; --r: -10deg; width: 48px; height: 48px; }

/* Tablet: pull tiles out to the edges */
@media (max-width: 900px) {
  .tile { opacity: .75; }
  .t1 { left: 2%; top: 4%; } .t3 { right: 2%; top: 4%; }
  .t2 { left: 3%; top: auto; bottom: 2%; } .t4 { right: 3%; top: auto; bottom: 4%; }
  .t5, .t6 { display: none; }
}
/* Phone: small and quiet, corners only */
@media (max-width: 560px) {
  .stage { padding-block: 3.5rem 4rem; }
  .tile { width: 38px; height: 38px; border-radius: 11px; font-size: .75rem; opacity: .6; }
  .t1 { left: 8px; top: .25rem; } .t3 { right: 8px; top: .25rem; }
  .t2 { left: 8px; bottom: .25rem; } .t4 { right: 8px; bottom: .25rem; }
}

/* ---------- Motion (skipped for reduced-motion users) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: rise .8s var(--ease-out) both; }
  .content > :nth-child(2) { animation-delay: .08s; }
  .content > :nth-child(3) { animation-delay: .16s; }
  .content > :nth-child(4) { animation-delay: .26s; }

  .pulse::after { animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }

  .typed { animation: type 1.4s steps(22) 1s both; }
  .cursor { animation: blink 1s steps(1) infinite; }
  .out { animation: fade-in .4s ease-out both; }
  .o1 { animation-delay: 2.7s; }
  .o2 { animation-delay: 3.2s; }
  .o3 { animation-delay: 3.7s; }
  .spin { animation: spin .9s linear infinite; }

  .tile { animation: drift var(--d, 9s) ease-in-out var(--delay, 0s) infinite alternate, fade-in 1s ease-out both; }
  .t1 { --d: 9s; } .t2 { --d: 11s; --delay: -3s; } .t3 { --d: 10s; --delay: -6s; }
  .t4 { --d: 12s; --delay: -2s; } .t5 { --d: 8s; --delay: -5s; } .t6 { --d: 10.5s; --delay: -4s; }

  .bg { animation: glow 18s ease-in-out infinite alternate; }
}

@keyframes rise    { from { opacity: 0; translate: 0 18px; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes type    { from { width: 0; } }
@keyframes blink   { 50% { opacity: 0; } }
@keyframes spin    { to { rotate: 360deg; } }
@keyframes ping    { 75%, 100% { scale: 2.6; opacity: 0; } }
@keyframes drift   { to { translate: 0 -18px; rotate: calc(var(--r, 0deg) * -1); } }
@keyframes glow    { to { filter: hue-rotate(-25deg); scale: 1.08; } }
