:root {
      --bg:      #0d0d0f;
      --bg2:     #131316;
      --bg3:     #1a1a1f;
      --bg4:     #222228;
      --line:    #2a2a32;
      --muted:   #6b6b7a;
      --faint:   #3d3d4a;
      --text:    #e2e2e8;
      --dim:     #9090a0;
      --red:     #c0202a;
      --red-dim: rgba(192,32,42,0.15);
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: 'Space Grotesk', sans-serif;
      font-weight: 300;
      line-height: 1.7;
      min-height: 100vh;
      overflow-x: hidden;
    }

    /* ─── HEADER ─── */
    header {
      position: sticky; top: 0; z-index: 100;
      background: rgba(13,13,15,0.94);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--line);
      padding: 0 3rem;
      display: flex; align-items: center; justify-content: space-between;
      height: 60px;
    }
    .logo {
      font-family: 'DM Mono', monospace;
      font-size: 1rem; font-weight: 500;
      color: var(--text); text-decoration: none; cursor: pointer;
      letter-spacing: 0.01em;
    }
    .logo span { color: var(--red); }

    nav { display: flex; gap: 2.5rem; }
    nav a {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.14em;
      color: var(--muted); text-decoration: none; cursor: pointer;
      transition: color 0.2s; position: relative;
    }
    nav a::after {
      content: ''; position: absolute;
      bottom: -4px; left: 0; width: 0; height: 1px;
      background: var(--red); transition: width 0.25s;
    }
    nav a:hover { color: var(--text); }
    nav a:hover::after, nav a.active::after { width: 100%; }
    nav a.active { color: var(--text); }

    /* ─── PAGES ─── */
    .page { display: none; animation: fadein 0.3s ease; }
    .page.active { display: block; }
    @keyframes fadein {
      from { opacity: 0; transform: translateY(6px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ─── HOME ─── */
    .home-hero {
      min-height: calc(100vh - 60px);
      display: flex; flex-direction: column; justify-content: center;
      padding: 6rem 3rem 5rem; max-width: 900px;
    }
    .hero-kicker {
      font-family: 'DM Mono', monospace;
      font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.22em;
      color: var(--red); margin-bottom: 2rem;
    }
    .hero-title {
      font-family: 'DM Mono', monospace;
      font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 500;
      line-height: 1.05; letter-spacing: -0.02em;
      color: var(--text); min-height: 1.1em;
    }
    .hero-title .dot { color: var(--red); }
    .cursor {
      display: inline-block; width: 3px; height: 0.85em;
      background: var(--red); margin-left: 3px; vertical-align: middle;
      animation: blink 0.85s step-end infinite;
    }
    @keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }
    .hero-rule {
      width: 48px; height: 1px; background: var(--line);
      margin: 2.5rem 0; opacity: 0; transition: opacity 0.5s ease;
    }
    .hero-rule.in { opacity: 1; }
    .hero-desc {
      font-size: 1rem; color: var(--dim); max-width: 520px;
      line-height: 1.85; margin-bottom: 2.5rem;
      opacity: 0; transition: opacity 0.5s ease 0.1s;
    }
    .hero-desc.in { opacity: 1; }
    .hero-cta {
      display: flex; gap: 1rem; flex-wrap: wrap;
      opacity: 0; transition: opacity 0.5s ease 0.2s;
    }
    .hero-cta.in { opacity: 1; }

    .btn {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.13em;
      padding: 0.75rem 1.75rem; cursor: pointer; text-decoration: none; border: none;
      transition: background 0.2s, color 0.2s, border-color 0.2s;
    }
    .btn-primary { background: var(--red); color: #fff; }
    .btn-primary:hover { background: #d92030; }
    .btn-secondary { background: transparent; color: var(--dim); border: 1px solid var(--faint); }
    .btn-secondary:hover { border-color: var(--dim); color: var(--text); }

    .home-posts { padding: 0 3rem 5rem; border-top: 1px solid var(--line); }

    .section-label {
      font-family: 'DM Mono', monospace;
      font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.2em;
      color: var(--red); padding: 2rem 0 1.8rem;
    }

    .post-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
    .post-card {
      padding: 1.6rem; border-right: 1px solid var(--line);
      cursor: pointer; transition: background 0.2s;
    }
    .post-card:last-child { border-right: none; }
    .post-card:hover { background: var(--bg3); }
    .card-tag {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); margin-bottom: 0.6rem;
    }
    .card-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.05rem; font-weight: 700; line-height: 1.3;
      margin-bottom: 0.5rem; color: var(--text);
    }
    .card-excerpt { font-size: 0.82rem; color: var(--dim); line-height: 1.7; }
    .card-date {
      margin-top: 1.1rem; font-family: 'DM Mono', monospace;
      font-size: 0.6rem; color: var(--faint);
    }

    /* ─── DEVLOG ─── */
    .devlog-layout { display: grid; grid-template-columns: 1fr 240px; min-height: calc(100vh - 60px); }
    .devlog-main { padding: 4rem 4rem 4rem 3rem; border-right: 1px solid var(--line); }
    .devlog-sidebar {
      padding: 4rem 2rem;
      position: sticky; top: 60px;
      height: calc(100vh - 60px); overflow-y: auto;
    }
    .page-title {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 700;
      margin-bottom: 0.3rem; color: var(--text);
    }
    .page-subtitle {
      font-family: 'Roboto Slab', serif;
      font-style: normal; color: var(--muted);
      font-weight: 300;
      font-size: 1.05rem; margin-bottom: 2.5rem;
    }

    .post-list { list-style: none; }
    .post-item { border-bottom: 1px solid var(--line); padding: 1.8rem 0; cursor: pointer; }
    .post-item:first-child { border-top: 1px solid var(--line); }
    .post-item:hover .post-item-title { color: var(--red); }
    .post-meta { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.45rem; }
    .post-tag {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em;
      background: var(--bg4); color: var(--muted); padding: 0.16rem 0.5rem;
    }
    .post-date { font-family: 'DM Mono', monospace; font-size: 0.63rem; color: var(--faint); }
    .post-item-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.3rem; font-weight: 700; line-height: 1.25;
      margin-bottom: 0.45rem; color: var(--text); transition: color 0.2s;
    }
    .post-excerpt { font-size: 0.85rem; color: var(--dim); line-height: 1.7; max-width: 560px; }
    .post-read {
      margin-top: 0.8rem; font-family: 'DM Mono', monospace;
      font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--red);
    }

    .sidebar-section { margin-bottom: 2rem; }
    .sidebar-label {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.16em;
      color: var(--muted); margin-bottom: 0.85rem;
      padding-bottom: 0.45rem; border-bottom: 1px solid var(--line);
    }
    .tag-pills { display: flex; flex-wrap: wrap; gap: 0.38rem; }
    .tag-pill {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em;
      background: transparent; border: 1px solid var(--faint);
      color: var(--muted); padding: 0.22rem 0.55rem; cursor: pointer; transition: all 0.18s;
    }
    .tag-pill:hover, .tag-pill.active { background: var(--red); color: #fff; border-color: var(--red); }

    .game-list { list-style: none; }
    .game-item {
      display: flex; align-items: flex-start; gap: 0.6rem;
      padding: 0.6rem 0; border-bottom: 1px solid var(--line); cursor: pointer;
    }
    .game-item:last-child { border-bottom: none; }
    .gdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
    .gdot-active   { background: var(--red); }
    .gdot-hiatus   { background: var(--faint); }
    .gdot-complete { background: #4a8ac4; }
    .game-name { font-size: 0.83rem; color: var(--text); line-height: 1.3; }
    .game-status { font-family: 'DM Mono', monospace; font-size: 0.58rem; color: var(--muted); margin-top: 0.12rem; }

    /* ─── FULL POST ─── */
    .post-view { display: none; max-width: 700px; margin: 0 auto; padding: 4rem 2rem 6rem; }
    .post-view.on { display: block; animation: fadein 0.3s ease; }
    .post-back {
      font-family: 'DM Mono', monospace;
      font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em;
      color: var(--muted); cursor: pointer; margin-bottom: 2.5rem; display: inline-block;
    }
    .post-back:hover { color: var(--red); }
    .post-view-meta { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
    .pv-title {
      font-family: 'Playfair Display', serif;
      font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 700;
      line-height: 1.15; margin-bottom: 2rem; color: var(--text);
    }
    .post-body { font-size: 1rem; line-height: 1.9; color: var(--dim); }
    .post-body p { margin-bottom: 1.25rem; }
    .post-body h2 { font-family: 'Playfair Display', serif; font-size: 1.35rem; font-weight: 700; margin: 2.5rem 0 0.8rem; color: var(--text); }
    .post-body h3 { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-style: italic; margin: 1.8rem 0 0.6rem; color: var(--text); }
    .post-body code { font-family: 'DM Mono', monospace; font-size: 0.83em; background: var(--bg4); padding: 0.12em 0.38em; }
    .post-body pre { background: var(--bg2); border: 1px solid var(--line); padding: 1.4rem; overflow-x: auto; margin: 1.4rem 0; font-family: 'DM Mono', monospace; font-size: 0.82rem; line-height: 1.6; }
    .post-body pre code { background: none; padding: 0; }
    .post-body blockquote { border-left: 2px solid var(--red); padding-left: 1.4rem; margin: 1.4rem 0; color: var(--muted); font-style: italic; }
    .post-body em { color: var(--text); }

    /* ─── HISTORY ─── */
    .history-layout { padding: 4rem 3rem 5rem; max-width: 860px; margin: 0 auto; }
    .timeline { position: relative; margin-top: 2.5rem; }
    .timeline::before { content: ''; position: absolute; left: 100px; top: 0; bottom: 0; width: 1px; background: var(--line); }
    .tl-entry { display: grid; grid-template-columns: 100px 1fr; }
    .tl-year {
      font-family: 'DM Mono', monospace; font-size: 0.63rem;
      color: var(--faint); padding: 2.6rem 1.2rem 2rem 0;
      text-align: right; line-height: 1.5;
    }
    .tl-body { padding: 2rem 0 2rem 2.2rem; border-bottom: 1px solid var(--line); position: relative; }
    .tl-body::before {
      content: ''; position: absolute; left: -4px; top: 2.4rem;
      width: 8px; height: 8px; border-radius: 50%;
      background: var(--bg); border: 1.5px solid var(--red);
    }
    .tl-entry:last-child .tl-body { border-bottom: none; }
    .tl-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; color: var(--text); }
    .tl-status { font-family: 'DM Mono', monospace; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.6rem; }
    .s-active  { color: var(--red); }
    .s-shipped { color: #4a8ac4; }
    .s-hiatus  { color: var(--faint); }
    .tl-desc { font-size: 0.95rem; color: var(--dim); line-height: 1.75; }
    .tl-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.65rem; }
    .tl-tag { font-family: 'DM Mono', monospace; font-size: 0.57rem; text-transform: uppercase; letter-spacing: 0.07em; background: var(--bg4); color: var(--muted); padding: 0.15rem 0.45rem; }

    /* ─── CONTACT ─── */
    .contact-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 60px); }
    .contact-left { padding: 5rem 3rem; background: var(--bg2); border-right: 1px solid var(--line); }
    .contact-right { padding: 5rem 3rem; }
    .contact-intro { font-size: 0.9rem; color: var(--dim); line-height: 1.85; margin-top: 1rem; margin-bottom: 2.2rem; }
    .clinks { list-style: none; }
    .clink { display: flex; align-items: flex-start; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
    .clink:first-child { border-top: 1px solid var(--line); }
    .clink-label { font-family: 'DM Mono', monospace; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--faint); min-width: 72px; padding-top: 0.12rem; }
    .clink-val { font-size: 0.86rem; color: var(--text); text-decoration: none; }
    .clink-val:hover { color: var(--red); }
    .form-field { margin-bottom: 1.5rem; }
    .form-label { display: block; font-family: 'DM Mono', monospace; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.4rem; }
    .form-input, .form-textarea {
      width: 100%; background: var(--bg3); border: 1px solid var(--line);
      padding: 0.75rem 0.9rem; font-family: 'Space Grotesk', sans-serif;
      font-size: 0.87rem; color: var(--text); font-weight: 300; outline: none;
      transition: border-color 0.2s; -webkit-appearance: none;
    }
    .form-input:focus, .form-textarea:focus { border-color: var(--red); background: var(--bg2); }
    .form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

    /* ─── FOOTER ─── */
    footer { border-top: 1px solid var(--line); padding: 1.6rem 3rem; display: flex; justify-content: space-between; align-items: center; }
    .footer-logo { font-family: 'DM Mono', monospace; font-size: 0.82rem; font-weight: 500; color: var(--text); }
    .footer-logo span { color: var(--red); }
    .footer-note { font-family: 'DM Mono', monospace; font-size: 0.6rem; color: var(--faint); }

    @media (max-width: 860px) {
      header { padding: 0 1.5rem; }
      .home-hero { padding: 4rem 1.5rem 3rem; }
      .home-posts { padding: 0 1.5rem 4rem; }
      .post-grid { grid-template-columns: 1fr; }
      .post-card { border-right: none; border-bottom: 1px solid var(--line); }
      .post-card:last-child { border-bottom: none; }
      .devlog-layout { grid-template-columns: 1fr; }
      .devlog-sidebar { display: none; }
      .devlog-main { padding: 3rem 1.5rem; }
      .history-layout { padding: 3rem 1.5rem; }
      .timeline::before { left: 52px; }
      .tl-entry { grid-template-columns: 52px 1fr; }
      .contact-layout { grid-template-columns: 1fr; }
      .contact-left, .contact-right { padding: 3rem 1.5rem; }
      footer { padding: 1.5rem; flex-direction: column; gap: 0.6rem; text-align: center; }
    }

/* ─── POST MEDIA ─── */
.post-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 2rem 0;
}
.post-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.post-images {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-figure img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
}

.post-figure figcaption {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.post-empty {
  color: var(--muted);
  font-style: italic;
}

.post-body ul {
  margin: 0 0 1.25rem 1.4rem;
  color: var(--dim);
}
.post-body ul li {
  font-size: 0.96rem;
  line-height: 1.9;
  margin-bottom: 0.3rem;
}
.post-body a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid var(--red-dim);
  transition: border-color 0.2s;
}
.post-body a:hover {
  border-color: var(--red);
}

.tl-link {
  display: inline-block;
  margin-top: 0.8rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid var(--red-dim);
  transition: border-color 0.2s;
}
.tl-link:hover {
  border-color: var(--red);
}

.tl-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

.tl-link[onclick] {
  cursor: pointer;
}

.contact-simple {
  max-width: 560px;
  margin: 0 auto;
  padding: 4rem 2rem 5rem;
}
.contact-simple .page-title {
  margin-bottom: 2.5rem;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg2);
}
::-webkit-scrollbar-thumb {
  background: var(--faint);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

* {
  scrollbar-width: 10px;
  scrollbar-color: var(--faint) var(--bg2);
}