/* NextG Design — "Editorial" direction (warm paper, ink, serif, polaroids).
   Loaded after site.css (+ home.css / landing.css) and re-themes them.
   Default = paper edition; [data-theme="dark"] = night edition. */

:root, :root[data-theme="light"] {
  --bg: #f4efe6;
  --bg-2: #ebe4d6;
  --surface: #fffdf8;
  --surface-2: #f8f2e7;
  --line: #ddd3c1;
  --line-strong: #1c1917;
  --text: #1c1917;
  --muted: #57534e;
  --primary: #c2410c;
  --accent: #c2410c;
  --ink: #1c1917;
  --paper: #f4efe6;
  --grad: linear-gradient(120deg, #c2410c, #ea580c);
  --grad-cool: linear-gradient(120deg, #1c1917, #44403c);
  --shadow: 0 30px 40px -24px rgba(60, 40, 20, 0.45), 0 2px 6px rgba(60, 40, 20, 0.12);
  --radius: 6px;
  --radius-sm: 4px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #171310;
  --bg-2: #1f1a15;
  --surface: #221c17;
  --surface-2: #2a231c;
  --line: #3b3229;
  --line-strong: #f1ead9;
  --text: #f1ead9;
  --muted: #b5ab99;
  --primary: #fb923c;
  --accent: #fb923c;
  --ink: #f1ead9;
  --paper: #171310;
  --grad: linear-gradient(120deg, #fb923c, #f97316);
  --shadow: 0 30px 40px -24px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

body { background: var(--bg); font-family: var(--font-body); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.03em; }
:focus-visible { outline-color: var(--accent); }

/* Paper grain instead of neon aurora */
.aurora { display: none; }
.grain {
  inset: 0; opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .grain { opacity: 0.5; mix-blend-mode: screen; }

/* Accents: serif italic in rust instead of gradients */
.grad-text { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--accent); font-style: italic; }

/* ---------- Header ---------- */
.site-top { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line-strong); }
.logo { font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.logo-word em { font: italic 600 1.35rem var(--font-display); margin-right: 2px; }
.logo-mark { background: var(--ink); border-radius: 50%; box-shadow: none; }
.logo-mark svg { stroke: var(--paper) !important; }
.nav a { color: var(--muted); font-weight: 500; border-radius: 0; }
.nav a:hover { color: var(--text); background: none; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); }
.nav .nav-cta, .nav .nav-cta:hover { background: var(--ink); color: var(--paper); border-radius: 999px; box-shadow: none; text-decoration: none; filter: none; }
.icon-btn { background: transparent; border-color: var(--line); }
.icon-btn:hover { border-color: var(--ink); }
@media (max-width: 920px) { .nav { background: var(--surface); border-color: var(--line); border-radius: 10px; } }

/* ---------- Buttons & small parts ---------- */
.btn-primary, .btn-primary:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.btn-primary:hover { transform: translate(var(--mx), calc(var(--my) - 2px)); }
.btn-ghost { background: transparent; border: 1px solid var(--ink); color: var(--text); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.link-u { color: var(--text); font: italic 500 1.15rem var(--font-display); text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--accent); align-self: center; }
.eyebrow { color: var(--text); letter-spacing: 0.16em; font-weight: 600; }
.eyebrow .dot { background: var(--accent); animation: none; box-shadow: none; }
.chip { border-radius: 999px; background: transparent; border-color: var(--line); color: var(--muted); }
.chip-ai { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.card { background: var(--surface); border-color: var(--line); border-radius: var(--radius); }
.card::before { background: radial-gradient(420px circle at var(--sx) var(--sy), rgba(194, 65, 12, 0.07), transparent 60%); }
a.card:hover, a.card:focus-visible { border-color: var(--ink); }

/* ---------- Hero ---------- */
.hero::before { display: none; }
.hero { padding-top: clamp(28px, 4vw, 56px); }
.hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
.ed-title { font-size: clamp(3rem, 6.2vw, 5.6rem); line-height: 0.98; margin: 26px 0 26px; }
.ed-title i { color: var(--accent); font-weight: 400; }
.ed-title .line { display: block; overflow: hidden; padding-bottom: 0.12em; margin-bottom: -0.12em; }
.ed-title .line > span { display: inline-block; animation: edRise 1.1s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 120ms + 200ms); }
@keyframes edRise { from { transform: translateY(108%); } }
.hero-sub { color: var(--muted); }
.hero-ctas { align-items: center; gap: 22px; }
.hero-facts .ico { color: var(--accent); }

/* Polaroid stack: two still prints behind the live lens print */
.hero-prints { position: relative; min-height: 600px; margin-bottom: 40px; }
.print {
  position: absolute; margin: 0; background: #fffdf8; padding: 12px 12px 54px;
  box-shadow: 0 30px 40px -24px rgba(60, 40, 20, 0.45), 0 2px 6px rgba(60, 40, 20, 0.12);
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] .print { background: #efe7d6; box-shadow: 0 30px 50px -24px rgba(0, 0, 0, 0.8); }
.print .ph { aspect-ratio: 4 / 3.3; overflow: hidden; background: #ddd; }
.print .ph svg { display: block; width: 100%; height: 100%; }
.print figcaption, .print .lens-hint { font: 700 1.55rem var(--font-hand); color: #292524; }
.print-back figcaption { position: absolute; bottom: 12px; left: 16px; }
.print-back { width: 44%; animation: dropIn 1s cubic-bezier(.2, .9, .25, 1.2) both; }
.p-a { left: 0; top: 12px; transform: rotate(-7deg); animation-delay: 0.3s; }
.p-b { right: 0; top: 330px; transform: rotate(5deg); animation-delay: 0.5s; }
.print-back:hover { transform: rotate(0deg) translateY(-8px) scale(1.03); z-index: 6; }
.tape { position: absolute; width: 90px; height: 26px; background: rgba(250, 204, 21, 0.55); top: -12px; left: 38%; transform: rotate(-4deg); z-index: 2; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-60px) rotate(-14deg) scale(1.1); } }

/* The live lens as the front print */
.lens-stage.print-main, .lens-stage.print { position: relative; z-index: 3; width: 78%; margin: 70px auto 0; padding: 14px 14px 18px; transform: rotate(-1.5deg); animation: dropIn 1s cubic-bezier(.2, .9, .25, 1.2) 0.7s both; }
.lens-stage.print .lens-svg { border-radius: 0; box-shadow: none; }
.lens-stage.print .lens-controls { margin-top: 10px; flex-direction: column; align-items: flex-start; gap: 8px; }
.lens-stage.print .lens-hint { font-size: 1.45rem; color: #292524; }
.lens-modes button { min-height: 40px; background: transparent; border: 1px solid #d6cbb6; color: #292524; font-family: var(--font-body); }
.lens-modes button:hover { border-color: #1c1917; }
.lens-modes button[aria-pressed="true"] { background: #1c1917; color: #fffdf8; border-color: #1c1917; }
.note { position: absolute; z-index: 5; font: 700 1.7rem var(--font-hand); color: var(--accent); animation: fadeNote 0.6s ease 1.6s both; pointer-events: none; }
.note svg { position: absolute; overflow: visible; }
.note path { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-dasharray: 220; animation: drawLine 1s ease 1.8s both; }
@keyframes drawLine { from { stroke-dashoffset: 220; } }
@keyframes fadeNote { from { opacity: 0; } }
.n1 { right: 0; top: 18px; } .n1 svg { left: -80px; top: 30px; width: 90px; height: 70px; }
.n2 { right: -8px; bottom: -38px; } .n2 svg { left: -104px; top: -52px; width: 110px; height: 60px; }

/* ---------- Sections ---------- */
.section-head h2 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); }
.section { border-top: 1px solid var(--line); }
.hero + .section { border-top: 1px solid var(--line-strong); }
.proof-diagram { color: var(--text); }
.proof-diagram .p-flow { stroke: var(--accent); }

/* Bento cards: each visual sits like a print with a white border */
.b-visual { background: #fffdf8; padding: 8px; border-radius: 2px; box-shadow: 0 10px 20px -14px rgba(60, 40, 20, 0.5); }
.b-visual > svg { border-radius: 0; }
.b-erase .b-visual svg { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
.b-text h3 { font-weight: 400; }
.b-text h3 .ico { color: var(--accent); }
.b-link { font-family: var(--font-display); font-style: italic; font-weight: 500; text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--accent); }
.b-bars { background: #fffdf8; }
.b-bars i { background: linear-gradient(180deg, #c2410c, #1c1917); }
.b-strip { background: #fffdf8; }
.also li { background: transparent; border-color: var(--line); }
.also .ico { color: var(--accent); }

/* Tools */
.tool-group > h3 { font-family: var(--font-body); color: var(--text); border-bottom: 1px solid var(--line-strong); padding-bottom: 8px; }
.tool-ico, .tool-card:nth-child(3n+2) .tool-ico, .tool-card:nth-child(3n) .tool-ico { background: var(--ink); color: var(--paper); border-radius: 50%; box-shadow: none; }
.tool-card h4 { font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; }

/* Steps: big italic numerals on an ink rule */
.steps::before { background: var(--ink); height: 1px; top: 30px; }
.step-n { width: 60px; height: 60px; font: italic 400 1.9rem var(--font-display); color: var(--accent); background: var(--bg); border: 1px solid var(--ink); background-image: none; }
.steps h3 { font-size: 1.4rem; }

/* Prose + guides */
.prose a, .faq-item a, .l-sec a { color: var(--text); text-decoration-color: var(--accent); }
.guide-link strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 400; }

/* FAQ */
.faq-item { border-bottom-color: var(--line-strong); }
.faq-item summary { font: 400 1.35rem/1.3 var(--font-display); }
.faq-item summary .ico { color: var(--accent); }

/* CTA: ink band */
.cta-card { background: var(--ink); color: var(--paper); border: 0; border-radius: 8px; animation: none; }
.cta-card h2 { color: var(--paper); }
.cta-card .grad-text { color: #fdba74; }
.cta-card p { color: color-mix(in srgb, var(--paper) 75%, transparent); }
.cta-card .btn-primary { background: var(--paper); color: var(--ink); }
:root[data-theme="dark"] .cta-card .grad-text { color: #c2410c; }

/* Footer */
.site-foot { border-top: 1px solid var(--line-strong); }
.foot-grid h3 { font-family: var(--font-body); letter-spacing: 0.14em; }
.foot-base { border-top-color: var(--line); }

/* ---------- Landing pages ---------- */
.l-drop { border: 1px dashed var(--ink); border-radius: 8px; background: var(--surface); }
.l-drop:hover, .l-drop.dragover { border-color: var(--accent); background: var(--surface-2); }
.l-drop-ico { color: var(--accent); }
.crumbs a:hover { color: var(--text); }
.l-sec h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
.l-sec kbd { background: var(--surface); }

/* ---------- Editor page (outer page; the workspace keeps its dark pro theme) ---------- */
.app.app-wide { --panel: #fffdf8; --panel-2: #f8f2e7; --border: #ddd3c1; --text-dim: #57534e; --accent: #c2410c; --accent-2: #c2410c; }
:root[data-theme="dark"] .app.app-wide { --panel: #221c17; --panel-2: #2a231c; --border: #3b3229; --text-dim: #b5ab99; --accent: #fb923c; --accent-2: #fb923c; }
.app .header .brand-name { font-family: var(--font-display); font-weight: 400; font-size: 2.4rem; }
.app .drop-zone { border: 1px dashed var(--ink); border-radius: 8px; }
.app .content-block { border-radius: 8px; }
.app .content-block h2, .app .content-block h3 { font-family: var(--font-display); font-weight: 400; }
.app .btn-primary { background: var(--ink); color: var(--paper); box-shadow: none; }
.ed-shell { --accent: #a78bfa; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-prints { min-height: 0; padding-bottom: 20px; margin-bottom: 0; }
  .print-back { display: none; }
  .lens-stage.print-main, .lens-stage.print { width: 100%; margin-top: 10px; transform: none; }
  .note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ed-title .line > span, .print, .lens-stage.print, .note, .note path { animation: none !important; }
}

/* Theme button: moon on paper (switch to night), sun at night */
.theme-btn .sun { display: none; }
.theme-btn .moon { display: block; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }

/* Landing headlines: serif, highlighted word in rust italic (no gradient) */
.hero-title { font-weight: 400; }
.hero-title .scan {
  background: none; -webkit-background-clip: initial; background-clip: initial;
  color: var(--accent); font-style: italic;
  animation: wordIn 0.9s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms + 80ms);
}
.nav .nav-cta[aria-current="page"] { color: var(--paper); }

/* Original NextG logo */
.logo-img { display: block; height: 40px; width: auto; }
.logo-foot { height: 48px; }
:root[data-theme="dark"] .logo-img { background: #f4efe6; padding: 4px 8px; border-radius: 6px; box-sizing: content-box; height: 32px; }
:root[data-theme="dark"] .logo-foot { height: 40px; }
.ws-logo img { display: block; height: 24px; width: auto; background: #fffdf8; padding: 3px 7px; border-radius: 5px; }
