/* KayJay Software — (c) 2026 Kyle Kulper. All rights reserved. */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #08090b;
  --panel: #0e1114;
  --panel-2: #12161a;
  --ink: #e7ecef;
  --soft: #99a3ac;
  --faint: #5d666e;
  --dim: #39424a;
  --rule: #1b2127;
  --rule-lit: #28313a;
  --signal: #4ddcc4;
  --signal-dim: #2c8b7d;
  --amber: #e0a049;
  --alert: #e0605c;
  --sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wrap: 74rem;
  --gut: clamp(1.1rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  /* faint engineering grid, barely there */
  background-image:
    linear-gradient(to right, rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 44px 44px;
}

a { color: var(--signal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #7ff0dc; }
h1, h2, h3, h4 { font-family: var(--sans); font-weight: 700; line-height: 1.08; letter-spacing: -.022em; margin: 0; }
::selection { background: var(--signal); color: #04120f; }

/* ── micro-label ────────────────────────────────────────── */

.label {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .19em; text-transform: uppercase; color: var(--faint);
}

/* ── header ─────────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem var(--gut);
  background: rgba(8,9,11,.86);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font-family: var(--mono); font-size: .84rem; font-weight: 600;
  color: var(--ink); text-decoration: none; letter-spacing: .02em;
}
.wordmark span { color: var(--signal); }
.site-head nav { display: flex; align-items: center; gap: clamp(.7rem, 2.2vw, 1.5rem); }
.site-head nav a {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--soft); text-decoration: none;
}
.site-head nav a:hover { color: var(--signal); }
.site-head nav .nav-cta {
  color: var(--signal); border: 1px solid var(--signal-dim);
  padding: .3rem .75rem; border-radius: 2px;
}
.site-head nav .nav-cta:hover { background: var(--signal); color: #04120f; }

/* ── layout + section chrome ────────────────────────────── */

section { max-width: var(--wrap); margin: 0 auto; padding: clamp(3.2rem, 7vw, 5.5rem) var(--gut); }
.band { max-width: none; background: var(--panel); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.band > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }

.sec-head { display: flex; align-items: baseline; gap: .9rem; margin-bottom: 1.1rem; }
.sec-num {
  font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .1em;
  color: var(--signal); flex: none;
}
.sec-head .label { flex: none; }
.sec-head .fill { flex: 1 1 auto; height: 1px; background: var(--rule-lit); }

.section-h { font-size: clamp(1.6rem, 3.7vw, 2.35rem); margin: 0 0 .5em; max-width: 22ch; }
.section-lede { color: var(--soft); max-width: 47rem; margin: 0 0 2.8rem; }

/* ── panel (the core instrument surface) ────────────────── */

.panel {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--rule);
}
/* corner ticks */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none;
  border-color: var(--rule-lit); border-style: solid; border-width: 0;
}
.panel::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; border-color: var(--signal-dim); }
.panel::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; border-color: var(--signal-dim); }

.panel-bar {
  display: flex; align-items: center; gap: .8rem;
  padding: .55rem .9rem; border-bottom: 1px solid var(--rule);
  background: rgba(255,255,255,.014);
}
.panel-bar .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--signal); flex: none; }
.panel-bar .fill { flex: 1 1 auto; height: 1px; background: var(--rule); }

/* ── hero ───────────────────────────────────────────────── */

.hero { padding-top: clamp(2.8rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.hero .label { display: block; margin-bottom: 1.1rem; color: var(--signal); }
.hero h1 { font-size: clamp(2.2rem, 6.6vw, 4rem); margin: 0 0 1.3rem; max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--signal); }
.lede { font-size: clamp(1rem, 1.9vw, 1.13rem); color: var(--soft); max-width: 46rem; margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 2.6rem; }

.btn {
  display: inline-block; padding: .62rem 1.3rem; border-radius: 2px;
  background: var(--signal); color: #04120f; font-weight: 600; font-size: .88rem;
  font-family: var(--mono); letter-spacing: .02em;
  text-decoration: none; border: 1px solid var(--signal); cursor: pointer;
  transition: background .14s, color .14s;
}
.btn:hover { background: #7ff0dc; border-color: #7ff0dc; color: #04120f; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-lit); }
.btn-ghost:hover { background: transparent; color: var(--signal); border-color: var(--signal-dim); }

.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 2.4rem;
}
.stat { background: var(--bg); padding: 1rem 1.1rem; }
.stat b {
  display: block; font-family: var(--mono); font-size: 1.6rem; font-weight: 600;
  color: var(--signal); line-height: 1; font-variant-numeric: tabular-nums;
}
.stat span { display: block; font-family: var(--mono); font-size: .64rem; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); margin-top: .55rem; }

/* ── case studies ───────────────────────────────────────── */

.case { display: grid; grid-template-columns: minmax(0,18rem) minmax(0,1fr); gap: clamp(1.5rem,4vw,3rem); padding: 2.4rem 0; border-top: 1px solid var(--rule); }
.case:first-of-type { border-top: none; padding-top: .4rem; }
.case-meta h3 { font-size: clamp(1.35rem,2.8vw,1.7rem); margin: .45rem 0 .3rem; }
.case-sub { color: var(--faint); font-size: .86rem; margin: 0 0 1.4rem; font-family: var(--mono); }
.spec { margin: 0; font-size: .88rem; }
.spec dt { font-family: var(--mono); font-size: .64rem; letter-spacing: .15em; text-transform: uppercase; color: var(--dim); margin-top: 1rem; }
.spec dd { margin: .22rem 0 0; color: var(--soft); }
.case-body p { margin: 0 0 1.05rem; color: var(--soft); }
.case-body > p:first-child { color: var(--ink); font-size: 1.03rem; }
.feats { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.feats li { position: relative; padding-left: 1.3rem; margin-bottom: .78rem; color: var(--soft); font-size: .94rem; }
.feats li::before { content: ""; position: absolute; left: 0; top: .66em; width: 6px; height: 1px; background: var(--signal); }
.feats strong { color: var(--ink); font-weight: 600; }
.case-note { border-left: 1px solid var(--signal-dim); padding-left: 1rem; font-size: .9rem; color: var(--faint) !important; margin-bottom: 0 !important; }
.case-status { margin-top: .9rem; }

/* ── status pills ───────────────────────────────────────── */

.status {
  display: inline-flex; align-items: center; gap: .42rem;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase;
  border: 1px solid var(--rule-lit); padding: .14rem .45rem; color: var(--faint); white-space: nowrap;
}
.status::before { content: ""; width: 4px; height: 4px; background: currentColor; }
.status.live { color: var(--signal); border-color: var(--signal-dim); }
.status.dev { color: var(--amber); border-color: rgba(224,160,73,.32); }
.status.proto { color: var(--faint); }

/* ── demos ──────────────────────────────────────────────── */

.demo { margin-bottom: 2.2rem; }
.demo-head { padding: 1.2rem 1.3rem 1rem; border-bottom: 1px solid var(--rule); }
.demo-head h3 { font-size: 1.18rem; margin: .4rem 0 .5rem; }
.demo-head p { margin: 0; color: var(--soft); font-size: .91rem; max-width: 56rem; }
.demo-stage { position: relative; background: #050607; }
.demo-stage canvas { display: block; width: 100%; height: auto; touch-action: manipulation; }
.demo-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.2rem;
  padding: .75rem 1.3rem; border-top: 1px solid var(--rule); background: rgba(255,255,255,.015);
  font-family: var(--mono); font-size: .72rem; color: var(--dim);
}
.demo-foot .readout { color: var(--soft); font-variant-numeric: tabular-nums; }
.demo-foot .readout b { color: var(--signal); font-weight: 600; }
.demo-foot .spacer { flex: 1 1 auto; }

.ctl {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; color: var(--soft); border: 1px solid var(--rule-lit);
  border-radius: 2px; padding: .34rem .7rem; cursor: pointer; transition: border-color .14s, color .14s;
}
.ctl:hover { border-color: var(--signal-dim); color: var(--signal); }
.ctl[aria-pressed="true"], .ctl.on { background: var(--signal); border-color: var(--signal); color: #04120f; }
.ctl:disabled { opacity: .3; cursor: default; }
.ctl:disabled:hover { border-color: var(--rule-lit); color: var(--soft); }

kbd {
  font-family: var(--mono); font-size: .68rem; background: var(--panel);
  border: 1px solid var(--rule-lit); border-radius: 2px; padding: .06rem .32rem; color: var(--soft);
}

.dpad { display: grid; grid-template-columns: repeat(3, 2.4rem); grid-template-rows: repeat(2, 2rem); gap: .25rem; }
.dpad button { font-size: .85rem; padding: 0; }
.dpad .up { grid-column: 2; grid-row: 1; }
.dpad .left { grid-column: 1; grid-row: 2; }
.dpad .down { grid-column: 2; grid-row: 2; }
.dpad .right { grid-column: 3; grid-row: 2; }

/* blackjack */
.bj-felt { padding: 1.4rem 1.3rem; background: linear-gradient(180deg, #0a1512 0%, #050607 75%); }
.bj-row { margin-bottom: 1.2rem; }
.bj-row h4 { font-family: var(--mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-weight: 400; margin: 0 0 .55rem; }
.bj-hand { display: flex; gap: .45rem; min-height: 5.4rem; flex-wrap: wrap; }
.pc {
  width: 3.7rem; height: 5.3rem; border-radius: 3px; background: #ecebe6; color: #0d1013;
  border: 1px solid #b9b5ab; display: flex; flex-direction: column; justify-content: space-between;
  padding: .3rem .35rem; font-family: var(--mono); font-size: .92rem; font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(0,0,0,.9); animation: dealIn .26s cubic-bezier(.2,.9,.3,1.15) both;
}
.pc.red { color: #b3282d; }
.pc.back { background: repeating-linear-gradient(45deg, #16202a, #16202a 3px, #101820 3px, #101820 6px); border-color: #263341; }
.pc .r2 { align-self: flex-end; transform: rotate(180deg); }
@keyframes dealIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.bj-total { font-family: var(--mono); font-size: .72rem; color: var(--signal); margin-left: .5rem; }

/* ── work grid ──────────────────────────────────────────── */

.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.8rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.mini { background: var(--panel-2); padding: 1.3rem; transition: background .16s; }
.mini:hover { background: var(--panel); }
.mini[hidden] { display: none; }
.mini h4 { font-size: 1.02rem; margin: 0; }
.mini .tag { font-family: var(--mono); font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin: .3rem 0 .75rem; }
.mini p:last-child { margin: 0; font-size: .88rem; color: var(--soft); }
.mini-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }

/* ── skills matrix ──────────────────────────────────────── */

.matrix { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,17rem); gap: 1.5rem; align-items: start; }
.matrix-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.skill-group { background: var(--panel-2); padding: 1.1rem 1rem; }
.skill-group h3 { font-family: var(--mono); font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--signal); margin: 0 0 .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip {
  font-family: var(--mono); font-size: .69rem; color: var(--soft);
  background: transparent; border: 1px solid var(--rule-lit); border-radius: 2px;
  padding: .22rem .5rem; cursor: pointer; transition: border-color .14s, color .14s;
}
.chip:hover { color: var(--ink); border-color: var(--dim); }
.chip.on { background: var(--signal); border-color: var(--signal); color: #04120f; }
.skill-detail { position: sticky; top: 5rem; padding: 1.1rem; min-height: 9rem; }
.skill-detail .label { display: block; margin-bottom: .7rem; }
.skill-detail h4 { font-size: 1.05rem; margin: 0 0 .5rem; color: var(--ink); }
.skill-detail p { margin: 0; font-size: .89rem; color: var(--soft); }
.skill-detail .hint { color: var(--dim); font-style: italic; }

/* ── beyond ─────────────────────────────────────────────── */

.beyond { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.pursuit { background: var(--panel-2); padding: 1.5rem; }
.pursuit h3 { font-size: 1.1rem; margin: .35rem 0 .7rem; }
.pursuit p { margin: 0 0 .85rem; color: var(--soft); font-size: .91rem; }
.pursuit p:last-child { margin-bottom: 0; }
.player { display: block; margin-top: 1rem; padding: .7rem; background: var(--bg); border: 1px solid var(--rule); }
.transport { display: flex; align-items: center; gap: .8rem; }
.player .meta { flex: 1 1 auto; min-width: 0; }
.player .t { font-family: var(--mono); font-size: .72rem; color: var(--soft); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .s { font-family: var(--mono); font-size: .63rem; color: var(--dim); display: block; font-variant-numeric: tabular-nums; }
.player-slot { font-family: var(--mono); font-size: .7rem; color: var(--dim); }
.player-bar {
  display: block; height: 2px; background: var(--rule-lit); margin: .5rem 0 .4rem;
  cursor: pointer; position: relative;
}
.player-bar i { display: block; height: 100%; width: 0; background: var(--signal); transition: width .1s linear; }
@media (prefers-reduced-motion: reduce) { .player-bar i { transition: none; } }

.tracklist { list-style: none; margin: .7rem 0 0; padding: .6rem 0 0; border-top: 1px solid var(--rule); }
.tracklist li { margin: 0; }
.tracklist button {
  display: flex; align-items: baseline; gap: .6rem; width: 100%; text-align: left;
  background: none; border: 0; padding: .3rem .2rem; cursor: pointer;
  font-family: var(--mono); font-size: .72rem; color: var(--soft);
}
.tracklist button:hover { color: var(--ink); }
.tracklist button .n { color: var(--dim); font-size: .64rem; }
.tracklist button.on { color: var(--signal); }
.tracklist button.on .n { color: var(--signal); }

/* ── about / contact / foot ─────────────────────────────── */

.about-body { max-width: 45rem; }
.about-body p { color: var(--soft); margin: 0 0 1.1rem; }
.about-body p:first-child { font-size: 1.18rem; color: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.about-body p:last-child { color: var(--dim); font-size: .89rem; font-family: var(--mono); }
.contact-lede { color: var(--soft); max-width: 42rem; margin: 0 0 1.8rem; font-size: 1.02rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: .7rem; margin: 0; }

.site-foot { border-top: 1px solid var(--rule); padding: 2.2rem var(--gut); text-align: center; color: var(--dim); font-size: .8rem; font-family: var(--mono); }
.site-foot p { margin: 0 0 .35rem; }
.foot-note { font-size: .7rem; opacity: .8; }

/* ── reveal ─────────────────────────────────────────────── */

.reveal { opacity: 0; transform: translateY(12px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ─────────────────────────────────────────── */

@media (max-width: 820px) {
  .matrix { grid-template-columns: 1fr; }
  .skill-detail { position: static; }
}
@media (max-width: 780px) {
  .case { grid-template-columns: 1fr; gap: 1.3rem; }
  .site-head nav a:not(.nav-cta) { display: none; }
  .demo-foot { font-size: .68rem; }
  body { background-image: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .mini, .ctl, .chip { transition: none; }
  .pc { animation: none; }
}
