/* ============================================================
   Apa Dilag — /fun
   Design tokens ported verbatim from the main portfolio so both
   sites read as one family — same defaults, same theme key.
   ============================================================ */

:root {
  --bg: #121512;
  --bg2: #171c17;
  --bg3: #1d231d;
  --line: #232a23;
  --line2: #2c342c;
  --text: #e8ece7;
  --muted: #aab2a8;
  --faint: #6e786c;
  --accent: #7fb487;
  --accentSoft: rgba(127, 180, 135, 0.12);
  --accentInk: #0c100c;
  --err: #d9706b;
  --shadow: rgba(0, 0, 0, 0.32);
  --maxw: 1200px;
}

[data-theme="light"] {
  --bg: #f3f5f1;
  --bg2: #ffffff;
  --bg3: #eef1ec;
  --line: #e2e6dd;
  --line2: #d4dacf;
  --text: #161a15;
  --muted: #4f5a4c;
  --faint: #8a9486;
  --accent: #3c7a4a;
  --accentSoft: rgba(60, 122, 74, 0.10);
  --accentInk: #ffffff;
  --err: #c05550;
  --shadow: rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Hanken Grotesk', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* full-bleed hero canvas without a horizontal scrollbar */
}
::selection { background: var(--accentSoft); }
a { color: inherit; }
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------------- layout ---------------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }

/* ---------------- nav ---------------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.nav nav {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand span { color: var(--accent); }
.brand .path {
  font-family: 'IBM Plex Mono', monospace; font-weight: 400;
  font-size: 13px; color: var(--muted); margin-left: 2px;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a.navlink {
  text-decoration: none; font-family: 'IBM Plex Mono', monospace;
  font-size: 13px; color: var(--muted); transition: color .18s;
}
.nav-links a.navlink:hover { color: var(--text); }

button.theme-toggle {
  background: transparent; border: 1px solid var(--line2); color: var(--muted);
  font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  padding: 7px 12px; border-radius: 3px; cursor: pointer; transition: color .18s, border-color .18s;
}
button.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* ---------------- hero ---------------- */
.hero { position: relative; padding: 88px 0 24px; }

.hero-canvas {
  position: absolute;
  top: 0; height: 100%;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: 0; display: block; pointer-events: none;
}
.hero-fade {
  position: absolute; top: 0; height: 100%;
  left: 50%; width: 100vw; transform: translateX(-50%);
  z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 25%, var(--bg) 100%);
}

.hero-inner { position: relative; z-index: 2; }
.hero-kicker {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 26px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 76px); line-height: 1.0; font-weight: 800;
  letter-spacing: -0.03em; margin: 0; max-width: 14ch;
}
.hero h1 .accent-dot { color: var(--accent); }
.hero-sub { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 60ch; margin: 22px 0 0; }

/* ---------------- the things ---------------- */
.things {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 20px;
  padding: 40px 0 96px;
}

.thing {
  display: grid; grid-template-columns: 380px 1fr; gap: 28px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 5px;
  padding: 20px; text-decoration: none; color: inherit;
  max-width: 900px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.thing:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px var(--shadow); }

/* live, scaled-down render of the actual page */
.thing-preview {
  position: relative; display: block; overflow: hidden;
  border: 1px solid var(--line); border-radius: 4px;
  aspect-ratio: 16 / 10; background: var(--bg3);
}
.thing-preview-shield {
  position: absolute; inset: 0; z-index: 1;
}
.thing-preview iframe {
  position: absolute; top: 0; left: 0;
  width: 400%; height: 400%;
  transform: scale(0.25); transform-origin: 0 0;
  border: 0; pointer-events: none;
}

.thing-info { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 6px 6px 0; }
.thing-info .num { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.thing-name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.thing-info .org { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.thing-info .blurb { font-size: 15px; line-height: 1.6; color: var(--muted); margin-top: 14px; }
.thing-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); background: var(--bg3); padding: 4px 9px; border-radius: 3px; }
.thing-info .open { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--accent); margin-top: auto; padding-top: 16px; }

/* ---------------- footer ---------------- */
footer.site { border-top: 1px solid var(--line); }
footer.site .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 24px 32px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--faint);
}
footer.site a { text-decoration: none; transition: color .18s; }
footer.site a:hover { color: var(--accent); }

/* ---------------- responsive ---------------- */
@media (max-width: 820px) {
  main, header.nav nav, footer.site .inner { padding-left: 20px; padding-right: 20px; }
  .thing { grid-template-columns: 1fr; gap: 18px; }
  .thing-info { padding: 0 4px 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .thing:hover { transform: none; }
}
