/* Kamaq.io — shared styles */
:root {
  --bg: #FFFFFF;
  --surface: #F1F4F7;
  --ink: #0F1B2D;
  --ink-2: #2A3A55;
  --muted: #55607A;
  --line: #DCE1E8;
  --gold: #B5730A;
  --gold-soft: #FBEFD9;
  --band-bg: #0F1B2D;
  --band-ink: #EEF1F5;
  --band-muted: #B7C1CF;
  --band-line: #2A3A55;
  --gold-bright: #E8A33D;
  --ok: #1F7A4D;
  --ok-soft: #E3F3EA;
  --focus: #3B5BDB;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 22px;
  --max: 1160px;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1B2D;
    --surface: #16253B;
    --ink: #EEF1F5;
    --ink-2: #C9D2DE;
    --muted: #A3AEBF;
    --line: #2A3A55;
    --gold: #E8A33D;
    --gold-soft: #3A2E17;
    --band-bg: #16253B;
    --band-ink: #EEF1F5;
    --band-muted: #B7C1CF;
    --band-line: #33476A;
    --ok: #5CC98F;
    --ok-soft: #173826;
    --focus: #8EA6FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.025em; margin: 0; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.02; font-weight: 700; }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); line-height: 1.08; font-weight: 700; }
h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-word { font-family: var(--display); font-size: 1.6rem; font-weight: 700; letter-spacing: -0.03em; }
.brand-word span { font-weight: 500; color: var(--gold); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; font-weight: 500; font-size: 0.97rem; }
.site-nav a { text-decoration: none; padding: 10px 0; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-s);
  font: 600 1rem var(--body); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg);
}
.btn:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--surface); filter: none; }
.btn.gold { background: var(--gold-bright); border-color: var(--gold-bright); color: #0F1B2D; }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 0.95rem; }
.site-nav .btn { padding: 0 18px; text-decoration: none; }
.site-nav .btn:hover { text-decoration: none; }

/* Sections */
section { padding: 104px 0; }
.section-head { display: grid; gap: 16px; max-width: 46rem; margin-bottom: 56px; }
.band { background: var(--band-bg); color: var(--band-ink); }
.band .lead, .band .muted { color: var(--band-muted); }
.band .btn.ghost { color: var(--band-ink); border-color: var(--band-ink); }
.band .btn.ghost:hover { background: var(--band-line); }
.tint { background: var(--surface); }

/* Hero */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.hero-copy { display: grid; gap: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stack-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.stack-list li { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.9rem; color: var(--ink-2); }
.khipu-art { width: 100%; max-width: 440px; justify-self: center; }
.khipu-art .cord { stroke: var(--ink); }
.khipu-art .knot { fill: var(--gold-bright); }
@media (prefers-reduced-motion: no-preference) {
  .khipu-art .strand { transform-box: fill-box; transform-origin: top; animation: drop 900ms cubic-bezier(.2,.8,.2,1) both; }
  .khipu-art .strand:nth-of-type(2) { animation-delay: 120ms; }
  .khipu-art .strand:nth-of-type(3) { animation-delay: 240ms; }
}
@keyframes drop { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* Steps (a real sequence) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; counter-reset: step; position: relative; }
.steps li { position: relative; padding-top: 64px; display: grid; gap: 10px; align-content: start; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 700 1.1rem var(--display);
  background: var(--ink); color: var(--bg);
}
.steps li::after { content: ""; position: absolute; top: 21px; left: 56px; right: -28px; height: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.band .steps li::before { background: var(--gold-bright); color: #0F1B2D; }
.band .steps li::after { background: var(--band-line); }

/* Services list */
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.service { padding: 36px 36px 36px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; grid-template-columns: 40px minmax(0, 1fr); column-gap: 18px; }
.service:nth-child(even) { padding-left: 36px; padding-right: 0; border-left: 1px solid var(--line); }
.service svg { grid-row: span 2; stroke: var(--gold); }
.service p { color: var(--ink-2); }

/* Product feature on landing */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.feature-copy { display: grid; gap: 22px; }
.product-name { font-family: var(--display); font-weight: 700; }
.product-name .ai { color: var(--gold-bright); }
.preview-card { background: #FFFFFF; color: #0F1B2D; border-radius: var(--radius-l); padding: 22px; display: grid; gap: 16px; }
.preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.preview-doc { background: #F6F7F9; border: 1px solid #DCE1E8; border-radius: var(--radius-m); padding: 16px; display: grid; gap: 8px; align-content: start; }
.preview-doc i { display: block; height: 8px; border-radius: 3px; background: #DCE1E8; }
.preview-fields { display: grid; gap: 10px; align-content: start; }
.preview-fields div { display: grid; gap: 4px; font-size: 0.8rem; color: #55607A; }
.preview-fields b { display: block; height: 32px; border: 1px solid #DCE1E8; border-radius: 6px; font: 500 0.9rem var(--body); color: #0F1B2D; padding: 6px 10px; }
.preview-actions { display: flex; justify-content: flex-end; gap: 8px; }
.preview-actions span { padding: 8px 14px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; border: 1.5px solid #0F1B2D; }
.preview-actions span:last-child { background: #0F1B2D; color: #FFFFFF; }

/* Projects */
.projects { display: grid; border-top: 1px solid var(--line); }
.project { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 24px; align-items: baseline; padding: 32px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.project .tag { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.project h3 { margin-bottom: 6px; }
.project p { color: var(--ink-2); }
.project .read { font-weight: 600; white-space: nowrap; }
.project:hover h3 { text-decoration: underline; text-underline-offset: 5px; }

/* Contact */
.contact .wrap { display: grid; gap: 24px; justify-items: start; }
.contact h2 { max-width: 18em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; font-size: 0.95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--ink-2); font-weight: 500; text-decoration: none; padding: 10px 0; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.btn .icon { flex: none; }

/* ===== Yupanai page ===== */
.y-hero { padding: 80px 0 56px; }
.y-hero .wrap { display: grid; gap: 22px; }
.y-hero h1 .ai { color: var(--gold); }
.back { font-weight: 500; text-decoration: none; }
.back:hover { text-decoration: underline; }

/* Demo */
.demo-section { padding-top: 0; }
.demo { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); overflow: hidden; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg); }
.demo-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface); }
.demo-tab { min-height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; font: 600 0.95rem var(--body); color: var(--muted); cursor: pointer; }
.demo-tab[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.demo-note { font-size: 0.9rem; color: var(--muted); }
.demo-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.demo-left { padding: 28px; border-right: 1px solid var(--line); }
.demo-right { padding: 28px; display: grid; gap: 18px; align-content: start; background: var(--bg); }

.paper {
  position: relative; background: #FFFFFF; color: #1B2533; border-radius: 8px;
  box-shadow: 0 1px 0 #DCE1E8, 0 10px 30px rgba(15, 27, 45, 0.12);
  padding: 28px; font-size: 0.82rem; line-height: 1.45; overflow: hidden; min-height: 460px;
}
.paper .doc-title { font: 700 1.05rem var(--display); letter-spacing: 0; }
.paper .doc-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.paper .doc-meta { display: grid; gap: 2px; margin-bottom: 16px; }
.paper table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.paper th { text-align: left; font-weight: 600; border-bottom: 1px solid #1B2533; padding: 6px 4px; }
.paper td { border-bottom: 1px solid #E3E7EC; padding: 6px 4px; }
.paper .num { text-align: right; font-variant-numeric: tabular-nums; }
.paper .totals { display: grid; justify-content: end; gap: 2px; }
.paper .totals div { display: flex; gap: 24px; justify-content: space-between; min-width: 220px; }
.paper .totals .grand { font-weight: 700; font-size: 0.95rem; border-top: 1px solid #1B2533; padding-top: 4px; }
.paper [data-src] { border-radius: 3px; transition: background-color 160ms, box-shadow 160ms; }
.paper [data-src].hl { background: #FBE3B4; box-shadow: 0 0 0 3px #FBE3B4; }
.paper .stamp { position: absolute; right: 20px; bottom: 20px; font: 600 0.75rem var(--body); color: #55607A; }

.scan { position: absolute; inset: 0; pointer-events: none; display: none; }
.scan.on { display: block; }
.scan::before {
  content: ""; position: absolute; left: 0; right: 0; height: 64px;
  background: linear-gradient(to bottom, rgba(232, 163, 61, 0), rgba(232, 163, 61, 0.35), rgba(232, 163, 61, 0));
  animation: sweep 1.4s ease-in-out both;
}
@keyframes sweep { from { top: -64px; } to { top: 100%; } }
@media (prefers-reduced-motion: reduce) { .scan::before { animation: none; display: none; } }

.demo-status { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: var(--surface); color: var(--muted); }
.pill.wait { background: var(--gold-soft); color: var(--ink); }
.pill.done { background: var(--ok-soft); color: var(--ok); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; color: var(--muted); }
.field input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--bg); color: var(--ink); font: 500 0.95rem var(--body); width: 100%;
}
.field input:disabled { background: var(--surface); color: var(--muted); }
.field input.filled { border-color: var(--gold); }
.lines { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lines th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lines td { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.lines .num { text-align: right; font-variant-numeric: tabular-nums; }
.lines-wrap { overflow-x: auto; }
.empty { padding: 28px; border: 1.5px dashed var(--line); border-radius: var(--radius-m); color: var(--muted); text-align: center; display: grid; gap: 14px; justify-items: center; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.result { padding: 14px 16px; border-radius: var(--radius-m); background: var(--ok-soft); color: var(--ink); }
.result strong { color: var(--ok); }
[hidden] { display: none !important; }

/* Reads / outputs */
.flows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--band-line); border-radius: var(--radius-l); overflow: hidden; }
.flow { padding: 36px; display: grid; gap: 14px; align-content: start; }
.flow + .flow { border-left: 1px solid var(--band-line); }
.flow .path { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font: 600 1.05rem var(--display); }
.flow .path svg { stroke: var(--gold-bright); }

.points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 56px; }
.point { display: grid; gap: 8px; padding-top: 20px; border-top: 2px solid var(--ink); }
.point p { color: var(--ink-2); }

.video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-l); overflow: hidden; background: var(--band-bg); color: var(--band-ink); display: grid; place-items: center; text-align: center; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-placeholder { display: grid; gap: 14px; justify-items: center; padding: 24px; }
.video-placeholder svg { stroke: var(--gold-bright); }

/* Problem */
.problem-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.issues { display: grid; gap: 28px; }
.issue { display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Before / after */
.compare { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.compare-head { font: 700 1.15rem var(--display); padding: 0 0 16px; border-bottom: 2px solid var(--ink); color: var(--muted); }
.compare-head.after { color: var(--ink); padding-left: 28px; }
.compare .cell { display: grid; gap: 6px; align-content: start; padding: 26px 28px 26px 0; border-bottom: 1px solid var(--line); }
.compare .cell.after { padding: 26px 0 26px 28px; border-left: 3px solid var(--gold-bright); background: var(--surface); padding-right: 20px; }
.compare .cell h3 { font-size: 1.15rem; }
.cell-label { display: none; font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.metric { display: grid; gap: 6px; padding-top: 20px; border-top: 1px solid var(--band-line); }
.metric strong { font: 700 clamp(2.6rem, 5vw, 3.8rem) var(--display); line-height: 1; letter-spacing: -0.03em; color: var(--gold-bright); }
.placeholder { outline: 2px dashed currentColor; outline-offset: 6px; border-radius: 4px; font-size: 0.6em; }

.points.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.video video { background: #000; }

.result.warn { background: var(--gold-soft); }
.result.warn strong { color: var(--ink); }

/* Savings estimator */
.estimator { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.estimate-form { display: grid; gap: 16px; }
.band .field label { color: var(--band-muted); }
.band .field input { background: var(--bg); color: var(--ink); border-color: var(--band-line); }
.estimate { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-top: 20px; margin-top: 4px; border-top: 1px solid var(--band-line); }
.estimate div { display: grid; gap: 4px; }
.estimate strong { font: 700 clamp(2.4rem, 4.5vw, 3.4rem) var(--display); line-height: 1; letter-spacing: -0.03em; color: var(--gold-bright); }
.estimate span { color: var(--band-muted); font-size: 0.95rem; }
.estimate #e-cost-row { grid-column: 1 / -1; }

/* Responsive */
@media (max-width: 900px) {
  section { padding: 72px 0; }
  .hero .wrap, .feature, .demo-body { grid-template-columns: minmax(0, 1fr); }
  .khipu-art { max-width: 300px; }
  .demo-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .steps li::after { display: none; }
  .services, .points, .flows { grid-template-columns: minmax(0, 1fr); }
  .service, .service:nth-child(even) { padding: 28px 0; border-left: 0; }
  .flow + .flow { border-left: 0; border-top: 1px solid var(--band-line); }
  .project { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .problem-grid, .compare, .metrics, .points.three, .estimator { grid-template-columns: minmax(0, 1fr); }
  .compare-head { display: none; }
  .cell-label { display: block; }
  .compare .cell { padding: 20px 0; }
  .compare .cell.after { padding: 20px 16px; margin-bottom: 16px; }
}
@media (max-width: 520px) {
  .fields, .preview-row { grid-template-columns: minmax(0, 1fr); }
  .demo-left, .demo-right { padding: 18px; }
  .paper { padding: 18px; }
}
