/* ── KenKenetic home: the index of everything ─────────────────────────────── */
:root {
  --bg: #0a0a0a; --bg-2: #141414; --ink: #f2f2f2; --ink-2: #a8a8a8; --ink-3: #6b6b6b;
  --line: rgba(255,255,255,0.14); --gold: #d9b24c; --accent: #fff;
  --sans: "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 3vw, 48px);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5; background: var(--bg); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
.goldline { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--gold); z-index: 50; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 40; background: rgba(10,10,10,0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 18px; padding: 16px var(--gutter) 12px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand img { width: 38px; height: 38px; filter: invert(1); }
.brand span { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-2); }
.nav { display: flex; gap: 22px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.nav a, .nav button { color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav button:hover, .nav .is-on { color: var(--ink); border-bottom-color: var(--ink); }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 0 var(--gutter) 14px; }
.filters select, .filters input { -webkit-appearance: none; appearance: none; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 7px 34px 7px 14px; font: inherit; font-size: 13px; outline: none; }
.filters select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.filters select:focus, .filters input:focus { border-color: var(--ink-2); }
.filters input { padding-right: 14px; min-width: 150px; }
.filters .count { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.08em; }
.filters .clear { font-size: 12px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.filters .clear[hidden] { display: none; }

.chips { display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter) 12px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; white-space: nowrap; }
.chip { font-size: 12px; letter-spacing: 0.04em; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip.is-on { color: var(--bg); background: var(--ink); border-color: var(--ink); }

/* ── Grid ────────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px 20px; padding: 28px var(--gutter) 80px; }
.card { display: block; color: inherit; min-width: 0; }   /* a 1fr track must not grow to the image's natural width */
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; border-radius: 2px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s ease, transform 0.6s ease; }
.card-img img.is-in { opacity: 1; }
.card:hover .card-img img { transform: scale(1.03); }
.card-img .badge { position: absolute; left: 10px; top: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: rgba(0,0,0,0.55); padding: 4px 7px; border-radius: 2px; }
.card-img .play { position: absolute; right: 10px; bottom: 10px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,0.6); }
.card-img .play::after { content: ''; position: absolute; left: 11px; top: 8px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.card h3 { margin: 10px 0 2px; font-size: 14px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.card .meta, .connected .card h3 { overflow-wrap: anywhere; }
.grid, .connected { overflow-x: clip; }
.card .meta { font-size: 12px; color: var(--ink-3); }
.empty { padding: 80px var(--gutter); color: var(--ink-3); text-align: center; }

/* featured strip */
.strip-head { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 14px; margin: 8px 0 -8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); }
.strip-head:not(:first-child) { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.strip-head .strip-sub { text-transform: none; letter-spacing: 0.04em; color: var(--ink-3); font-family: var(--sans); font-size: 12px; }
.card--big { grid-column: span 2; }
.card--big .card-img { aspect-ratio: 16 / 9; }
.card--big h3 { font-size: 18px; font-weight: 400; margin-top: 12px; }
@media (max-width: 640px) { .card--big { grid-column: 1 / -1; } }

/* parts of a merged project */
.parts-box summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.parts-box summary::-webkit-details-marker { display: none; }
.parts-box .chev { width: 7px; height: 7px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.2s; margin-top: -3px; }
.parts-box[open] .chev { transform: rotate(-135deg); margin-top: 3px; }
.parts { list-style: none; padding: 0; margin: 0 0 8px; max-height: 320px; overflow-y: auto; }
.parts li { border-top: 1px solid var(--line); }
.parts a { display: flex; gap: 12px; padding: 8px 0; font-size: 13px; line-height: 1.3; }
.parts a:hover { color: var(--ink); }
.parts a span { flex: none; min-width: 84px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }

/* ── Project view ────────────────────────────────────────────────────────── */
.view { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; display: none; }
.view.is-open { display: block; }
body.has-view { overflow: hidden; }
.view-close { position: fixed; top: 16px; right: var(--gutter); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(10,10,10,0.7); font-size: 18px; line-height: 44px; text-align: center; }
.view-close:hover { border-color: var(--ink); }
.view-inner { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2.1fr); gap: 0 clamp(24px, 4vw, 72px); padding: 44px var(--gutter) 72px; min-height: 100vh; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 16px; }
.view-title { overflow-wrap: anywhere; hyphens: auto; font-size: clamp(34px, 4.6vw, 64px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.02; margin: 0 0 22px; }
.view-rule { border: 0; border-top: 1px solid var(--ink); margin: 0 0 26px; }
.lede { font-size: clamp(18px, 1.5vw, 22px); line-height: 1.3; margin: 0 0 16px; }
.view-copy p { color: var(--ink-2); margin: 0 0 12px; max-width: 46ch; }
.view-copy p:last-child { margin-bottom: 0; }
.view-side { display: flex; flex-direction: column; }
.view-foot { margin-top: auto; padding-top: 36px; }
.view-foot .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.view-foot .roles { margin: 0 0 20px; }
.view-links a { display: inline-block; margin: 0 14px 10px 0; border-bottom: 1px solid var(--ink); line-height: 1.25; }
.view-links a::after { content: ' \2197'; }
.view-links a.int::after { content: ' \2192'; }
.view-links a.ext { color: var(--ink); }

.view-main { min-width: 0; }
.view-main .eyebrow { margin-bottom: 20px; }
.hero { position: relative; background: var(--bg-2); aspect-ratio: 16 / 9; max-height: 82vh; margin: 0 auto; border-radius: 2px; overflow: hidden; }
.hero-nav { position: absolute; top: 14%; bottom: 22%; width: 18%;   /* leaves the player's title bar and control bar clickable */ min-width: 56px; opacity: 0; transition: opacity 0.2s; }
.hero-nav.prev { left: 0; cursor: w-resize; } .hero-nav.next { right: 0; cursor: e-resize; }
.hero-nav::after { content: ''; position: absolute; top: 50%; width: 14px; height: 14px; border-top: 2px solid #fff; border-left: 2px solid #fff; filter: drop-shadow(0 0 6px rgba(0,0,0,0.8)); }
.hero-nav.prev::after { left: 18px; transform: translateY(-50%) rotate(-45deg); }
.hero-nav.next::after { right: 18px; transform: translateY(-50%) rotate(135deg); }
.hero:hover .hero-nav { opacity: 1; }
@media (pointer: coarse) { .hero-nav { opacity: 0.6; width: 48px; min-width: 0; } }
.hero img, .hero video, .hero iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border: 0; background: #000; }
.hero img.fill { object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 18px; }
.thumbs button { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); border-radius: 2px; overflow: hidden; opacity: 0.75; transition: opacity 0.2s; }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button:hover, .thumbs button.is-on { opacity: 1; outline: 1px solid var(--ink); outline-offset: 2px; }
.thumbs button .play { position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.65); }
.thumbs button .play::after { content: ''; position: absolute; left: 9px; top: 6px; border-left: 8px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.thumbs-more { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; padding: 6px 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); aspect-ratio: auto; background: none; opacity: 1; }
.thumbs-more:hover { color: var(--ink); outline: none; }
.thumbs-more .chev { width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.thumbs-more .chev.up { transform: rotate(-135deg); margin-top: 3px; }
.caption { margin: 10px 0 0; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; min-height: 1.3em; }

.connected { grid-column: 1 / -1; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.connected:empty { display: none; }
.connected h4 { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); font-weight: 400; }
.fold summary { list-style: none; cursor: pointer; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary h4 { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 0; }
.fold .chev { width: 7px; height: 7px; border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3); transform: rotate(45deg); margin-top: -3px; }
.fold[open] .chev { transform: rotate(-135deg); margin-top: 3px; }
.fold .row { margin-top: 6px; }
.connected .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 14px; margin-bottom: 26px; }
.connected .card h3 { font-size: 13px; }

.view-hint { position: fixed; right: var(--gutter); bottom: 14px; font-family: var(--mono); font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em; }
.view-nav { position: fixed; left: var(--gutter); bottom: 12px; display: flex; gap: 6px; }
.view-nav button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink-2); font-size: 16px; background: rgba(10,10,10,0.7); }
.view-nav button:hover { color: var(--ink); border-color: var(--ink); }

/* ── Panels (About / Contact) ────────────────────────────────────────────── */
.panel { position: fixed; inset: 0; z-index: 70; background: rgba(10,10,10,0.96); display: none; overflow-y: auto; padding: 80px var(--gutter); }
.panel.is-open { display: block; }
.panel-inner { max-width: 620px; }
.panel h2 { font-size: clamp(34px, 4.6vw, 64px); font-weight: 300; letter-spacing: -0.02em; margin: 0 0 24px; }
.panel p { color: var(--ink-2); font-size: 17px; line-height: 1.5; max-width: 48ch; }
.panel a { border-bottom: 1px solid var(--ink); }
.panel .list { list-style: none; padding: 0; margin: 28px 0 0; }
.panel .list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 20px; flex-wrap: wrap; }
.panel .list li span:first-child { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); min-width: 110px; padding-top: 4px; }

@media (max-width: 900px) {
  .view-inner { grid-template-columns: 1fr; gap: 28px; padding-top: 72px; }
  .view-side { order: 1; }
  .view-main { order: 2; }
  .connected { order: 3; }
  .filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .view-foot { margin-top: 24px; }
  .view-hint { display: none; }
  .view-close { top: 12px; right: 12px; }
}
@media (max-width: 640px) {
  .top-row { flex-wrap: wrap; gap: 10px 14px; }
  .brand span { display: none; }
  .nav { gap: 14px; font-size: 11px; }
  .filters { gap: 8px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .count { margin-left: 0; white-space: nowrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .card h3 { font-size: 13px; }
  .thumbs { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .view-nav { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
@media print {
  .top, .goldline, .view-close, .view-nav, .view-hint, .thumbs-more, .connected { display: none !important; }
  html, body { background: #fff; color: #000; }
  .view { position: static; overflow: visible; }
  .view-copy p, .eyebrow { color: #333; }
}

/* ── Contact form + social icons ─────────────────────────────────────────── */
.cform { margin: 8px 0 32px; max-width: 520px; }
.cform label { display: block; margin-bottom: 14px; }
.cform label > span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.cform input, .cform textarea { width: 100%; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font: inherit; font-size: 15px; outline: none; resize: vertical; }
.cform input:focus, .cform textarea:focus { border-color: var(--ink-2); }
.cform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cform-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cform-send { background: var(--ink); color: var(--bg); border-radius: 999px; padding: 10px 26px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; }
.cform-send:hover { background: var(--gold); }
.cform-send[disabled] { opacity: 0.5; cursor: default; }
.cform-note { font-size: 13px; color: var(--ink-2); }
.socials { display: flex; gap: 14px; align-items: center; }
.soc { color: var(--ink-2); border: 0 !important; display: inline-flex; padding: 4px; }
.soc:hover { color: var(--gold); }
.panel .list li .socials { padding-top: 0; }

/* desktop: everything in the header sits centred */
@media (min-width: 901px) {
  .top-row { justify-content: center; gap: 48px; }
  .brand { margin-right: 0; }
  .chips { justify-content: safe center; }
  .filters { justify-content: center; }
  .filters .count { margin-left: 0; }
}

/* swipe between slides without fighting the page scroll */
.hero{touch-action:pan-y}
.hero.is-empty{display:none}
.thumbs .thumb-clip{display:block;width:100%;height:100%;background:var(--bg-2)}
