:root {
  /* Apple Dark Mode Base & Typography Colors (iOS 26 / visionOS Neutral Glass) */
  --bg: #090a0f;
  --ink: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.64);
  --subtle: rgba(235, 235, 245, 0.42);
  --warm: #f2cfa5;

  /* Authentic Achromatic Optical Liquid Glass Tokens */
  --glass-surface:
    radial-gradient(
      130% 110% at 20% 0%,
      rgba(255, 255, 255, 0.13) 0%,
      rgba(255, 255, 255, 0.04) 55%,
      rgba(255, 255, 255, 0.07) 100%
    );
  --glass-surface-hover:
    radial-gradient(
      130% 110% at 20% 0%,
      rgba(255, 255, 255, 0.19) 0%,
      rgba(255, 255, 255, 0.065) 55%,
      rgba(255, 255, 255, 0.11) 100%
    );
  --glass-bar:
    linear-gradient(
      180deg,
      rgba(32, 34, 44, 0.62) 0%,
      rgba(20, 22, 30, 0.52) 100%
    );
  --glass-drawer:
    linear-gradient(
      165deg,
      rgba(28, 30, 40, 0.76) 0%,
      rgba(16, 18, 25, 0.72) 100%
    );
  --glass-pill:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.15) 0%,
      rgba(255, 255, 255, 0.06) 100%
    );
  --glass-pill-hover:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.1) 100%
    );
  --glass-subcard:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.025) 100%
    );

  /* Optical Rim & Specular Caustics (Top-Left Specular + Bottom-Right Refraction) */
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --glass-divider: rgba(255, 255, 255, 0.08);
  --glass-rim:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.36),
    inset 1px 0 0 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.08);
  --glass-shadow:
    0 22px 48px -12px rgba(0, 0, 0, 0.55),
    0 4px 16px -2px rgba(0, 0, 0, 0.35);
  --glass-shadow-hover:
    0 28px 60px -12px rgba(0, 0, 0, 0.72),
    0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --glass-blur: blur(36px) saturate(180%);

  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font: 16px / 1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100dvh;
}

/* Soft Warm-Studio & Moonlight Ambient Light Field (makes clear glass refract naturally) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle 680px at 66% 36%, rgba(244, 188, 132, 0.16), transparent 70%),
    radial-gradient(circle 640px at 18% 18%, rgba(145, 175, 225, 0.12), transparent 70%),
    radial-gradient(circle 720px at 78% 82%, rgba(135, 160, 210, 0.09), transparent 72%),
    radial-gradient(circle 540px at 24% 78%, rgba(232, 176, 125, 0.08), transparent 70%),
    linear-gradient(180deg, #0b0d13 0%, #08090e 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 3px;
}

button[hidden],
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

/* Floating Segmented iOS 26 / visionOS Liquid Glass Top Bar (3 Separate Islands) */
.mast,
.reader-head {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  padding: 14px clamp(16px, 4vw, 60px) 10px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(9, 10, 15, 0.92) 0%,
    rgba(9, 10, 15, 0.52) 68%,
    rgba(9, 10, 15, 0) 100%
  );
}

.mast-inner,
.reader-head-inner {
  pointer-events: none;
  max-width: 1460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Segment 1: Left Brand Liquid Glass Capsule */
.brand {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  height: 52px;
  padding: 0 18px 0 10px;
  border-radius: 999px;
  background: var(--glass-bar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
  font-weight: 650;
  font-size: 14.5px;
  line-height: 1.22;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-strong);
}

.brand img {
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: block;
}

.brand b {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.13em;
  margin-top: 2px;
  color: var(--subtle);
}

/* Segment 2: Center Navigation Liquid Glass Segmented Island */
.mast-nav {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-bar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mast-nav a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.mast-nav a:hover,
.mast-nav a[aria-current='page'] {
  background: var(--glass-pill-hover);
  color: var(--ink);
  box-shadow: var(--glass-rim), 0 2px 10px rgba(0, 0, 0, 0.28);
}

/* Segment 3: Right Action Liquid Glass Capsule */
.mast-end {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-pill,
.back-home {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--glass-bar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.panel-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--glass-border);
  background: var(--glass-pill);
  box-shadow: var(--glass-rim);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-pill:hover,
.panel-tools button:hover,
.back-home:hover {
  background: var(--glass-surface-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}

.mast.is-scrolled .brand,
.mast.is-scrolled .mast-nav,
.mast.is-scrolled .nav-pill {
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-rim), var(--glass-shadow-hover);
}

/* Main Container */
.house {
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 60px);
}

/* Hero Spread (Clean open spatial typography on left, glowing 3D room on right) */
.spread {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(300px, 37%) 1fr;
  gap: clamp(24px, 3.5vw, 52px);
  align-items: center;
  min-height: clamp(460px, calc(100svh - 190px), 760px);
  padding: clamp(16px, 2.5vw, 32px) 0 clamp(24px, 3vw, 40px);
}

.intro {
  z-index: 1;
  position: relative;
  padding: 12px 0;
  transition: opacity 0.28s ease;
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--subtle);
  font-weight: 500;
}

.intro h1 {
  font: 700 clamp(50px, 5.4vw, 86px) / 1.08 var(--sans);
  letter-spacing: -0.04em;
  margin: 14px 0 18px;
  color: var(--ink);
}

.intro h1 span {
  color: var(--warm);
}

.intro p {
  max-width: 24em;
  font-size: clamp(15px, 1.06vw, 17px);
  line-height: 1.85;
  color: var(--muted);
  text-wrap: pretty;
}

.intro p strong {
  color: var(--ink);
  font-weight: 600;
}

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

/* Tactile Apple Liquid Glass Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #090a0f;
  font-size: 14px;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 10px 28px -6px rgba(255, 255, 255, 0.22);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 14px 32px -6px rgba(255, 255, 255, 0.32);
}

.btn-primary svg {
  width: 16px;
  height: 16px;
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--glass-pill);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim);
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.feature-link:hover {
  transform: translateY(-1px);
  border-color: var(--glass-border-strong);
  background: var(--glass-pill-hover);
}

/* 3D Room Scene on Warm Ambient Light Stage */
.scene {
  align-self: stretch;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  background: radial-gradient(
    ellipse closest-side at 53% 54%,
    rgba(245, 195, 142, 0.18),
    rgba(255, 255, 255, 0.04) 58%,
    transparent 96%
  );
}

.scene figure {
  width: min(106%, calc((100svh - 190px) * 1.3086), 980px);
  min-width: min(600px, 100%);
  aspect-ratio: 1340 / 1024;
  position: relative;
  line-height: 0;
  transform-origin: var(--origin, 45% 42%);
  transition: transform 0.46s cubic-bezier(0.2, 0.72, 0.25, 1);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.scene img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.58));
  pointer-events: none;
  -webkit-user-drag: none;
}

.object-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.shadow {
  position: absolute;
  left: 18%;
  right: 12%;
  top: 68%;
  height: 18%;
  background: rgba(242, 190, 135, 0.12);
  filter: blur(36px);
  border-radius: 50%;
}

.figcap {
  position: absolute;
  right: 8px;
  bottom: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass-pill);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim), 0 6px 18px rgba(0, 0, 0, 0.3);
  font-size: 11.5px;
  color: var(--muted);
}

.scene,
.scene *,
.object-map,
.object-map a,
.object-map .toy-pick,
.object-map path {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none !important;
}

.object-map path {
  pointer-events: fill;
  cursor: pointer;
  fill: transparent !important;
  stroke: none !important;
}

#tag {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -122%);
  background: var(--glass-drawer);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  color: var(--ink);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-rim), 0 10px 28px rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  line-height: 1.35;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 550;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  font: 650 22px / 1.25 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-head p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.section-more:hover {
  background: var(--glass-pill-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}

/* Core Liquid Glass Surface Class shared across cards & panels */
.dir-card,
.work-card,
.note-row,
.side-card,
.standalone .journal {
  position: relative;
  background: var(--glass-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim), var(--glass-shadow);
}

.dir-card:hover,
.work-card:hover,
.note-row:hover {
  transform: translateY(-2px);
  background: var(--glass-surface-hover);
  border-color: var(--glass-border-strong);
  box-shadow: var(--glass-rim), var(--glass-shadow-hover);
}

/* Directory (3 Liquid Glass Cards) */
.directory {
  padding: 16px 0 36px;
}

.directory nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dir-card {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border-radius: 24px;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.dir-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.dir-top svg {
  width: 20px;
  height: 20px;
  color: var(--ink);
}

.dir-top em {
  margin-left: auto;
  font-style: normal;
  font-size: 15px;
  color: var(--subtle);
  transition: transform 0.18s ease, color 0.18s ease;
}

.dir-card:hover .dir-top em {
  transform: translate(2px, -2px);
  color: var(--ink);
}

.dir-card strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.dir-card p {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
}

/* Featured Works */
.showcase {
  padding: 20px 0 36px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.work-card {
  display: flex;
  flex-direction: column;
  padding: 24px 26px;
  border-radius: 24px;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;
}

.work-tag,
.note-tag {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--subtle);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.work-card h3 {
  font: 650 19.5px / 1.35 var(--sans);
  letter-spacing: -0.015em;
  color: var(--ink);
}

.work-card p {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
  flex: 1;
}

.work-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-divider);
  font-size: 12px;
}

.work-card-foot span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--subtle);
}

.work-card-foot em {
  font-style: normal;
  font-weight: 550;
  color: var(--ink);
  white-space: nowrap;
}

/* Recent Notes */
.recent-notes {
  padding: 20px 0 48px;
}

.note-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 22px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.note-body {
  flex: 1;
  min-width: 0;
}

.note-tag {
  display: block;
  margin-bottom: 4px;
}

.note-body h3 {
  font: 650 18px / 1.4 var(--sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.note-body p {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.note-row em {
  font-style: normal;
  font-size: 16px;
  color: var(--subtle);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.note-row:hover em {
  transform: translateX(3px);
  color: var(--ink);
}

/* Footer */
.folio {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--glass-divider);
  padding: 24px 0 38px;
  font-size: 12px;
  color: var(--subtle);
}

.folio-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.folio a:hover {
  color: var(--ink);
}

/* Floating Left Liquid Glass Drawer */
.reading-open {
  overflow: hidden;
}

.reading-open .scene figure {
  transform: translateX(4%) scale(1.06);
}

.reading-open .intro {
  opacity: 0;
  pointer-events: none;
}

dialog {
  color: var(--ink);
  background: transparent;
  border: 0;
}

#drawer {
  position: fixed;
  inset: 14px auto 14px 14px;
  margin: 0;
  width: min(540px, 44vw);
  max-width: calc(100vw - 28px);
  height: calc(100dvh - 28px);
  max-height: calc(100dvh - 28px);
  padding: 0;
  border-radius: 28px;
  background: var(--glass-drawer);
  backdrop-filter: blur(42px) saturate(190%);
  -webkit-backdrop-filter: blur(42px) saturate(190%);
  border: 1px solid var(--glass-border-strong);
  box-shadow:
    var(--glass-rim),
    0 30px 80px -12px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}

#drawer[open] {
  display: flex;
  flex-direction: column;
  animation: enter 0.26s cubic-bezier(0.2, 0.85, 0.25, 1);
}

#drawer::backdrop {
  background: rgba(4, 6, 12, 0.28);
}

.panel-tools {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--glass-divider);
  background: rgba(255, 255, 255, 0.03);
}

.panel-tools span {
  font-size: 12px;
  color: var(--muted);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--glass-border);
  background: var(--glass-pill);
  box-shadow: var(--glass-rim);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.panel-link:hover {
  background: var(--glass-pill-hover);
  border-color: var(--glass-border-strong);
}

#paper {
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
}

/* Standalone Wide Two-Column Layout */
.journal {
  max-width: 740px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 48px) clamp(22px, 3.5vw, 40px);
}

.standalone {
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 60px) 72px;
}

.standalone-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(22px, 2.6vw, 32px);
  align-items: start;
}

.standalone .journal {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: clamp(32px, 4vw, 54px) clamp(28px, 4.5vw, 60px);
  border-radius: 28px;
}

.side-rail {
  position: sticky;
  top: 86px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  padding: 22px 24px;
  border-radius: 24px;
}

.side-card h3 {
  font: 650 13.5px / 1.3 var(--sans);
  letter-spacing: 0.02em;
  color: var(--muted);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--glass-divider);
}

.fact-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fact-list dt {
  font-size: 11.5px;
  color: var(--subtle);
  margin-bottom: 2px;
}

.fact-list dd {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 500;
}

.side-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-divider);
}

.side-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-pill);
  box-shadow: var(--glass-rim);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.side-links a:hover {
  background: var(--glass-pill-hover);
  border-color: var(--glass-border-strong);
}

.side-links em {
  font-style: normal;
  color: var(--muted);
}

.side-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-nav-list a {
  display: block;
  padding: 10px 13px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.side-nav-list a:hover,
.side-nav-list a[aria-current='page'] {
  background: var(--glass-pill);
  border-color: var(--glass-border);
  box-shadow: var(--glass-rim);
}

.side-nav-list strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.side-nav-list span {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--subtle);
}

.journal h1 {
  font: 700 clamp(30px, 3.4vw, 46px) / 1.18 var(--sans);
  letter-spacing: -0.03em;
  margin: 12px 0 14px;
}

.journal h1:focus {
  outline: none;
}

.journal .lead {
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--muted);
  margin-bottom: 26px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--glass-pill);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-rim);
  margin-bottom: 16px;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.crumb:hover {
  color: var(--ink);
  border-color: var(--glass-border-strong);
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entries a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass-subcard);
  box-shadow: var(--glass-rim);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.entries a:hover {
  transform: translateY(-2px);
  background: var(--glass-surface-hover);
  border-color: var(--glass-border-strong);
}

.entries label {
  display: block;
  color: var(--subtle);
  font-size: 11.5px;
  margin-bottom: 4px;
  pointer-events: none;
}

.entries h2 {
  font: 650 19px / 1.4 var(--sans);
  margin: 0 0 4px;
}

.entries p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.entries b {
  margin-left: auto;
  color: var(--subtle);
  font-weight: 400;
}

.endmark {
  border-top: 1px solid var(--glass-divider);
  margin-top: 36px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--subtle);
}

.prose {
  line-height: 1.9;
  font-size: 15.5px;
  color: rgba(245, 245, 247, 0.88);
}

.prose p,
.prose ol,
.prose ul {
  margin: 12px 0 18px;
}

.prose li {
  margin: 6px 0;
}

.prose h2 {
  font: 650 21px / 1.4 var(--sans);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  text-underline-offset: 0.22em;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

.prose pre {
  overflow: auto;
  padding: 16px;
  background: var(--glass-subcard);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  font-size: 14px;
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.plate img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55);
  display: block;
}

.plate figcaption {
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0 24px;
}

/* Rich Prose Sub-Cards in Neutral Liquid Glass */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 26px;
}

#drawer .feature-grid {
  grid-template-columns: 1fr;
}

.feature-item {
  padding: 18px 20px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-subcard);
  box-shadow: var(--glass-rim);
}

.feature-item h3 {
  font: 650 15.5px / 1.4 var(--sans);
  color: var(--ink);
  margin-bottom: 6px;
}

.feature-item p {
  margin: 0 !important;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--muted);
}

.callout {
  margin: 22px 0;
  padding: 18px 22px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: var(--glass-subcard);
  box-shadow: var(--glass-rim);
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--muted);
}

.callout strong {
  color: var(--ink);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 10px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-pill);
  box-shadow: var(--glass-rim);
  color: var(--ink) !important;
  text-decoration: none !important;
  font-size: 13.5px;
  font-weight: 550;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  background: var(--glass-pill-hover);
  border-color: var(--glass-border-strong);
}

.action-btn.primary {
  background: rgba(255, 255, 255, 0.92);
  border-color: #ffffff;
  color: #090a0f !important;
  font-weight: 600;
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 22px -6px rgba(255, 255, 255, 0.25);
}

.action-btn.primary:hover {
  background: #ffffff;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

.stack-tags span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-pill);
  box-shadow: var(--glass-rim);
  color: var(--ink);
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateX(-20px) scale(0.985);
  }
}

/* Entrance Choreography (Apple-style smooth spatial reveal) */
@keyframes barDropIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUpIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes roomReveal {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.93);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.mast-inner .brand,
.mast-inner .mast-nav,
.mast-inner .mast-end,
.reader-head-inner .brand,
.reader-head-inner .mast-nav,
.reader-head-inner .back-home {
  animation: barDropIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.mast-inner .mast-nav,
.reader-head-inner .mast-nav {
  animation-delay: 0.06s;
}

.mast-inner .mast-end,
.reader-head-inner .back-home {
  animation-delay: 0.12s;
}

.intro .kicker {
  animation: fadeUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.08s backwards;
}

.intro h1 {
  animation: fadeUpIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.16s backwards;
}

.intro p {
  animation: fadeUpIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.24s backwards;
}

.intro .intro-actions {
  animation: fadeUpIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.32s backwards;
}

.scene figure {
  animation: roomReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.12s backwards;
}

.figcap {
  animation: fadeUpIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s backwards;
}

.directory {
  animation: fadeUpIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.36s backwards;
}

.showcase {
  animation: fadeUpIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.44s backwards;
}

.recent-notes {
  animation: fadeUpIn 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.52s backwards;
}

.standalone .journal {
  animation: fadeUpIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.08s backwards;
}

.side-rail {
  animation: fadeUpIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.16s backwards;
}

/* Tablet */
@media (max-width: 1040px) {
  .standalone-grid {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
  }
}

@media (max-width: 980px) {
  .spread {
    grid-template-columns: 40% 60%;
  }

  .intro h1 {
    font-size: 52px;
  }

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

/* Mobile */
@media (max-width: 720px) {
  .mast,
  .reader-head {
    padding: 10px 14px 4px;
  }

  .brand {
    height: 44px;
    padding: 0 14px 0 8px;
    font-size: 13.5px;
  }

  .brand img {
    width: 28px;
    height: 28px;
  }

  .nav-pill,
  .back-home {
    height: 44px;
    padding: 0 15px;
    font-size: 12px;
  }

  .mast-nav {
    display: none;
  }

  .house {
    padding: 0 16px;
    overflow-x: clip;
  }

  .spread {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 12px 0;
    gap: 12px;
  }

  .intro h1 {
    font-size: clamp(36px, 9.5vw, 52px);
    margin: 10px 0 12px;
  }

  .intro h1 br {
    display: none;
  }

  .intro p {
    font-size: 14.5px;
    line-height: 1.75;
    max-width: 32em;
  }

  .intro-actions {
    margin-top: 18px;
    gap: 10px;
  }

  .btn-primary,
  .feature-link {
    padding: 9px 18px;
    font-size: 13px;
  }

  .scene {
    margin: 0 -16px;
    align-self: auto;
  }

  .scene figure {
    width: 110%;
    min-width: 0;
    max-width: 680px;
  }

  .figcap {
    right: 16px;
    bottom: 6px;
    font-size: 10.5px;
  }

  .directory,
  .showcase,
  .recent-notes {
    padding: 18px 0 26px;
  }

  .directory nav,
  .work-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dir-card,
  .work-card {
    padding: 18px 20px;
    border-radius: 20px;
  }

  .note-row {
    padding: 16px 18px;
    gap: 12px;
    border-radius: 18px;
  }

  .folio {
    font-size: 11px;
    padding: 18px 0 28px;
  }

  .reading-open .scene figure {
    transform: translateY(-18%) scale(1.14);
  }

  #drawer {
    inset: auto 8px 8px 8px;
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: 78dvh;
    max-height: 78dvh;
    border-radius: 26px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .panel-tools {
    padding: 12px 18px;
  }

  .journal {
    padding: 22px 18px;
  }

  .standalone {
    padding: 14px 14px 36px;
  }

  .standalone .journal {
    padding: 22px 18px;
    border-radius: 22px;
  }

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

  .journal h1 {
    font-size: 30px;
  }

  @keyframes enter {
    from {
      opacity: 0;
      transform: translateY(20px) scale(0.985);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
