/* ============================================================
   Cumulus — Reset + Layout shell
   ============================================================ */

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

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

body {
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Paper texture: subtle grain + soft top vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 12% -8%, rgba(15, 178, 194, 0.07), transparent 60%),
    radial-gradient(90% 70% at 100% 0%, rgba(226, 152, 47, 0.05), transparent 55%),
    var(--paper);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* --- App root --- */
#app { min-height: 100vh; }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: rgba(244, 241, 233, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.brand__name span { color: var(--accent-deep); }
.brand__tag {
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  border-left: 1px solid var(--line-strong);
  padding-left: 12px;
  margin-left: 2px;
}
.topbar__spacer { flex: 1; }

.wf-name {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  max-width: 360px;
}
.wf-name svg { width: 15px; height: 15px; color: var(--faint); flex: none; }
.wf-name input {
  border: none;
  background: none;
  font-size: var(--t-sm);
  font-weight: 600;
  width: 240px;
  letter-spacing: -0.01em;
}
.wf-name input:focus { outline: none; }
.wf-name__hint { font-size: var(--t-2xs); color: var(--faint); }

.topbar__meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--muted);
}
.topbar__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-2), var(--accent-deep));
  color: #fff; font-size: var(--t-xs); font-weight: 700;
  display: grid; place-items: center;
  letter-spacing: 0.02em;
}

/* ============================================================
   WIZARD GRID
   ============================================================ */
.wizard {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--info-w);
  gap: 0;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar-h));
  align-items: stretch;
}

/* --- Left rail / stepper --- */
.rail {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 26px 20px 26px 22px;
  border-right: 1px solid var(--line);
}
.rail__title {
  font-size: var(--t-2xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin-bottom: 18px;
  padding-left: 6px;
}

/* --- Center content --- */
.content {
  padding: 34px clamp(24px, 3.2vw, 52px) calc(var(--footer-h) + 36px);
  min-width: 0;
  position: relative;
}
.content__inner { max-width: 760px; }

/* --- Right info panel --- */
.info {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.5), rgba(251,249,243,0.2)),
    var(--surface-sunk);
  padding: 28px 24px 40px;
}

/* ============================================================
   FOOTER NAV
   ============================================================ */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 clamp(24px, 3vw, 52px);
  background: rgba(244, 241, 233, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--line);
}
.footer__progress { flex: 1; display: flex; flex-direction: column; gap: 7px; max-width: 420px; }
.footer__progress-track {
  height: 5px; border-radius: var(--r-pill);
  background: var(--paper-2);
  overflow: hidden;
}
.footer__progress-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width var(--dur-slow) var(--ease-out);
}
.footer__progress-label {
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex; justify-content: space-between;
}
.footer__actions { display: flex; align-items: center; gap: 12px; }

/* ============================================================
   LAUNCHER (landing)
   ============================================================ */
.launcher {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 92px) clamp(24px, 5vw, 64px) 80px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.launcher__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-tint);
  padding: 6px 13px;
  border-radius: var(--r-pill);
  margin-bottom: 26px;
}
.launcher__eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.launcher h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-display);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  margin-bottom: 22px;
}
.launcher h1 em {
  font-style: italic;
  color: var(--accent-deep);
}
.launcher__lede {
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 30em;
  margin-bottom: 34px;
}
.launcher__cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.launcher__stats {
  display: flex; gap: 30px; margin-top: 46px;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.launcher__stat .n {
  font-family: var(--font-mono);
  font-size: 1.5rem; font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.launcher__stat .l {
  font-size: var(--t-xs); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}

/* Launcher visual card — a stylised "workflow" preview */
.launcher__visual {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 26px;
  overflow: hidden;
}
.launcher__visual::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(110% 60% at 90% -10%, var(--accent-tint), transparent 60%);
  opacity: 0.7;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  :root { --info-w: 0px; }
  .wizard { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .info { display: none; }
}
@media (max-width: 860px) {
  :root { --rail-w: 0px; }
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .launcher { grid-template-columns: 1fr; padding-top: 48px; }
  .launcher__visual { order: -1; }
  .wf-name { display: none; }
}
