/* kkostovdesign.com
   Layout: one centred column (max 1120px). A point-cloud canvas sits behind the top of
   every page and fades out; content floats over it. Dark by default; the switch in the header flips to light and is remembered. */
:root {
  --bg: #0E0F11; --fg: #EDEDEE; --muted: #9295A0; --line: #24262B; --tile: #1A1C20; --tile-2: #22252A;
  --accent: #FF6A3D; --on-accent: #0E0F11; --glass: rgba(14, 15, 17, .72);
  --display: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --max: 1120px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #FFFFFF; --fg: #111214; --muted: #5F626A; --line: #E4E5E8; --tile: #F0F1F3; --tile-2: #E6E8EB;
  --accent: #D9441A; --on-accent: #FFFFFF; --glass: rgba(255, 255, 255, .78); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 17px; line-height: 1.6; position: relative; min-height: 100vh; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fg); color: var(--bg); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 16px; top: 16px; }

canvas.nodes { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 15; pointer-events: none; display: block; }
canvas.pc { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; pointer-events: none; display: block; }
.page { position: relative; z-index: 1; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* header */
.top { position: sticky; top: 0; z-index: 20; }
.top::before { content: ""; position: absolute; inset: 0; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transition: opacity .3s; }
.top.scrolled::before { opacity: 1; }
.top .wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 18px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 15px; letter-spacing: .04em; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 26px; font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); padding-block: 4px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"] { border-bottom: 1px solid var(--fg); }
.cta-link { font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid var(--fg); padding: 8px 16px; border-radius: 999px; white-space: nowrap; }
.cta-link:hover { background: var(--fg); color: var(--bg); }
/* dark / light switch: a pill track with a white knob; knob right = dark */
.theme-switch { position: relative; flex: none; width: 54px; height: 30px; padding: 0; border-radius: 999px; cursor: pointer;
  background: #16171A; border: 1px solid #2C2E33; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55); transition: background .3s, border-color .3s; }
.theme-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 30px; height: 22px; border-radius: 999px; background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45); transition: transform .3s cubic-bezier(.3, .7, .2, 1); }
.theme-switch[aria-checked="true"]::after { transform: translateX(18px); }
:root[data-theme="light"] .theme-switch { background: #E6E8EB; border-color: #D2D4D9; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }
.theme-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.top-r { display: flex; align-items: center; gap: 14px; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; }
@media (max-width: 860px) {
  .nav, .top .cta-link { display: none; }
  .menu-btn { display: block; }
  .top.open .nav { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); padding: 16px max(20px, env(safe-area-inset-left, 0px)) 24px; gap: 14px; border-bottom: 1px solid var(--line); font-size: 18px; }
}

/* type + bits */
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lede { font-size: 19px; color: var(--muted); max-width: 52ch; }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; padding: 12px 22px; border-radius: 999px; text-decoration: none; border: 1px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer; font-family: inherit; }
.btn.solid { background: var(--fg); color: var(--bg); }
.btn:hover { opacity: .85; }
.section { padding-block: 72px; display: flex; flex-direction: column; gap: 32px; }
.section + .section { border-top: 1px solid var(--line); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.more { font-size: 14px; color: var(--muted); }

/* hero */
.hero { min-height: min(78vh, 720px); display: flex; flex-direction: column; justify-content: center; gap: 22px; padding-block: 60px 80px; }
.hero h1 { font-size: clamp(42px, 7.4vw, 92px); font-weight: 800; max-width: 11ch; }
.hero.short { min-height: 0; padding-block: 90px 56px; }
.hero.short h1 { font-size: clamp(38px, 6vw, 72px); max-width: 16ch; }
.hero .lede, .hero h1 { text-shadow: 0 0 24px var(--bg), 0 0 8px var(--bg); }

/* work grid */
.filters { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; }
.filters button { background: none; border: 0; padding: 4px 0; color: var(--muted); cursor: pointer; font: inherit; border-bottom: 1px solid transparent; }
.filters button[aria-pressed="true"] { color: var(--fg); border-color: var(--fg); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.work { display: flex; flex-direction: column; gap: 10px; text-decoration: none; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; min-width: 0; }
.work .thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--tile); }
.work .thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.36); transition: transform .5s, filter .5s; filter: grayscale(1) contrast(1.05); }
.work:hover .thumb img, .work:focus-visible .thumb img { transform: scale(1.42); filter: none; }
.work .play { position: absolute; left: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; background: var(--bg); color: var(--fg); display: grid; place-items: center; font-size: 13px; padding-left: 2px; opacity: .92; }
.work .meta { display: flex; flex-direction: column-reverse; gap: 4px; }
.work .t { font-weight: 600; font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(2 * 1.35em); }
.work .c { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .86); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lb[hidden] { display: none; }
.lb .box { width: min(1100px, 100%); display: flex; flex-direction: column; gap: 12px; color: #EDEDEE; }
.lb .frame { aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 6px; overflow: hidden; }
.lb iframe { width: 100%; height: 100%; border: 0; display: block; }
.lb .bar { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 15px; flex-wrap: wrap; }
.lb .bar a { color: #EDEDEE; font-size: 14px; }
.lb .close { background: none; border: 1px solid rgba(237, 237, 238, .5); color: #EDEDEE; border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-size: 14px; }

/* clients */
.clients { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--display); font-weight: 700; font-size: clamp(18px, 2.4vw, 26px); color: var(--muted); }
.clients span { white-space: nowrap; }

/* packages / rows */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 1.1fr 2fr auto; gap: 24px; align-items: baseline; padding-block: 22px; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { font-size: 22px; font-weight: 700; }
.row p { color: var(--muted); }
.row .go { font-size: 14px; font-weight: 600; white-space: nowrap; }
@media (max-width: 700px) { .row { grid-template-columns: 1fr; gap: 8px; } }
.rate { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.rate b { font-family: var(--display); font-size: clamp(40px, 6vw, 64px); font-weight: 800; letter-spacing: -0.03em; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }
.cols > div { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cols h3 { font-size: 18px; font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { padding-block: 8px; border-top: 1px solid var(--line); font-size: 15px; }
.list li:last-child { border-bottom: 1px solid var(--line); }
.list a { text-decoration: none; }
.list a:hover { text-decoration: underline; }

/* about */
.split { display: grid; grid-template-columns: 5fr 6fr; gap: 56px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } }
.portrait { border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 5; background: var(--tile); }
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; filter: grayscale(1) contrast(1.05); }
.prose { display: flex; flex-direction: column; gap: 18px; max-width: 64ch; }
.prose h2 { font-size: 26px; font-weight: 700; margin-top: 12px; }
.prose h3 { font-size: 20px; font-weight: 700; margin-top: 8px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.prose blockquote { margin: 0; padding-left: 18px; border-left: 2px solid var(--fg); }
.quote { font-family: var(--display); font-size: clamp(24px, 3.4vw, 36px); font-weight: 700; max-width: 26ch; line-height: 1.2; }
.quote cite { display: block; margin-top: 12px; font-family: var(--mono); font-size: 12px; font-style: normal; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

/* forms */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field legend { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--fg); }
.field textarea { min-height: 150px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--fg); }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 15px; min-height: 1.6em; }
.status.ok { color: var(--fg); font-weight: 600; }
.status.err { color: var(--accent); }
.info { display: flex; flex-direction: column; gap: 20px; }
.info .v { font-size: 18px; font-weight: 600; word-break: break-word; }

/* blog */
.posts { display: flex; flex-direction: column; }
.post { display: grid; grid-template-columns: 140px 1fr; gap: 24px; padding-block: 26px; border-top: 1px solid var(--line); text-decoration: none; }
.post:last-child { border-bottom: 1px solid var(--line); }
.post h3 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.post p { color: var(--muted); font-size: 15px; }
.post:hover h3 { text-decoration: underline; }
@media (max-width: 640px) { .post { grid-template-columns: 1fr; gap: 6px; } }
.article { padding-block: 40px 80px; }
.article .prose { margin: 0 auto; }

/* sets */
.set-empty { border: 1px dashed var(--line); border-radius: 10px; padding: 36px 28px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 40px; }
.foot .wrap { padding-block: 48px; display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot nav, .foot .social { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }
.big-cta { padding-block: 96px; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.big-cta h2 { font-size: clamp(36px, 6vw, 72px); font-weight: 800; max-width: 14ch; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* sets */
.sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; }
@media (max-width: 900px) { .sets { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sets { grid-template-columns: 1fr; } }
.set { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 14px 14px 12px; background: var(--bg); transition: border-color .3s; }
.set.playing { border-color: var(--fg); }
.set-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.set-head h2 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.set-n, .set-meta { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); }
.set-meta { margin-left: auto; text-transform: uppercase; }
.set.playing .set-n { color: var(--accent); }
.set-player { min-height: 120px; display: flex; align-items: center; }
.set-player iframe { width: 100%; height: 120px; border: 0; border-radius: 6px; display: block; }
.set-more { margin-top: 20px; }

/* visual mode: while a set plays everything dims to 10%; hovering a part brings it back */
.top, .foot, main > *, canvas.nodes { transition: opacity 1.2s ease; }
body.listening .top, body.listening .foot, body.listening main > *, body.listening canvas.nodes { opacity: .1; }
body.listening .top:hover, body.listening .foot:hover, body.listening main > *:hover,
body.listening .top:focus-within, body.listening main > *:focus-within { opacity: 1; transition-duration: .3s; }
@media (prefers-reduced-motion: reduce) { .top, .foot, main > *, .set, .set-more, canvas.nodes { transition: none; } }
