@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --black: #000000;
  --dark: #121212;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e0e0e0;
  --text-dim: #888888;
  --white: #ffffff;
  --accent: #00e5ff;
  --accent2: #b388ff;
  --accent3: #ffd740;
  --font: 'Space Mono', 'Courier New', monospace;
  --max-w: 1200px;
  --rail-w: 220px;
  --aside-w: 200px;
  --gap: 1.5rem;
  color-scheme: dark;
}

html {
  background: var(--black);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--black);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}

a:hover {
  color: var(--white);
  text-shadow: 0 0 10px var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ─── LAYOUT WRAPPER ─── */

.site-wrap {
  display: flex;
  min-height: 100vh;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.home-wrap {
  display: block;
  max-width: 100%;
  padding: 0;
}

/* ─── ASIDE NAV (left) ─── */

.site-aside {
  width: var(--aside-w);
  min-width: var(--aside-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 2rem 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.site-aside nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.site-aside nav ul li a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  line-height: 1.4;
  min-height: 40px;
  display: flex;
  align-items: center;
}

.site-aside nav ul li a:hover,
.site-aside nav ul li a[aria-current="page"] {
  color: var(--white);
  border-left-color: var(--accent);
  background: rgba(0, 229, 255, 0.04);
  text-shadow: none;
}

/* ─── CONTENT AREA ─── */

.content-area {
  display: flex;
  flex: 1;
  min-width: 0;
  padding: 2rem var(--gap);
  gap: var(--gap);
}

.content-area main {
  flex: 1;
  min-width: 0;
}

/* ─── SIDE RAIL (right aside) ─── */

.side-rail {
  width: var(--rail-w);
  min-width: var(--rail-w);
  flex-shrink: 0;
  padding: 0 0 0 1.5rem;
  border-left: 1px solid var(--border);
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.rail-title {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.rail-title span {
  display: inline;
}

.rail-sub {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin: 1.5rem 0 0.75rem;
  text-transform: uppercase;
}

.rail-sub span {
  display: inline;
}

.side-rail ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.side-rail ul li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.7rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  min-height: 40px;
  letter-spacing: 0.05em;
  transition: color 0.15s;
}

.side-rail ul li a:hover {
  color: var(--white);
  text-shadow: none;
}

/* ─── BREADCRUMB ─── */

.breadcrumb {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  letter-spacing: 0.05em;
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span {
  color: var(--text);
}

/* ─── H1 ─── */

main h1, .hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

/* ─── SECTION TITLE ─── */

.section-title {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.section-title span {
  display: inline;
}

/* ─── ARTICLE / SECTION BASE ─── */

main > div > section {
  margin-bottom: 3rem;
}

/* ─── DATES ─── */

.entry-date, .entry-pub, .entry-mod, .child-date {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

.entry-mod {
  margin-left: 1rem;
}

.entry-meta {
  margin: 0.75rem 0 1rem;
}

/* ─── CONTENT BODY (page.content) ─── */

.page-body, .about-body, .privacy-body, .cat-content-block,
.entry-body, .tag-content-block, .home-content-block {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 72ch;
}

.page-body h2, .about-body h2, .privacy-body h2,
.entry-body h2, .tag-content-block h2 {
  font-size: 1.1rem;
  color: var(--white);
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.02em;
}

.page-body h2 > span, .about-body h2 > span,
.privacy-body h2 > span, .entry-body h2 > span {
  display: inline;
}

.page-body p, .about-body p, .privacy-body p, .entry-body p {
  margin-bottom: 1rem;
}

.page-body a, .about-body a, .privacy-body a, .entry-body a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}

/* ─── HOME LAYOUT ─── */

.home-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.home-aside {
  display: none;
}

/* ─── HOME NAV BAR ─── */

.nav-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  gap: 0;
  flex: 1;
}

.nav-right {
  justify-content: flex-end;
}

.nav-left li a, .nav-right li a {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  border: 1px solid transparent;
  min-height: 40px;
  transition: color 0.15s, border-color 0.15s;
}

.nav-left li a:hover, .nav-right li a:hover {
  color: var(--white);
  border-color: var(--border);
  text-shadow: none;
}

.brand-center {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0 1.5rem;
  text-shadow: 0 0 10px rgba(0,229,255,0.3);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.brand-center:hover {
  text-shadow: 0 0 16px var(--accent);
  color: var(--white);
}

/* ─── HERO ─── */

.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 2rem;
  max-width: 700px;
}

.hero-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--white);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 50ch;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: var(--white);
  color: var(--black);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  border: none;
  text-shadow: none;
  min-height: 48px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.hero-cta:hover {
  background: var(--accent);
  color: var(--black);
  box-shadow: 0 0 20px rgba(0,229,255,0.4);
  text-shadow: none;
}

.hero-slash {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--dark);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 1;
}

/* ─── HOME MAIN CONTENT ─── */

.home-main > main {
  background: var(--dark);
  padding: 4rem 2rem;
}

.home-main > main > div > section {
  max-width: var(--max-w);
  margin: 0 auto 4rem;
}

.home-content-block {
  max-width: 72ch;
}

.home-main .side-rail {
  display: none;
}

/* ─── CAT GRID ─── */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.cat-card {
  background: var(--dark);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: background 0.2s;
}

.cat-card:hover {
  background: #1e1e1e;
}

.cat-card-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  letter-spacing: -0.05em;
}

.cat-card-title {
  font-size: 1rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.cat-card-title span {
  display: inline;
}

.cat-card-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
}

.cat-card-link {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.cat-card-link:hover {
  text-shadow: 0 0 8px var(--accent);
}

/* ─── ENTRY LIST (home) ─── */

.entry-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.entry-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.entry-row:last-child {
  border-bottom: none;
}

.entry-row:hover {
  background: rgba(255,255,255,0.02);
}

.entry-row-tag {
  font-size: 0.65rem;
  color: var(--accent2);
  letter-spacing: 0.1em;
  white-space: nowrap;
  min-width: 60px;
}

.entry-row-title {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-row-title:hover {
  color: var(--white);
  text-shadow: none;
}

.entry-row-date {
  font-size: 0.65rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── CATEGORY PAGE ─── */

.cat-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.cat-desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  max-width: 60ch;
}

.child-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.child-card:first-of-type {
  border-top: 1px solid var(--border);
}

.child-index {
  font-size: 0.65rem;
  color: var(--border);
  font-weight: 700;
  letter-spacing: 0.1em;
  min-width: 28px;
  padding-top: 0.25rem;
}

.child-body {
  flex: 1;
}

.child-title {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.child-title span {
  display: inline;
}

.child-title a {
  color: var(--white);
}

.child-title a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

.child-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.child-date {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: block;
  margin-top: 0.4rem;
}

.child-arrow {
  color: var(--text-dim);
  font-size: 1rem;
  padding: 0.5rem;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}

.child-arrow:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

/* ─── ENTRY PAGE ─── */

.entry-hero {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  overflow: hidden;
}

.entry-hero-img {
  width: 100%;
  height: auto;
}

.entry-siblings {
  margin-top: 3rem;
}

.sibling-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.sibling-list li {
  border-bottom: 1px solid var(--border);
}

.sibling-list li:last-child {
  border-bottom: none;
}

.sibling-list li a {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  min-height: 44px;
  transition: color 0.15s, background 0.15s;
}

.sibling-list li a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.02);
  text-shadow: none;
}

/* ─── TAG PAGE ─── */

.tag-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
}

.tag-count strong {
  color: var(--accent);
}

.tag-entry {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.tag-entry:first-of-type {
  border-top: 1px solid var(--border);
}

.tag-num {
  font-size: 0.65rem;
  color: var(--border);
  font-weight: 700;
  min-width: 28px;
  padding-top: 0.2rem;
}

.tag-entry-body {
  flex: 1;
}

.tag-entry-title {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.tag-entry-title span {
  display: inline;
}

.tag-entry-title a {
  color: var(--white);
}

.tag-entry-title a:hover {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent);
}

.tag-entry-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.tag-entry-parent {
  font-size: 0.65rem;
  color: var(--accent2);
  letter-spacing: 0.06em;
}

.tag-entry-parent:hover {
  color: var(--white);
  text-shadow: none;
}

.tag-entry time {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

/* ─── ABOUT CTA GRID ─── */

.cta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  max-width: 480px;
}

.cta-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--dark);
  color: var(--text);
  min-height: 64px;
  transition: background 0.15s, color 0.15s;
}

.cta-block:hover {
  background: var(--surface);
  color: var(--white);
  text-shadow: none;
}

.cta-label {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.cta-arrow {
  color: var(--accent);
  font-size: 0.9rem;
}

/* ─── PRIVACY / BACK LINKS ─── */

.back-links {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  max-width: 320px;
}

.back-links li {
  border-bottom: 1px solid var(--border);
}

.back-links li:last-child {
  border-bottom: none;
}

.back-links li a {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  color: var(--text);
  min-height: 44px;
}

.back-links li a:hover {
  color: var(--white);
  text-shadow: none;
}

/* ─── FOOTER ─── */

footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.home-main footer {
  background: var(--black);
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.footer-logo {
  display: block;
  font-size: clamp(1.8rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
  line-height: 1;
}

.footer-brand p {
  font-size: 0.75rem;
  color: var(--text-dim);
  max-width: 36ch;
  line-height: 1.7;
}

.footer-links address {
  font-style: normal;
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-links ul li {
  border-bottom: 1px solid var(--border);
}

.footer-links ul li:last-child {
  border-bottom: none;
}

.footer-links ul li a {
  display: flex;
  align-items: center;
  padding: 0.6rem 0;
  font-size: 0.72rem;
  color: var(--text-dim);
  min-height: 40px;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.footer-links ul li a:hover {
  color: var(--white);
  text-shadow: none;
}

.footer-bar {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  text-align: center;
}

.footer-bar p {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

/* ─── REVEAL ANIMATION ─── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── RESPONSIVE ─── */

@media (max-width: 1024px) {
  :root {
    --aside-w: 160px;
    --rail-w: 180px;
  }

  .site-wrap {
    padding: 0 1rem;
  }

  .site-aside nav ul li a {
    font-size: 0.7rem;
    padding: 0.6rem 0.75rem;
  }
}

@media (max-width: 768px) {
  .site-wrap {
    flex-direction: column;
    padding: 0;
  }

  .site-aside {
    width: 100%;
    min-width: unset;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0;
    overflow: visible;
  }

  .site-aside nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    padding: 0.5rem;
  }

  .site-aside nav ul li a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.75rem;
    font-size: 0.68rem;
  }

  .site-aside nav ul li a[aria-current="page"],
  .site-aside nav ul li a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
    background: rgba(0,229,255,0.04);
  }

  .content-area {
    flex-direction: column;
    padding: 1.5rem 1rem;
  }

  .side-rail {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 1.5rem 0 0;
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1rem;
  }

  .nav-brand-bar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-left, .nav-right {
    flex-wrap: wrap;
  }

  .nav-left li a, .nav-right li a {
    font-size: 0.65rem;
    padding: 0.4rem 0.5rem;
  }

  .cat-grid {
    grid-template-columns: 1fr;
  }

  .cta-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .footer-logo {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }
}

@media (max-width: 480px) {
  .hero-inner {
    padding: 1.25rem;
  }

  .hero-cta {
    width: 100%;
    justify-content: center;
  }

  .child-card {
    gap: 0.75rem;
  }

  .tag-entry {
    gap: 0.75rem;
  }

  .entry-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
