/* ============================================================
   Kyoss — portfolio
   Design tokens first. Everything below reads from them, and so do
   review.css and case.css, so keep the token names.
   ============================================================ */

/* Self-hosted, so the site makes no third-party requests. Both SIL OFL 1.1. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --ink:        #ece8f6;
  --ink-soft:   #a79fc0;
  --ink-faint:  #847ca6;

  --bg:         #0d0a14;
  --bg-raise:   #16111f;
  --bg-alt:     #110d19;
  --line:       #292036;
  --line-soft:  #1f1830;

  --accent:     #b794f6;
  --accent-dim: #7c5cbf;
  --accent-ink: #1a0f2e;
  --gold:       #e0a3d5;

  --radius:     6px;
  --radius-sm:  4px;
  --maxw:       1120px;
  --side:       380px;

  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font:    "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.025em; }
/* slim scrollbars in the site's colours, for the page and the plugin window */
/* Firefox only: in Chrome and Edge these would switch off the rules below, arrows and all */
@supports not selector(::-webkit-scrollbar) {
  html, .drawer { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-dim); }
::-webkit-scrollbar-button { display: none; }

::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ============================================================
   Shared page chrome — used by tokyocore.html and review.html
   ============================================================ */

.nav {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 26px 16px;
}
.brand { text-decoration: none; display: inline-flex; align-items: baseline; }
.brand-mark { display: none; }
.brand-name { font: 800 1.6rem/1 var(--display); letter-spacing: -.04em; }
.brand-name::after { content: "."; color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 24px; font-size: .95rem; font-weight: 500; }
.nav nav a { text-decoration: none; color: var(--ink-soft); }
.nav nav a:hover { color: var(--ink); }
.nav nav .nav-cta {
  color: var(--accent-ink); background: var(--accent);
  padding: 9px 16px; border-radius: var(--radius-sm); font-weight: 600;
}
.nav nav .nav-cta:hover { background: #cbb0fb; color: var(--accent-ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-raise); color: var(--ink);
  font: 600 .95rem var(--font); text-decoration: none; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn:hover { border-color: var(--accent-dim); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #cbb0fb; border-color: #cbb0fb; }
.btn-small { padding: 9px 15px; font-size: .88rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.eyebrow { margin: 0; color: var(--gold); font-weight: 600; font-size: .88rem; }

.section { max-width: var(--maxw); margin: 0 auto; padding: 48px 16px; }

/* the accent closing panel, on every page */
.contact-card, .hire {
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px);
}
.contact-card h2, .hire h2 {
  font: 800 clamp(2rem, 4.5vw, 3.4rem)/.98 var(--display); letter-spacing: -.04em; margin: 0;
}
.contact-card p, .hire p { margin: 14px 0 0; max-width: 52ch; }
.contact-card .btn { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--ink); }
.contact-card .btn:hover { background: #2a1a47; }
.contact-card .btn-primary { background: var(--ink); border-color: var(--ink); color: var(--accent-ink); }
.contact-card .btn-primary:hover { background: #fff; }

.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 32px 16px 48px;
  color: var(--ink-faint); font-size: .85rem;
}
.foot p { margin: 0; }

/* ============================================================
   index.html — one column of sections, each doing one job:
   intro, plugins, servers, how I work, contact.
   ============================================================ */

.wrap { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }

/* the nav sticks, so the sections are always one click away */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(13, 10, 20, .86); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.top .nav { padding: 16px 0; max-width: none; }

/* ---------- intro ---------- */
.intro { padding: clamp(64px, 12vw, 128px) 0 clamp(56px, 9vw, 96px); }
.intro h1 {
  font: 800 clamp(2.6rem, 6.5vw, 4.6rem)/1 var(--display); letter-spacing: -.045em;
  margin: 14px 0 0; max-width: 16ch;
}
.intro h1 em { font-style: normal; color: var(--accent); }
.intro .lead { color: var(--ink-soft); font-size: 1.12rem; max-width: 54ch; margin: 22px 0 0; }
.intro .hero-actions { margin-top: 32px; }

.facts {
  list-style: none; margin: 56px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}
.facts li { padding: 20px 20px 0 0; }
.facts b { display: block; font: 800 2rem/1 var(--display); letter-spacing: -.03em; }
.facts span { color: var(--ink-faint); font-size: .9rem; }

/* ---------- sections ---------- */
.part { padding: 72px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: 64px; }
.part-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 32px; }
.part-head h2 { font: 800 clamp(1.9rem, 4vw, 2.6rem)/1.05 var(--display); letter-spacing: -.035em; margin: 8px 0 0; }
.part-head p { margin: 10px 0 0; color: var(--ink-soft); max-width: 52ch; }

/* intro video */
.reel { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--bg-raise); box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.reel video { display: block; width: 100%; height: 100%; background: var(--bg); }

/* ---------- plugins ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 .88rem var(--font); color: var(--ink-soft); cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 13px;
}
.chip:hover { color: var(--ink); border-color: var(--accent-dim); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer;
  font: inherit; color: inherit; min-height: 200px;
  background: var(--bg-raise); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 22px; transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card[hidden] { display: none; }
.card .pic { position: relative; display: block; margin: -22px -22px 10px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-alt); }
.card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .pic img { transform: scale(1.04); }
.card .k { font-size: .8rem; color: var(--gold); font-weight: 600; }
.card h3 { font: 700 1.3rem/1.15 var(--display); letter-spacing: -.02em; margin: 0; }
.card p { margin: 0; color: var(--ink-soft); font-size: .94rem; }
.card .status { align-self: flex-start; font-size: .75rem; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: 3px; padding: 1px 7px; }
.card .go { margin-top: auto; padding-top: 10px; font-size: .82rem; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 12px; }
.card .go i { font-style: normal; color: var(--accent); opacity: 0; transition: opacity .2s; }
.card:hover .go i, .card:focus-visible .go i { opacity: 1; }

.more-row { display: flex; justify-content: center; margin-top: 28px; }
.more-row:has([hidden]) { display: none; }

/* ---------- servers ---------- */
.servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.srv {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 24px;
}
.srv .logo { height: 72px; display: flex; align-items: center; margin-bottom: 6px; }
.srv .logo img { max-height: 72px; max-width: 180px; object-fit: contain; }
.srv .logo img.px { width: 64px; height: 64px; image-rendering: pixelated; }
.srv .logo-fallback { font: 800 1.1rem var(--display); }
.srv h3 { font: 700 1.35rem/1.1 var(--display); letter-spacing: -.02em; margin: 0; }
.srv .r { color: var(--accent); font-size: .88rem; font-weight: 500; margin: 0; }
.srv p { margin: 0; color: var(--ink-soft); font-size: .94rem; }
.srv .tags { font-size: .8rem; color: var(--ink-faint); }
.srv .tags span + span::before { content: "·"; margin: 0 7px; }
.srv .btn { align-self: flex-start; margin-top: auto; }
.srv .q { margin-top: auto; padding-top: 6px; font-style: italic; color: var(--ink); }
.srv .q.pending { font-style: normal; color: var(--ink-faint); font-size: .85rem; }

/* ---------- how I work ---------- */
.steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px;
  padding: 22px 0; border-top: 1px solid var(--line-soft);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: "0" counter(s); color: var(--accent); font: 600 .9rem var(--mono); padding-top: 4px; }
.steps h3 { font: 600 1.15rem/1.35 var(--display); letter-spacing: -.015em; margin: 0; }
.steps p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- contact ---------- */
.hire { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: end; }
.hire ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hire li a, .hire li span {
  display: flex; justify-content: space-between; gap: 12px; text-decoration: none;
  background: var(--accent-ink); color: var(--ink); border-radius: var(--radius-sm); padding: 12px 16px;
  overflow-wrap: anywhere;
}
.hire li small { color: var(--ink-faint); font-size: .85rem; }
.hire li a:hover { background: #2a1a47; }
.home-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* the detail drawer */
.scrim {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(5, 3, 9, .75); opacity: 0; pointer-events: none; transition: opacity .3s;
}
/* the plugin detail window, centred over the page */
.drawer {
  position: fixed; top: 50%; left: 50%; z-index: 21;
  width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 40px clamp(20px, 4vw, 48px);
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translate(-50%, -48%) scale(.98);
  transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s;
}
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity .2s, transform .25s cubic-bezier(.2, .8, .2, 1); }
/* stays in the top-right corner while the window scrolls */
.drawer .x {
  position: sticky; top: 0; float: right; z-index: 1;
  margin: -16px -20px 0 16px;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--bg-alt); border: 1px solid var(--line); color: var(--ink-soft);
  font-size: 1.2rem; cursor: pointer;
}
.drawer .x:hover { color: var(--ink); border-color: var(--accent-dim); }
.drawer .k { color: var(--gold); font-weight: 600; font-size: .85rem; }
.drawer h2 { font: 800 2.6rem/1 var(--display); letter-spacing: -.04em; margin: 8px 0 6px; overflow-wrap: anywhere; }
.drawer .sc { color: var(--ink-faint); font-size: .88rem; }
.drawer .lead { font: 600 1.25rem/1.35 var(--display); letter-spacing: -.01em; margin: 24px 0; }
.drawer ul { margin: 0; padding: 0 0 0 18px; color: var(--ink-soft); }
.drawer li { margin-bottom: 10px; }
.drawer li::marker { color: var(--accent); }
.drawer .nt { margin: 22px 0; padding: 16px 18px; background: var(--bg-raise); border-radius: var(--radius-sm); color: var(--ink-soft); font-size: .95rem; }
.drawer h4 { margin: 24px 0 8px; font-size: .85rem; font-weight: 600; color: var(--ink-faint); }
.drawer code {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 8px;
  background: var(--bg-raise); border: 1px solid var(--line-soft); border-radius: 3px;
  font: .82rem var(--mono); color: var(--ink);
}

.drawer .shots { display: grid; gap: 12px; margin: 0 0 24px; }
.drawer .shots a { display: block; text-decoration: none; color: var(--ink-faint); font-size: .85rem; }
.card .pic .play { position: absolute; left: 10px; bottom: 10px; font: 600 .72rem var(--font); font-style: normal; color: var(--ink); background: rgba(13, 10, 20, .8); border-radius: 3px; padding: 2px 7px; }
.drawer .shots video { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); background: var(--bg-raise); }
.drawer .shots img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line-soft); }
.drawer .shots span { display: block; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .steps li { grid-template-columns: 40px minmax(0, 1fr); }
  .steps li p { grid-column: 2; }
  .hire { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .drawer { width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; padding: 28px 16px; }
  .drawer .x { margin: -12px -4px 0 12px; }
  .facts { grid-template-columns: 1fr; }
  .facts li { padding: 16px 0 0; display: flex; align-items: baseline; gap: 12px; }
  .facts b { font-size: 1.6rem; }
  .cards, .servers { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .nav nav { gap: 16px; }
  .nav nav a:not(.nav-cta) { display: none; }
}
