/* ==========================================================
   nineplop — styles
   Colors live in :root; dark mode redefines them below.
   ========================================================== */

:root {
  --bg: #fff5e4;
  --bg-2: #ffeccc;
  --card: #ffffff;
  --ink: #1d1a2e;
  --ink-soft: #5b5670;
  --line: #1d1a2e;

  --tomato: #ff5a4e;
  --sun: #ffc93c;
  --teal: #20bfae;
  --lilac: #8c6cff;
  --pink: #ff8fc7;

  --shadow: 4px 4px 0 var(--line);
  --shadow-lg: 7px 7px 0 var(--line);
  --radius: 18px;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131f;
    --bg-2: #201b2e;
    --card: #221d31;
    --ink: #f7efe0;
    --ink-soft: #b3aac6;
    --line: #000000;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131f;
  --bg-2: #201b2e;
  --card: #221d31;
  --ink: #f7efe0;
  --ink-soft: #b3aac6;
  --line: #000000;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }

:focus-visible { outline: 3px solid var(--lilac); outline-offset: 3px; border-radius: 6px; }

/* ---------------- HERO ---------------- */

.hero {
  position: relative;
  height: 100svh;
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

#plop-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-inner {
  position: relative;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
}

.wordmark {
  margin: 0;
  font-weight: 800;
  font-size: clamp(64px, 17vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  display: flex;
  justify-content: center;
}
.wordmark span {
  display: inline-block;
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.35s);
}
.wordmark span:nth-child(1) { --i: 1; }
.wordmark span:nth-child(2) { --i: 2; }
.wordmark span:nth-child(3) { --i: 3; }
.wordmark span:nth-child(4) { --i: 4; }
.wordmark span:nth-child(5) { --i: 5; color: var(--tomato); }
.wordmark span:nth-child(6) { --i: 6; color: var(--tomato); }
.wordmark span:nth-child(7) { --i: 7; color: var(--tomato); }
.wordmark span:nth-child(8) { --i: 8; color: var(--tomato); }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-0.06em) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) { .wordmark span { animation: none; } }

.tagline {
  margin: 12px 0 0;
  font-size: clamp(18px, 2.6vw, 26px);
  color: var(--ink-soft);
}
.tagline em { font-style: normal; color: var(--ink); font-weight: 600; }

.hint {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-soft);
}

.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  translate: -50% 0;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--line);
  border-radius: 50%;
  background: var(--sun);
  color: #1d1a2e;
  text-decoration: none;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.scroll-cue:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); }

/* ---------------- LAYOUT ---------------- */

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) { main { padding: 0 32px; } }

.section { padding: 56px 0; }

.section h2 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

/* ---------------- NOW ---------------- */

.now {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 12px 18px;
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  width: fit-content;
  max-width: 100%;
  font-size: 16px;
}
.now-label { color: var(--ink-soft); }
.now-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 var(--teal);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal) 60%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* ---------------- FILTERS ---------------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 6px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, background .12s;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------------- GRID / CARDS ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s cubic-bezier(.3,1.6,.6,1), box-shadow .15s;
}
.card:hover, .card:focus-visible {
  transform: translate(-3px, -3px) rotate(-0.6deg);
  box-shadow: var(--shadow-lg);
}
.card:nth-child(even):hover { transform: translate(-3px, -3px) rotate(0.6deg); }

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-bottom: 2.5px solid var(--line);
  background: var(--c, var(--lilac));
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-thumb .glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 64px;
  font-weight: 800;
  color: #1d1a2e;
}
.card-thumb .glyph::before,
.card-thumb .glyph::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
}
.card-thumb .glyph::before { width: 120px; height: 120px; left: -30px; bottom: -40px; }
.card-thumb .glyph::after { width: 60px; height: 60px; right: 18px; top: 14px; }

.card-kind {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 2px solid var(--line);
  color: var(--ink);
}

.card-body { padding: 14px 18px 18px; }
.card-body h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.card-body p { margin: 0; font-size: 16px; color: var(--ink-soft); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-soft);
}
.tag::before { content: "#"; opacity: .6; }

.empty { color: var(--ink-soft); font-family: var(--font-mono); }

/* ---------------- ABOUT ---------------- */

.about {
  display: grid;
  gap: 20px 48px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .about { grid-template-columns: 260px 1fr; }
  .about .socials { grid-column: 2; }
}
.about-body p { margin: 0 0 12px; font-size: 20px; max-width: 60ch; }

.socials {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.socials a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 8px 16px;
  border: 2.5px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.socials li:nth-child(4n+1) a:hover { background: var(--tomato); }
.socials li:nth-child(4n+2) a:hover { background: var(--sun); }
.socials li:nth-child(4n+3) a:hover { background: var(--teal); }
.socials li:nth-child(4n+4) a:hover { background: var(--pink); }
.socials a:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-lg); color: #1d1a2e; }

/* ---------------- FOOTER ---------------- */

.footer {
  max-width: 1120px;
  margin: 40px auto 0;
  padding: 28px 16px 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink-soft);
  border-top: 2.5px dashed color-mix(in srgb, var(--ink) 25%, transparent);
}
@media (min-width: 720px) { .footer { padding-left: 32px; padding-right: 32px; } }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------------- MODAL ---------------- */

.modal {
  padding: 0;
  border: none;
  background: transparent;
  width: min(1100px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100svh - 24px);
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop {
  background: color-mix(in srgb, #1d1a2e 70%, transparent);
  backdrop-filter: blur(4px);
}
.modal[open] .modal-card { animation: pop-in .28s cubic-bezier(.3,1.5,.6,1); }
@keyframes pop-in {
  from { transform: scale(.9) translateY(20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-card {
  background: var(--card);
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: calc(100svh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 14px 16px 12px 20px;
  border-bottom: 2.5px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
.modal-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .12s;
}
.icon-btn:hover { background: var(--sun); color: #1d1a2e; }
.icon-btn[hidden] { display: none; }

.modal-stage {
  background: #0f0d16;
  position: relative;
  flex-shrink: 1;
  min-height: 0;
}
.modal-stage:empty { display: none; }
.modal-stage iframe,
.modal-stage video,
.modal-stage img,
.modal-stage model-viewer {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.modal-stage img { object-fit: contain; max-height: 70svh; }
.modal-stage .ratio { aspect-ratio: var(--ratio, 16 / 9); max-height: 70svh; width: 100%; margin: 0 auto; }
.modal-stage:fullscreen .ratio { max-height: 100svh; height: 100%; aspect-ratio: auto; }
.modal-stage:fullscreen img { max-height: 100svh; }

.gallery { display: flex; gap: 8px; overflow-x: auto; padding: 8px; scroll-snap-type: x mandatory; }
.gallery img { height: 60svh; width: auto; max-width: none; flex-shrink: 0; scroll-snap-align: center; border-radius: 8px; }

.modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
}
.modal-body p { margin: 0 0 10px; max-width: 70ch; }
.modal-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.modal-links a {
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 7px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  background: var(--sun);
  color: #1d1a2e;
  box-shadow: 3px 3px 0 var(--line);
}
.modal-links a:hover { background: var(--teal); }

body.modal-open { overflow: hidden; }
