/* ==========================================================================
   fachrynuzuli.com — Living Sunset Meadow Macintosh & Editorial Reader
   Palette extracted in OKLCH from the golden-hour mountain meadow scene.
   ========================================================================== */

:root {
  /* Surfaces (warm-tinted neutrals, never pure #fff or #000) */
  --paper:          oklch(0.96 0.014 80);
  --paper-raised:   oklch(0.982 0.01 82);
  --paper-sunken:   oklch(0.922 0.019 76);
  --wash:           oklch(0.50 0.15 44 / 0.075);
  --crt-bg:         oklch(0.845 0.025 82);
  --crt-bg-edge:    oklch(0.755 0.028 78);

  /* Sun-warmed 1984 Macintosh Plastic Bezel Tones */
  --bezel-lit:      oklch(0.79 0.052 72);
  --bezel-mid:      oklch(0.67 0.028 74);
  --bezel-shade:    oklch(0.53 0.024 72);
  --bezel-cavity:   oklch(0.27 0.024 56);

  /* Ink & Neutrals (warm twilight espresso-charcoal) */
  --ink:            oklch(0.20 0.022 50);
  --ink-soft:       oklch(0.31 0.024 52);
  --ink-muted:      oklch(0.47 0.024 56);
  --rule:           oklch(0.84 0.024 74);
  --rule-strong:    oklch(0.68 0.028 65);

  /* Sunset & Dusk Accents */
  --amber:          oklch(0.64 0.165 55);
  --sienna:         oklch(0.50 0.15 44);
  --sienna-deep:    oklch(0.39 0.125 40);
  --dusk:           oklch(0.25 0.055 256);
  --dusk-ink:       oklch(0.94 0.016 80);
  --dusk-muted:     oklch(0.76 0.025 74);
  --dusk-amber:     oklch(0.78 0.145 64);

  /* Typography */
  --font-display:   'Bricolage Grotesque', system-ui, sans-serif;
  --font-serif:     'Source Serif 4', Georgia, serif;
  --font-mono:      'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Spacing */
  --space-1:        0.25rem;
  --space-2:        0.5rem;
  --space-3:        0.75rem;
  --space-4:        1rem;
  --space-5:        1.5rem;
  --space-6:        2rem;
  --space-7:        3rem;
  --space-8:        4.5rem;

  /* Motion */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast:         140ms;
  --t-base:         260ms;
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--dusk);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.04rem;
  line-height: 1.72;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.stage-only {
  background-color: var(--dusk);
  height: 100dvh;
  overflow: hidden;
}

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

a {
  color: var(--sienna-deep);
  text-decoration: underline;
  text-decoration-color: oklch(0.50 0.15 44 / 0.38);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
  transition: color var(--t-fast) ease, text-decoration-color var(--t-fast) ease;
}

a:hover {
  color: var(--sienna);
  text-decoration-color: var(--sienna);
}

:where(a:any-link, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--sienna);
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   LIVING HERO STAGE: Sunset Meadow + Pushed-Back 1984 Macintosh
   ========================================================================== */

.hero-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--dusk);
  isolation: isolate;
}

.scene-rig {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-stage.is-entering .scene-rig {
    animation: cinematic-focus-in 1.15s var(--ease-out-expo) both;
    will-change: transform, filter, opacity;
  }
}

@keyframes cinematic-focus-in {
  0% {
    opacity: 0.12;
    filter: blur(14px);
    transform: scale(1.045);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
    transform: scale(1);
  }
}

.scene-frame {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 1376 / 768;
  width: max(100%, calc(100dvh * (1376 / 768)));
  height: auto;
  overflow: hidden;
}

@media (max-aspect-ratio: 4/5) {
  .scene-frame {
    width: max(
      calc(100dvh * (1376 / 768)),
      min(calc(100dvw / 0.195), 2350px)
    );
    transform: translate(-50%, -50%);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .scene-frame {
    width: max(100%, calc(100dvh * (1376 / 768)), 1040px);
    transform: translate(-50%, -44%);
  }
}

.scene-picture,
.scene-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

/* ── Ambient Living Layers (Very Subtle, Pure GPU Compositor) ──────────── */

.ambient-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-clouds {
  z-index: 2;
  height: 46%;
  bottom: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 54%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 54%, transparent 100%);
}

.cloud-band {
  position: absolute;
  inset: -10% -35%;
  opacity: 0.14;
  mix-blend-mode: screen;
}

.cloud-band-a {
  background:
    radial-gradient(32% 42% at 22% 48%, oklch(0.86 0.13 62 / 0.72) 0%, transparent 72%),
    radial-gradient(28% 36% at 64% 38%, oklch(0.76 0.11 46 / 0.58) 0%, transparent 72%),
    radial-gradient(24% 32% at 88% 54%, oklch(0.72 0.09 36 / 0.45) 0%, transparent 70%);
}

.cloud-band-b {
  opacity: 0.09;
  background:
    radial-gradient(36% 30% at 38% 28%, oklch(0.90 0.08 72 / 0.55) 0%, transparent 74%),
    radial-gradient(30% 34% at 78% 24%, oklch(0.68 0.10 40 / 0.52) 0%, transparent 72%);
}

.ambient-shadows {
  z-index: 3;
}

.shadow-veil {
  position: absolute;
  inset: -6%;
  background:
    radial-gradient(52% 65% at 8% 52%, oklch(0.84 0.16 64 / 0.11) 0%, transparent 62%),
    radial-gradient(58% 68% at 92% 42%, oklch(0.16 0.045 258 / 0.16) 0%, transparent 66%);
  opacity: 0.7;
}

.ambient-flowers {
  z-index: 4;
}

.meadow-breeze-sheen {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 64%;
  bottom: 0;
  opacity: 0.065;
  mix-blend-mode: soft-light;
  background:
    radial-gradient(28% 52% at 22% 66%, oklch(0.88 0.14 72) 0%, transparent 72%),
    radial-gradient(26% 48% at 78% 68%, oklch(0.85 0.12 66) 0%, transparent 72%);
}

.flower-sway-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  will-change: transform;
}

.flower-sway-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.flower-sway-left {
  transform-origin: 18% 100%;
  -webkit-mask-image: radial-gradient(36% 34% at 15% 96%, #000 32%, transparent 82%);
  mask-image: radial-gradient(36% 34% at 15% 96%, #000 32%, transparent 82%);
}

.flower-sway-right {
  transform-origin: 82% 100%;
  -webkit-mask-image: radial-gradient(40% 42% at 84% 94%, #000 35%, transparent 82%);
  mask-image: radial-gradient(40% 42% at 84% 94%, #000 35%, transparent 82%);
}

.flower-sway-front {
  transform-origin: 52% 100%;
  -webkit-mask-image: radial-gradient(34% 18% at 54% 99%, #000 28%, transparent 80%);
  mask-image: radial-gradient(34% 18% at 54% 99%, #000 28%, transparent 80%);
}

.ambient-dither {
  position: fixed;
  inset: -24px;
  z-index: 12;
  pointer-events: none;
  opacity: 0.022;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 160px 160px;
}

@media (prefers-reduced-motion: no-preference) {
  .cloud-band-a { animation: cloud-drift-a 48s linear infinite alternate; }
  .cloud-band-b { animation: cloud-drift-b 68s linear infinite alternate; }
  .shadow-veil { animation: sunset-shadow-breathe 16s ease-in-out infinite; }
  .meadow-breeze-sheen { animation: meadow-sheen-glide 13s ease-in-out infinite; }
  .flower-sway-left { animation: flower-sway-a 7.8s ease-in-out infinite; }
  .flower-sway-right { animation: flower-sway-b 9.4s ease-in-out infinite; }
  .flower-sway-front { animation: flower-sway-c 6.6s ease-in-out infinite; }
  .ambient-dither { animation: dither-scramble 1.15s steps(1, end) infinite; }
}

.motion-paused .cloud-band,
.motion-paused .shadow-veil,
.motion-paused .meadow-breeze-sheen,
.motion-paused .flower-sway-layer,
.motion-paused .ambient-dither {
  animation-play-state: paused !important;
}

@keyframes cloud-drift-a {
  0%   { transform: translate3d(-4%, 0, 0); }
  100% { transform: translate3d(5%, -1.5%, 0); }
}

@keyframes cloud-drift-b {
  0%   { transform: translate3d(4%, -1%, 0); }
  100% { transform: translate3d(-5%, 1.2%, 0); }
}

@keyframes sunset-shadow-breathe {
  0%, 100% { opacity: 0.62; transform: translate3d(0, 0, 0); }
  50%      { opacity: 0.95; transform: translate3d(1.2%, -0.5%, 0); }
}

@keyframes meadow-sheen-glide {
  0%, 100% { transform: translate3d(-3%, 0, 0); opacity: 0.04; }
  50%      { transform: translate3d(4%, 0, 0); opacity: 0.095; }
}

@keyframes flower-sway-a {
  0%, 100% { transform: rotate(-0.65deg) translate3d(-0.25%, 0, 0); }
  50%      { transform: rotate(0.85deg) translate3d(0.35%, -0.15%, 0); }
}

@keyframes flower-sway-b {
  0%, 100% { transform: rotate(0.7deg) translate3d(0.25%, 0, 0); }
  50%      { transform: rotate(-0.9deg) translate3d(-0.35%, -0.15%, 0); }
}

@keyframes flower-sway-c {
  0%, 100% { transform: rotate(-0.45deg) translate3d(-0.18%, 0, 0); }
  50%      { transform: rotate(0.55deg) translate3d(0.22%, -0.1%, 0); }
}

@keyframes dither-scramble {
  0%   { transform: translate3d(0, 0, 0); }
  12%  { transform: translate3d(-7px, 5px, 0); }
  25%  { transform: translate3d(9px, -6px, 0); }
  37%  { transform: translate3d(-4px, -9px, 0); }
  50%  { transform: translate3d(6px, 8px, 0); }
  62%  { transform: translate3d(-9px, 3px, 0); }
  75%  { transform: translate3d(5px, -8px, 0); }
  87%  { transform: translate3d(-3px, 6px, 0); }
}

/* ==========================================================================
   LIVE CRT SCREEN OVERLAY (Clean Minimal 1984 Macintosh Desktop)
   ========================================================================== */

.crt-aperture {
  position: absolute;
  z-index: 6;
  left: 42.34%;
  top: 33.30%;
  width: 15.24%;
  height: 21.30%;
  border-radius: 7.4% / 9.6%;
  overflow: hidden;
  container-type: size;
  background:
    radial-gradient(
      ellipse at 48% 44%,
      var(--crt-bg) 0%,
      oklch(0.815 0.026 80) 72%,
      var(--crt-bg-edge) 100%
    );
  box-shadow:
    inset 0 0 15px oklch(0.18 0.025 50 / 0.36),
    inset 0 2px 5px oklch(0.18 0.025 50 / 0.30),
    inset -2px 0 8px oklch(0.24 0.04 255 / 0.16),
    inset 2px 0 8px oklch(0.76 0.13 62 / 0.24);
  color: var(--ink);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
}

.crt-aperture::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 2px,
      oklch(0.20 0.02 50 / 0.036) 2px,
      oklch(0.20 0.02 50 / 0.036) 3px
    ),
    radial-gradient(ellipse at 20% 16%, oklch(0.97 0.04 75 / 0.16) 0%, transparent 48%);
}

.crt-boot {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.crt-boot-slit {
  position: absolute;
  inset: 0;
  background: oklch(0.13 0.015 52);
  display: grid;
  place-items: center;
}

.crt-boot-slit::after {
  content: '';
  width: 84%;
  height: 2px;
  background: oklch(0.95 0.025 80);
  box-shadow: 0 0 14px 3px oklch(0.92 0.08 72 / 0.9);
  transform: scaleX(0.05);
  opacity: 0;
}

.crt-boot-progress {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, var(--crt-bg), var(--crt-bg-edge));
  display: grid;
  place-items: center;
  opacity: 0;
}

.crt-progress-track {
  width: 48%;
  height: 6px;
  border: 1.5px solid var(--ink);
  padding: 1px;
  background: var(--crt-bg);
}

.crt-progress-fill {
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(0);
}

.crt-screen {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
  padding: 2.8cqh 6.5cqi 2.2cqh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.crt-header {
  border-bottom: 1px solid oklch(0.20 0.022 50 / 0.55);
  padding-bottom: 1.4cqh;
  margin-bottom: 1.2cqh;
  flex-shrink: 0;
}

.crt-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(0.54rem, min(6.1cqi, 7.8cqh), 1.06rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}

.crt-menu {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.crt-menu-list {
  list-style: none;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crt-menu-item {
  width: 100%;
  flex: 1;
  display: flex;
}

.crt-menu-btn {
  width: 100%;
  height: 100%;
  min-block-size: 0;
  display: grid;
  grid-template-columns: 2.5ch 1fr auto;
  align-items: center;
  gap: 0.7ch;
  padding: 0 2cqi;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: clamp(0.48rem, min(5.1cqi, 6.6cqh), 0.88rem);
  line-height: 1.1;
  text-align: left;
  cursor: pointer;
  border-radius: 1px;
  transition: none;
}

.crt-numeral {
  text-align: right;
  color: var(--ink-soft);
  font-size: 0.86em;
}

.crt-label {
  font-weight: 500;
  letter-spacing: -0.015em;
}

.crt-hint {
  font-size: 0.72em;
  color: var(--ink-soft);
  opacity: 0;
}

.crt-menu-btn:hover,
.crt-menu-btn:focus-visible,
.crt-menu-btn[aria-current="true"] {
  background-color: var(--ink);
  color: var(--paper-raised);
  outline: none;
}

.crt-menu-btn:hover .crt-numeral,
.crt-menu-btn:focus-visible .crt-numeral,
.crt-menu-btn[aria-current="true"] .crt-numeral {
  color: var(--dusk-amber);
}

.crt-menu-btn:hover .crt-hint,
.crt-menu-btn:focus-visible .crt-hint,
.crt-menu-btn[aria-current="true"] .crt-hint {
  opacity: 1;
  color: var(--paper-raised);
}

.crt-menu-btn:focus-visible {
  box-shadow: 0 0 0 1.5px var(--amber);
}

.crt-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  border-top: 1px solid oklch(0.20 0.022 50 / 0.28);
  padding-top: 1cqh;
  margin-top: 1cqh;
  font-size: clamp(0.38rem, min(3.5cqi, 4.4cqh), 0.62rem);
  line-height: 1.1;
  color: var(--ink-soft);
}

.crt-footer a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0 2px;
}

.crt-footer a:hover,
.crt-footer a:focus-visible {
  background-color: var(--ink);
  color: var(--paper-raised);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .crt-aperture.is-booting .crt-boot {
    display: block;
    animation: crt-boot-fade 1.95s linear forwards;
  }

  .crt-aperture.is-booting .crt-boot-slit {
    animation: crt-slit-stage 0.95s linear forwards;
  }

  .crt-aperture.is-booting .crt-boot-slit::after {
    animation: crt-slit-expand 0.42s var(--ease-out-expo) 0.50s forwards;
  }

  .crt-aperture.is-booting .crt-boot-progress {
    animation: crt-progress-stage 0.92s linear 0.86s forwards;
  }

  .crt-aperture.is-booting .crt-progress-fill {
    animation: crt-progress-fill 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.94s forwards;
  }

  .crt-aperture.is-booting .crt-screen {
    opacity: 0;
    animation: crt-screen-in 0.38s var(--ease-out-expo) 1.66s forwards;
  }

  .crt-aperture.is-booting .crt-menu-item {
    opacity: 0;
    transform: translateY(3px);
    animation: crt-row-reveal 0.26s var(--ease-out-expo) forwards;
  }

  .crt-aperture.is-booting .crt-menu-item:nth-child(1) { animation-delay: 1.72s; }
  .crt-aperture.is-booting .crt-menu-item:nth-child(2) { animation-delay: 1.77s; }
  .crt-aperture.is-booting .crt-menu-item:nth-child(3) { animation-delay: 1.82s; }
  .crt-aperture.is-booting .crt-menu-item:nth-child(4) { animation-delay: 1.87s; }
  .crt-aperture.is-booting .crt-menu-item:nth-child(5) { animation-delay: 1.92s; }
  .crt-aperture.is-booting .crt-menu-item:nth-child(6) { animation-delay: 1.97s; }
}

@keyframes crt-slit-expand {
  0%   { transform: scaleX(0.05) scaleY(0.8); opacity: 0.9; }
  52%  { transform: scaleX(1) scaleY(1.6); opacity: 1; }
  100% { transform: scaleX(1.06) scaleY(26); opacity: 0; }
}

@keyframes crt-slit-stage {
  0%, 88% { opacity: 1; }
  100%    { opacity: 0; }
}

@keyframes crt-progress-stage {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes crt-progress-fill {
  0%   { transform: scaleX(0); }
  25%  { transform: scaleX(0.28); }
  52%  { transform: scaleX(0.62); }
  78%  { transform: scaleX(0.86); }
  100% { transform: scaleX(1); }
}

@keyframes crt-boot-fade {
  0%, 89% { opacity: 1; visibility: visible; }
  100%    { opacity: 0; visibility: hidden; }
}

@keyframes crt-screen-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes crt-row-reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Whisper-Quiet Corner Controls ─────────────────────────────────────── */

.hero-corner-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 15;
  padding: var(--space-4) clamp(0.85rem, 2.5vw, 1.75rem) clamp(0.75rem, 2dvh, 1.25rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

.hero-corner-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  pointer-events: auto;
}

.corner-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 36px;
  padding: 0.3rem 0.8rem;
  background: oklch(0.16 0.025 50 / 0.72);
  color: oklch(0.93 0.018 78);
  border: 1px solid oklch(0.88 0.04 74 / 0.28);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease;
}

.corner-chip:hover {
  background: var(--paper-raised);
  color: var(--ink);
  border-color: var(--paper-raised);
  text-decoration: none;
}

.corner-chip-accent {
  border-color: oklch(0.78 0.145 64 / 0.52);
  color: var(--dusk-amber);
}

.corner-chip-accent:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

/* ==========================================================================
   CURVED MACINTOSH CRT POPUP (<dialog>) — Constant Fixed Size Across All Tabs
   ========================================================================== */

dialog.mac-window {
  margin: auto;
  width: min(860px, calc(100dvw - 2.25rem));
  height: min(740px, calc(100dvh - 2.75rem));
  max-width: none;
  max-height: none;
  padding: clamp(10px, 1.7vw, 18px);
  border: 1.5px solid oklch(0.32 0.025 55 / 0.75);
  border-radius: 26px;
  background:
    linear-gradient(
      112deg,
      var(--bezel-lit) 0%,
      var(--bezel-mid) 46%,
      var(--bezel-shade) 100%
    );
  color: var(--ink);
  box-shadow:
    inset 1.5px 1.5px 0 oklch(0.92 0.065 68 / 0.62),
    inset -2px -2px 4px oklch(0.24 0.025 54 / 0.45),
    0 34px 80px oklch(0.10 0.032 256 / 0.68),
    0 6px 18px oklch(0.14 0.025 50 / 0.35);
  overflow: hidden;

  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: var(--ease-out-expo);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog.mac-window {
    transform: translateY(10px) scale(0.95);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.mac-window {
    transition-duration: 0.1s;
  }
}

dialog.mac-window[open] {
  display: flex;
  flex-direction: column;
}

dialog.mac-window[open]:where(:not([data-closing])) {
  opacity: 1;

  @starting-style {
    opacity: 0;
  }

  @media (prefers-reduced-motion: no-preference) {
    transform: translateY(0) scale(1);

    @starting-style {
      transform: translateY(10px) scale(0.95);
    }
  }
}

dialog.mac-window:modal {
  overscroll-behavior: contain;
}

dialog.mac-window::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: oklch(0.14 0.035 256 / 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog.mac-window[open]:where(:not([data-closing]))::backdrop {
  background-color: oklch(0.14 0.035 256 / 0.64);

  @starting-style {
    background-color: oklch(0.14 0.035 256 / 0);
  }
}

.mac-crt-cavity {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 20px / 17px;
  border: 2px solid var(--bezel-cavity);
  overflow: hidden;
  box-shadow:
    inset 0 0 22px oklch(0.18 0.025 50 / 0.20),
    inset 0 3px 8px oklch(0.18 0.025 50 / 0.22),
    0 1px 0 oklch(0.92 0.045 72 / 0.45);
}

.mac-crt-cavity::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border-radius: inherit;
  box-shadow:
    inset 0 0 26px oklch(0.18 0.025 50 / 0.14),
    inset 2px 2px 10px oklch(0.94 0.05 74 / 0.14);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0px,
      transparent 3px,
      oklch(0.20 0.02 50 / 0.018) 3px,
      oklch(0.20 0.02 50 / 0.018) 4px
    );
}

.crt-scan-sweep {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 36%;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-100%);
  background: linear-gradient(
    to bottom,
    transparent 0%,
    oklch(0.64 0.14 55 / 0.08) 45%,
    oklch(0.98 0.02 80 / 0.22) 60%,
    transparent 100%
  );
}

@media (prefers-reduced-motion: no-preference) {
  .crt-scan-sweep.is-sweeping {
    animation: crt-sweep-down 240ms var(--ease-out-expo) forwards;
  }
}

@keyframes crt-sweep-down {
  0%   { opacity: 0.9; transform: translateY(-40%); }
  100% { opacity: 0; transform: translateY(300%); }
}

.mac-titlebar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: var(--space-3);
  padding: 0.5rem 0.9rem;
  border-bottom: 1.5px solid var(--ink);
  background:
    repeating-linear-gradient(
      to bottom,
      var(--paper-raised) 0px,
      var(--paper-raised) 2px,
      oklch(0.20 0.022 50 / 0.18) 2px,
      oklch(0.20 0.022 50 / 0.18) 3px
    );
  flex-shrink: 0;
}

.mac-close-box {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 80ms linear, color 80ms linear, transform 80ms ease;
}

.mac-close-box:hover,
.mac-close-box:focus-visible {
  background: var(--ink);
  color: var(--paper-raised);
}

.mac-close-box:active {
  transform: scale(0.94);
}

.mac-titlebar-label {
  justify-self: center;
  background: var(--paper-raised);
  padding: 0.12rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  border: 1px solid oklch(0.20 0.022 50 / 0.15);
  border-radius: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-tabstrip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper-sunken);
  flex-shrink: 0;
}

.mac-tab {
  min-block-size: 36px;
  padding: 0.45rem 0.4rem;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color 80ms linear, color 80ms linear, transform 90ms ease;
}

.mac-tab:last-child { border-right: 0; }
.mac-tab:hover { background: oklch(0.20 0.022 50 / 0.08); color: var(--ink); }
.mac-tab:active { transform: scale(0.97); }
.mac-tab[aria-selected="true"] { background: var(--ink); color: var(--paper-raised); }

.mac-window-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(1.25rem, 2.8vw, 2.25rem) clamp(1.15rem, 3.2vw, 2.5rem);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.mac-window-body:focus-visible {
  outline: 2px solid var(--sienna);
  outline-offset: -3px;
}

/* Directional section-switching micro-animations */
@media (prefers-reduced-motion: no-preference) {
  .mac-section-stage.dir-next { animation: section-glide-next 270ms var(--ease-out-expo) both; }
  .mac-section-stage.dir-prev { animation: section-glide-prev 270ms var(--ease-out-expo) both; }
  .mac-section-stage.dir-open { animation: section-glide-open 250ms var(--ease-out-expo) both; }
  .mac-section-stage > .dossier-section > * { animation: section-child-rise 280ms var(--ease-out-expo) both; }
  .mac-section-stage > .dossier-section > *:nth-child(1) { animation-delay: 0ms; }
  .mac-section-stage > .dossier-section > *:nth-child(2) { animation-delay: 30ms; }
  .mac-section-stage > .dossier-section > *:nth-child(3) { animation-delay: 60ms; }
  .mac-section-stage > .dossier-section > *:nth-child(4) { animation-delay: 85ms; }
}

@keyframes section-glide-next {
  from { opacity: 0; transform: translate3d(16px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes section-glide-prev {
  from { opacity: 0; transform: translate3d(-16px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes section-glide-open {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes section-child-rise {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.mac-window-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: 0.55rem 0.95rem;
  border-top: 1px solid var(--rule-strong);
  background: var(--paper-sunken);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  flex-shrink: 0;
}

#mac-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-window-footer-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-shrink: 0;
}

.mac-nav-btn {
  min-block-size: 34px;
  padding: 0.25rem 0.78rem;
  background: var(--paper-raised);
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 80ms linear, color 80ms linear, transform 80ms ease;
}

.mac-nav-btn:hover { background: var(--ink); color: var(--paper-raised); }
.mac-nav-btn:active { transform: scale(0.96); }

/* ==========================================================================
   DOSSIER CONTENT STYLES (Clean Headings, Zero Unnecessary Eyebrows)
   ========================================================================== */

.dossier-section {
  padding-block: 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 1.5px solid var(--ink);
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 1.2rem + 1.5vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}

.subsection-heading {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 0.98rem + 0.6vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--ink);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.prose {
  max-width: 65ch;
  color: var(--ink-soft);
}

.prose + .prose {
  margin-top: var(--space-3);
}

/* ── i. About + Interactive Chart.js Radar & D3.js Kamal Way Diagram ───── */

.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.28rem, 1rem + 1.1vw, 1.75rem);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: -0.022em;
  color: var(--ink);
  max-width: 34ch;
  margin-bottom: var(--space-5);
}

.about-split {
  display: grid;
  grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 2.4rem);
  align-items: start;
  margin-bottom: var(--space-3);
}

.nowrap {
  white-space: nowrap;
}

.fact-sheet {
  border-top: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.fact-row {
  padding-block: 0.46rem;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 0.12rem;
}

.fact-row dt {
  color: var(--ink-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.fact-row dd {
  color: var(--ink);
  line-height: 1.45;
}

.pillar-list {
  list-style: none;
  border-top: 1px solid var(--rule-strong);
}

.pillar-item {
  display: grid;
  grid-template-columns: minmax(130px, 160px) minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--rule);
}

.pillar-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
  line-height: 1.3;
}

.pillar-body {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* Interactive Chart.js Principles Radar + Inspector Panel */
.viz-panel {
  margin-top: var(--space-4);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
}

.radar-layout {
  display: grid;
  grid-template-columns: minmax(250px, 315px) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}

.radar-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 315px;
  margin-inline: auto;
}

.kamal-node:focus:not(:focus-visible) {
  outline: none;
}

.radar-legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.radar-btn {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  color: var(--ink);
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}

.radar-btn:hover {
  background: var(--wash);
}

.radar-btn[aria-pressed="true"] {
  background: var(--paper-sunken);
  border-color: var(--ink);
}

.radar-btn-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.radar-btn-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink);
}

.radar-btn-score {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--sienna);
}

.radar-btn-desc {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--ink-soft);
}

/* Interactive D3.js Kamal Way Compounding Loop Diagram */
.kamal-d3-shell {
  margin-top: var(--space-3);
  padding: clamp(0.85rem, 2vw, 1.35rem);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
}

.kamal-d3-canvas {
  width: 100%;
  overflow-x: auto;
}

.kamal-d3-canvas svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 460px;
}

.kamal-d3-readout {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.kamal-d3-readout strong {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--sienna-deep);
}

/* ── ii. Chronological Visual Journey Spine (2020 -> Present) ──────────── */

.journey-spine {
  position: relative;
  list-style: none;
  margin-top: var(--space-4);
  padding-left: 2.25rem;
}

.journey-spine::before {
  content: '';
  position: absolute;
  left: 0.62rem;
  top: 0.85rem;
  bottom: 1.5rem;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    var(--rule-strong) 0%,
    var(--ink) 78%,
    var(--sienna) 100%
  );
}

.journey-node {
  position: relative;
  padding-bottom: var(--space-5);
}

.journey-node:last-child {
  padding-bottom: 0;
}

.journey-dot {
  position: absolute;
  left: -2.25rem;
  top: 0.55rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
}

.journey-dot::after {
  content: '';
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--ink);
}

.journey-node.is-current .journey-dot {
  border-color: var(--sienna);
  background: var(--sienna);
  box-shadow: 0 0 0 4px oklch(0.50 0.15 44 / 0.18);
}

.journey-node.is-current .journey-dot::after {
  background: var(--paper-raised);
}

.journey-card {
  padding: var(--space-4) var(--space-5);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  transition: border-color var(--t-fast) ease;
}

.journey-node.is-current .journey-card {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 oklch(0.20 0.022 50 / 0.1);
}

.journey-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin-bottom: var(--space-2);
}

.journey-year-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.55rem;
  background: var(--paper-sunken);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  border-radius: 999px;
}

.journey-node.is-current .journey-year-badge {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-raised);
}

.journey-org {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--sienna-deep);
  font-weight: 500;
}

.journey-role {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 0.96rem + 0.5vw, 1.32rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.journey-summary {
  font-size: 0.96rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.journey-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--space-3);
}

.journey-chips li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
}

.journey-details {
  margin-top: var(--space-3);
  border-top: 1px solid var(--rule);
  padding-top: var(--space-2);
}

.journey-details summary {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--sienna-deep);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-block: 0.15rem;
}

.journey-details summary::-webkit-details-marker {
  display: none;
}

.journey-details summary::before {
  content: '+';
  font-weight: 700;
}

.journey-details[open] summary::before {
  content: '−';
}

.journey-bullets {
  margin-top: var(--space-2);
  padding-left: 1.15rem;
  color: var(--ink-soft);
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.journey-bullets li::marker {
  color: var(--sienna);
}

/* ── iii. Works (Clickable App Prototypes Directory) ───────────────────── */

.works-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: var(--space-5);
}

.filter-pill {
  min-block-size: 32px;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 90ms linear, color 90ms linear, border-color 90ms linear;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper-raised);
}

.works-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.work-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease, transform var(--t-fast) ease;
}

.work-card:hover {
  border-color: var(--ink);
  background: var(--paper-sunken);
  transform: translateY(-1px);
}

.work-card[hidden] {
  display: none;
}

.work-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}

.work-name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.work-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--sienna-deep);
  border: 1px solid oklch(0.50 0.15 44 / 0.35);
  background: var(--wash);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.work-badge-live {
  background: var(--dusk);
  border-color: var(--dusk);
  color: var(--dusk-amber);
}

.work-desc {
  font-size: 0.92rem;
  line-height: 1.56;
  color: var(--ink-soft);
}

.work-links {
  margin-top: auto;
  padding-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.work-links a {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1.5px solid var(--rule-strong);
  padding-block: 2px;
}

.work-links a:hover {
  color: var(--sienna-deep);
  border-bottom-color: var(--sienna-deep);
}

/* ── iv. Writings & Zara-Inspired Editorial List ───────────────────────── */

.book-feature {
  background: var(--dusk);
  color: var(--dusk-ink);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: var(--space-5);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.book-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--dusk-ink);
  margin-bottom: var(--space-3);
}

.book-desc {
  color: var(--dusk-muted);
  font-size: 0.95rem;
  line-height: 1.66;
  margin-bottom: var(--space-4);
}

.book-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-block-size: 38px;
  padding: 0.45rem 1rem;
  background: var(--dusk-amber);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--dusk-amber);
  border-radius: 3px;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease;
}

.book-cta:hover {
  background: var(--paper-raised);
  border-color: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
}

.book-theses {
  list-style: none;
  border-top: 1px solid oklch(0.94 0.016 80 / 0.22);
}

.book-theses li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--space-2);
  padding-block: 0.65rem;
  border-bottom: 1px solid oklch(0.94 0.016 80 / 0.16);
  font-size: 0.9rem;
  line-height: 1.56;
  color: var(--dusk-ink);
}

.book-theses .thesis-num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--dusk-amber);
  padding-top: 0.16rem;
}

.publication-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.pub-link-block {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--t-fast) ease, background-color var(--t-fast) ease;
}

.pub-link-block:hover {
  border-color: var(--ink);
  background: var(--paper-sunken);
  text-decoration: none;
}

.pub-domain {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--sienna);
}

.pub-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.pub-desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* Zara-inspired spacious 3-column Writings & Prompts editorial index */
.writings-list {
  list-style: none;
  border-top: 1.5px solid var(--ink);
}

.wr-item {
  border-bottom: 1px solid var(--rule);
}

.wr-row {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.5rem var(--space-4);
  padding: 1rem 0.65rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: 4px;
  transition: background-color var(--t-fast) ease;
}

.wr-row:hover {
  background-color: var(--wash);
  text-decoration: none;
}

.wr-date {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-muted);
  padding-top: 0.22rem;
  white-space: nowrap;
}

.wr-main {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  min-width: 0;
}

.wr-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.wr-row:hover .wr-title {
  color: var(--sienna-deep);
}

.wr-excerpt {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  line-height: 1.48;
  color: var(--ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wr-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  padding-top: 0.15rem;
}

.wr-read {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.wr-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--sienna-deep);
  border: 1px solid oklch(0.50 0.15 44 / 0.42);
  padding: 0.1rem 0.52rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── v. Resources (Skills, Editorial Prompts, Daily Stack) ─────────────── */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.skill-block {
  padding: var(--space-4);
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skill-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.skill-desc {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.56;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-2);
}

.tool-group-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sienna);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-2);
  border-bottom: 1.5px solid var(--ink);
}

.tool-list {
  list-style: none;
}

.tool-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding-block: 0.22rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.tool-row a {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}

.tool-row a:hover {
  color: var(--sienna-deep);
  text-decoration: underline;
}

.tool-role {
  color: var(--ink-muted);
  font-size: 0.71rem;
}

/* ── vi. Connect ───────────────────────────────────────────────────────── */

.connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(1.4rem, 3vw, 2.5rem);
  align-items: start;
}

.connect-list {
  list-style: none;
  border-top: 1.5px solid var(--ink);
}

.connect-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.connect-row a,
.ai-endpoint-list a {
  display: inline-flex;
  align-items: center;
  min-block-size: 28px;
}

.connect-label {
  color: var(--ink-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.connect-value {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.copy-inline-btn {
  min-block-size: 28px;
  padding: 0.18rem 0.55rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  border-radius: 2px;
}

.copy-inline-btn:hover {
  background: var(--ink);
  color: var(--paper-raised);
  border-color: var(--ink);
}

.ai-agent-box {
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ai-agent-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
}

.ai-agent-desc {
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.58;
}

.ai-endpoint-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.ai-endpoint-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 0.5rem 0.65rem;
  background: var(--paper-sunken);
  border: 1px solid var(--rule);
  border-radius: 3px;
}

/* ==========================================================================
   SECOND-LEVEL EDITORIAL READER (Zara-Inspired: Works In-Window & Standalone)
   ========================================================================== */

body.reader-standalone {
  background: var(--paper);
  min-height: 100dvh;
}

.reader-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
}

.reader-topbar-inner {
  max-width: 1080px;
  margin-inline: auto;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.reader-brand {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.reader-brand:hover {
  color: var(--sienna-deep);
  text-decoration: none;
}

.reader-top-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: 0.75rem;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent 100%);
  mask-image: linear-gradient(to right, #000 90%, transparent 100%);
}

.reader-top-tabs::-webkit-scrollbar {
  display: none;
}

.reader-top-tabs a {
  display: inline-flex;
  align-items: center;
  min-block-size: 36px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0.3rem 0.72rem;
  border-radius: 999px;
  white-space: nowrap;
}

.reader-top-tabs a:hover {
  color: var(--ink);
  background: var(--wash);
}

.reader-top-tabs a.is-active {
  background: var(--ink);
  color: var(--paper-raised);
}

.reader-top-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper-raised);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1;
  text-decoration: none;
  transition: transform var(--t-fast) ease, background-color var(--t-fast) ease;
}

.reader-top-close:hover {
  background: var(--sienna-deep);
  color: var(--paper-raised);
  transform: rotate(90deg);
  text-decoration: none;
}

.reader-shell {
  max-width: 1080px;
  margin-inline: auto;
  padding: clamp(1.75rem, 5vh, 3.25rem) clamp(1.15rem, 5vw, 3.5rem) var(--space-8);
}

/* Core second-level reader article — shared by BOTH standalone pages AND in-modal reader */
.reader-article {
  max-width: 64ch;
  margin-inline: auto;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--sienna-deep);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1.5px;
  margin-bottom: var(--space-5);
  background: none;
  border: 0;
  cursor: pointer;
}

.reader-back:hover {
  color: var(--sienna);
  text-decoration-style: wavy;
}

.reader-head {
  margin-bottom: var(--space-6);
}

.reader-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--sienna-deep);
  margin-bottom: var(--space-3);
}

.reader-cat-pill {
  border: 1px solid oklch(0.50 0.15 44 / 0.4);
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.reader-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 1.35rem + 2.2vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.09;
  color: var(--ink);
}

.mac-window-body .reader-title {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.35rem);
}

.reader-prose {
  font-family: var(--font-serif);
  font-size: clamp(1.04rem, 0.98rem + 0.25vw, 1.16rem);
  line-height: 1.78;
  color: var(--ink-soft);
  overflow-wrap: break-word;
}

.reader-prose p {
  margin-bottom: 1.2em;
}

.reader-prose h1,
.reader-prose h2,
.reader-prose h3,
.reader-prose h4 {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 1.85em 0 0.6em;
}

.reader-prose h2 {
  font-size: 1.42em;
  font-weight: 600;
}

.reader-prose h3 {
  font-size: 1.18em;
  font-weight: 600;
}

.reader-prose ul,
.reader-prose ol {
  margin-bottom: 1.2em;
  padding-left: 1.35em;
}

.reader-prose li {
  margin-block: 0.32em;
}

.reader-prose li::marker {
  color: var(--sienna);
}

/* Zara-inspired literary pull-quote with oversized opening quotation mark */
.reader-prose blockquote {
  position: relative;
  margin: 1.65em 0;
  padding: 0.25em 0 0.25em 1.6em;
  color: var(--ink);
  font-style: italic;
}

.reader-prose blockquote::before {
  content: '“';
  position: absolute;
  left: -0.05em;
  top: -0.22em;
  font-family: var(--font-serif);
  font-size: 2.5em;
  line-height: 1;
  color: var(--sienna);
  font-style: normal;
}

.reader-prose img {
  margin: 1.75em auto;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-raised);
}

.reader-prose hr {
  border: 0;
  border-top: 1.5px solid var(--rule-strong);
  margin: 2.1em 0;
}

.reader-prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--paper-sunken);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.reader-prose pre {
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: var(--space-4);
  overflow-x: auto;
  margin: 1.4em 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.62;
  color: var(--ink);
}

.reader-prose pre code {
  background: transparent;
  padding: 0;
}

/* Prompt Utility Toolbar inside the Editorial Reader */
.prompt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 var(--space-5);
}

.copy-prompt-btn,
.view-toggle-btn {
  min-block-size: 36px;
  padding: 0.35rem 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}

.copy-prompt-btn {
  background: var(--ink);
  border: 1.5px solid var(--ink);
  color: var(--paper-raised);
}

.copy-prompt-btn:hover {
  background: var(--sienna-deep);
  border-color: var(--sienna-deep);
}

.view-toggle-btn {
  background: var(--paper-raised);
  border: 1.5px solid var(--rule-strong);
  color: var(--ink);
}

.view-toggle-btn:hover {
  border-color: var(--ink);
  background: var(--paper-sunken);
}

.prompt-block {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper-raised);
  padding: var(--space-5);
  border: 1.5px solid var(--rule-strong);
  border-radius: 6px;
  overflow-x: auto;
}

/* Article / Prompt Footer & Zara-style 2-column Adjacent Navigation Cards */
.reader-foot {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1.5px solid var(--rule-strong);
  display: grid;
  gap: var(--space-5);
}

.reader-source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--sienna-deep);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.reader-source-link:hover {
  color: var(--sienna);
  text-decoration-style: wavy;
}

.reader-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.reader-next {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease;
}

.reader-next:hover {
  background: var(--wash);
  border-color: var(--ink);
  text-decoration: none;
}

.reader-next-r {
  text-align: right;
}

.reader-next-k {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sienna-deep);
}

.reader-next-t {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--ink);
}

.reader-shell-foot {
  margin-top: var(--space-7);
  text-align: center;
}

.reader-loading {
  padding: var(--space-7) 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-muted);
}

/* ==========================================================================
   RESPONSIVE ADAPTATIONS (Every Screen Size & Pointer Type)
   ========================================================================== */

@media (max-width: 780px) {
  .about-split,
  .pillar-item,
  .radar-layout,
  .book-feature,
  .connect-layout {
    grid-template-columns: 1fr;
  }

  .mac-tabstrip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mac-tab {
    border-bottom: 1px solid var(--rule);
  }

  .mac-tab:nth-child(3n) {
    border-right: 0;
  }

  .mac-tab:nth-child(n + 4) {
    border-bottom: 0;
  }

  .reader-brand {
    display: none;
  }
}

@media (max-width: 620px) {
  dialog.mac-window {
    width: calc(100dvw - 0.9rem);
    height: min(86dvh, 720px);
    padding: 9px;
    border-radius: 22px;
  }

  .mac-crt-cavity {
    border-radius: 16px / 14px;
  }

  .wr-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.25rem var(--space-3);
    padding-inline: 0.35rem;
  }

  .wr-date {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .reader-nav {
    grid-template-columns: 1fr;
  }

  .reader-next-r {
    text-align: left;
  }

  .journey-spine {
    padding-left: 1.75rem;
  }

  .journey-dot {
    left: -1.75rem;
    width: 1.05rem;
    height: 1.05rem;
  }

  .journey-spine::before {
    left: 0.5rem;
  }

  .journey-card {
    padding: var(--space-4);
  }

  .corner-chip {
    font-size: 0.68rem;
    padding: 0.22rem 0.6rem;
  }
}

@media (max-height: 520px) {
  dialog.mac-window {
    height: calc(100dvh - 1rem);
    padding: 8px;
    border-radius: 18px;
  }

  .mac-crt-cavity {
    border-radius: 12px / 10px;
  }
}

@media (pointer: coarse) {
  .mac-tab,
  .copy-inline-btn,
  .filter-pill,
  .mac-nav-btn,
  .work-links a,
  .tool-row a,
  .connect-row a,
  .ai-endpoint-list a {
    min-block-size: 40px;
  }

  .mac-close-box {
    width: 38px;
    height: 38px;
  }

  .corner-chip {
    min-block-size: 40px;
  }
}
