/* ============================================================
   THE ALI MASTER — design system
   Elevated cinematic: purple/ruby DNA, refined for 2026
   ============================================================ */

:root{
  /* ---- core palette ---- */
  --void:        #0d0410;
  --void-2:      #150819;
  --purple-deep: #2a0e3d;
  --purple-mid:  #4a1a63;
  --purple-light:#7a3596;
  --purple-glow: #a855c7;

  --paper:  #f7f2f9;
  --muted:  #b6a0c4;
  --muted-2:#8b7799;
  --line:   rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.055);

  --ruby:       #d9273f;
  --ruby-light: #f3505f;
  --ruby-deep:  #971c2c;
  --gold:       #e8c07a;

  /* ---- surfaces ---- */
  --surface:      rgba(255,255,255,0.032);
  --surface-2:    rgba(255,255,255,0.055);
  --surface-solid:#1a0b21;
  --glass:        rgba(13,4,16,0.72);

  /* ---- type ---- */
  --display: 'Mrs Saint Delafield', cursive;
  --serif:   'Marcellus', 'Iowan Old Style', Georgia, serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;

  /* fluid type scale */
  --t-xs:   clamp(10.5px, 0.62vw + 9px,  12px);
  --t-sm:   clamp(12.5px, 0.3vw + 12px,  14px);
  --t-base: clamp(15px,   0.35vw + 14px, 17px);
  --t-lg:   clamp(18px,   0.6vw + 16px,  22px);
  --t-xl:   clamp(24px,   1.4vw + 20px,  34px);
  --t-2xl:  clamp(30px,   2.6vw + 22px,  52px);
  --t-3xl:  clamp(40px,   6.4vw + 16px,  104px);

  /* ---- motion ---- */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur:  0.45s;
  --dur-s: 0.22s;

  /* ---- shape ---- */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow:    0 18px 44px -14px rgba(0,0,0,0.62);
  --shadow-lg: 0 40px 90px -28px rgba(0,0,0,0.78);
  --glow-ruby: 0 0 0 1px rgba(217,39,63,0.28), 0 12px 40px -10px rgba(217,39,63,0.42);

  --header-h: 74px;
  --wrap: 1280px;
}

/* ---------- light theme ---------- */
[data-theme="light"]{
  --void:        #f4eff6;
  --void-2:      #ece4f0;
  --purple-deep: #e2d4ea;
  --purple-mid:  #c9b0d8;
  --purple-light:#8d5aa8;
  --purple-glow: #7a3596;

  --paper:  #1c0c24;
  --muted:  #614a70;
  --muted-2:#7d6a89;
  --line:   rgba(42,14,61,0.13);
  --line-2: rgba(42,14,61,0.08);

  --surface:      rgba(42,14,61,0.035);
  --surface-2:    rgba(42,14,61,0.06);
  --surface-solid:#ffffff;
  --glass:        rgba(248,244,250,0.78);

  --shadow-sm: 0 2px 8px rgba(42,14,61,0.09);
  --shadow:    0 18px 44px -18px rgba(42,14,61,0.22);
  --shadow-lg: 0 40px 90px -30px rgba(42,14,61,0.3);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body{
  margin:0;
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--t-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--void);
  overflow-x: hidden;
}

/* atmospheric backdrop — fixed, GPU-cheap */
.bg-atmos{
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(168,85,199,0.20), transparent 60%),
    radial-gradient(ellipse 60% 45% at 92% 4%,  rgba(217,39,63,0.16),  transparent 62%),
    radial-gradient(ellipse 90% 60% at 50% 108%, rgba(122,53,150,0.26), transparent 60%),
    linear-gradient(165deg, #2c1038 0%, var(--void) 48%, #190a24 100%);
}
[data-theme="light"] .bg-atmos{
  background:
    radial-gradient(ellipse 80% 55% at 12% -10%, rgba(168,85,199,0.16), transparent 60%),
    radial-gradient(ellipse 60% 45% at 92% 4%,  rgba(217,39,63,0.10),  transparent 62%),
    radial-gradient(ellipse 90% 60% at 50% 108%, rgba(122,53,150,0.12), transparent 60%),
    linear-gradient(165deg, #ffffff 0%, var(--void) 50%, #e6dcec 100%);
}

/* film grain */
.bg-grain{
  position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(6) infinite;
}
@keyframes grain{
  0%,100%{ transform: translate(0,0); }
  20%{ transform: translate(-4%,-6%); }
  40%{ transform: translate(-8%,3%); }
  60%{ transform: translate(3%,-4%); }
  80%{ transform: translate(-2%,6%); }
}

::selection{ background: rgba(217,39,63,0.34); color: #fff; }

a{ color: var(--ruby-light); text-decoration: none; }
img{ max-width: 100%; display: block; }
button{ font: inherit; color: inherit; }

:focus-visible{
  outline: 2px solid var(--ruby-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link{
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ruby); color:#fff; padding: 10px 18px;
  border-radius: 0 0 var(--r-sm) var(--r-sm); font-weight: 600; font-size: var(--t-sm);
  transition: top var(--dur-s) var(--ease);
}
.skip-link:focus{ top: 0; }

.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.wrap{ max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 3.4vw, 40px); }

/* ============================================================
   TYPOGRAPHY PRIMITIVES
   ============================================================ */
.eyebrow{
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before{
  content:""; width: 30px; height: 1px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--ruby), transparent);
}

h1,h2,h3,h4{ font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: 0.005em; }

.section-head{ margin-bottom: clamp(28px, 4vw, 48px); }
.section-head h2{
  font-size: var(--t-xl);
  line-height: 1.16;
  margin: 14px 0 0;
}
.section-head .sub{
  color: var(--muted); font-size: var(--t-sm); margin-top: 10px; max-width: 56ch;
}

/* shimmer foil for accent words */
.foil{
  background: linear-gradient(100deg,
    var(--ruby) 8%, var(--ruby-light) 30%, #fff 46%,
    var(--gold) 56%, var(--ruby-light) 70%, var(--ruby) 92%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: foil 5.5s var(--ease-in-out) infinite;
}
@keyframes foil{
  0%,100%{ background-position: 0% 0; }
  50%    { background-position: 100% 0; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header{
  position: sticky; top: 0; z-index: 60;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line-2);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.site-header.scrolled{
  border-bottom-color: var(--line);
  box-shadow: 0 10px 34px -18px rgba(0,0,0,0.7);
}

.header-bar{
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.brand{
  display: flex; align-items: center; gap: 13px;
  flex-shrink: 0; cursor: pointer;
  background: none; border: none; padding: 0;
}
.brand-mark{
  width: 40px; height: 40px; flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(217,39,63,0.35));
  transition: transform var(--dur) var(--ease);
}
.brand:hover .brand-mark{ transform: rotate(-7deg) scale(1.06); }
.brand-text{ display:flex; flex-direction: column; line-height: 1; text-align: left; min-width: 0; }
.brand-name{ font-family: var(--display); font-size: 27px; color: var(--paper); }
.brand-tag{
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-2); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 24vw;
}
@media (max-width: 1024px){ .brand-tag{ max-width: 42vw; } }
@media (max-width: 560px){ .brand-tag{ display:none; } }

.header-actions{ display:flex; align-items:center; gap: 9px; flex-shrink: 0; }

.icon-btn{
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  transition: all var(--dur-s) var(--ease);
}
.icon-btn svg{ width: 18px; height: 18px; }
.icon-btn:hover{
  color: var(--paper); background: var(--surface-2);
  border-color: rgba(217,39,63,0.4); transform: translateY(-2px);
}
.icon-btn.yt:hover, .icon-btn.li:hover{ color: var(--ruby-light); box-shadow: var(--glow-ruby); }

.nav-links{ display:flex; align-items:center; gap: 4px; }
.nav-link{
  font-family: var(--mono); font-weight: 700;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper); padding: 9px 12px; border-radius: 9px;
  white-space: nowrap;
  transition: all var(--dur-s) var(--ease);
}
.nav-link:hover{ color: var(--ruby-light); background: var(--surface); }

.cta-btn{
  font-size: var(--t-sm); font-weight: 650; letter-spacing: 0.01em;
  color:#fff; padding: 10px 20px; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep));
  border: none; white-space: nowrap;
  box-shadow: 0 8px 24px -8px rgba(217,39,63,0.62);
  transition: all var(--dur-s) var(--ease);
}
.cta-btn:hover{ transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(217,39,63,0.8); }

/* scroll progress */
.scroll-bar{
  position: absolute; left:0; bottom:-1px; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--ruby), var(--gold), var(--purple-glow));
}

@media (max-width: 1024px){
  .nav-links{ display:none; }
}
@media (max-width: 560px){
  :root{ --header-h: 64px; }
  .brand-mark{ width:34px; height:34px; }
  .brand-name{ font-size: 23px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero{
  position: relative;
  padding: clamp(56px, 9vw, 130px) 0 clamp(40px, 6vw, 76px);
}
.hero-grid{
  display: grid; grid-template-columns: minmax(0,1.32fr) minmax(0,0.78fr);
  gap: clamp(32px, 5vw, 76px); align-items: center;
}
@media (max-width: 940px){
  .hero-grid{ grid-template-columns: 1fr; gap: 40px; }
}

.hero h1{
  font-size: var(--t-3xl);
  line-height: 1.02;
  margin: 20px 0 0;
  letter-spacing: -0.015em;
}
.hero .translit{
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ruby-light); margin: 20px 0 0;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hero .lede{
  color: var(--muted); font-size: var(--t-lg); line-height: 1.62;
  max-width: 56ch; margin: 26px 0 0; font-weight: 350;
}
.hero-cta{ display:flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }

.btn{
  display:inline-flex; align-items:center; gap: 9px;
  font-size: var(--t-sm); font-weight: 650;
  padding: 13px 24px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
  transition: all var(--dur-s) var(--ease);
}
.btn svg{ width: 15px; height: 15px; }
.btn-primary{
  color:#fff; background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep));
  box-shadow: 0 10px 30px -10px rgba(217,39,63,0.66);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(217,39,63,0.82); }
.btn-ghost{
  color: var(--paper); background: var(--surface); border-color: var(--line);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover{ background: var(--surface-2); border-color: rgba(217,39,63,0.42); transform: translateY(-2px); }

/* hero quote — As You Like It, Act II Scene VII */
.hero-quote{
  margin: 30px 0 0; padding: 4px 0 4px 22px;
  border-left: 2px solid var(--ruby);
}
.hero-quote p{
  font-family: var(--serif); font-size: var(--t-lg); line-height: 1.5;
  color: var(--paper); margin: 0; font-style: italic;
}
.hero-quote cite{
  display:block; margin-top: 12px; font-style: normal;
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted-2);
}

/* hero collage — floating, hovering cards (original style) */
.hero-visual{ position: relative; aspect-ratio: 4/5; }

.collage-card{
  position:absolute; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: var(--purple-deep);
  animation: float 9s var(--ease-in-out) infinite;
}
.collage-card a{ display:block; width:100%; }
/* height:auto keeps every photo at its own original proportions — no cropping */
.collage-card img{ width:100%; height:auto; display:block; }
.collage-card::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(160deg, rgba(255,255,255,0.14), transparent 45%, rgba(13,4,16,0.5));
}
/* width + top/left only, so each card's height follows its image */
.collage-card:nth-child(1){ top:  0;  left:  0;  width: 50%; z-index: 3; --rot: -2.5deg; animation-delay:  0s; }
.collage-card:nth-child(2){ top:  3%; left: 48%; width: 52%; z-index: 2; --rot:  3deg;   animation-delay: -2.3s; }
.collage-card:nth-child(3){ top: 31%; left: 44%; width: 56%; z-index: 4; --rot: -1.5deg; animation-delay: -4.6s; }
.collage-card:nth-child(4){ top: 60%; left:  4%; width: 58%; z-index: 5; --rot:  2.5deg; animation-delay: -6.9s; }
@keyframes float{
  0%,100%{ transform: translateY(0) rotate(var(--rot,0deg)); }
  50%    { transform: translateY(-13px) rotate(var(--rot,0deg)); }
}
.collage-card:hover{ animation-play-state: paused; z-index: 9 !important; }

@media (max-width: 940px){
  .hero-visual{ aspect-ratio: 4/5; max-width: 460px; margin-inline: auto; width: 100%; }
}
/* phones: stack naturally, still uncropped, animation off */
@media (max-width: 700px){
  .hero-visual{
    aspect-ratio: auto; max-width: 420px;
    display:grid; grid-template-columns: 1fr 1fr;
    gap: 12px; align-items: start;
  }
  .collage-card{
    position: static; top:auto; left:auto; width:auto;
    animation: none; --rot: 0deg;
  }
  .collage-card:nth-child(1){ grid-row: span 2; }
  .collage-badge{
    position: static; grid-column: 1 / -1;
    justify-self: start; margin-top: 4px;
  }
}

.collage-badge{
  position:absolute; z-index: 6; bottom: 4%; right: -1%;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 17px; box-shadow: var(--shadow);
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  display:flex; align-items:center; gap: 9px;
}
.collage-badge .dot{
  width: 7px; height:7px; border-radius:50%; background: var(--ruby);
  box-shadow: 0 0 0 4px rgba(217,39,63,0.22);
  animation: pulse 2.2s var(--ease-in-out) infinite;
}
@keyframes pulse{
  0%,100%{ box-shadow: 0 0 0 4px rgba(217,39,63,0.22); }
  50%    { box-shadow: 0 0 0 9px rgba(217,39,63,0.04); }
}

/* ============================================================
   MARQUEE
   ============================================================ */
.marquee{
  overflow:hidden; position: relative;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  padding: 15px 0;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee-track{
  display:flex; gap: 46px; white-space: nowrap; width: max-content;
  animation: scroll-x 58s linear infinite;
}
.marquee:hover .marquee-track{ animation-play-state: paused; }
.marquee-track button{
  font-family: var(--mono); font-size: var(--t-xs);
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2);
  display:flex; align-items:center; gap: 11px;
  background:none; border:none; cursor:pointer; padding:0;
  transition: color var(--dur-s) var(--ease);
}
.marquee-track button:hover{ color: var(--ruby-light); }
.marquee-track button::before{
  content:""; width:4px; height:4px; border-radius:50%; background: var(--ruby); flex-shrink:0;
}
@keyframes scroll-x{ to{ transform: translateX(-50%); } }

/* ============================================================
   SECTION SHELL
   ============================================================ */
section{ position: relative; }
.pad{ padding: clamp(60px, 8vw, 118px) 0; }
.pad-sm{ padding: clamp(44px, 5vw, 72px) 0; }

.divider{
  height:1px; border:0; margin:0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid{
  display:grid; grid-template-columns: minmax(0,0.8fr) minmax(0,1.2fr);
  gap: clamp(32px, 5vw, 68px); align-items: start;
}
@media (max-width: 900px){ .about-grid{ grid-template-columns: 1fr; } }

.about-portrait{
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  aspect-ratio: 4/5; background: var(--purple-deep);
}
.about-portrait img{ width:100%; height:100%; object-fit: cover; }
.about-portrait figcaption{
  position:absolute; inset: auto 0 0 0; padding: 18px;
  background: linear-gradient(0deg, rgba(13,4,16,0.9), transparent);
  font-family: var(--mono); font-size: var(--t-xs); color: var(--muted);
  letter-spacing: 0.06em;
}

.about-body p{ color: var(--muted); font-size: var(--t-base); line-height: 1.78; margin: 0 0 16px; }
.about-body p:first-of-type{
  font-size: var(--t-lg); color: var(--paper); font-weight: 350; line-height: 1.6;
}
.about-body p strong{ color: var(--paper); font-weight: 600; }

.chip-row{ display:flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.chip{
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.06em;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 999px;
}
.chip.accent{ color: var(--ruby-light); border-color: rgba(217,39,63,0.32); background: rgba(217,39,63,0.07); }

/* ============================================================
   TOOLBAR / SEARCH / FILTERS
   ============================================================ */
.toolbar{
  position: sticky; top: var(--header-h); z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line-2);
  padding: 14px 0;
}
.toolbar-row{ display:flex; align-items:center; gap: 12px; flex-wrap: wrap; }

.search-box{
  position: relative; flex: 1 1 260px; min-width: 0; max-width: 400px;
}
.search-box svg.mag{
  position:absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted-2); pointer-events:none;
}
.search-box input{
  width: 100%; font-family: var(--body); font-size: var(--t-sm); color: var(--paper);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 42px 12px 42px;
  transition: all var(--dur-s) var(--ease);
}
.search-box input::placeholder{ color: var(--muted-2); }
.search-box input:focus{
  outline: none; border-color: rgba(217,39,63,0.5);
  background: var(--surface-2); box-shadow: 0 0 0 4px rgba(217,39,63,0.1);
}
.search-clear{
  position:absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--muted); cursor:pointer;
  display: none; place-items:center; font-size: 14px; line-height: 1;
}
.search-box.has-value .search-clear{ display: grid; }
.search-clear:hover{ color: var(--ruby-light); }

.select{
  font-family: var(--body); font-size: var(--t-sm); font-weight: 500; color: var(--paper);
  background: var(--surface); border: 1px solid var(--line);
  padding: 11px 34px 11px 15px; border-radius: 999px; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b6a0c4' stroke-width='2.2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
  transition: all var(--dur-s) var(--ease);
}
.select:hover{ border-color: rgba(217,39,63,0.36); }
.select option{ background: var(--surface-solid); color: var(--paper); }

.seg{
  display:flex; gap: 3px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.seg button{
  border:none; background: transparent; color: var(--muted); cursor:pointer;
  font-size: var(--t-xs); font-weight: 650; letter-spacing: 0.04em;
  padding: 8px 15px; border-radius: 999px;
  transition: all var(--dur-s) var(--ease);
  display:flex; align-items:center; gap:6px;
}
.seg button svg{ width: 14px; height: 14px; }
.seg button:hover{ color: var(--paper); }
.seg button[aria-pressed="true"]{
  color:#fff; background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep));
  box-shadow: 0 4px 14px -4px rgba(217,39,63,0.6);
}

.spacer{ flex: 1 1 auto; }

.chip-scroll{
  display:flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px;
  scrollbar-width: none; -ms-overflow-style: none;
  mask-image: linear-gradient(90deg, #000 0, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 96%, transparent);
}
.chip-scroll::-webkit-scrollbar{ display: none; }

.fchip{
  font-size: var(--t-xs); font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); padding: 9px 15px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: all var(--dur-s) var(--ease);
  display:flex; align-items:center; gap: 7px;
}
.fchip .cnt{
  font-family: var(--mono); font-size: 9.5px; opacity: 0.65;
  background: rgba(255,255,255,0.09); padding: 1px 5px; border-radius: 5px;
}
.fchip:hover{ color: var(--paper); border-color: rgba(217,39,63,0.4); transform: translateY(-1px); }
.fchip[aria-pressed="true"]{
  color:#fff; border-color: transparent;
  background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep));
  box-shadow: 0 6px 20px -6px rgba(217,39,63,0.62);
}
.fchip[aria-pressed="true"] .cnt{ background: rgba(0,0,0,0.22); opacity: 0.9; }

.result-line{
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2); padding: 20px 0 4px;
  display:flex; align-items:center; gap: 12px; flex-wrap: wrap;
}
.reset-link{
  color: var(--ruby-light); background:none; border:none; cursor:pointer;
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.1em;
  text-transform: uppercase; text-decoration: underline; padding: 0;
}

/* ============================================================
   STORY GRID
   ============================================================ */
.grid{
  display: grid; gap: clamp(18px, 2.2vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding-bottom: 20px;
}
.grid.tiles{ grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }

.card{
  position: relative;
  background: linear-gradient(158deg, rgba(122,53,150,0.16), rgba(13,4,16,0.5));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
  display:flex; flex-direction: column;
  text-align: left; padding: 0; width: 100%;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  will-change: transform;
}
[data-theme="light"] .card{ background: linear-gradient(158deg, rgba(255,255,255,0.9), rgba(244,239,246,0.7)); }

.card:hover{
  transform: translateY(-7px);
  border-color: rgba(217,39,63,0.42);
  box-shadow: var(--shadow), 0 0 0 1px rgba(217,39,63,0.14);
}
/* sheen */
.card::before{
  content:""; position:absolute; inset:0; z-index: 5; pointer-events:none;
  background: linear-gradient(112deg, transparent 34%, rgba(255,255,255,0.13) 47%, transparent 60%);
  transform: translateX(-125%);
  transition: transform 0.85s var(--ease);
}
.card:hover::before{ transform: translateX(125%); }

.card-thumb{
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: linear-gradient(145deg, var(--purple-light), var(--purple-deep));
  display:grid; place-items:center;
}
.grid.tiles .card-thumb{ aspect-ratio: 1/1; }

/* direct children only — must NOT catch the flag images nested in .card-meta */
.card-thumb > img{
  position:absolute; inset:0; width:100%; height:100%; object-fit: cover;
  transition: transform 0.9s var(--ease), opacity 0.5s var(--ease);
}
.card-thumb > img.lazy{ opacity: 0; }
.card-thumb > img.ready{ opacity: 1; }
.card:hover .card-thumb > img{ transform: scale(1.055); }
.card-thumb .lqip{
  position:absolute; inset:0; width:100%; height:100%; object-fit: cover;
  filter: blur(14px) saturate(1.3); transform: scale(1.1); z-index: 0;
}
.card-thumb .glyph{ font-size: 46px; z-index:1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.55)); }

.card-thumb::after{
  content:""; position:absolute; inset:0; z-index: 2;
  background: linear-gradient(180deg, rgba(13,4,16,0.62) 0%, transparent 26%, transparent 52%, rgba(13,4,16,0.8) 100%);
}

.card-meta{
  position:absolute; top:0; left:0; right:0; z-index: 3;
  display:flex; align-items:center; justify-content:space-between; gap: 8px;
  padding: 12px 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
}
.card-date{
  color: rgba(255,255,255,0.92); text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.card-flags{ display:flex; gap: 4px; flex-shrink: 0; margin-left: auto; }
.card-flags img{
  width: 19px; height: 19px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.card-cat{
  position:absolute; bottom: 13px; left: 14px; z-index: 3;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: rgba(217,39,63,0.9);
  backdrop-filter: blur(6px);
  padding: 5px 11px; border-radius: 999px; font-weight: 500;
}
.card-time{
  position:absolute; bottom: 13px; right: 14px; z-index: 3;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.86);
  background: rgba(13,4,16,0.55); backdrop-filter: blur(6px);
  padding: 5px 10px; border-radius: 999px;
}

.card-body{ padding: 20px 20px 22px; display:flex; flex-direction:column; gap: 9px; flex:1; }
.card-title{
  font-family: var(--serif); font-size: clamp(20px, 1.3vw, 25px);
  line-height: 1.2; color: var(--paper);
  transition: color var(--dur-s) var(--ease);
}
.card:hover .card-title{ color: var(--ruby-light); }
.card-hook{ font-size: var(--t-sm); color: var(--muted); line-height: 1.62; flex:1; }
.card-sub{
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--muted-2); text-transform: uppercase;
  overflow:hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-more{
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ruby-light); display:flex; align-items:center; gap: 7px; margin-top: 4px;
}
.card-more svg{ width: 13px; height: 13px; transition: transform var(--dur-s) var(--ease); }
.card:hover .card-more svg{ transform: translateX(4px); }

/* tile mode overlay */
.card-tile-cap{ display:none; }
.grid.tiles .card-body{ display:none; }
.grid.tiles .card-cat, .grid.tiles .card-time, .grid.tiles .card-meta{ display:none; }
.grid.tiles .card-tile-cap{
  display:flex; align-items:flex-end; position:absolute; inset:0; z-index:3;
  padding: 12px;
  background: linear-gradient(0deg, rgba(13,4,16,0.88) 0%, transparent 58%);
}
.grid.tiles .card-tile-cap span{
  font-family: var(--serif); font-size: 14.5px; line-height: 1.22; color: #fff;
}
.grid.tiles .card{ border-radius: var(--r); }

/* timeline mode */
.grid.timeline{ grid-template-columns: 1fr; gap: 0; max-width: 900px; margin: 0 auto; }
.grid.timeline .card{
  flex-direction: row; align-items: stretch;
  border-radius: var(--r);
  margin-bottom: 16px;
}
.grid.timeline .card-thumb{ flex: 0 0 clamp(120px, 24%, 240px); aspect-ratio: auto; }
.grid.timeline .card-body{ padding: 20px 24px; }
.grid.timeline .card-cat, .grid.timeline .card-time{ display:none; }
@media (max-width: 620px){
  .grid.timeline .card{ flex-direction: column; }
  .grid.timeline .card-thumb{ aspect-ratio: 16/9; flex: none; }
}

/* reveal on scroll */
.reveal{ opacity: 0; transform: translateY(26px); }
.reveal.in{
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.empty{
  text-align:center; padding: 80px 20px; color: var(--muted);
  grid-column: 1 / -1;
}
.empty .big{ font-family: var(--serif); font-size: var(--t-xl); color: var(--paper); margin-bottom: 10px; }

/* ============================================================
   YOUTUBE BAND
   ============================================================ */
.yt-band{
  position: relative; overflow: hidden;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 100% at 82% 50%, rgba(217,39,63,0.2), transparent 68%),
    linear-gradient(120deg, rgba(122,53,150,0.16), rgba(13,4,16,0.4));
}
.yt-inner{
  display:grid; grid-template-columns: minmax(0,1fr) auto;
  gap: clamp(28px, 4vw, 60px); align-items:center;
}
@media (max-width: 780px){ .yt-inner{ grid-template-columns: 1fr; } }

.yt-inner h2{ font-size: var(--t-xl); line-height: 1.14; margin: 14px 0 0; }
.yt-inner p{ color: var(--muted); font-size: var(--t-base); margin: 14px 0 0; max-width: 48ch; }

.yt-play{
  display:flex; align-items:center; gap: 16px;
  padding: 20px 30px 20px 22px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: all var(--dur) var(--ease);
}
.yt-play:hover{
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(217,39,63,0.5); box-shadow: var(--glow-ruby);
}
.yt-play .circle{
  width: 60px; height: 60px; border-radius: 50%; flex-shrink:0;
  display:grid; place-items:center; color:#fff;
  background: linear-gradient(135deg, #ff2d3f, #b3131f);
  box-shadow: 0 10px 30px -8px rgba(217,39,63,0.8);
}
.yt-play .circle svg{ width: 26px; height: 26px; margin-left: 3px; }
.yt-play .txt b{ display:block; font-family: var(--serif); font-weight: 400; font-size: var(--t-lg); color: var(--paper); }
.yt-play .txt span{
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-2);
}

/* ============================================================
   NEWSLETTER
   ============================================================ */
.news-card{
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(32px, 5vw, 64px);
  background:
    radial-gradient(ellipse 70% 120% at 8% 0%, rgba(168,85,199,0.22), transparent 62%),
    linear-gradient(140deg, rgba(74,26,99,0.35), rgba(13,4,16,0.6));
  box-shadow: var(--shadow);
  text-align: center;
}
.news-card h2{ font-size: var(--t-xl); line-height: 1.14; margin: 16px 0 0; }
.news-card p{ color: var(--muted); margin: 14px auto 0; max-width: 50ch; font-size: var(--t-base); }
.news-card .eyebrow{ justify-content: center; }

.news-form{
  display:flex; gap: 10px; margin: 30px auto 0; max-width: 470px; flex-wrap: wrap;
}
.news-form input{
  flex: 1 1 220px; min-width: 0;
  font-family: var(--body); font-size: var(--t-sm); color: var(--paper);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 14px 22px;
  transition: all var(--dur-s) var(--ease);
}
.news-form input::placeholder{ color: var(--muted-2); }
.news-form input:focus{
  outline:none; border-color: rgba(217,39,63,0.5);
  box-shadow: 0 0 0 4px rgba(217,39,63,0.1);
}
.news-note{
  font-family: var(--mono); font-size: var(--t-xs); color: var(--muted-2);
  margin-top: 16px; letter-spacing: 0.05em;
}
.news-ok{
  color: var(--ruby-light); font-size: var(--t-sm); margin-top: 16px; display:none;
}
.news-ok.show{ display:block; }

/* ============================================================
   READER (story detail)
   ============================================================ */
.reader-overlay{
  position: fixed; inset: 0; z-index: 120;
  background: rgba(6,2,8,0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: none; opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.reader-overlay.open{ display: block; }
.reader-overlay.shown{ opacity: 1; }

.reader{
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  scroll-behavior: auto;
}
.reader-sheet{
  max-width: 1180px; margin: clamp(12px, 3vh, 40px) auto;
  background: linear-gradient(168deg, rgba(42,14,61,0.92), rgba(13,4,16,0.97));
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(22px) scale(0.985);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.4s var(--ease-out);
}
[data-theme="light"] .reader-sheet{ background: linear-gradient(168deg, #fff, #f4eff6); }
.reader-overlay.shown .reader-sheet{ transform: none; opacity: 1; }

@media (max-width: 640px){
  .reader-sheet{ margin: 0; border-radius: 0; border: none; min-height: 100%; }
}

/* reader top bar */
.reader-bar{
  position: sticky; top: 0; z-index: 12;
  display:flex; align-items:center; justify-content:space-between; gap: 14px;
  padding: 14px 18px;
  background: var(--glass); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line-2);
}
.reader-bar-left{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tag{
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.tag.cat{ color:#fff; background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep)); }
.tag.sub{ color: var(--muted); border: 1px solid var(--line); text-transform: none; letter-spacing: 0.04em; font-size: 10.5px; }
.reader-bar-right{ display:flex; align-items:center; gap: 7px; flex-shrink: 0; }

/* reader top: image + intro side by side, full story goes below in .reader-main */
.reader-top{
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(0,0.95fr);
  align-items: stretch;
}
.reader-top-media{ display:flex; flex-direction:column; min-width:0; }
.reader-top-intro{
  display:flex; flex-direction:column; justify-content:center; min-width:0;
  padding: clamp(26px, 3.6vw, 50px) clamp(24px, 3.6vw, 52px);
  border-left: 1px solid var(--line-2);
}
.reader-top-intro h1{ margin: 0; }
@media (max-width: 900px){
  .reader-top{ grid-template-columns: 1fr; }
  .reader-top-intro{ border-left: none; border-top: 1px solid var(--line-2); }
}

/* reader hero image */
.reader-stage{
  position: relative; background: #000;
  aspect-ratio: 16/9;
  max-height: 66vh;   /* keep the title and story visible without scrolling far */
  overflow: hidden;
}
@media (max-width: 900px) and (min-width: 641px){ .reader-stage{ max-height: 46vh; } }
@media (max-width: 640px){ .reader-stage{ aspect-ratio: 4/3; max-height: 52vh; } }
.reader-stage .slide{
  position:absolute; inset:0;
  /* flex + max-height on the child: the photo scales DOWN to fit and can never
     exceed the frame. (grid + place-items-center + height:100% made the auto row
     grow to the image's intrinsic height, so the photo overflowed the stage.) */
  display:flex; align-items:center; justify-content:center;
  padding: 46px 0 30px;         /* clear the date/flags bar and the caption */
  overflow: hidden;
  opacity:0; transition: opacity 0.5s var(--ease);
  background: linear-gradient(145deg, var(--purple-light), var(--purple-deep));
}
.reader-stage .slide.active{ opacity:1; }

/* the photo itself — fit inside the frame, keep its own proportions */
.reader-stage .slide > img:not(.blurbg),
.reader-stage .slide > video{
  position: relative; z-index: 1;
  width: auto; height: auto;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
}

/* blurred backdrop fills the whole frame behind the photo */
.reader-stage .slide .blurbg{
  position:absolute; inset:0;
  width:100%; height:100%; max-width:none; max-height:none;
  object-fit: cover;
  filter: blur(34px) saturate(1.4) brightness(0.55); transform: scale(1.15); z-index: 0;
}
.reader-stage .slide .glyph{ font-size: 76px; z-index:1; }

.stage-cap{
  position:absolute; left:0; right:0; bottom:0; z-index: 6;
  padding: 34px 20px 16px;
  background: linear-gradient(0deg, rgba(0,0,0,0.82), transparent);
  font-family: var(--mono); font-size: var(--t-xs); color: rgba(255,255,255,0.82);
  letter-spacing: 0.04em; text-align:center;
}
.stage-arrow{
  position:absolute; top:50%; transform: translateY(-50%); z-index: 7;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(13,4,16,0.6); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.16); color:#fff; cursor:pointer;
  display:grid; place-items:center;
  transition: all var(--dur-s) var(--ease);
}
.stage-arrow svg{ width: 20px; height: 20px; }
.stage-arrow:hover{ background: rgba(217,39,63,0.72); transform: translateY(-50%) scale(1.08); }
.stage-arrow.prev{ left: 14px; }
.stage-arrow.next{ right: 14px; }
.stage-arrow[hidden]{ display:none; }

/* stage top bar — date left, flags top-right corner, on one line */
.stage-topbar{
  position:absolute; top:0; left:0; right:0; z-index: 8;
  display:flex; align-items:center; justify-content:space-between; gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(13,4,16,0.82), rgba(13,4,16,0.35) 70%, transparent);
  pointer-events: none;
}
.stage-date{
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255,255,255,0.94);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.stage-flags{ display:flex; gap: 5px; flex-shrink: 0; }
.stage-flags img{
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow: 0 2px 7px rgba(0,0,0,0.55);
  background: rgba(21,8,25,0.4);
}

.stage-count{
  position:absolute; top: 46px; right: 16px; z-index: 7;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: #fff; background: rgba(13,4,16,0.62); backdrop-filter: blur(8px);
  padding: 6px 12px; border-radius: 999px;
}

.thumb-rail{
  display:flex; gap: 8px; padding: 12px 18px; overflow-x: auto;
  border-bottom: 1px solid var(--line-2);
  scrollbar-width: thin;
}
.thumb-rail[hidden]{ display:none; }
.thumb-rail button{
  flex-shrink:0; width: 74px; aspect-ratio: 4/3; border-radius: var(--r-sm);
  overflow:hidden; border: 2px solid transparent; cursor:pointer; padding:0;
  opacity: 0.5; background: var(--purple-deep);
  transition: all var(--dur-s) var(--ease);
}
.thumb-rail button img{ width:100%; height:100%; object-fit: cover; }
.thumb-rail button:hover{ opacity: 0.85; }
.thumb-rail button[aria-current="true"]{ opacity: 1; border-color: var(--ruby); }

/* reader article */
.reader-main{
  display:grid; grid-template-columns: minmax(0,1fr) 300px;
  gap: clamp(28px, 3.4vw, 52px);
  padding: clamp(28px, 4vw, 52px) clamp(20px, 4vw, 54px) clamp(40px, 6vw, 76px);
}
@media (max-width: 900px){ .reader-main{ grid-template-columns: 1fr; } }

.reader-article h1{
  font-size: clamp(28px, 3.4vw, 50px); line-height: 1.1;
  letter-spacing: -0.012em; margin: 0;
}
.reader-kicker{
  font-family: var(--mono); font-size: var(--t-xs); letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2);
  display:flex; gap: 14px; flex-wrap: wrap; align-items:center;
  justify-content: space-between;
  margin: 18px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--line-2);
}
.reader-kicker .sep{ opacity: 0.4; }

.reader-hook{
  font-family: var(--serif); font-size: var(--t-lg); line-height: 1.55;
  color: var(--paper); margin: 26px 0 0;
  padding-left: 20px; border-left: 2px solid var(--ruby);
}
.prose{ margin-top: 28px; }
.prose p{
  color: var(--muted); font-size: var(--t-base); line-height: 1.82; margin: 0 0 20px;
}
.prose p:first-child::first-letter{
  font-family: var(--serif); font-size: 3.1em; float: left;
  line-height: 0.82; padding: 6px 12px 0 0; color: var(--ruby-light);
}
.prose p:last-child{ margin-bottom: 0; }

.block{ margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line-2); }
.block h4{
  font-family: var(--mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2);
  margin: 0 0 16px;
}

.links-list{ display:flex; flex-direction:column; gap: 4px; }
.links-list a{
  display:flex; align-items:center; gap: 11px;
  font-size: var(--t-sm); color: var(--paper);
  padding: 13px 15px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  transition: all var(--dur-s) var(--ease);
}
.links-list a svg{ width: 14px; height: 14px; color: var(--ruby-light); flex-shrink:0; }
.links-list a:hover{
  background: var(--surface-2); border-color: rgba(217,39,63,0.4);
  transform: translateX(4px); color: var(--ruby-light);
}

.tag-row{ display:flex; flex-wrap:wrap; gap: 8px; align-items:center; }
.htag{
  font-family: var(--mono); font-size: 11.5px;
  color: var(--ruby-light); background: rgba(217,39,63,0.08);
  border: 1px solid rgba(217,39,63,0.28);
  padding: 6px 12px; border-radius: 999px;
  cursor: pointer; transition: all var(--dur-s) var(--ease);
}
.htag:hover{ background: rgba(217,39,63,0.18); }

.mini-btn{
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); padding: 7px 13px; border-radius: 999px; cursor:pointer;
  transition: all var(--dur-s) var(--ease);
}
.mini-btn:hover{ color: var(--ruby-light); border-color: rgba(217,39,63,0.4); }

/* reader sidebar */
.reader-side{ display:flex; flex-direction: column; gap: 26px; align-self: start; }
@media (min-width: 901px){ .reader-side{ position: sticky; top: 86px; } }

.side-card{
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 20px;
}
.side-card h4{
  font-family: var(--mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2);
  margin: 0 0 14px;
}
.share-grid{ display:grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.share-btn{
  display:flex; align-items:center; justify-content:center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--paper);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 11px 8px; border-radius: var(--r-sm); cursor:pointer;
  transition: all var(--dur-s) var(--ease);
}
.share-btn svg{ width: 15px; height: 15px; flex-shrink:0; }
.share-btn:hover{ transform: translateY(-2px); border-color: rgba(217,39,63,0.4); color: var(--ruby-light); }
.share-btn.wide{ grid-column: 1 / -1; }

.rel-list{ display:flex; flex-direction: column; gap: 4px; }
.rel-item{
  display:flex; gap: 12px; align-items:center; text-align:left;
  background: none; border: none; padding: 9px; border-radius: var(--r-sm);
  cursor:pointer; width: 100%;
  transition: background var(--dur-s) var(--ease);
}
.rel-item:hover{ background: var(--surface-2); }
.rel-item img{
  width: 52px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink:0;
  background: var(--purple-deep);
}
.rel-item .t{
  font-family: var(--serif); font-size: 13.5px; line-height: 1.28; color: var(--paper);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-item .d{ font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); margin-top: 3px; letter-spacing: 0.06em; }

/* comments */
.c-list{ display:flex; flex-direction:column; gap: 12px; margin-bottom: 18px; }
.c-item{
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 14px 16px;
}
.c-head{ display:flex; justify-content:space-between; gap: 10px; margin-bottom: 6px; align-items:center; }
.c-name{ font-size: 13.5px; font-weight: 650; color: var(--ruby-light); }
.c-time{ font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); }
.c-text{ font-size: var(--t-sm); color: var(--paper); line-height: 1.66; margin: 0; }
.c-note{ font-size: var(--t-sm); color: var(--muted-2); font-style: italic; margin: 0 0 16px; }

.c-form{ display:flex; flex-direction:column; gap: 10px; }
.c-form input, .c-form textarea{
  font-family: var(--body); font-size: var(--t-sm); color: var(--paper);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px 14px; resize: vertical;
  transition: all var(--dur-s) var(--ease);
}
.c-form input::placeholder, .c-form textarea::placeholder{ color: var(--muted-2); }
.c-form input:focus, .c-form textarea:focus{
  outline:none; border-color: rgba(217,39,63,0.5); box-shadow: 0 0 0 3px rgba(217,39,63,0.09);
}
.c-form button{
  align-self: flex-start;
  font-size: var(--t-sm); font-weight: 650; color:#fff;
  background: linear-gradient(135deg, var(--ruby-light), var(--ruby-deep));
  border:none; padding: 12px 24px; border-radius: 999px; cursor:pointer;
  transition: all var(--dur-s) var(--ease);
}
.c-form button:hover{ transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(217,39,63,0.65); }

/* prev/next post footer */
.reader-nav{
  display:grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 0 clamp(20px, 4vw, 54px) clamp(32px, 5vw, 56px);
}
@media (max-width: 620px){ .reader-nav{ grid-template-columns: 1fr; } }
.rnav{
  display:flex; flex-direction: column; gap: 7px; text-align:left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; cursor:pointer;
  transition: all var(--dur-s) var(--ease);
}
.rnav:hover{ border-color: rgba(217,39,63,0.42); transform: translateY(-3px); background: var(--surface-2); }
.rnav .lbl{
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2);
  display:flex; align-items:center; gap: 7px;
}
.rnav .lbl svg{ width: 13px; height: 13px; }
.rnav .t{ font-family: var(--serif); font-size: var(--t-base); color: var(--paper); line-height: 1.3; }
.rnav.next{ text-align: right; }
.rnav.next .lbl{ justify-content: flex-end; }

/* reading progress inside reader */
.read-progress{
  position: absolute; left:0; bottom: -1px; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--ruby), var(--gold));
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer{
  border-top: 1px solid var(--line);
  padding: clamp(44px, 6vw, 76px) 0 clamp(30px, 4vw, 44px);
  margin-top: 20px;
}
.footer-grid{
  display:grid; grid-template-columns: minmax(0,1.4fr) repeat(2, minmax(0,1fr));
  gap: clamp(28px, 4vw, 60px);
}
@media (max-width: 760px){ .footer-grid{ grid-template-columns: 1fr 1fr; } .footer-brand{ grid-column: 1 / -1; } }

.footer-brand .brand-name{ font-size: 34px; }
.footer-brand p{ color: var(--muted); font-size: var(--t-sm); margin: 14px 0 0; max-width: 40ch; }
.footer-social{ display:flex; gap: 9px; margin-top: 20px; }

.footer-col h5{
  font-family: var(--mono); font-size: var(--t-xs); font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted-2);
  margin: 0 0 16px;
}
.footer-col a, .footer-col button{
  display:block; font-size: var(--t-sm); color: var(--muted);
  padding: 6px 0; background:none; border:none; cursor:pointer; text-align:left;
  transition: color var(--dur-s) var(--ease);
}
.footer-col a:hover, .footer-col button:hover{ color: var(--ruby-light); }

.footer-base{
  margin-top: clamp(36px, 5vw, 60px); padding-top: 24px;
  border-top: 1px solid var(--line-2);
  display:flex; justify-content:space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--mono); font-size: var(--t-xs); color: var(--muted-2);
  letter-spacing: 0.1em;
}

/* ============================================================
   TOAST + BACK TO TOP
   ============================================================ */
.toast{
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translate(-50%, 90px);
  background: var(--surface-solid); color: var(--paper);
  border: 1px solid rgba(217,39,63,0.4);
  border-radius: 999px; padding: 13px 26px;
  font-size: var(--t-sm); font-weight: 550;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events:none;
  transition: transform 0.45s var(--ease-out), opacity 0.3s var(--ease);
}
.toast.show{ transform: translate(-50%, 0); opacity: 1; }

.to-top{
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--line); color: var(--paper);
  display:grid; place-items:center; cursor:pointer;
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: all var(--dur) var(--ease);
}
.to-top svg{ width: 19px; height: 19px; }
.to-top.show{ opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover{ border-color: rgba(217,39,63,0.5); color: var(--ruby-light); }

/* ============================================================
   MOTION / PRINT
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal{ opacity:1; transform:none; }
  .bg-grain{ display:none; }
}

@media print{
  .site-header, .toolbar, .marquee, .to-top, .yt-band, .news-card, .site-footer,
  .reader-bar-right, .reader-nav, .c-form{ display:none !important; }
  body{ background:#fff; color:#000; }
  .reader-overlay{ position:static; background:#fff; }
}
