/* Catppuccin Latte (light) / Mocha (dark) — https://catppuccin.com */
html[data-theme="latte"] {
  --base:#eff1f5; --mantle:#e6e9ef; --crust:#dce0e8;
  --surface0:#ccd0da; --surface1:#bcc0cc; --surface2:#acb0be;
  --text:#4c4f69; --subtext1:#5c5f77; --subtext0:#6c6f85;
  --mauve:#8839ef; --pink:#ea76cb; --peach:#fe640b; --green:#40a02b;
  --teal:#179299; --sky:#04a5e5; --yellow:#df8e1d; --red:#d20f39;
  --hl: color-mix(in srgb, var(--yellow) 52%, transparent);
  --shadow: rgba(76,79,105,.12);
}
html[data-theme="mocha"] {
  --base:#1e1e2e; --mantle:#181825; --crust:#11111b;
  --surface0:#313244; --surface1:#45475a; --surface2:#585b70;
  --text:#cdd6f4; --subtext1:#bac2de; --subtext0:#a6adc8;
  --mauve:#cba6f7; --pink:#f5c2e7; --peach:#fab387; --green:#a6e3a1;
  --teal:#94e2d5; --sky:#89dceb; --yellow:#f9e2af; --red:#f38ba8;
  --hl: color-mix(in srgb, var(--mauve) 42%, transparent);
  --shadow: rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: Fredoka, ui-rounded, system-ui, sans-serif;
  font-weight: 350;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand { font-family: Silkscreen, ui-monospace, monospace; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 .9em; }
a { color: var(--mauve); text-decoration-thickness: 2px; text-underline-offset: 3px; }
:focus-visible { outline: 3px dashed var(--peach); outline-offset: 3px; border-radius: 6px; }

/* ---------- header ---------- */
.top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 3rem);
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--base) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--surface1);
}
.brand { color: var(--text); text-decoration: none; font-size: .95rem; }
.brand span { color: var(--pink); }
.top nav { display: flex; align-items: center; gap: 1rem; font-size: .95rem; }
.top nav a { color: var(--subtext0); text-decoration: none; }
.top nav a:hover { color: var(--mauve); text-decoration: underline wavy; }

#theme-toggle {
  font: inherit; font-size: 1.05rem; line-height: 1;
  background: var(--surface0); color: var(--text);
  border: 2px solid var(--surface2);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: .35rem .7rem; cursor: pointer;
}
#theme-toggle:hover { background: var(--surface1); }

main { padding: 0 clamp(1rem, 4vw, 3rem); max-width: 1120px; margin: 0 auto; }

/* ---------- hero ---------- */
.hero { padding: clamp(2rem, 7vw, 4.5rem) 0 1rem; }
.kicker {
  font-family: Silkscreen, monospace; font-size: .7rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 1.1rem;
}
.hero h1 { font-size: clamp(1.35rem, 3.6vw, 2.1rem); margin: 0 0 1.2rem; }
.mark {
  background: linear-gradient(transparent 70%, var(--hl) 70%);
  padding: 0 .12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lede { max-width: 62ch; color: var(--subtext1); font-size: 1.02rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  font: inherit; font-weight: 500; text-decoration: none;
  display: inline-block; padding: .55rem 1.15rem;
  background: var(--surface0); color: var(--text);
  border: 2px solid var(--text);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  box-shadow: 3px 3px 0 var(--surface2);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--surface2); }
.btn.ghost { background: transparent; border-color: var(--surface2); box-shadow: none; }
.hero-doodle { width: 100%; height: 120px; display: block; margin-top: 1.4rem; }

/* ---------- sections ---------- */
.sec-title { font-size: .95rem; margin: 0 0 1.4rem; color: var(--subtext0); text-transform: uppercase; letter-spacing: .1em; }
.work, .about { padding: clamp(2rem, 5vw, 3.5rem) 0; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; }

.card {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--mantle);
  border: 2px solid var(--surface1);
  border-radius: 16px 22px 14px 20px / 20px 14px 22px 16px;
  padding: 1.2rem 1.25rem 1.1rem;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 7px 7px 0 var(--shadow); border-color: var(--mauve); }
.card h3 { font-size: .92rem; margin: .35rem 0 .5rem; }
.card .who { font-family: Silkscreen, monospace; font-size: .58rem; letter-spacing: .1em; text-transform: uppercase; color: var(--subtext0); }
.card p { font-size: .93rem; color: var(--subtext1); margin: 0 0 .8rem; }
.card canvas { width: 100%; height: 84px; display: block; margin: .2rem 0 .6rem; }
.card .mini {
  font-family: Silkscreen, monospace; font-size: .58rem; letter-spacing: .04em;
  color: var(--teal); min-height: 84px; display: flex; align-items: center; margin: .2rem 0 .6rem;
}
.card .more { font-family: Silkscreen, monospace; font-size: .6rem; color: var(--mauve); letter-spacing: .06em; }

/* ---------- about ---------- */
.about-box {
  background: var(--mantle);
  border: 2px dashed var(--surface1);
  border-radius: 16px 22px 14px 20px / 20px 14px 22px 16px;
  padding: clamp(1.1rem, 3vw, 1.8rem);
  max-width: 74ch;
}
.about-box p { color: var(--subtext1); }
.fine { font-size: .85rem; color: var(--subtext0); margin-bottom: 0; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .45rem; padding: 0; margin: .9rem 0 1.1rem; }
.chips li {
  font-family: Silkscreen, monospace; font-size: .58rem; letter-spacing: .06em;
  padding: .3rem .6rem; background: var(--surface0); color: var(--subtext1);
  border: 1px solid var(--surface2); border-radius: 999px;
}

/* ---------- dialog ---------- */
.detail {
  width: min(760px, 92vw); max-height: 88vh;
  background: var(--base); color: var(--text);
  border: 2px solid var(--text); border-radius: 18px 24px 16px 22px / 22px 16px 24px 18px;
  padding: 0; box-shadow: 10px 10px 0 var(--shadow);
}
.detail:focus, .detail:focus-visible { outline: none; }
.detail::backdrop { background: color-mix(in srgb, var(--crust) 72%, transparent); backdrop-filter: blur(3px); }
.facts { margin: -.2rem 0 1.1rem; }
.facts li { background: color-mix(in srgb, var(--teal) 14%, var(--surface0)); color: var(--subtext1); }
#d-chart[hidden], #d-caption[hidden] { display: none; }
.detail article { padding: clamp(1.1rem, 3vw, 1.9rem); }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.detail-head h3 { margin: 0; font-size: 1.05rem; }
.detail-head .kicker { margin-bottom: .4rem; }
.close {
  font: inherit; background: transparent; border: 0; color: var(--subtext0);
  font-size: 1.1rem; cursor: pointer; padding: .2rem .4rem; border-radius: 999px;
  outline-offset: 1px;
}
.close:hover { color: var(--red); }
.d-tagline { color: var(--subtext0); font-size: .95rem; margin: .7rem 0 1rem; }
#d-chart { width: 100%; height: 210px; display: block; }
.cap { font-family: Silkscreen, monospace; font-size: .56rem; letter-spacing: .05em; color: var(--subtext0); margin: .4rem 0 1.3rem; }

.shots { display: grid; gap: .9rem; margin: 0 0 1.4rem; }
.shots:empty { display: none; }
.shots figure { margin: 0; }
.shots img {
  width: 100%; height: auto; display: block;
  background: var(--mantle); border: 2px solid var(--surface1);
  border-radius: 12px 16px 10px 14px / 14px 10px 16px 12px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.shots figcaption {
  font-family: Silkscreen, monospace; font-size: .56rem; letter-spacing: .05em;
  color: var(--subtext0); margin-top: .35rem;
}
.d-body { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.d-body h4 { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal); margin: 0 0 .3rem; }
.d-body p, .d-body ul { margin: 0; color: var(--subtext1); font-size: .95rem; }
.d-body ul { padding-left: 1.1rem; }
.d-body li { margin-bottom: .25rem; }

/* ---------- footer ---------- */
.foot {
  text-align: center; padding: 2.5rem 1rem 3rem;
  color: var(--subtext0); font-size: .85rem;
  border-top: 2px dashed var(--surface1); margin-top: 2rem;
}

@media (min-width: 620px) {
  .d-body { grid-template-columns: 1fr 1fr; }
  .d-body section:last-of-type { grid-column: 1 / -1; }
}

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