@import url('assets/fonts/fonts.css');

/* ============================================================
   Looper — landing page. Very Fantastic / Kiln palette.
   Flat. Warm. No gradients (brand rule #5).
   ============================================================ */
:root {
  --primary: #d94f30;
  --secondary: #2e5eaa;
  --accent: #f2c744;
  --surface: #f8f4ed;
  --dark: #181820;
  --tonal-light: #e8845e;
  --tonal-dark: #b83e22;

  --ink: #181820;
  --ink-70: #18182099;
  --ink-50: #18182080;
  --ink-30: #1818204d;
  --ink-15: #18182026;
  --ink-08: #18182014;

  /* light ink for dark surfaces */
  --paper-70: #f8f4edc4;
  --paper-50: #f8f4ed85;
  --paper-15: #f8f4ed28;
  --paper-08: #f8f4ed14;

  --maxw: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --display: 'Righteous', system-ui, sans-serif;
  --body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- shared type ---- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.eyebrow.muted { color: var(--ink-50); }
.eyebrow.on-dark { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: currentColor;
  display: inline-block;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.005em; }
h2.section-title {
  font-size: clamp(2.1rem, 4.8vw, 3.6rem);
  line-height: 1.02;
  margin: 0 0 22px;
  max-width: 18ch;
  text-wrap: balance;
}
.lead { font-size: clamp(1.05rem, 1.8vw, 1.32rem); line-height: 1.55; color: var(--ink-70); max-width: 52ch; }
.lead.on-dark { color: var(--paper-70); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
section { padding-block: clamp(72px, 11vw, 150px); }

/* ---- buttons ---- */
.btn {
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid var(--dark);
  background: var(--dark);
  color: var(--surface);
  padding: 14px 26px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--surface); box-shadow: 0 4px 0 var(--tonal-dark); }
.btn.primary:hover { box-shadow: 0 6px 0 var(--tonal-dark); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink-15); box-shadow: none; }
.btn.ghost:hover { border-color: var(--dark); }
.btn.on-dark { background: var(--surface); border-color: var(--surface); color: var(--dark); }
.btn.big { font-size: 1.08rem; padding: 17px 34px; border-radius: 16px; }

/* ---- stepping-bars glyph motif ---- */
.bars { display: inline-flex; flex-direction: column; gap: 3px; }
.bars > i { display: block; height: 4px; border-radius: 2px; background: var(--primary); }
.bars > i:nth-child(1) { width: 22px; }
.bars > i:nth-child(2) { width: 16px; }
.bars > i:nth-child(3) { width: 10px; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background .2s ease;
}
.nav.scrolled { border-bottom-color: var(--ink-15); }
.nav-inner { display: flex; align-items: center; gap: 26px; height: 70px; }
.nav .logo { height: 26px; }
.nav .logo img { height: 100%; width: auto; }
.nav-links { display: flex; gap: 26px; margin-left: 14px; }
.nav-links a { font-size: 0.95rem; font-weight: 500; color: var(--ink-70); transition: color .12s ease; }
.nav-links a:hover { color: var(--ink); }
.nav-spacer { flex: 1; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav .btn { padding: 10px 20px; font-size: 0.95rem; border-radius: 11px; }
.nav-ghost-link { font-size: 0.95rem; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 860px) { .nav-links { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(60px, 8vw, 104px); padding-bottom: clamp(40px, 7vw, 80px); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 {
  font-size: clamp(2.7rem, 5.6vw, 4.9rem);
  line-height: 0.98;
  margin: 0 0 26px;
  letter-spacing: 0.004em;
  text-wrap: balance;
}
.hero h1 .hl { color: var(--primary); position: relative; white-space: nowrap; }
.hero h1 .hl::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.08em; height: 0.14em;
  background: var(--accent); z-index: -1; border-radius: 3px;
}
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.hero-meta {
  margin-top: 26px; font-family: var(--mono); font-size: 0.78rem; color: var(--ink-50);
  letter-spacing: 0.02em; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center;
}
.hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-30); }
.hero-meta > span:not(.dot) { white-space: nowrap; }

/* badge sticker */
.sticker {
  position: absolute; top: 18px; right: calc(var(--pad) + 6px); z-index: 5;
  background: var(--accent); color: var(--dark);
  font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 10px 14px; border-radius: 12px;
  transform: rotate(7deg); border: 2px solid var(--dark);
  line-height: 1.25; text-align: center;
}
@media (max-width: 980px) { .sticker { display: none; } }

/* ---- app window frame ---- */
.window {
  border-radius: 16px; overflow: hidden; background: var(--surface);
  border: 1px solid var(--ink-15);
  box-shadow: 0 30px 60px -28px rgba(24,24,32,0.42), 0 4px 14px -6px rgba(24,24,32,0.18);
}
.window-bar {
  height: 40px; display: flex; align-items: center; gap: 14px; padding: 0 15px;
  background: #ece6db; border-bottom: 1px solid var(--ink-15);
}
.window-dots { display: flex; gap: 7px; }
.window-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--ink-15); }
.window-dots i:nth-child(1) { background: var(--primary); }
.window-title { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-50); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window image-slot, .window .shot { display: block; width: 100%; }
.hero .window image-slot { height: 400px; }

/* ============================================================
   HERO FILE-TREE ANIMATION
   ============================================================ */
.tree {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1;
  background: var(--surface);
  padding: 16px 16px 18px;
  min-height: 476px;
  position: relative;
  overflow: hidden;
}
.t-row {
  display: flex; align-items: center;
  height: 0; opacity: 0; transform: translateX(-7px);
  overflow: hidden; white-space: pre;
  transition: height .34s ease, opacity .34s ease, transform .34s ease;
}
.t-row.show { height: 22px; opacity: 1; transform: none; }
.t-row.root { height: 22px; opacity: 1; transform: none; margin-bottom: 2px; }
.t-connector { color: var(--ink-30); white-space: pre; flex: 0 0 auto; }
.t-icon { width: 16px; height: 16px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; margin: 0 7px 0 1px; color: var(--ink-50); }
.t-icon svg { width: 14px; height: 14px; display: block; }
.t-name { color: var(--ink); font-weight: 500; }
.t-row.file .t-name { color: var(--ink-70); font-weight: 400; }
.t-row.file .t-icon { color: var(--secondary); opacity: .55; }
.t-arrow { color: var(--ink-30); padding: 0 2px; }
.t-target { color: var(--ink-30); }

/* knowledge-base subtree — built by Looper, gets a warm band */
.t-row.kb { background: #d94f3010; }
.t-row.kbroot .t-name { color: var(--primary); }
.t-row.kbroot .t-icon { color: var(--primary); opacity: 1; }
.t-row.kb.file .t-icon { color: var(--primary); opacity: .8; }

/* symlinks — secondary (links), drop in with a boom; collapsed until then */
.t-row.symlink .t-icon, .t-row.symlink .t-name { color: var(--secondary); }
.t-row.symlink.show { height: 0; opacity: 0; }
.t-row.symlink.boom { height: 22px; opacity: 1; animation: kbboom .55s cubic-bezier(.2,1.35,.45,1) both; }
@keyframes kbboom {
  0%   { opacity: 0; transform: translateY(-9px) scale(.92); }
  55%  { opacity: 1; transform: translateY(2px) scale(1.05); }
  100% { opacity: 1; transform: none; }
}
.t-row.symlink.boom .t-icon { animation: kbflash .6s ease; }
@keyframes kbflash { 0%,100% { color: var(--secondary); } 40% { color: var(--accent); } }

/* AI sparkle + word pop */
.t-sparkle {
  width: 0; opacity: 0; margin-left: 9px; color: var(--primary);
  display: inline-flex; align-items: center; flex: 0 0 auto;
  transform: scale(.3) rotate(-40deg);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,1.4,.4,1);
}
.t-sparkle svg { width: 13px; height: 13px; }
.t-row.sparkle-on .t-sparkle { width: 13px; opacity: 1; transform: scale(1) rotate(0); animation: sparklePulse 1.7s ease-in-out .4s infinite; }
@keyframes sparklePulse { 0%,100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.22) rotate(10deg); } }
.t-word {
  margin-left: 9px; font-size: 10.5px; font-weight: 500; padding: 2px 9px; border-radius: 20px;
  white-space: nowrap; flex: 0 0 auto;
  opacity: 0; transform: translateX(-10px) scale(.8);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2,1.35,.4,1);
}
.t-word.primary { background: var(--primary); color: var(--surface); }
.t-word.secondary { background: var(--secondary); color: var(--surface); }
.t-word.accent { background: var(--accent); color: var(--dark); }
.t-row.word-on .t-word { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .t-row, .t-sparkle, .t-word { transition: none; }
  .t-row.symlink.boom, .t-row.sparkle-on .t-sparkle { animation: none; }
}

/* ============================================================
   PROBLEM (dark inverted band)
   ============================================================ */
.band-dark { background: var(--dark); color: var(--surface); }
.band-dark .section-title { color: var(--surface); }
.problem-head { max-width: 60ch; }
.problem-quips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; }
.quip {
  border: 1px solid var(--paper-15); border-radius: 16px; padding: 26px 24px;
  background: #20202b;
}
.quip .n { font-family: var(--display); font-size: 1.7rem; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.quip p { margin: 0; color: var(--paper-70); font-size: 1.02rem; line-height: 1.45; }
@media (max-width: 760px) { .problem-quips { grid-template-columns: 1fr; } }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 56px; }
.step { position: relative; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 15px;
  background: #d94f3014; margin-bottom: 22px; position: relative;
}
.step-num svg { width: 26px; height: 26px; color: var(--primary); }
.step.s .step-num { background: #2e5eaa14; }
.step.s .step-num svg { color: var(--secondary); }
.step.s .step-num .count { background: var(--secondary); }
/* pipeline connector chevrons */
.steps.pipeline .step:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; right: -22px; width: 15px; height: 15px;
  border-top: 2px solid var(--ink-30); border-right: 2px solid var(--ink-30);
  transform: rotate(45deg); border-radius: 2px;
}
.step-num .count {
  position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: var(--surface); font-family: var(--mono); font-size: 0.72rem;
  display: flex; align-items: center; justify-content: center; font-weight: 500;
}
.step h3 { font-size: 1.45rem; margin: 0 0 10px; }
.step p { margin: 0; color: var(--ink-70); font-size: 1.02rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 36px; } .steps.pipeline .step:not(:last-child)::after { display: none; } }

/* pattern callouts (specs-only + enrichment) */
.patterns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 40px; }
.pattern { border: 1px solid var(--ink-15); border-left: 3px solid var(--secondary); border-radius: 14px; padding: 24px 26px; background: var(--surface); }
.pattern.enrich { border-left-color: var(--primary); }
.pattern-tag { display: inline-block; font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--secondary); margin-bottom: 12px; }
.pattern.enrich .pattern-tag { color: var(--primary); }
.pattern h3 { font-size: 1.3rem; margin: 0 0 9px; }
.pattern p { margin: 0; color: var(--ink-70); font-size: 1rem; line-height: 1.5; }
@media (max-width: 760px) { .patterns { grid-template-columns: 1fr; } }

/* ============================================================
   FEATURES
   ============================================================ */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 56px; }
.feature {
  border: 1px solid var(--ink-15); border-radius: 18px; padding: 30px 28px; background: var(--surface);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.feature:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -24px rgba(24,24,32,0.4); border-color: var(--ink-30); }
.feature .ficon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: var(--surface); margin-bottom: 20px;
}
.feature.s .ficon { background: var(--secondary); }
.feature.a .ficon { background: var(--accent); color: var(--dark); }
.feature .ficon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.28rem; margin: 0 0 9px; }
.feature p { margin: 0; color: var(--ink-70); font-size: 0.98rem; line-height: 1.48; }
@media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }

/* ============================================================
   SHOWCASE (alternating)
   ============================================================ */
.showcase-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.showcase-row + .showcase-row { margin-top: clamp(64px, 9vw, 120px); }
.showcase-row.flip .showcase-copy { order: 2; }
.showcase-row .window image-slot { height: 360px; }
.showcase-copy h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 16px; line-height: 1.05; }
.showcase-copy p { color: var(--ink-70); font-size: 1.08rem; margin: 0 0 18px; max-width: 44ch; }
.ticklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.ticklist li { display: flex; gap: 11px; align-items: flex-start; font-size: 1rem; color: var(--ink-70); }
.ticklist svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; color: var(--primary); }
@media (max-width: 820px) {
  .showcase-row, .showcase-row.flip { grid-template-columns: 1fr; }
  .showcase-row.flip .showcase-copy { order: 0; }
}

/* ============================================================
   GEMINI KEY (brand moment)
   ============================================================ */
.gemini { background: var(--dark); color: var(--surface); }
.gemini .section-title { color: var(--surface); }
.gemini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 5vw, 72px); align-items: center; }
.gemini .lead { color: var(--paper-70); margin-bottom: 24px; }
.gemini .fineprint { font-family: var(--mono); font-size: 0.82rem; color: var(--paper-50); line-height: 1.6; max-width: 46ch; }
.key-card {
  background: var(--surface); border-radius: 18px; padding: 26px; color: var(--ink);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.6);
  transform: rotate(-1.4deg);
}
.key-card .key-img { border-radius: 10px; overflow: hidden; border: 1px solid var(--ink-15); }
.key-card .key-cap { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-50); margin-top: 14px; display: flex; align-items: center; gap: 8px; }
.key-card .key-cap .led { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); }
@media (max-width: 820px) { .gemini-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FAQ
   ============================================================ */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 40px; margin-top: 48px; }
.faq-item { border-top: 1px solid var(--ink-15); padding-top: 22px; }
.faq-item h3 { font-family: var(--body); font-weight: 700; font-size: 1.12rem; margin: 0 0 9px; letter-spacing: 0; }
.faq-item p { margin: 0; color: var(--ink-70); font-size: 1rem; line-height: 1.5; }
.faq-item code { font-family: var(--mono); font-size: 0.86em; background: var(--ink-08); padding: 1px 6px; border-radius: 5px; }
@media (max-width: 720px) { .faq-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FINAL CTA (primary brand band)
   ============================================================ */
.cta-band { background: var(--primary); color: var(--surface); text-align: center; }
.cta-band h2 { font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 0.98; margin: 0 auto 28px; max-width: 16ch; color: var(--surface); text-wrap: balance; }
.cta-band .btn.on-dark { box-shadow: 0 5px 0 var(--tonal-dark); }
.cta-band .btn.on-dark:hover { box-shadow: 0 7px 0 var(--tonal-dark); }
.cta-sub { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.08em; color: var(--paper-70); margin-top: 22px; text-transform: uppercase; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--dark); color: var(--paper-70); padding-block: 64px 40px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; align-items: flex-start; }
.footer .logo img { height: 28px; }
.footer-tag { margin-top: 18px; max-width: 38ch; font-size: 0.96rem; color: var(--paper-50); line-height: 1.5; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-50); margin: 0 0 16px; font-weight: 500; }
.footer-col a { display: block; color: var(--paper-70); font-size: 0.96rem; margin-bottom: 11px; transition: color .12s; }
.footer-col a:hover { color: var(--surface); }
.footer-bottom { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--paper-15); display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-bottom .swatches { display: flex; gap: 6px; }
.footer-bottom .swatches i { width: 16px; height: 16px; border-radius: 4px; }
.footer-bottom small { font-family: var(--mono); font-size: 0.74rem; color: var(--paper-50); letter-spacing: 0.02em; }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .btn:hover, .feature:hover { transform: none; }
}
