/* Kuntelo — shared styles for the content pages under public/<page>/index.html.
   The one-pager (public/index.html) keeps its own inline styles; the tokens and
   the header/footer rules here mirror it so the pages look like one site. */
:root {
  --bg: #000000;
  --bg-2: #0d0d0d;
  --ink: #ffffff;
  --ink-2: #a3a3a3;
  --ink-3: #5c5c5c;
  --line: #262626;
  --brand: #d9b02a;
  --brand-hover: #c29c1f;
  --paper: #f3f1ea;
  --paper-2: #e9e6dc;
  --paper-ink: #0b0b0b;
  --paper-ink-2: #4d4b45;
  --paper-line: #d8d4c6;
  --sans: 'Inter Tight', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --max: 1360px;
  --pad: clamp(20px, 3.5vw, 48px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--brand); color: var(--bg); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- header ---------- */
header.site { position: sticky; top: 0; z-index: 50; background: #000; border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; gap: 24px; }
.wordmark {
  display: block; width: var(--w); height: calc(var(--w) * 134 / 1322);
  background: url('/kuntelo-logo.png') no-repeat;
  background-size: calc(var(--w) * 1672 / 1322) auto;
  background-position: calc(var(--w) * -185 / 1322) calc(var(--w) * -375 / 1322);
}
.nav-logo .wordmark { --w: 300px; }
@media (max-width: 1400px) { .nav-logo .wordmark { --w: 220px; } }
.nav-links { display: flex; gap: 28px; }
.nav-links a { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); position: relative; white-space: nowrap; }
.nav-links a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--brand); transition: right .25s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { right: 0; }
@media (max-width: 1150px) { .nav-links { display: none; } }

.btn {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 0 20px; height: 46px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.btn-brand { background: var(--brand); color: #000; }
.btn-brand:hover { background: var(--brand-hover); }
.btn-brand .plus { border-left: 1px solid rgba(0,0,0,.25); padding-left: 14px; margin-left: 2px; align-self: stretch; display: flex; align-items: center; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.paper .btn-ghost { border-color: var(--paper-line); color: inherit; }
.paper .btn-ghost:hover { border-color: #000; color: inherit; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
@media (max-width: 1400px) { .nav-login { display: none; } }

.nav-burger {
  display: none; width: 46px; height: 46px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--line); background: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .2s;
}
.nav-burger:hover, .nav-burger[aria-expanded="true"] { border-color: var(--brand); }
.nav-burger span { display: block; width: 18px; height: 1.5px; background: var(--ink); transition: transform .3s cubic-bezier(.2,.7,.2,1), background .2s; }
.nav-burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); background: var(--brand); }
.nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); background: var(--brand); }
.mmenu { display: none; }
@media (max-width: 1150px) {
  .nav-burger { display: inline-flex; }
  .mmenu {
    display: flex; flex-direction: column; justify-content: space-between;
    position: fixed; left: 0; right: 0; top: 77px; bottom: 0; z-index: 49;
    background: var(--bg); overflow-y: auto;
    visibility: hidden; opacity: 0; transform: translateY(-10px);
    transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.2,1), visibility 0s .3s;
  }
  .mmenu.open { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, transform .3s cubic-bezier(.2,.7,.2,1); }
  body.menu-open { overflow: hidden; }
}
.mmenu > .wrap { width: 100%; }
.mmenu-links { display: grid; padding-top: 6px; position: relative; }
.mmenu-links a {
  display: flex; align-items: baseline; gap: 18px; padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500; letter-spacing: -0.03em; font-size: clamp(22px, 5vw, 32px); line-height: 1;
}
.mmenu-links a .mono { color: var(--brand); }
.mmenu-links a:active, .mmenu-links a[aria-current="page"] { color: var(--brand); }
.mmenu-foot { display: grid; gap: 12px; padding-top: 24px; padding-bottom: max(32px, env(safe-area-inset-bottom)); position: relative; }
.mmenu-foot .btn { justify-content: center; height: 54px; }
.mmenu-foot .btn-brand .plus { border-left: 0; padding-left: 0; margin-left: 0; }
.mmenu-meta { color: var(--ink-3); text-transform: none; letter-spacing: .04em; margin-top: 10px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; }
.mmenu-meta a:hover { color: var(--brand); }
@media (max-width: 560px) {
  .nav { gap: 12px; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn-brand { padding: 0 14px; }
  .nav-actions .btn-brand .plus { display: none; }
  .nav-logo .wordmark { --w: 150px; }
}
@media (max-width: 400px) { .nav-logo .wordmark { --w: 128px; } }

/* ---------- page hero ---------- */
.phero { padding: clamp(56px, 8vw, 110px) 0 clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.phero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 960px) { .phero-grid { grid-template-columns: 1fr; } }
.crumbs { color: var(--ink-3); margin: 0 0 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand); }
.crumbs b { color: var(--brand); font-weight: 500; }
.phero h1 { font-weight: 500; letter-spacing: -0.045em; line-height: 0.98; font-size: clamp(40px, 6vw, 92px); margin: 0 0 26px; text-wrap: balance; }
.phero h1 em { font-style: normal; color: var(--brand); }
.phero .lead { color: var(--ink-2); font-size: clamp(17px, 1.5vw, 21px); max-width: 38rem; margin: 0; }

/* ---------- ascii figures ---------- */
.art {
  font-family: var(--mono); font-size: clamp(9px, 1.05vw, 14px); line-height: 1.25;
  color: var(--ink-2); margin: 0; white-space: pre; overflow-x: auto; max-width: 100%;
  padding: 22px 24px; border: 1px solid var(--line); background: var(--bg-2);
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.art b { color: var(--brand); font-weight: 400; }
.art i { color: var(--ink); font-style: normal; }
.art u { color: var(--ink-3); text-decoration: none; }
.art-wrap { min-width: 0; }
.art-tag { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.paper .art { border-color: var(--paper-line); background: #fff; color: var(--paper-ink-2); }
.paper .art i { color: var(--paper-ink); }
.paper .art u { color: #b3b0a4; }
.paper .art-tag { color: var(--paper-ink-2); }
@media (max-width: 560px) { .art { font-size: 9px; padding: 16px 14px; } }

/* ---------- content blocks ---------- */
section.block { padding: clamp(64px, 8vw, 120px) 0; }
section.block + section.block:not(.paper) { border-top: 1px solid var(--line); }
.paper { background: var(--paper); color: var(--paper-ink); }
.paper ::selection { background: #000; color: var(--brand); }
.sec-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: clamp(36px, 5vw, 64px); }
@media (max-width: 900px) { .sec-head { grid-template-columns: 1fr; } }
.sec-head h2 { font-weight: 500; letter-spacing: -0.04em; line-height: 1; font-size: clamp(32px, 4.6vw, 64px); margin: 0; text-wrap: balance; }
.eyebrow { color: var(--brand); margin: 0 0 18px; }
.paper .eyebrow { color: var(--paper-ink-2); }
.sec-head p { margin: 0; font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); max-width: 34rem; }
.paper .sec-head p { color: var(--paper-ink-2); }

.prose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
@media (max-width: 960px) { .prose { grid-template-columns: 1fr; } }
.prose-main { max-width: 42rem; min-width: 0; }
.prose-side { min-width: 0; position: sticky; top: 100px; }
@media (max-width: 960px) { .prose-side { position: static; } }
.prose h3 { font-weight: 500; letter-spacing: -0.02em; font-size: clamp(22px, 2vw, 28px); line-height: 1.15; margin: 40px 0 12px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; color: var(--ink-2); font-size: 17px; }
.paper .prose p { color: var(--paper-ink-2); }
.prose p b { color: var(--ink); font-weight: 500; }
.paper .prose p b { color: var(--paper-ink); }
.prose ul { margin: 0 0 18px; padding-left: 0; list-style: none; display: grid; gap: 8px; color: var(--ink-2); }
.paper .prose ul { color: var(--paper-ink-2); }
.prose li { padding-left: 22px; position: relative; }
.prose li::before { content: '—'; position: absolute; left: 0; color: var(--brand); }
.prose a:not(.btn) { border-bottom: 1px solid var(--ink-3); }
.prose a:not(.btn):hover { color: var(--brand); border-color: var(--brand); }
.paper .prose a:not(.btn) { border-color: var(--paper-line); }

/* Q&A list */
.qa { border-top: 1px solid var(--line); }
.paper .qa { border-color: var(--paper-line); }
.qa article { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.paper .qa article { border-color: var(--paper-line); }
@media (max-width: 560px) { .qa article { grid-template-columns: 40px 1fr; gap: 14px; } }
.qa .n { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--brand); padding-top: 6px; }
.qa h3 { margin: 0 0 8px; font-weight: 500; letter-spacing: -0.02em; font-size: 22px; line-height: 1.15; }
.qa p { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; max-width: 46rem; }
.qa p:last-child { margin-bottom: 0; }
.paper .qa p { color: var(--paper-ink-2); }
.qa a { border-bottom: 1px solid var(--ink-3); }
.qa a:hover { color: var(--brand); border-color: var(--brand); }

/* cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.paper .grid-3, .paper .grid-4 { background: var(--paper-line); border-color: var(--paper-line); }
@media (max-width: 1000px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-4, .grid-3 { grid-template-columns: 1fr; } }
.card { background: var(--bg); padding: 30px 26px 34px; min-height: 240px; display: flex; flex-direction: column; gap: 18px; transition: background .25s, color .25s; }
.paper .card { background: var(--paper); }
.card .idx { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--ink-3); display: flex; justify-content: space-between; }
.paper .card .idx { color: var(--paper-ink-2); }
.card .idx b { color: var(--brand); font-weight: 500; }
.card h3 { font-weight: 500; letter-spacing: -0.02em; font-size: 24px; line-height: 1.1; margin: auto 0 0; }
.card p { margin: 0; color: var(--ink-2); font-size: 16px; }
.paper .card p { color: var(--paper-ink-2); }
.card:hover { background: var(--brand); color: #000; }
.card:hover p, .card:hover .idx, .card:hover .idx b { color: #000; }

/* related pages + closing */
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (max-width: 900px) { .related { grid-template-columns: 1fr; } }
.related a { background: var(--bg); padding: 26px 26px 28px; display: grid; gap: 10px; transition: background .25s; }
.related a:hover { background: var(--bg-2); }
.related a:hover .t { color: var(--brand); }
.related .k { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.related .t { font-weight: 500; letter-spacing: -0.02em; font-size: 22px; line-height: 1.1; }
.related .d { color: var(--ink-2); font-size: 15px; }
.closing { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
@media (max-width: 900px) { .closing { grid-template-columns: 1fr; } }
.closing h2 { font-weight: 500; letter-spacing: -0.045em; line-height: .95; font-size: clamp(40px, 6.5vw, 104px); margin: 0; }
.closing h2 em { font-style: normal; color: var(--brand); }
.closing p { color: var(--ink-2); font-size: clamp(17px, 1.4vw, 20px); margin: 0 0 30px; max-width: 32rem; }
.closing .actions { display: flex; gap: 18px; flex-wrap: wrap; }

/* footer */
footer.site { border-top: 1px solid var(--line); padding: 56px 0 40px; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 1000px) { .foot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot { grid-template-columns: 1fr; } }
.foot p { color: var(--ink-2); font-size: 15px; max-width: 30rem; margin: 0; }
.foot h4 { margin: 0 0 16px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.foot li a:hover, .foot address a:hover { color: var(--brand); }
.foot address { font-style: normal; display: grid; gap: 8px; font-size: 15px; color: var(--ink-2); }
.foot address b { color: var(--ink); font-weight: 500; }
.foot-bottom { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  .mmenu, .mmenu-links a { transition: none; }
}

.art-wide { font-size: clamp(8px, .82vw, 11.5px); }

/* ascii figure animation (site.js): cells hidden before the build-in wipe,
   brand colour while scrambling or heated by the pointer */
.art span { transition: color .25s; }
.art .off { visibility: hidden; }
.art .hot, .paper .art .hot { color: var(--brand); transition: none; }
.art { cursor: crosshair; }
