/* ==========================================================================
   Loki.Ge — landing page (requires base.css)
   ========================================================================== */

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 247, 250, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(17, 29, 66, .4); }
.header__inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; }
.brand__word { font-family: var(--font-sans); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; color: var(--navy-800); line-height: 1; }
.brand__dot { color: var(--green-500); }
.brand__ge { color: var(--slate-500); }
.brand--light .brand__word { color: #fff; }
.brand--light .brand__ge { color: var(--slate-300); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a:not(.btn) {
  padding: 8px 12px; border-radius: 8px; font-size: .92rem; font-weight: 600; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.nav a:not(.btn):hover { color: var(--ink); background: rgba(17, 29, 66, .06); }
.nav__cta-mobile { display: none; }
.nav-toggle {
  display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--card); align-items: center; justify-content: center;
}
.nav-toggle .i { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--line); }

/* spreadsheet canvas */
.hero__sheet { position: absolute; inset: 0; pointer-events: none; --cw: 104px; --rh: 34px; --rw: 44px; --ch: 28px; }
.hero__corner {
  position: absolute; left: 0; top: 0; width: var(--rw); height: var(--ch);
  background: #dfe4ec; border-right: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.hero__corner::after {
  content: ""; position: absolute; right: 4px; bottom: 4px; border: 5px solid transparent;
  border-right-color: var(--slate-400); border-bottom-color: var(--slate-400);
}
.hero__cols, .hero__rows {
  position: absolute; display: flex; font-family: var(--font-mono); font-size: 12px; color: var(--slate-500);
  background: #e2e7ee;
}
.hero__cols { left: var(--rw); top: 0; right: 0; height: var(--ch); border-bottom: 1px solid var(--line-strong);
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent); mask-image: linear-gradient(90deg, #000 60%, transparent); }
.hero__cols span { flex: none; width: var(--cw); display: grid; place-items: center; border-right: 1px solid var(--line-strong); }
.hero__rows { left: 0; top: var(--ch); bottom: 0; width: var(--rw); flex-direction: column; border-right: 1px solid var(--line-strong);
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.hero__rows span { flex: none; height: var(--rh); display: grid; place-items: center; border-bottom: 1px solid var(--line-strong); }
.hero__cols .is-active, .hero__rows .is-active { background: var(--green-100); color: var(--green-700); font-weight: 700; box-shadow: inset 0 -2px 0 var(--green-500); }
.hero__rows .is-active { box-shadow: inset -2px 0 0 var(--green-500); }
.hero__grid {
  position: absolute; left: var(--rw); top: var(--ch); right: 0; bottom: 0;
  background-image:
    linear-gradient(to bottom, rgba(150, 162, 186, .28) 1px, transparent 1px),
    linear-gradient(to right, rgba(150, 162, 186, .28) 1px, transparent 1px);
  background-size: var(--cw) var(--rh);
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 70% 30%, #000 30%, transparent 78%);
}
.float-sq {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  border: 2px solid rgba(139, 149, 173, .35); border-radius: 22%;
  animation: drift 14s ease-in-out infinite; animation-delay: var(--d);
}
.float-sq--solid { border: 0; background: rgba(182, 191, 209, .35); }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(8px, -14px) rotate(8deg); }
}

.hero__inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(32px, 4vw, 56px); align-items: center;
  padding-top: clamp(72px, 9vw, 112px); padding-bottom: clamp(64px, 8vw, 104px);
  padding-left: calc(var(--gutter) + 24px);
}

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: .85rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.pill__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 4px var(--green-100); }

.fbar {
  margin-top: 22px; display: flex; align-items: stretch; max-width: 480px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
  font-family: var(--font-mono); font-size: .86rem; box-shadow: var(--shadow-sm);
}
.fbar__ref { padding: 8px 12px; min-width: 52px; text-align: center; color: var(--slate-500); border-right: 1px solid var(--line); background: #f7f9fb; }
.fbar__fx { padding: 8px 10px; color: var(--slate-400); font-style: italic; border-right: 1px solid var(--line); }
.fbar__formula { padding: 8px 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: clip; display: flex; align-items: center; min-width: 0; }
.fbar__caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 2px; background: var(--green-500); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__title { margin-top: 22px; font-size: clamp(2.5rem, 5.4vw, 4.4rem); color: var(--navy-800); }
.hero__dash { color: var(--green-500); }
.sel {
  position: relative; display: inline-block; padding: .02em .16em .04em; margin-left: -.16em; margin-top: .08em;
  background: rgba(39, 169, 111, .08);
  box-shadow: inset 0 0 0 3px var(--green-500);
}
.sel__handle {
  position: absolute; right: -6px; bottom: -6px; width: 11px; height: 11px;
  background: var(--green-500); border: 2px solid var(--bg-2);
}
.hero__lead { margin-top: 22px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 54ch; }
.hero__actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__trust { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.hero__trust li { display: inline-flex; align-items: center; gap: 8px; }
.hero__trust .i { color: var(--green-600); stroke-width: 3; width: 1em; height: 1em; }

/* hero visual */
.hero__visual { position: relative; }
.tiles {
  position: absolute; right: -56px; bottom: -104px; z-index: 0;
  display: grid; grid-template-columns: repeat(4, 46px); gap: 10px; opacity: .9;
}
.tiles span { aspect-ratio: 1; border-radius: 10px; background: #d9dee7; }
.tiles span:nth-child(-n+4) { background: var(--navy-800); }
.tiles span.ok { background: var(--green-500); position: relative; }
.tiles span.ok::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 14px; height: 7px;
  border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---------- Morph card (Excel ↔ Loki) ---------- */
.morph { position: relative; z-index: 1; }
.morph__switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; margin: 0 0 14px;
  padding: 4px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.morph__switch button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 112px; padding: 8px 16px; border: 0; border-radius: 9px; background: transparent;
  font-weight: 700; font-size: .9rem; color: var(--slate-500); transition: color .3s;
}
.morph__switch button[aria-pressed="true"] { color: #fff; }
.morph__thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 9px; background: var(--orange-500); transition: transform .45s var(--ease), background-color .45s;
}
[data-state="loki"] .morph__thumb { transform: translateX(100%); background: var(--green-500); }

.sheet {
  position: relative; background: var(--card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  overflow: hidden; transition: border-color .45s;
}
.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.sheet__title { font-weight: 700; font-size: 1rem; min-width: 0; }
.sheet__title > span { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.sheet__title img { border-radius: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.badge .i { width: 1em; height: 1em; stroke-width: 2.5; }
.badge--warn { background: var(--orange-50); color: var(--orange-600); box-shadow: inset 0 0 0 1px var(--orange-100); }
.badge--ok { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-100); }

.sheet__fbar {
  display: flex; align-items: center; gap: 0; margin: 12px 16px 0;
  border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; overflow: hidden; background: #fafbfc;
}
.sheet__ref { font-family: var(--font-mono); padding: 6px 10px; color: var(--slate-500); border-right: 1px solid var(--line); }
.sheet__fx { font-family: var(--font-mono); font-style: italic; padding: 6px 10px; color: var(--slate-400); border-right: 1px solid var(--line); }
.sheet__fbar .swap { padding: 6px 10px; }
.sheet__fbar .a { color: var(--orange-600); }
.sheet__fbar .b { color: var(--green-700); display: inline-flex; align-items: center; gap: 6px; }
.sheet__fbar .b .i { width: .95em; height: .95em; }

.sheet__table { padding: 10px 16px 16px; }
.srow {
  display: grid; grid-template-columns: 30px 1.5fr 1fr 1fr; align-items: center;
  font-size: .98rem; min-height: 50px;
  transition: grid-template-columns .5s var(--ease), background-color .45s, border-color .45s;
  border-bottom: 1px solid var(--line);
}
.srow > span { padding: 0 12px; height: 100%; display: flex; align-items: center; border-right: 1px solid var(--line); transition: border-color .45s; min-width: 0; }
.srow > span:last-child { border-right: 0; }
.srow .num { justify-content: flex-end; font-variant-numeric: tabular-nums; gap: 6px; }
.srow .rn {
  padding: 0; justify-content: center; font-family: var(--font-mono); font-size: .72rem; color: var(--slate-400);
  background: #f1f4f8; overflow: hidden; transition: opacity .3s, background-color .45s;
}
.srow--letters { min-height: 26px; font-family: var(--font-mono); font-size: .72rem; color: var(--slate-400); background: #f1f4f8; }
.srow--letters > span { justify-content: center; }
.srow--head { min-height: 38px; font-size: .82rem; color: var(--slate-500); font-weight: 600; }
.srow--head > span:nth-child(n+3) { justify-content: flex-end; }
.srow--dup { background: var(--orange-50); }
.tag {
  margin-left: 8px; font-style: normal; font-size: .72rem; font-weight: 700; color: #fff;
  background: var(--orange-600); padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.cell-err {
  font-family: var(--font-mono); font-weight: 700; color: var(--orange-600); background: var(--orange-50);
  padding: 2px 8px; border-radius: 6px; position: relative;
}
.cell-err::before {
  content: ""; position: absolute; left: 0; top: 0; border: 4px solid transparent;
  border-left-color: var(--orange-600); border-top-color: var(--orange-600); border-radius: 2px 0 0 0;
}
.tick { color: var(--green-500); stroke-width: 3; width: 0; height: 1em; opacity: 0; transform: scale(.4); transition: opacity .3s .15s, transform .4s .15s var(--ease), width .3s var(--ease), margin .3s var(--ease); margin-left: 0; }
.sheet__note {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px; background: var(--green-50); color: var(--green-700);
  font-size: .88rem; font-weight: 600; border: 1px solid var(--green-100);
}
.sheet__note .i { flex: none; }

/* swap / collapse primitives */
.swap { display: inline-grid; align-items: center; }
.swap > * { grid-area: 1 / 1; transition: opacity .35s ease, transform .4s var(--ease), visibility 0s linear 0s; }
.swap--end { justify-items: end; }
.swap > * { white-space: nowrap; }
.srow .swap .b { display: inline-flex; align-items: center; }
.swap > .b { opacity: 0; transform: translateY(8px); visibility: hidden; transition: opacity .35s ease, transform .4s var(--ease), visibility 0s linear .4s; }
[data-state="loki"] .swap > .a { opacity: 0; transform: translateY(-8px); visibility: hidden; transition: opacity .35s ease, transform .4s var(--ease), visibility 0s linear .4s; }
[data-state="loki"] .swap > .b { opacity: 1; transform: none; visibility: visible; transition: opacity .35s ease .1s, transform .4s var(--ease) .1s, visibility 0s; }

.collapse { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .5s var(--ease), opacity .35s; }
.collapse > div { overflow: hidden; min-height: 0; }
.collapse--note { grid-template-rows: 0fr; opacity: 0; }
[data-state="loki"] .collapse--dup,
[data-state="loki"] .collapse--letters { grid-template-rows: 0fr; opacity: 0; }
[data-state="loki"] .collapse--note { grid-template-rows: 1fr; opacity: 1; transition-delay: .2s; }

/* Loki state: grid lines dissolve into a clean app table */
[data-state="loki"] .srow { grid-template-columns: 0px 1.5fr 1fr 1fr; }
[data-state="loki"] .srow > span { border-right-color: transparent; }
[data-state="loki"] .srow .rn { opacity: 0; }
[data-state="loki"] .srow--head { color: var(--slate-400); }
[data-state="loki"] .tick { opacity: 1; transform: none; width: 1em; margin-left: 4px; }
[data-state="loki"] .sheet { border-color: var(--green-200); }

.xfile {
  position: relative; display: inline-block; flex: none; width: 18px; height: 22px; border-radius: 3px;
  background: linear-gradient(135deg, transparent 0 5px, var(--green-600) 5px);
  -webkit-mask: linear-gradient(225deg, transparent 5px, #000 5px); mask: linear-gradient(225deg, transparent 5px, #000 5px);
}
.xfile::after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 8px; bottom: 4px;
  background:
    linear-gradient(#fff, #fff) 0 0 / 100% 1.5px no-repeat,
    linear-gradient(#fff, #fff) 0 50% / 100% 1.5px no-repeat,
    linear-gradient(#fff, #fff) 0 100% / 100% 1.5px no-repeat,
    linear-gradient(#fff, #fff) 50% 0 / 1.5px 100% no-repeat;
  opacity: .9;
}

/* ---------- Documents marquee ---------- */
.docs { background: var(--card); border-bottom: 1px solid var(--line); }
.docs__inner { display: flex; align-items: center; gap: 28px; padding-top: 18px; padding-bottom: 18px; }
.docs__label { flex: none; font-size: .78rem; font-weight: 700; color: var(--slate-500); line-height: 1.35; padding-right: 28px; border-right: 1px solid var(--line); }
.marquee {
  position: relative; display: flex; overflow: hidden; min-width: 0; flex: 1;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; gap: 12px; padding-right: 12px; flex: none; animation: marquee 48s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track li {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); font-size: .9rem; font-weight: 600; white-space: nowrap;
}
.ext { font-family: var(--font-mono); font-size: .8em; color: var(--slate-400); margin-left: -6px; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; position: relative; }
.section--tint { background: var(--bg-2); }
.section--dark { background: var(--navy-800); color: #fff; }
.section-head { max-width: 880px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .h2 { margin-bottom: 16px; }

/* ---------- Problem ---------- */
.problem { overflow: hidden; }
.problem::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 104px 34px;
  -webkit-mask-image: radial-gradient(90% 80% at 80% 50%, #000, transparent 75%);
  mask-image: radial-gradient(90% 80% at 80% 50%, #000, transparent 75%);
}
.problem__inner { position: relative; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
.problem__intro { position: sticky; top: calc(var(--header-h) + 32px); }
.problem .h2 { color: #fff; margin-bottom: 18px; }
.callout {
  margin-top: 28px; display: flex; gap: 14px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius); background: rgba(236, 106, 50, .1);
  border: 1px solid rgba(236, 106, 50, .3); color: #ffd9c7; font-size: 1.02rem;
}
.callout .i { color: var(--orange-500); width: 1.4em; height: 1.4em; margin-top: 2px; }
.callout strong { color: #fff; }

.errors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.err {
  position: relative; padding: 22px; border-radius: var(--radius);
  background: var(--navy-700); border: 1px solid var(--navy-600);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.err:nth-child(even) { transform: translateY(28px); }
.err:hover { border-color: var(--green-400); box-shadow: 0 0 0 1px var(--green-400); }
.err:hover::after {
  content: ""; position: absolute; right: -5px; bottom: -5px; width: 9px; height: 9px;
  background: var(--green-400); border: 2px solid var(--navy-800);
}
.err__cell {
  display: flex; align-items: stretch; margin-bottom: 18px;
  border: 1px solid var(--navy-500); border-radius: 10px; overflow: hidden; background: var(--navy-900);
  font-family: var(--font-mono);
}
.err__ref { padding: 14px 12px; font-size: .78rem; color: var(--slate-400); border-right: 1px solid var(--navy-500); display: grid; place-items: center; min-width: 54px; background: rgba(255, 255, 255, .03); }
.err__val { position: relative; padding: 12px 16px; font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 700; color: var(--orange-500); letter-spacing: .02em; }
.err__val::before { content: ""; position: absolute; left: 0; top: 0; border: 6px solid transparent; border-left-color: var(--orange-500); border-top-color: var(--orange-500); }
.err h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 6px; color: #fff; }
.err p { color: var(--slate-300); font-size: .94rem; }

/* ---------- Features (bento) ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.feat { padding: 18px 18px 24px; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.feat h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.35; margin: 20px 6px 8px; }
.feat p { color: var(--ink-2); font-size: .95rem; margin: 0 6px; }
.feat__demo {
  height: 172px; padding: 18px; border-radius: 14px; background: var(--bg);
  border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 10px;
  background-image: linear-gradient(to bottom, rgba(150, 162, 186, .14) 1px, transparent 1px), linear-gradient(to right, rgba(150, 162, 186, .14) 1px, transparent 1px);
  background-size: 52px 22px;
}
.feat__demo--stack { align-items: center; gap: 6px; }
.feat__demo .arrow { color: var(--slate-400); }
.feat--accent { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.feat--accent p { color: var(--slate-300); }
.feat--accent .feat__demo { background-color: var(--navy-700); border-color: var(--navy-600);
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px); }

.mini-fbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: .82rem; flex-wrap: wrap; }
.mini-fbar__fx { font-family: var(--font-mono); font-style: italic; color: var(--slate-400); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; margin-left: auto; }
.chip .i { width: .95em; height: .95em; }
.chip--navy { background: var(--navy-800); color: #fff; }
.mini-cells { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); font-variant-numeric: tabular-nums; }
.mini-cells span { padding: 8px 12px; text-align: right; font-weight: 600; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.mini-cells span + span { border-left: 1px solid var(--line); }
.mini-cells .is-locked { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 2px var(--green-500); }
.mini-cells .i { width: .9em; height: .9em; }

.mini-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; font-weight: 600; }
.mini-row .mono { font-size: .78rem; color: var(--slate-500); }
.mini-row .ok { color: var(--green-500); stroke-width: 3; }
.mini-row--bad { background: var(--orange-50); border-color: var(--orange-200); color: var(--orange-700); }
.mini-row--bad span { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mini-row--bad .mono { color: var(--orange-600); }
.mini-row--bad .i { color: var(--orange-600); stroke-width: 3; }
.mini-msg { display: flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.mini-msg .i { width: 1em; height: 1em; stroke-width: 3; }
.mini-msg--warn { color: var(--orange-600); }
.mini-msg--ok { color: var(--green-400); }
.mini-label { font-size: .78rem; font-weight: 600; color: var(--slate-500); }
.mini-input { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--card); border-radius: 8px; border: 1.5px solid var(--line-strong); }
.mini-input--bad { border-color: var(--orange-500); box-shadow: 0 0 0 4px var(--orange-50); color: var(--ink); }
.mini-input .i { color: var(--orange-500); }
.mini-log { display: grid; gap: 8px; }
.mini-log li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; }
.mini-log time { font-family: var(--font-mono); font-size: .72rem; color: var(--slate-400); }
.ava { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 700; background: var(--navy-800); color: #fff; }
.ava--g { background: var(--green-500); }
.ava--o { background: var(--orange-500); }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.mini-heads { display: grid; grid-template-columns: repeat(4, auto); gap: 0; border: 1px solid var(--navy-500); border-radius: 8px; overflow: hidden; font-size: .74rem; font-weight: 600; }
.mini-heads span { padding: 8px 6px; text-align: center; background: var(--navy-900); color: var(--slate-300); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-heads span + span { border-left: 1px solid var(--navy-500); }

/* ---------- Process ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 24px; right: 24px; top: 46px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 16px);
}
.step { position: relative; padding: 24px; background: var(--card); border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.step__ref {
  position: absolute; top: 14px; right: 16px; font-family: var(--font-mono); font-size: .75rem; font-weight: 700;
  color: var(--slate-400); padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg);
}
.step__icon {
  position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--navy-800); color: #fff; margin-bottom: 18px; box-shadow: 0 0 0 6px var(--card);
}
.step:last-child .step__icon { background: var(--green-500); }
.step h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: .94rem; }

/* ---------- Portfolio (workbook) ---------- */
.workbook {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl);
  box-shadow: var(--shadow); overflow: hidden;
}
.workbook__tabs {
  display: flex; align-items: flex-end; gap: 4px; padding: 10px 16px 0; background: var(--bg-2);
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.workbook__tabs::-webkit-scrollbar { display: none; }
.wtab {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 12px 18px; border: 1px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0;
  background: transparent; font-weight: 700; font-size: .92rem; color: var(--slate-500);
  position: relative; top: 1px; transition: background-color .2s, color .2s;
}
.wtab:hover { color: var(--ink); background: rgba(255, 255, 255, .55); }
.wtab[aria-selected="true"] { background: var(--card); color: var(--ink); border-color: var(--line); }
.wtab[aria-selected="true"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--green-500); }
.wtab[aria-selected="true"] .i { color: var(--green-600); }
.wtab--add { color: var(--slate-400); font-weight: 400; font-size: 1.2rem; padding: 8px 14px; cursor: default; }
.wtab--add:hover { background: transparent; color: var(--slate-400); }

.workbook__fbar {
  display: flex; align-items: center; border-bottom: 1px solid var(--line); font-size: .84rem; background: #fbfcfd;
}
.workbook__fbar .fbar__ref, .workbook__fbar .fbar__fx { padding: 8px 14px; font-family: var(--font-mono); }
.workbook__fbar .mono { padding: 8px 14px; color: var(--ink-2); }

.wpanel { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; padding: clamp(20px, 3vw, 36px); }
.wpanel[hidden] { display: none; }
.wpanel.is-entering { animation: panelIn .45s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.shot {
  display: block; border-radius: 16px; overflow: hidden; background: var(--navy-800);
  box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s;
}
.shot:hover { transform: translateY(-4px) rotate(-.25deg); box-shadow: var(--shadow-lg); }
.shot__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #eef1f5; border-bottom: 1px solid var(--line); }
.shot__bar i { width: 10px; height: 10px; border-radius: 50%; background: #d1d7e1; }
.shot__bar span {
  margin-left: 10px; flex: 1; max-width: 320px; padding: 3px 12px; border-radius: 6px; background: var(--card);
  font-family: var(--font-mono); font-size: .72rem; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; background: var(--bg); }

.wpanel__num { font-size: .8rem; color: var(--slate-400); margin-bottom: 10px; }
.wpanel__body .h3 { margin-bottom: 12px; }
.wpanel__body > p:not(.wpanel__num) { color: var(--ink-2); }
.ticks { margin: 20px 0 26px; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; font-size: .95rem; font-weight: 500; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 6px;
  background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b8f5c' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: inset 0 0 0 1px var(--green-100);
}
.wpanel__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- FAQ ---------- */
.faq__inner { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.faq__intro { position: sticky; top: calc(var(--header-h) + 32px); }
.faq__intro .h2 { margin-bottom: 16px; }
.faq__intro .btn { margin-top: 26px; }
.faq__list { display: grid; gap: 12px; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s, box-shadow .2s; }
.qa[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.qa summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; font-weight: 700; font-size: 1.02rem;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { color: var(--slate-500); transition: transform .3s var(--ease), color .2s; }
.qa[open] summary .i { transform: rotate(45deg); color: var(--green-600); }
.qa p { padding: 0 22px 22px; color: var(--ink-2); max-width: 66ch; }

/* ---------- CTA ---------- */
.cta { background: var(--navy-800); color: #fff; position: relative; overflow: hidden; padding: clamp(64px, 9vw, 112px) 0; }
.cta::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(to right, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 104px 34px;
  -webkit-mask-image: radial-gradient(70% 100% at 20% 50%, #000, transparent 80%);
  mask-image: radial-gradient(70% 100% at 20% 50%, #000, transparent 80%);
}
.cta::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 192, 138, .28), transparent 65%);
}
.cta__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.cta .h2 { color: #fff; margin-bottom: 14px; }
.cta__actions { display: grid; gap: 12px; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-950); color: var(--slate-300); padding: 64px 0 28px; font-size: .92rem; }
.footer__inner { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer__brand p { margin-top: 16px; max-width: 40ch; color: var(--slate-400); }
.footer__nav { display: flex; flex-direction: column; gap: 10px; }
.footer__nav a { color: var(--slate-300); transition: color .2s; width: fit-content; }
.footer__nav a:hover { color: #fff; }
.footer__h { font-family: var(--font-mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--slate-500); margin-bottom: 4px; }
.footer__bottom { position: relative; margin-top: 48px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--slate-500); font-size: .84rem; }

.footer__bottom::before { content: ""; position: absolute; top: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: rgba(255, 255, 255, .08); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .err.reveal:nth-child(even) { transform: translateY(46px); }
.js .err.reveal.is-in:nth-child(even) { transform: translateY(28px); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .nav a:not(.btn) { padding: 8px 9px; font-size: .88rem; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps::before { display: none; }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .header__cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; left: 0; right: 0; top: var(--header-h); margin: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px -20px rgba(17, 29, 66, .35);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform .25s var(--ease), opacity .25s, visibility 0s .25s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; transition: transform .25s var(--ease), opacity .25s; }
  .nav a:not(.btn) { padding: 12px; font-size: 1rem; }
  .nav__cta-mobile { display: inline-flex; margin-top: 8px; min-height: 48px; }

  .hero__inner { grid-template-columns: minmax(0, 1fr); padding-left: calc(var(--gutter) + 20px); }
  .hero__visual { max-width: 560px; }
  .problem__inner, .faq__inner, .cta__inner { grid-template-columns: minmax(0, 1fr); }
  .problem__intro, .faq__intro { position: static; }
  .wpanel { grid-template-columns: minmax(0, 1fr); }
  .footer__inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .hero__sheet { --rw: 22px; --cw: 72px; --rh: 30px; --ch: 22px; }
  .hero__rows span { font-size: 9px; }
  .hero__cols span { font-size: 10px; }
  .hero__inner { padding-left: calc(var(--gutter) + 12px); padding-right: calc(var(--gutter) - 4px); }
  .fbar { font-size: .76rem; }
  .hero__actions .btn { width: 100%; }
  .tiles { display: none; }
  .morph__switch button { min-width: 0; }
  .srow { font-size: .88rem; grid-template-columns: 22px 1.2fr 1fr 1.2fr; min-height: 46px; }
  [data-state="loki"] .srow { grid-template-columns: 0px 1.2fr 1fr 1.2fr; }
  .srow--head { font-size: .72rem; }
  .srow--dup > span:nth-child(2) { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; }
  .srow--dup .tag { margin-left: 0; }
  .srow > span { padding: 0 8px; }
  .sheet__head { padding: 14px 14px; flex-wrap: wrap; }
  .sheet__title { font-size: .92rem; }
  .sheet__table { padding: 8px 10px 12px; }
  .sheet__fbar { margin: 10px 10px 0; }
  .tag { margin-left: 6px; font-size: .66rem; padding: 2px 6px; }
  .docs__inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .docs__label { border-right: 0; padding-right: 0; }
  .docs__label br { display: none; }
  .errors { grid-template-columns: 1fr; }
  .err:nth-child(even), .js .err.reveal.is-in:nth-child(even) { transform: none; }
  .js .err.reveal:nth-child(even) { transform: translateY(18px); }
  .bento, .steps { grid-template-columns: 1fr; }
  .wtab { padding: 10px 14px; font-size: .86rem; }
  .wpanel__actions .btn { flex: 1; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .marquee__track { animation: none; }
  .marquee { overflow-x: auto; }
  .js .reveal { opacity: 1; transform: none; }
}
