/* thedjhouse portfolio: a dark "workshop" cousin of the Duno.Games look */

:root {
  --bg: #1b1916;
  --bg-2: #211e1a;
  --panel: #26231f;
  --panel-2: #2d2924;
  --line: #3d382f;
  --text: #f1ead3;
  --muted: #a39b86;
  --lime: #b6d76c;
  --purple: #8e4482;
  --purple-soft: #d9a9cf;
  --gold: #f6c744;

  --font-head: "Gaegu", "Segoe Print", cursive;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --wobble: 14px 20px 12px 22px / 20px 12px 22px 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 1.05rem/1.65 var(--font-body);
  background-image: radial-gradient(circle at 30px 30px, rgba(182, 215, 108, .05) 0 18px, transparent 19px);
  background-size: 120px 120px;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px dashed var(--lime); outline-offset: 3px; }
.wrap { width: min(100% - 40px, 1160px); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--lime); color: #1b1916; padding: 10px 16px; border-radius: 10px; }
.skip:focus { top: 12px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1; margin: 0; }

/* ---------- Top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px clamp(16px, 4vw, 40px);
  background: linear-gradient(to bottom, rgba(27, 25, 22, .85), rgba(27, 25, 22, 0));
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wordmark { font: 700 1.9rem/1 var(--font-head); text-decoration: none; }
.bar nav { display: flex; gap: 4px; }
.bar nav a { text-decoration: none; font: 700 1.35rem/1 var(--font-head); padding: 8px 12px; border-radius: 12px; color: var(--muted); transition: color .15s, background .15s; }
.bar nav a:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; background: #000; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0, rgba(27, 25, 22, .72) 28%, rgba(27, 25, 22, .15) 65%),
    linear-gradient(to right, rgba(27, 25, 22, .55), transparent 60%);
}
.hero-inner { position: relative; width: min(100% - 40px, 1160px); margin: 0 auto; padding: 140px 0 clamp(64px, 12vh, 120px); }
.eyebrow {
  display: inline-block; margin: 0 0 14px; padding: 5px 16px; background: var(--lime); color: #1b1916;
  font: 700 1.3rem/1.2 var(--font-head); border-radius: 12px 18px 10px 16px; transform: rotate(-1.5deg);
}
.hero h1 { font-size: clamp(4rem, 14vw, 9rem); letter-spacing: .01em; text-shadow: 4px 4px 0 var(--purple); }
.lede { max-width: 40ch; margin: 18px 0 28px; font-size: clamp(1.1rem, 2.4vw, 1.35rem); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; min-height: 48px; text-decoration: none;
  font: 700 1.5rem/1 var(--font-head); color: var(--text); background: rgba(255, 255, 255, .08);
  border: 3px solid var(--text); border-radius: var(--wobble); transition: transform .15s, background .15s, box-shadow .15s;
}
.pill span { font: 500 1rem/1 var(--font-mono); }
.pill:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--lime); }
.pill-main { background: var(--purple); border-color: var(--text); }
.video-toggle {
  position: absolute; right: clamp(16px, 4vw, 40px); bottom: 24px; z-index: 2; cursor: pointer;
  font: 700 1.1rem/1 var(--font-head); color: var(--text); background: rgba(27, 25, 22, .7);
  border: 2px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.video-toggle:hover { border-color: var(--lime); }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; width: 26px; height: 42px; margin-left: -13px; border: 3px solid var(--text); border-radius: 14px; opacity: .7; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--text); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; max-width: 62ch; }
.kicker { margin: 0 0 6px; font: 500 .95rem/1 var(--font-mono); color: var(--lime); letter-spacing: .08em; }
.section h2 { font-size: clamp(2.8rem, 7vw, 4.6rem); }
.section h2::after {
  content: ""; display: block; width: 110px; height: 14px; margin-top: 10px; background: var(--purple-soft);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14' viewBox='0 0 30 14'%3E%3Cpath d='M0 7 Q7.5 -1 15 7 T30 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14' viewBox='0 0 30 14'%3E%3Cpath d='M0 7 Q7.5 -1 15 7 T30 7' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
}
.intro { margin: 18px 0 0; color: var(--muted); font-size: 1.15rem; }

/* ---------- Code editor ---------- */
.ide { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #171512; box-shadow: 8px 8px 0 rgba(142, 68, 130, .55); }
.explorer { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.explorer-title { margin: 0 8px 8px; font: 500 .75rem/1 var(--font-mono); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.file {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  padding: 10px 12px; border: 0; border-left: 3px solid transparent; border-radius: 8px; background: none; color: var(--muted);
  font: 500 .95rem/1.2 var(--font-mono); transition: background .15s, color .15s;
}
.file small { font: 500 .78rem/1.3 var(--font-body); color: #7f7867; }
.file:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.file[aria-selected="true"] { background: rgba(182, 215, 108, .1); border-left-color: var(--lime); color: var(--text); }

.editor { min-width: 0; display: flex; flex-direction: column; }
.editor-bar { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 7px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--purple-soft); }
.dots i:nth-child(2) { background: var(--gold); }
.dots i:nth-child(3) { background: var(--lime); }
.editor-file { flex: 1; font: 500 .9rem/1 var(--font-mono); color: var(--muted); }
.copy {
  cursor: pointer; font: 700 1.1rem/1 var(--font-head); color: var(--text); background: transparent;
  border: 2px solid var(--line); border-radius: 10px; padding: 6px 14px; transition: border-color .15s, background .15s;
}
.copy:hover { border-color: var(--lime); }
.copy.done { background: var(--lime); border-color: var(--lime); color: #1b1916; }

pre.code { margin: 0; padding: 18px 0; overflow: auto; max-height: 540px; tab-size: 4; counter-reset: ln; font: 400 .92rem/1.7 var(--font-mono); }
pre.code code { display: block; min-width: max-content; font: inherit; }
.line { display: block; padding: 0 24px 0 0; white-space: pre; }
.line::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 3.4em; padding-right: 1.2em; margin-right: .4em; text-align: right; color: #5f5a4c; user-select: none; }
.line:hover { background: rgba(255, 255, 255, .03); }

.t-comment { color: #8b8573; font-style: italic; }
.t-keyword { color: var(--purple-soft); }
.t-string { color: var(--lime); }
.t-number { color: var(--gold); }
.t-fn { color: #7fd0e8; }
.t-builtin { color: #f2a65a; }
.t-type { color: #e77bb0; }
code { color: #e8e1ce; }

.notes { padding: 18px 22px 22px; border-top: 1px solid var(--line); background: var(--panel); }
.notes h3 { font-size: 1.9rem; margin-bottom: 6px; }
.notes p { margin: 0 0 12px; color: var(--muted); max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li { padding: 2px 12px; font: 500 .8rem/1.6 var(--font-mono); color: var(--lime); border: 1px solid rgba(182, 215, 108, .4); border-radius: 999px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: 240px; grid-auto-flow: dense; gap: 18px; }
.shot { margin: 0; }
.shot.wide { grid-column: span 2; }
.shot.tall { grid-row: span 2; }
.shot-btn {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; cursor: zoom-in; overflow: hidden;
  background: var(--panel); border: 3px solid var(--text); border-radius: var(--wobble); color: inherit;
  transition: transform .25s, box-shadow .25s;
}
.shot-btn:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 6px 6px 0 var(--purple); }
.shot-btn img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.shot-btn:hover img { transform: scale(1.06); }
.shot-btn figcaption, .shot-cap {
  position: absolute; inset: auto 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  padding: 36px 16px 14px; background: linear-gradient(to top, rgba(14, 13, 11, .92), transparent);
  transform: translateY(35%); opacity: .9; transition: transform .3s, opacity .3s;
}
.shot-btn:hover .shot-cap, .shot-btn:focus-visible .shot-cap { transform: none; opacity: 1; }
.shot-cap b { font: 700 1.6rem/1 var(--font-head); }
.shot-cap span { font: 500 .8rem/1.4 var(--font-mono); color: var(--lime); }
.badge { position: absolute; top: 12px; left: 12px; padding: 3px 12px; font: 700 1.05rem/1.3 var(--font-head); color: #1b1916; background: var(--gold); border-radius: 10px 14px 8px 12px; }

/* ---------- Lightbox ---------- */
dialog#lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100dvh; color: var(--text); }
dialog#lightbox::backdrop { background: rgba(10, 9, 8, .92); }
.lb { position: relative; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 16px; padding: 56px clamp(16px, 7vw, 100px) 24px; }
.lb-stage { min-height: 0; display: grid; place-items: center; }
.lb-stage > img, .lb-stage .compare { max-width: 100%; max-height: 100%; border: 3px solid var(--text); border-radius: var(--wobble); background: #000; }
.lb-stage > img { width: auto; height: auto; object-fit: contain; }
.lb-info { text-align: center; max-width: 70ch; margin: 0 auto; }
.lb-info h3 { font-size: 2.2rem; }
.lb-info p { margin: 6px 0 8px; color: var(--muted); }
.lb-info .chips { justify-content: center; }
.lb-close, .lb-nav {
  position: absolute; z-index: 3; width: 48px; height: 48px; cursor: pointer; display: grid; place-items: center;
  font: 400 2rem/1 var(--font-body); color: var(--text); background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .5); border-radius: 50%;
}
.lb-close:hover, .lb-nav:hover { background: var(--purple); }
.lb-close { top: 12px; right: 16px; }
.lb-nav { top: 50%; margin-top: -48px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

.badge-r { left: auto; right: 12px; background: var(--text); }
.lb-thumbs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lb-thumb { width: 88px; height: 56px; padding: 0; cursor: pointer; overflow: hidden; opacity: .55; background: none; border: 2px solid var(--line); border-radius: 8px; transition: opacity .15s, border-color .15s; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: .9; }
.lb-thumb[aria-current="true"] { opacity: 1; border-color: var(--lime); }

/* before / after slider */
.compare { --pos: 50%; position: relative; aspect-ratio: 16 / 10; width: min(100%, 1100px); max-height: 100%; overflow: hidden; user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: var(--text); pointer-events: none; }
.compare-line::after {
  content: "\2194"; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center;
  font-size: 1.3rem; color: #1b1916; background: var(--lime); border: 3px solid var(--text); border-radius: 50%;
}
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input:focus-visible + .compare-line::after { outline: 3px dashed var(--text); outline-offset: 3px; }
.compare .tag { position: absolute; bottom: 12px; padding: 2px 12px; font: 700 1.1rem/1.4 var(--font-head); color: var(--text); background: rgba(14, 13, 11, .75); border-radius: 8px; pointer-events: none; }
.compare .tag-b { left: 12px; }
.compare .tag-a { right: 12px; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact h2::after { margin-inline: auto; }
.contact .intro { margin-inline: auto; max-width: 50ch; }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 28px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 24px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.foot p { margin: 0; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; translate: 0 22px; transition: opacity .6s ease, translate .6s ease; }
.js .reveal.in { opacity: 1; translate: 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .ide { grid-template-columns: 1fr; }
  .explorer { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .explorer-title { display: none; }
  .file { flex: none; border-left: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; }
  .file small { display: none; }
  .file[aria-selected="true"] { border-bottom-color: var(--lime); }
  .shot.wide { grid-column: auto; }
}
@media (max-width: 560px) {
  .bar nav a { font-size: 1.15rem; padding: 6px 8px; }
  .gallery { grid-auto-rows: 220px; }
  .shot.tall { grid-row: auto; }
  .lb-nav { top: auto; bottom: 150px; margin: 0; }
  .line::before { width: 2.6em; padding-right: .8em; }
  pre.code { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: 0 0; }
}
