:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --surface: #ffffff;
  --surface-soft: #f5f5f7;
  --hairline: rgba(29, 29, 31, 0.1);
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--surface); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.journal-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px clamp(18px, 4vw, 64px) 42px;
  background: linear-gradient(to bottom, var(--surface) 0 38%, var(--surface-soft) 38% 100%);
}
.ambient { position: absolute; z-index: -1; border-radius: 999px; filter: blur(30px); opacity: 0.45; }
.ambient-one { width: 360px; height: 360px; top: 17%; left: -210px; background: rgba(255, 255, 255, 0.9); }
.ambient-two { width: 440px; height: 440px; right: -240px; top: 49%; background: rgba(255, 255, 255, 0.78); }

.glass-nav {
  position: sticky;
  top: 18px;
  z-index: 30;
  width: min(1180px, 100%);
  min-height: 64px;
  margin: 0 auto;
  padding: 10px 14px 10px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(28px) saturate(160%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; color: inherit; text-decoration: none; font-size: 15px; font-weight: 720; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; color: #ffffff; background: #1d1d1f; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14); }
.nav-stats { display: flex; gap: 24px; color: var(--muted); font-size: 12px; }
.nav-stats strong { color: var(--ink); font-size: 15px; margin-right: 3px; }
.nav-link { justify-self: end; padding: 10px 13px; border-radius: 12px; color: var(--ink); background: rgba(245,245,247,.88); text-decoration: none; font-size: 12px; transition: 180ms ease; }
.nav-link:hover { transform: translateY(-1px); background: #ffffff; box-shadow: 0 8px 22px rgba(0,0,0,.08); }

.hero { width: min(1080px, 100%); margin: 0 auto; padding: 116px 0 96px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 24px; color: var(--muted); font-size: 11px; font-weight: 760; letter-spacing: 0.16em; }
.eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 6px rgba(29, 29, 31, 0.08); }
.hero h1 { margin: 0; color: var(--ink); font-size: clamp(42px, 7vw, 82px); line-height: 1.02; letter-spacing: -0.065em; font-weight: 710; text-wrap: balance; }
.hero-copy { width: min(620px, 100%); margin: 30px auto 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.75; }
.hero-footnote { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 26px; color: var(--muted); font-size: 12px; }
.verified-mark { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; color: white; background: var(--ink); font-size: 10px; }
.hero-footnote span:last-child::before { content: "·"; margin-right: 10px; }

.content-panel { width: min(1180px, 100%); margin: 0 auto; }
.section-intro { display: grid; grid-template-columns: 1fr minmax(260px, 440px); align-items: end; gap: 32px; margin-bottom: 28px; padding: 0 4px; }
.section-kicker { margin: 0; color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .16em; text-transform: uppercase; }
.section-intro h2 { margin: 9px 0 0; color: var(--ink); font-size: clamp(28px, 4vw, 44px); line-height: 1.12; letter-spacing: -.045em; }
.section-intro > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }
.glass-surface { border: 1px solid rgba(29,29,31,.08); background: rgba(255,255,255,.76); box-shadow: 0 12px 36px rgba(0,0,0,.05); backdrop-filter: blur(24px) saturate(145%); }
.toolbar { position: relative; z-index: 4; display: flex; justify-content: space-between; gap: 18px; padding: 11px; border-radius: 20px; }
.category-tabs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { flex: 0 0 auto; padding: 9px 12px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; transition: 180ms ease; }
.category-tabs button:hover, .category-tabs button.active { color: var(--ink); background: #ffffff; box-shadow: 0 5px 16px rgba(0,0,0,.06); }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sort-control select { min-width: 110px; padding: 9px 30px 9px 11px; border: 1px solid rgba(29,29,31,.08); border-radius: 12px; color: var(--ink); background: #ffffff; cursor: pointer; }

.principle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; align-items: stretch; gap: 22px; width: min(1080px, 100%); margin: 24px auto 0; }
.principle-card { position: relative; display: flex; height: 330px; min-height: 250px; overflow: hidden; border: 1px solid rgba(255,255,255,.76); border-radius: 26px; background: rgba(255,255,255,.62); box-shadow: 0 18px 54px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.86); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease; }
.principle-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(145deg, rgba(255,255,255,.52), rgba(255,255,255,.08) 48%, rgba(245,245,247,.22)); }
.principle-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -100px; bottom: -105px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); transition: transform 260ms ease; }
.principle-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.74); box-shadow: 0 26px 64px rgba(0,0,0,.11), inset 0 1px 0 rgba(255,255,255,.94); }
.principle-card:hover::after { transform: scale(1.3); }
.card-main { position: relative; z-index: 1; display: flex; flex: 1 1 auto; flex-direction: column; width: 100%; height: 100%; min-height: 250px; padding: 25px 26px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.card-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.category-pill { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid rgba(29,29,31,.08); border-radius: 999px; color: var(--muted); background: var(--surface-soft); }
.card-main h3 { margin: 24px 0 14px; color: var(--ink); font-size: clamp(23px, 3vw, 34px); line-height: 1.18; letter-spacing: -.04em; font-weight: 660; text-wrap: balance; }
.card-main > p { max-width: 90%; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.card-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 11px; }
.card-footer span { display: inline-flex; align-items: center; gap: 6px; }

.loading-card { min-height: 270px; padding: 32px; border: 1px solid var(--hairline); border-radius: 26px; background: #ffffff; }
.loading-card span { display: block; height: 16px; margin: 20px 0; border-radius: 999px; background: linear-gradient(90deg, #f5f5f7, #ffffff, #f5f5f7); background-size: 220% 100%; animation: shimmer 1.7s infinite; }
.loading-card span:first-child { width: 30%; height: 10px; }
.loading-card span:last-child { width: 70%; }
@keyframes shimmer { to { background-position: -220% 0; } }
.empty-state, .error-state { min-height: 300px; margin-top: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--hairline); border-radius: 26px; background: #ffffff; text-align: center; }
.empty-state > span, .error-state > span { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 17px; color: var(--ink); background: var(--surface-soft); font-size: 23px; box-shadow: 0 12px 28px rgba(0,0,0,.07); }
.empty-state h3, .error-state h3 { margin: 18px 0 8px; font-size: 22px; }
.empty-state p, .error-state p { margin: 0; color: var(--muted); }
.error-state button { margin-top: 20px; padding: 10px 16px; border: 0; border-radius: 12px; color: white; background: var(--ink); cursor: pointer; }

footer { width: min(1180px, 100%); margin: 36px auto 0; padding: 28px 4px 0; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; }
footer a { color: inherit; text-decoration: none; }

.detail-dialog { width: min(850px, calc(100vw - 28px)); max-height: 88vh; overflow-y: auto; padding: clamp(28px, 5vw, 54px); border: 1px solid rgba(29,29,31,.1); border-radius: 28px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 30px 100px rgba(0,0,0,.22); backdrop-filter: blur(30px) saturate(145%); }
.detail-dialog::backdrop { background: rgba(29,29,31,.24); backdrop-filter: blur(8px); }
.dialog-close-form { position: sticky; z-index: 2; top: -30px; height: 0; text-align: right; }
.dialog-close { width: 38px; height: 38px; border: 1px solid rgba(29,29,31,.08); border-radius: 50%; color: var(--ink); background: rgba(245,245,247,.88); font-size: 23px; line-height: 1; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.detail-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.detail-dialog h2 { max-width: 740px; margin: 22px 0 0; color: var(--ink); font-size: clamp(31px, 5vw, 53px); line-height: 1.08; letter-spacing: -.05em; }
.detail-lead { max-width: 680px; margin: 17px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.boundary-card { margin-top: 30px; padding: 18px 20px; border: 1px solid rgba(29,29,31,.08); border-radius: 17px; background: var(--surface-soft); }
.boundary-card span, .story-kicker { color: var(--muted); font-size: 10px; font-weight: 720; letter-spacing: .12em; text-transform: uppercase; }
.boundary-card p { margin: 8px 0 0; color: var(--ink); line-height: 1.7; }
.story-section { margin-top: 42px; }
.story-heading { display: flex; justify-content: space-between; align-items: end; padding-bottom: 18px; border-bottom: 1px solid var(--hairline); }
.story-heading h3 { margin: 6px 0 0; font-size: 21px; letter-spacing: -.03em; }
.story-heading > span { color: var(--muted); font-size: 12px; }
.story-entry { display: grid; grid-template-columns: 145px 1fr; gap: 28px; padding: 28px 0; border-bottom: 1px solid var(--hairline); }
.story-date { color: var(--muted); font-size: 11px; }
.story-copy h4 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.story-copy > p { margin: 12px 0 0; white-space: pre-wrap; color: var(--muted); font-size: 14px; line-height: 1.85; }
.story-copy blockquote { margin: 20px 0 0; padding: 16px 18px; border-left: 3px solid var(--ink); border-radius: 0 12px 12px 0; color: var(--ink); background: var(--surface-soft); font-size: 13px; line-height: 1.7; }
.story-copy blockquote span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; }

@media (max-width: 850px) {
  .journal-shell { padding: 14px 14px 32px; }
  .glass-nav { top: 10px; grid-template-columns: 1fr auto; border-radius: 18px; }
  .nav-stats { display: none; }
  .hero { padding: 86px 8px 68px; }
  .hero h1 { font-size: clamp(40px, 12vw, 64px); }
  .section-intro { grid-template-columns: 1fr; gap: 14px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .sort-control { justify-content: flex-end; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-card, .card-main { height: auto; min-height: 245px; }
  .story-entry { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 520px) {
  .brand > span:last-child { display: none; }
  .glass-nav { padding-left: 10px; }
  .hero-footnote { flex-wrap: wrap; }
  .hero-footnote span:last-child::before { display: none; }
  .card-main { padding: 23px; }
  .card-main h3 { font-size: 26px; }
  .card-footer { flex-direction: column; align-items: flex-start; }
  footer { align-items: flex-start; flex-direction: column; gap: 10px; }
  .detail-dialog { padding: 36px 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
