/* ---------------------------------------------------------
   Tokens
--------------------------------------------------------- */
:root[data-theme="dark"] {
  --bg: #0d0c0a;
  --bg-raised: #161512;
  --text: #ece7dd;
  --text-dim: #a39d8f;
  --text-faint: #6f695d;
  --hairline: #2c2a25;
  --accent: #c98a56;
  --scrim: rgba(9, 8, 7, 0.72);
  --scrim-strong: rgba(9, 8, 7, 0.9);
}

:root[data-theme="light"] {
  --bg: #f4f1ea;
  --bg-raised: #ece7db;
  --text: #1c1a15;
  --text-dim: #58524a;
  --text-faint: #8c8577;
  --hairline: #d9d3c4;
  --accent: #a85f2e;
  --scrim: rgba(244, 241, 234, 0.55);
  --scrim-strong: rgba(244, 241, 234, 0.85);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.mono {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.mono-tag {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}

/* ---------------------------------------------------------
   Grain texture overlay — the "tech" layer under the editorial type
--------------------------------------------------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------
   Nav
--------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: linear-gradient(to bottom, var(--scrim-strong), transparent);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--text);
}
.nav-links {
  display: flex;
  gap: 1.75rem;
}
.nav-links a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.15rem;
}

#theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.25rem;
}

.theme-toggle-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  position: relative;
  display: inline-block;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.25s ease;
}
:root[data-theme="light"] .theme-toggle-thumb {
  transform: translateX(16px);
}
.theme-toggle-label { font-size: 0.68rem; letter-spacing: 0.08em; }

/* ---------------------------------------------------------
   Hero + About — shared background section
--------------------------------------------------------- */
.hero-about {
  position: relative;
  isolation: isolate;
}

.hero-about-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 35%;
  z-index: -2;
}

.scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to bottom,
    var(--scrim-strong) 0%,
    var(--scrim) 30%,
    var(--scrim-strong) 78%,
    var(--bg) 100%
  );
}

.home-view {
  min-height: 88vh;
  display: flex;
  align-items: center;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 4vh 1.75rem;
  text-align: left;
  width: 100%;
}

.hero-content .mono-tag {
  margin-bottom: 1.4rem;
}

.hero-name {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.1rem);
  line-height: 1.08;
  margin: 0 0 0.85rem;
  color: var(--text);
}
.nickname {
  display: block;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-dim);
  margin: 0 0 2.2rem;
  letter-spacing: 0.01em;
}

.bio {
  font-size: 1.14rem;
  line-height: 1.68;
  color: var(--text);
  max-width: 72ch;
  margin: 0 0 1.9rem;
}

.quiet-line {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 82ch;
  margin: 0;
}

/* About page — same backdrop treatment as Home, its own view */
.about-view {
  min-height: 88vh;
  display: flex;
  align-items: center;
}

.about-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 6vh 1.75rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.75rem;
  align-items: start;
  width: 100%;
}

.about-portrait img {
  width: 100%;
  border: 1px solid var(--hairline);
  filter: grayscale(0.15) contrast(1.02);
}

.about-text p {
  margin: 0 0 1.3rem;
  color: var(--text);
  font-size: 1.02rem;
}

.aside {
  font-size: 0.82rem;
  color: var(--text-faint);
  border-top: 1px dashed var(--hairline);
  padding-top: 1rem;
  margin-top: 1.5rem !important;
  line-height: 1.6;
}

/* ---------------------------------------------------------
   Reading nook
--------------------------------------------------------- */
.reading {
  max-width: 620px;
  margin: 0 auto;
  padding: 6vh 1.75rem 8vh;
  text-align: center;
}

.spines {
  display: flex;
  justify-content: center;
  gap: 3px;
  height: 46px;
  margin: 0 auto 1.6rem;
  width: fit-content;
}
.spines span {
  display: inline-block;
  width: 7px;
  height: 100%;
  background: var(--hairline);
  border-radius: 1px;
}
.spines span:nth-child(2) { height: 85%; background: var(--accent); opacity: 0.55; }
.spines span:nth-child(3) { height: 100%; }
.spines span:nth-child(4) { height: 70%; }
.spines span:nth-child(5) { height: 92%; background: var(--accent); opacity: 0.4; }
.spines span:nth-child(6) { height: 78%; }
.spines span:nth-child(7) { height: 100%; }
.spines span:nth-child(8) { height: 65%; }

.reading-line {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--text-dim);
  line-height: 1.55;
}

/* ---------------------------------------------------------
   Gallery
--------------------------------------------------------- */
.gallery {
  max-width: 1160px;
  margin: 0 auto;
  padding: 4vh 1.75rem 12vh;
}

.section-head {
  margin-bottom: 2.5rem;
}

.gallery-intro {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  max-width: 40ch;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 0.9rem;
}

.grid-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--hairline);
  grid-column: span 2;
  grid-row: span 1;
}
.grid-item.span-tall { grid-row: span 2; }

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: grayscale(0.08);
}
.grid-item:hover img {
  transform: scale(1.035);
  filter: grayscale(0);
}

.idx {
  position: absolute;
  bottom: 0.6rem;
  right: 0.7rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: #ece7dd;
  background: rgba(9, 8, 7, 0.55);
  padding: 0.15rem 0.4rem;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Lightbox — minimal, no gimmicks
--------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 5, 4, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.75rem;
  background: none;
  border: none;
  color: #ece7dd;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
footer {
  border-top: 1px solid var(--hairline);
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 6vh 1.75rem 4vh;
}

.footer-line {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 2rem;
}

.social-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin: 0 0 2.5rem;
  padding: 0;
}
.social-links a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.social-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.copyright {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media (max-width: 760px) {
  .nav-links { gap: 1.1rem; }
  .theme-toggle-label { display: none; }

  .home-view, .about-view { min-height: auto; padding-top: 6vh; padding-bottom: 6vh; }
  .hero-content { padding: 3vh 1.35rem; }
  .about-content {
    grid-template-columns: 1fr;
    padding: 3vh 1.35rem;
    gap: 1.75rem;
  }
  .about-portrait { max-width: 200px; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 180px;
  }
  .grid-item { grid-column: span 1; }
  .grid-item.span-tall { grid-row: span 2; }
}
