/* notes.css — /articles/ "Stories from the channel".
   Builds on styles.css (tokens, header, footer, buttons) and articles.css (.art-crumb, .art-eyebrow).
   Chapter colours match the homepage topic cards:
   ai-research = sage, founders-diary = blush, academia-to-job = butter, did-you-design-it = sand.
   Motion only runs when <html> has .js and the visitor hasn't asked for reduced motion. */

.nt-body { overflow-x: clip; }
.nt-main { padding-top: 68px; }
.nt-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.nt-header-cta { padding: 10px 20px; font-size: 0.85rem; }

/* ── Reading progress ─────────────────────────────────────────── */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 200; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--rose), var(--butter), var(--plum)); border-radius: 0 4px 4px 0; }

/* ── Decorative shapes ────────────────────────────────────────── */
.blob { position: absolute; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; pointer-events: none; z-index: 0;
  transform: translate3d(0, calc(var(--sy, 0) * var(--k, 0.08) * 1px), 0) rotate(var(--r, 0deg)); }
.blob--hero1 { width: 420px; height: 380px; right: -120px; top: 40px; background: var(--blush); opacity: .7; --k: -0.12; --r: 18deg; }
.blob--hero2 { width: 220px; height: 200px; left: -80px; bottom: -40px; background: var(--sage); opacity: .8; --k: 0.1; }
.ring { position: absolute; width: 140px; height: 140px; border: 1.5px solid var(--line); border-radius: 50%; left: 46%; top: 70px; z-index: 0; }
.blob--a { width: 300px; height: 280px; right: -90px; top: 120px; background: var(--paper); opacity: .55; --k: -0.06; --r: -20deg; }
.blob--b { width: 180px; height: 170px; left: -60px; top: 45%; background: var(--paper); opacity: .45; --k: 0.05; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero2 .art-crumb { display: table; margin-bottom: 28px; }
.hero2 .art-eyebrow { display: block; }
.hero2 { position: relative; padding: 48px 0 72px; }
.hero2-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hero2 h1 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.8rem, 6.4vw, 5rem); line-height: 0.98; letter-spacing: -0.015em; margin: 12px 0 24px; }
.scribble { position: relative; display: inline-block; font-style: italic; color: var(--color-accent); white-space: nowrap; }
.scribble svg { position: absolute; left: 0; bottom: -0.18em; width: 100%; height: 0.32em; overflow: visible; }
.scribble path { fill: none; stroke: var(--butter); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .scribble path { stroke-dashoffset: 1; animation: draw 1.1s .5s cubic-bezier(.6,.1,.2,1) forwards; }
.nt-lead { font-size: 1.15rem; line-height: 1.65; color: var(--cocoa-dark); margin-bottom: 14px; max-width: 560px; }
.nt-byline { font-size: 0.92rem; color: var(--color-text-muted); margin-bottom: 24px; }
.nt-byline a { color: var(--color-accent); text-underline-offset: 3px; }
.nt-accounts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.nt-account { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; min-height: 44px;
  background: var(--paper); border: 1px solid var(--hair-strong); color: var(--espresso); font-weight: 600; font-size: 0.9rem; text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition); }
.nt-account:hover { background: var(--espresso); color: var(--cream); transform: translateY(-2px) rotate(-1.5deg); }
.nt-account svg { width: 18px; height: 18px; }
.nt-stats { font-size: 0.85rem; color: var(--color-text-muted); }
.nt-stats strong { color: var(--espresso); }

.hero2-fan { position: relative; height: 460px; }
.fan { position: absolute; top: 20px; left: 50%; width: 210px; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.fan--0 { transform: translateX(-115%) rotate(-10deg) translateY(36px); z-index: 1; }
.fan--1 { transform: translateX(-50%) rotate(2deg); z-index: 3; }
.fan--2 { transform: translateX(15%) rotate(11deg) translateY(44px); z-index: 2; }
.hero2-fan:hover .fan--0 { transform: translateX(-128%) rotate(-14deg) translateY(30px); }
.hero2-fan:hover .fan--2 { transform: translateX(28%) rotate(15deg) translateY(38px); }
.js .fan { animation: fanIn .9s cubic-bezier(.2,.8,.2,1) both; }
.js .fan--0 { animation-delay: .15s; } .js .fan--1 { animation-delay: .3s; } .js .fan--2 { animation-delay: .45s; }
@keyframes fanIn { from { opacity: 0; translate: 0 60px; } to { opacity: 1; translate: 0 0; } }

/* ── Filter ───────────────────────────────────────────────────── */
.nt-filter { position: sticky; top: var(--header-h); z-index: 40; padding: 12px 0; margin-top: 28px;
  background: color-mix(in srgb, var(--cream) 88%, transparent); backdrop-filter: blur(8px); }
.nt-filter-inner { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.nt-filter-inner::-webkit-scrollbar { display: none; }
.nt-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hair-strong); background: var(--paper); font: 600 0.88rem var(--font-sans); color: var(--espresso); transition: background var(--transition), transform var(--transition); }
.nt-pill span { font-weight: 500; color: var(--color-text-muted); }
.nt-pill:hover { transform: translateY(-1px); }
.nt-pill.is-active { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.nt-pill.is-active span { color: var(--sand-text); }
.nt-pill:focus-visible, .nt-chip:focus-visible, .nt-account:focus-visible, .ph-play:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ── Chapters ─────────────────────────────────────────────────── */
.ch { position: relative; margin-top: 56px; --tint: var(--sage); scroll-margin-top: 120px; }
.ch[hidden] { display: none; }
.ch--founders-diary { --tint: var(--blush); }
.ch--academia-to-job { --tint: var(--butter-soft); }
.ch--did-you-design-it { --tint: var(--sand); }
.wave { display: block; width: 100%; height: 70px; margin-bottom: -1px; }
.wave path { fill: var(--tint); }
.ch-body { position: relative; background: var(--tint); padding: 24px 0 88px; border-radius: 0 0 48px 48px; overflow: hidden; }
.ch-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 28px; align-items: start; margin-bottom: 40px; }
.ch-num { font-family: var(--font-serif); font-size: clamp(5rem, 12vw, 9rem); line-height: .8; color: transparent; -webkit-text-stroke: 1.5px var(--espresso); opacity: .35; }
.ch-head h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.04; margin-bottom: 12px; }
.ch-head p { color: var(--cocoa-dark); max-width: 640px; font-size: 1.05rem; line-height: 1.6; }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.nt-count { font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--paper); }
.ch-cta { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: var(--espresso); color: var(--cream);
  font-weight: 600; font-size: 0.92rem; text-decoration: none; transition: transform var(--transition), box-shadow var(--transition); }
.ch-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(61,47,40,.25); }
.ch-collab { display: inline-block; margin-top: 40px; font-weight: 600; color: var(--rose-deep); text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px; }

/* ── Stories ──────────────────────────────────────────────────── */
.st-list { position: relative; }
.st { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 56px; align-items: start; scroll-margin-top: 130px; padding: 8px 0; }
.st--flip { grid-template-columns: minmax(0, 1fr) 300px; }
.st--flip .st-media { order: 2; }
.st-media { position: sticky; top: 150px; display: flex; justify-content: center; }
.st-text { max-width: 600px; padding-top: 12px; }
.st--flip .st-text { justify-self: end; }
.st:target .st-text { background: var(--paper); border-radius: var(--radius-md); padding: 20px; margin: -8px -20px; }
.st-meta { display: flex; align-items: center; gap: 12px; font-size: 0.82rem; color: var(--cocoa-dark); margin-bottom: 8px; }
.st-anchor { color: var(--color-text-muted); text-decoration: none; font-weight: 700; opacity: 0; transition: opacity var(--transition); }
.st:hover .st-anchor, .st-anchor:focus { opacity: 1; }
.st-title { font-family: var(--font-serif); font-weight: 400; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.08; margin-bottom: 16px; }
.st-tldr { font-size: 1.06rem; line-height: 1.6; margin-bottom: 18px; color: var(--espresso); }
.st-tldr-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; padding: 3px 8px; margin-right: 4px; border-radius: 6px;
  background: var(--espresso); color: var(--cream); vertical-align: 2px; transform: rotate(-3deg); }
.st-tldr mark { color: inherit; font-weight: 500; background: linear-gradient(transparent 58%, var(--butter) 58%) no-repeat 0 0 / 100% 100%; }
.js .st-tldr mark { background-size: 0% 100%; transition: background-size .9s .25s cubic-bezier(.6,.1,.2,1); }
.js .st-text.in .st-tldr mark { background-size: 100% 100%; }
.st-body p { font-size: 1rem; line-height: 1.72; color: var(--cocoa-dark); margin-bottom: 14px; }
.st-points { list-style: none; counter-reset: pt; margin: 6px 0 18px; padding: 0; display: grid; gap: 8px; }
.st-points li { counter-increment: pt; position: relative; padding: 10px 14px 10px 48px; border-radius: 14px; background: color-mix(in srgb, var(--paper) 75%, transparent);
  font-size: 0.95rem; line-height: 1.45; color: var(--espresso); }
.st-points li::before { content: counter(pt); position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--espresso); color: var(--cream); font-size: .78rem; font-weight: 700; }
.st-try { position: relative; margin: 8px 0 18px; padding: 18px 20px 16px; border-radius: 18px; background: var(--espresso); color: var(--cream); transform: rotate(-0.6deg); }
.st-try p { margin: 0; color: var(--cream); font-size: .98rem; line-height: 1.55; }
.st-try-tag { position: absolute; top: -12px; left: 18px; background: var(--butter); color: var(--espresso); font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; transform: rotate(-3deg); }
.st-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.st-on { font-size: .8rem; color: var(--cocoa-dark); font-weight: 600; }
.st-source { margin-top: 12px; font-size: .78rem; color: var(--color-text-muted); line-height: 1.5; }

/* Squiggles between stories */
.squiggle { display: block; width: min(560px, 70%); height: 110px; margin: 8px auto; overflow: visible; }
.squiggle path { fill: none; stroke: var(--espresso); stroke-opacity: .35; stroke-width: 1.6; stroke-dasharray: .012 .012; vector-effect: non-scaling-stroke; }
.js .squiggle path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.6,.1,.2,1); }
.js .squiggle.in path { stroke-dashoffset: 0; }

/* Phone frame + player */
.phone { width: 280px; padding: 10px; border-radius: 40px; background: var(--espresso); box-shadow: 0 30px 60px -20px rgba(61,47,40,.45), 0 0 0 1px rgba(0,0,0,.05);
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg)) rotate(var(--tilt, -2.5deg)); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.st--flip .phone { --tilt: 2.5deg; }
.st:hover .phone { --tilt: 0deg; }
.ph-screen { position: relative; aspect-ratio: 9 / 16; border-radius: 30px; overflow: hidden; background: var(--plum); }
.ph-screen img, .ph-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.ph-type { position: absolute; inset: 0; display: grid; place-items: center; padding: 28px; text-align: center;
  background: radial-gradient(circle at 30% 20%, var(--rose-light), transparent 55%), linear-gradient(160deg, var(--plum), var(--espresso)); }
.ph-type span { font-family: var(--font-serif); color: var(--cream); font-size: 1.7rem; line-height: 1.1; }
.ph-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: rgba(251,245,239,.92); color: var(--espresso); box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s; }
.ph-play svg { width: 30px; height: 30px; margin-left: 3px; }
.ph-open svg { width: 26px; height: 26px; margin-left: 0; }
.ph-play:hover { transform: scale(1.1); background: var(--butter); }
.js .ph-play::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(251,245,239,.8); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.ph-kind { position: absolute; left: 12px; top: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(61,47,40,.75); color: var(--cream); font-size: .7rem; font-weight: 600; }
.phone.is-playing .ph-kind { display: none; }
.phone--mini { width: 210px; padding: 8px; border-radius: 32px; --tilt: 0deg; }
.phone--mini .ph-screen { border-radius: 25px; }
.phone--mini .ph-play { width: 52px; height: 52px; pointer-events: none; }
.phone--mini .ph-play svg { width: 22px; height: 22px; }

/* Stat sticker */
.sticker { position: absolute; right: -28px; bottom: 40px; z-index: 3; width: 136px; min-height: 136px; padding: 18px 14px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--butter); color: var(--espresso);
  box-shadow: 0 12px 26px rgba(61,47,40,.22); transform: rotate(8deg); }
.st--flip .sticker { right: auto; left: -28px; transform: rotate(-8deg); }
.sticker b { font-family: var(--font-serif); font-weight: 400; font-size: 1.9rem; line-height: 1; }
.sticker--long b { font-size: 1.35rem; }
.sticker span { font-size: .66rem; line-height: 1.25; margin-top: 4px; font-weight: 600; }

/* Platform chips */
.nt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nt-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px; text-decoration: none;
  font-size: 0.78rem; font-weight: 600; color: var(--espresso); background: var(--paper); border: 1px solid var(--hair);
  transition: background var(--transition), color var(--transition), transform var(--transition); }
.nt-chip svg { width: 14px; height: 14px; }
.nt-chip:hover { background: var(--espresso); color: var(--cream); transform: translateY(-2px); }

/* ── Collaboration band ───────────────────────────────────────── */
.nt-collab { margin-top: 72px; }
.wave--dark path { fill: var(--espresso); }
.nt-collab-body { background: var(--espresso); color: var(--cream); padding: 40px 0 104px; }
.nt-eyebrow-light { color: var(--sand-text) !important; }
.nt-collab h2 { font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.04; margin: 12px 0 16px; color: var(--cream); }
.nt-collab h2 em { color: var(--rose-light); }
.nt-collab-lead { max-width: 640px; color: var(--sand-text); font-size: 1.08rem; line-height: 1.65; margin-bottom: 40px; }
.nt-collab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 40px; }
.nt-collab-card { position: relative; padding: 26px 22px 24px; border-radius: 26px; background: var(--espresso-2); border: 1px solid rgba(244,234,224,.12);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), background .35s; }
.nt-collab-card:nth-child(odd) { transform: rotate(-1.2deg); }
.nt-collab-card:nth-child(even) { transform: rotate(1.2deg) translateY(14px); }
.nt-collab-card:hover { transform: rotate(0) translateY(-6px); background: var(--plum); }
.nt-collab-n { font-family: var(--font-serif); font-size: 2.2rem; color: var(--butter); line-height: 1; }
.nt-collab-card h3 { font-family: var(--font-serif); font-weight: 400; font-size: 1.35rem; margin: 10px 0 8px; color: var(--cream); }
.nt-collab-card p { font-size: 0.92rem; line-height: 1.55; color: var(--sand-text); }
.nt-collab-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.nt-collab-link { color: var(--cream); font-weight: 600; text-underline-offset: 4px; }
.nt-body .footer { margin-top: 0; }

/* ── Scroll reveal (only with JS) ─────────────────────────────── */
.js .rv { opacity: 0; transform: translateY(36px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); }
.js .rv-side { transform: translateX(-60px) rotate(-4deg); }
.js .st--flip .rv-side { transform: translateX(60px) rotate(4deg); }
.js .rv-pop { opacity: 0; transform: scale(.4) rotate(-30deg); transition: opacity .5s .35s, transform .6s .35s cubic-bezier(.3,1.6,.5,1); }
.js .rv.in, .js .in .rv-pop { opacity: 1; transform: none; }
.js .in .rv-pop { transform: rotate(8deg); }
.js .st--flip .in .rv-pop { transform: rotate(-8deg); }
.js .nt-collab-card.rv.in:nth-child(odd) { transform: rotate(-1.2deg); }
.js .nt-collab-card.rv.in:nth-child(even) { transform: rotate(1.2deg) translateY(14px); }
.js .nt-collab-card.rv.in:hover { transform: rotate(0) translateY(-6px); }
.js .nt-collab-card.rv:nth-child(2) { transition-delay: .08s; } .js .nt-collab-card.rv:nth-child(3) { transition-delay: .16s; } .js .nt-collab-card.rv:nth-child(4) { transition-delay: .24s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .nt-collab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero2-grid { grid-template-columns: minmax(0, 1fr); }
  .hero2-fan { height: 400px; }
}
@media (max-width: 820px) {
  .st-media { position: relative; top: auto; }
  .st, .st--flip { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .st--flip .st-media { order: 0; }
  .st--flip .st-text { justify-self: start; }
  .phone { width: 250px; }
  .sticker { right: max(0px, calc(50% - 190px)); width: 116px; min-height: 116px; }
  .st--flip .sticker { left: auto; right: max(0px, calc(50% - 190px)); transform: rotate(8deg); }
  .js .st--flip .in .rv-pop { transform: rotate(8deg); }
  .squiggle { height: 80px; }
}
@media (max-width: 640px) {
  .nt-wrap { padding: 0 16px; }
  .hero2 { padding: 24px 0 48px; }
  .hero2-fan { height: 330px; }
  .fan { width: 160px; }
  .phone--mini { width: 160px; border-radius: 26px; }
  .phone--mini .ph-screen { border-radius: 20px; }
  .ch-head { grid-template-columns: minmax(0, 1fr); }
  .ch-num { font-size: 4.5rem; }
  .ch-body { border-radius: 0 0 32px 32px; padding-bottom: 64px; }
  .nt-collab-grid { grid-template-columns: minmax(0, 1fr); }
  .nt-collab-card:nth-child(n) { transform: none; }
  .st:target .st-text { margin: -8px -12px; padding: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .rv, .js .rv-side, .js .rv-pop { opacity: 1 !important; transform: none !important; transition: none !important; }
  .js .scribble path, .js .squiggle path { stroke-dashoffset: 0 !important; animation: none !important; transition: none !important; }
  .js .st-tldr mark { background-size: 100% 100% !important; transition: none !important; }
  .js .fan, .js .ph-play::after { animation: none !important; }
  .blob { transform: none !important; }
  .phone, .fan, .nt-account, .nt-chip, .nt-pill, .nt-collab-card { transition: none !important; }
}

/* Story title links to the story's own page (articles/<slug>/) */
.st-title-link { color: inherit; text-decoration: none; }
.st-title-link:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
