/* ===== Just an Ordinary Librarian — Ocean design system ===== */

:root {
  --abyss: #0A1E2D;
  --current: #163B52;
  --tide: #3D93A8;
  --tide-soft: #6FB4C4;
  --foam: #EAF6F8;
  --horizon: #F7FBFC;
  --driftwood: #B9A88C;
  --ink: #0F2733;
  --ink-soft: #3E5A66;
  --line: #D3E5EA;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Work Sans', sans-serif;
  color: var(--ink);
  background: var(--horizon);
  line-height: 1.6;
}
a { color: var(--tide); text-decoration: none; }
a:hover { color: var(--current); }
img { max-width: 100%; display: block; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- Nav ---- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 32px;
  background: rgba(10, 30, 45, 0.92);
  backdrop-filter: blur(8px);
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-mark { width: 30px; height: 30px; }
.nav-name {
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem;
  color: var(--horizon); letter-spacing: 0.01em;
}
.brand-stack {
  display: flex; flex-direction: column; align-items: center; line-height: 1.05;
}
.brand-stack .lead {
  font-family: 'Work Sans', sans-serif; font-size: 0.62rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: rgba(234,246,248,0.7);
  margin-bottom: 1px;
}
.brand-stack .main-word {
  font-family: 'Fraunces', serif; font-weight: 700; font-size: 1.5rem;
  color: var(--horizon); display: inline-flex; align-items: center;
}
.brand-stack .main-word .o-mark {
  width: 1.05em; height: 1.05em; border-radius: 50%; object-fit: cover;
  display: inline-block; margin: 0 0.02em; flex-shrink: 0;
}
.brand-stack .script-word {
  font-family: 'Pacifico', cursive; font-weight: 400; font-size: 1.05rem;
  color: var(--tide-soft); margin-top: -1px;
}
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav-links a {
  color: rgba(234,246,248,0.82); font-size: 0.92rem; font-weight: 500;
  font-family: 'Work Sans', sans-serif;
}
.nav-links a:hover, .nav-links a.act { color: var(--tide-soft); }
.nav-ham { display: none; background: none; border: none; cursor: pointer; }
.nav-ham span { display: block; width: 22px; height: 2px; background: var(--horizon); margin: 4px 0; }

/* ---- Hero: horizon gradient, the core visual idea ---- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 140px 24px 90px;
  background: linear-gradient(180deg, var(--abyss) 0%, var(--current) 55%, var(--tide) 100%);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: var(--horizon);
  clip-path: polygon(0 60%, 4% 55%, 9% 62%, 14% 52%, 19% 60%, 25% 50%, 31% 58%, 37% 48%, 43% 56%,
    49% 46%, 55% 54%, 61% 44%, 67% 52%, 73% 45%, 79% 53%, 85% 43%, 91% 51%, 96% 46%, 100% 50%,
    100% 100%, 0 100%);
}
.hero-pill {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: rgba(234,246,248,0.12); border: 1px solid rgba(234,246,248,0.25);
  color: var(--foam); font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem;
  letter-spacing: 0.06em; margin-bottom: 24px;
}
.hero h1 {
  font-family: 'Fraunces', serif; font-optical-sizing: auto;
  font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 500; line-height: 1.15;
  color: var(--horizon); max-width: 720px; margin: 0 0 20px;
}
.hero h1 em { font-style: italic; color: var(--tide-soft); }
.hero p {
  color: rgba(234,246,248,0.82); max-width: 520px; font-size: 1.05rem;
  margin: 0 auto;
}
.hero-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- Buttons ---- */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 30px;
  font-family: 'Work Sans', sans-serif; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none;
}
.btn-brand { background: var(--tide); color: #fff; }
.btn-brand:hover { background: var(--tide-soft); color: #fff; }
.btn-ghost { background: transparent; color: var(--horizon); border: 1.5px solid rgba(234,246,248,0.4); }
.btn-ghost:hover { border-color: var(--tide-soft); color: var(--tide-soft); }

/* ---- Sections ---- */
.section { padding: 70px 0; }
.section-lead {
  text-align: center; max-width: 620px; margin: 0 auto 50px;
}
.section-lead h2 {
  font-family: 'Fraunces', serif; font-size: 1.7rem; font-weight: 500; color: var(--ink);
  margin-bottom: 12px;
}
.section-lead p { color: var(--ink-soft); font-size: 1.02rem; }

/* ---- Porthole: the signature element ---- */
.porthole {
  position: relative;
  display: inline-block;
  width: 100%; aspect-ratio: 1 / 1; border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--current);
  box-shadow: 0 0 0 2px var(--tide-soft), inset 0 0 24px rgba(10,30,45,0.35), 0 10px 30px rgba(10,30,45,0.18);
}
.porthole img { width: 100%; height: 100%; object-fit: cover; }
.porthole-placeholder {
  width: 100%; height: 100%;
  background: radial-gradient(circle at 35% 30%, var(--tide-soft), var(--current) 65%, var(--abyss) 100%);
  display: flex; align-items: center; justify-content: center;
}
.porthole-placeholder svg { width: 42%; opacity: 0.8; }

/* ---- Post grid ---- */
.post-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px 28px;
}
.post-card { text-align: center; }
.post-card .porthole { width: 160px; margin: 0 auto 18px; }
.post-tag {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--tide);
}
.post-card h4 {
  font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 600; margin: 8px 0 8px;
  color: var(--ink);
}
.post-card p { color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 10px; }

.post-card-teaser { opacity: 0.6; }
.post-card-teaser .porthole-locked { filter: grayscale(0.4); cursor: default; }
.post-card-teaser .teaser-title { color: var(--ink-soft); font-style: italic; }
.post-card-teaser .post-tag { color: var(--driftwood); }

/* ---- Empty state ---- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--ink-soft);
}
.empty-state .porthole-placeholder-solo {
  width: 140px; margin: 0 auto 22px;
}
.empty-state h3 {
  font-family: 'Fraunces', serif; font-size: 1.3rem; color: var(--ink); margin-bottom: 10px;
}

/* ---- Newsletter band ---- */
.newsletter {
  background: var(--current); color: var(--horizon);
  text-align: center; padding: 60px 24px;
}
.newsletter h2 { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 500; margin-bottom: 8px; }
.newsletter p { color: rgba(234,246,248,0.75); margin-bottom: 24px; }
.nl-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; max-width: 420px; margin: 0 auto; }
.nl-input {
  flex: 1; min-width: 220px; padding: 12px 16px; border-radius: 30px; border: none;
  font-family: 'Work Sans', sans-serif; font-size: 0.95rem;
}

/* ---- Article page ---- */
.article-wrap { max-width: 660px; margin: 0 auto; padding: 0 24px; }
.article-back { font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; display: inline-block; margin-bottom: 20px; }
.article-hero-porthole { width: 220px; margin: 0 auto 26px; }
.article-meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; color: var(--tide);
  text-align: center; margin-bottom: 10px; letter-spacing: 0.04em;
}
article h1 {
  font-family: 'Fraunces', serif; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 600;
  text-align: center; margin: 0 0 34px; color: var(--ink);
}
article p { font-size: 1.05rem; margin-bottom: 20px; color: var(--ink); }
article h2 {
  font-family: 'Fraunces', serif; font-size: 1.4rem; font-weight: 600; margin: 34px 0 14px;
}
article ol, article ul { margin: 0 0 20px 22px; }
article li { margin-bottom: 8px; }

/* ---- Footer ---- */
footer { background: var(--abyss); color: rgba(234,246,248,0.75); padding: 50px 0 30px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; margin-bottom: 30px; }
.footer-brand-name { font-family: 'Fraunces', serif; font-size: 1.2rem; color: var(--horizon); font-weight: 600; }
.footer-links { display: flex; gap: 60px; }
.footer-col h5 {
  font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--tide-soft); margin-bottom: 12px;
}
.footer-col a { display: block; color: rgba(234,246,248,0.7); font-size: 0.9rem; margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(234,246,248,0.12); padding-top: 20px;
  font-size: 0.8rem; color: rgba(234,246,248,0.45);
}

/* ---- Wave divider between sections ---- */
.wave-divider {
  width: 100%; height: 40px; display: block;
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0;
    background: var(--abyss); padding: 20px 32px; gap: 16px;
  }
  .nav-ham { display: block; }
  .footer-grid { flex-direction: column; }
  .footer-links { gap: 30px; }
}
