:root {
  --bg: #09090b;
  --bg-2: #121218;
  --bg-3: #1a1a22;
  --text: #ece8de;
  --muted: #9c968a;
  --line: #2c2c36;
  --accent: #c4a4ff;
  --accent-dim: #8b6cc9;
  --gold: #c4a574;
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #ddd0ff; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(9,9,11,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .9rem 0;
}
.logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem; letter-spacing: .04em; color: var(--text);
}
.logo span { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; align-items: center; }
.nav a { color: var(--muted); font-size: .95rem; letter-spacing: .04em; text-transform: uppercase; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  color: var(--text); padding: .55rem .85rem; cursor: pointer;
  font: inherit; -webkit-tap-highlight-color: transparent;
}

.hero { padding: 5.5rem 0 4rem; }
.eyebrow {
  color: var(--gold); letter-spacing: .18em; text-transform: uppercase;
  font-size: .78rem; margin-bottom: .8rem;
}
h1, h2, h3 { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 500; line-height: 1.15; }
h1 { font-size: clamp(2.6rem, 7vw, 5rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: .8rem; }
h3 { font-size: 1.55rem; margin-bottom: .35rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

.btn {
  display: inline-block; padding: .75rem 1.15rem; border-radius: 2px;
  border: 1px solid var(--accent-dim); color: var(--text);
  letter-spacing: .06em; text-transform: uppercase; font-size: .82rem;
}
.btn:hover { background: var(--accent-dim); color: #fff; }
.btn-solid { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn-solid:hover { background: #9b7de0; color: #fff; }
.btn[aria-disabled="true"] {
  opacity: .55; pointer-events: none; border-style: dashed;
}

.section { padding: 3.5rem 0; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 1.75rem; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
.card {
  background: linear-gradient(180deg, var(--bg-2), #0e0e14);
  border: 1px solid var(--line); padding: 1.4rem;
  overflow: hidden;
}
.card-cover-link {
  display: block;
  margin: -1.4rem -1.4rem 1.1rem;
  text-align: center;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
}
.card-cover {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 450px;
  margin-inline: auto;
  object-fit: contain;
  object-position: center top;
  vertical-align: top;
}
.booklife-badge {
  width: 100%;
  height: auto;
  margin: 0 0 .35rem;
  border: 1px solid var(--line);
}

.kicker { color: var(--accent); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .45rem; }
.badge {
  display: inline-block; margin-bottom: .5rem; padding: .15rem .5rem;
  border: 1px solid var(--gold); color: var(--gold);
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
}

.book-list { display: grid; gap: 1.25rem; }
.book {
  display: grid; gap: 1.25rem; grid-template-columns: 1fr;
  align-items: start;
  background: var(--bg-2); border: 1px solid var(--line); padding: 1.4rem;
}
.book-cover-link {
  display: block;
  justify-self: start;
}
.book-cover {
  /* ~3in at typical screen density; smaller than home cards */
  max-height: 288px;
  width: auto;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-3);
}
.book-body { min-width: 0; }
.book h2 { margin-top: .15rem; }
.book h3 { margin-top: .2rem; }
@media (min-width: 720px) {
  .book:has(.book-cover-link) {
    grid-template-columns: auto 1fr;
  }
}
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.quote { border-left: 2px solid var(--accent-dim); padding-left: 1rem; color: var(--muted); font-style: italic; margin-top: 1rem; }


.wip-card {
  background: linear-gradient(180deg, var(--bg-2), #0e0e14);
  border: 1px solid var(--line);
  padding: 1.5rem 1.4rem 1.4rem;
  max-width: 42rem;
}
.wip-card > p { margin: .75rem 0; color: #d7d2c7; }
.wip-update-title {
  font-size: 1.1rem;
  margin: 1.25rem 0 .35rem;
  color: var(--gold);
  letter-spacing: .04em;
}
.wip-update { color: var(--text) !important; }

.signup, .contact-form, #mc_embed_signup {
  background: var(--bg-2); border: 1px solid var(--line); padding: 1.4rem;
  display: grid; gap: .75rem; max-width: 36rem;
}
#mc_embed_signup form {
  display: grid; gap: .75rem; margin: 0;
}
#mc_embed_signup label {
  color: var(--muted); font-size: .9rem;
}
#mc_embed_signup input[type="email"] {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); padding: .7rem .8rem; font: inherit;
}
#mc_embed_signup input[type="email"]:focus {
  outline: 1px solid var(--accent-dim);
}
#mc_embed_signup button[type="submit"] {
  justify-self: start; cursor: pointer; font: inherit;
}
.mc-badge {
  margin: 0; font-size: .72rem; color: var(--muted);
}
.mc-badge a { color: var(--muted); }
.mc-badge a:hover { color: var(--accent); }
input, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line);
  color: var(--text); padding: .7rem .8rem; font: inherit;
}
input:focus, textarea:focus { outline: 1px solid var(--accent-dim); }
.form-note { color: var(--muted); font-size: .85rem; }
.ok { color: #b8d9b4; }

.about-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
  max-width: 48rem;
}
.about-photo {
  margin: 0;
  width: 100%;
  max-width: 320px;
  justify-self: start;
}
.about-photo picture,
.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-3);
}
@media (min-width: 720px) {
  .about-layout {
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 2rem;
    max-width: 52rem;
  }
}
.about-prose { max-width: 42rem; min-width: 0; }
.about-prose p { margin-bottom: 1rem; color: #d7d2c7; }

.socials { display: flex; flex-wrap: wrap; gap: .75rem 1.1rem; margin-top: 1rem; }

.site-footer {
  border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem;
  color: var(--muted); font-size: .88rem;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; justify-content: space-between; }

/* Footer social icon row */
.footer-social {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: .35rem .9rem;
}
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; /* comfortable tap target */
  color: var(--muted); opacity: .85;
  transition: color .2s ease, opacity .2s ease;
}
.footer-social a:hover { color: var(--accent); opacity: 1; }
.footer-social a:focus-visible { outline: 1px solid var(--accent-dim); outline-offset: 2px; color: var(--text); opacity: 1; }
.footer-social svg { width: 18px; height: 18px; display: block; }
.footer-inner { align-items: center; }

/* Blog */
.post-list { list-style: none; display: grid; gap: 1.25rem; max-width: 46rem; }
.post-item {
  background: linear-gradient(180deg, var(--bg-2), #0e0e14);
  border: 1px solid var(--line); padding: 1.4rem;
}
.post-item h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: .2rem 0 .5rem; }
.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--accent); }
.post-meta { letter-spacing: .04em; }
.post-wrap { max-width: 42rem; }
.post-back { margin-bottom: 1.5rem; font-size: .9rem; }
.post-back a { color: var(--muted); }
.post-back a:hover { color: var(--accent); }
.post-head { margin-bottom: 1.5rem; }
.post-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.post-figure { margin: 0 0 2rem; }
.post-figure picture,
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}
.post-body p { margin-bottom: 1.1rem; color: #d7d2c7; font-size: 1.08rem; }
.post-body ul {
  margin: 0 0 1.1rem 1.25rem;
  padding: 0;
  color: #d7d2c7;
  font-size: 1.08rem;
}
.post-body li { margin-bottom: .45rem; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--text); }
.post-body h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 2rem 0 .7rem; color: var(--text); }
.post-signoff { font-style: italic; color: var(--muted) !important; }
.post-cta {
  margin: 2.5rem 0 2rem; padding: 1.4rem;
  background: var(--bg-2); border: 1px solid var(--line); border-left: 2px solid var(--accent-dim);
}
.post-cta h2 { font-size: 1.6rem; }

/* Homepage banner hero with gentle parallax */
.hero-banner {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 88vh; min-height: min(88vh, 900px); min-height: min(88svh, 900px); padding: 4.5rem 0 5rem;
  display: flex; align-items: flex-start;
}
.hero-media { position: absolute; inset: 0; z-index: -2; will-change: transform; }
.hero-media picture { position: absolute; inset: 0; display: block; }
.hero-img {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; max-width: none; object-fit: cover;
  object-position: 50% 60%; /* keeps Samara (lower left) and the moon (right) in frame */
}
.hero-banner::before { /* soft shade behind the text, over the sky */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 48% 55% at 64% 30%, rgba(9,9,11,.55), rgba(9,9,11,0) 70%),
    linear-gradient(180deg, rgba(9,9,11,.35) 0%, rgba(9,9,11,0) 18%, rgba(9,9,11,0) 62%, rgba(9,9,11,.75) 86%, #09090b 100%);
}
.hero-content { position: relative; z-index: 1; width: min(var(--max), calc(100% - 2rem)); }
.hero-content > * { margin-left: 36%; max-width: 30rem; }
.hero-banner h1 { font-size: clamp(2.2rem, 4.2vw, 3.6rem); text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.hero-banner .lede { color: #cfc9bd; text-shadow: 0 1px 10px rgba(0,0,0,.7); }
.hero-banner + .section { border-top: none; }
@media (max-width: 720px) {
  .hero-banner .hero-media { will-change: auto; transform: none !important; bottom: auto; height: 118%; } /* static on phones; extends below so Samara sits under the text */
  .hero-banner { min-height: calc(100vh - 60px); min-height: calc(100svh - 60px); padding: 2rem 0 4rem; }
  .hero-banner { padding-top: 1.5rem; }
  .hero-banner h1 { font-size: 1.95rem; }
  .hero-banner .lede { font-size: 1rem; line-height: 1.55; }
  .hero-banner .hero-actions { margin-top: 1.2rem; }
  .hero-img { object-position: 22% 60%; } /* Samara stays in view on narrow screens */
  .hero-content > * { margin-left: 0; }
  .hero-banner::before {
    background: linear-gradient(180deg, rgba(9,9,11,.6) 0%, rgba(9,9,11,.2) 45%, rgba(9,9,11,0) 60%, rgba(9,9,11,.8) 88%, #09090b 100%);
  }
}
@media (prefers-reduced-motion: reduce) { .hero-media { transform: none !important; will-change: auto; } }

@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav {
    display: none; position: absolute; right: 1rem; top: 58px;
    flex-direction: column; background: var(--bg-2); border: 1px solid var(--line);
    padding: 1rem 1.2rem; min-width: 180px;
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
}
/* Friends page: stacked covers beside each author card */
.friend-covers {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-self: start;
}

/* Portrait blog heroes (e.g. Sunat Kabisa bazaar) */
.post-figure--portrait {
  display: flex;
  justify-content: center;
  margin: 0 0 2rem;
}
.post-figure--portrait picture,
.post-figure--portrait img {
  width: auto;
  max-width: min(480px, 100%);
  max-height: 70vh;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}
