/* Tandem marketing site — light theme.
   All colours live in :root. Warm off-white base, espresso ink, tan for small labels,
   burgundy only as a small accent (dots, progress bars, rules, underlines). */
:root {
  --bg: #fbf8f2;
  --bg-soft: #f3ecdd;
  --ink: #2a1f19;
  --muted: rgba(42, 31, 25, 0.64);
  --line: rgba(42, 31, 25, 0.14);
  --tan: #7a5f2e;
  --burgundy: #7b1e2b;
  --serif: 'EB Garamond', Georgia, serif;
  --display: 'Cinzel', Georgia, serif;
  --read: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
}

/* Lenis (smooth scroll) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

*, *::before, *::after { box-sizing: border-box; }
body.tm { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.tm img { display: block; max-width: 100%; height: auto; }
.tm a { color: inherit; text-decoration: none; }
.tm main { display: block; }
.tm :where(h1, h2, h3, p, ul, figure) { margin: 0; padding: 0; }

.tm-label { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.36em; text-transform: uppercase; color: var(--tan); }
.tm-rule { display: block; width: 36px; height: 2px; background: var(--burgundy); margin: 1rem 0 0; }

/* Word-by-word reveal masks */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.14em; margin-bottom: -0.14em; }
.wi { display: inline-block; will-change: transform; }

/* Hidden-until-animated states: only while the motion layer is active.
   If the scripts never start, the failsafe below reveals everything after 3s. */
.motion [data-hero] { opacity: 0; }
.motion .reveal { opacity: 0; transform: translateY(32px); }
.motion .tm-manifesto .wi { opacity: 0.16; }
@keyframes tm-failsafe { to { opacity: 1; transform: none; } }
.motion:not(.motion-ready) [data-hero],
.motion:not(.motion-ready) .reveal { animation: tm-failsafe 0.01s linear 3s forwards; }

/* ---------- nav ---------- */
.tm-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 6vw; transition: background 0.4s, padding 0.4s, box-shadow 0.4s;
}
.tm-nav.is-solid { background: rgba(251, 248, 242, 0.86); backdrop-filter: blur(14px); padding-top: 0.7rem; padding-bottom: 0.7rem; box-shadow: 0 1px 0 var(--line); }
.tm-nav img { height: 24px; width: auto; }
.tm-nav ul { display: flex; align-items: center; gap: 1.8rem; list-style: none; }
.tm-nav a.link {
  font-family: var(--display); font-size: 0.68rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--ink); padding-bottom: 3px; border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.tm-nav a.link:hover { border-color: var(--burgundy); }
.tm-pill {
  display: inline-flex; align-items: center; gap: 0.6rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.5rem 1.1rem;
  font-family: var(--display); font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink);
}
.tm-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--burgundy); box-shadow: 0 0 0 4px rgba(123, 30, 43, 0.14); }
@media (max-width: 640px) { .tm-nav .hide-sm { display: none; } .tm-nav ul { gap: 1.1rem; } }

/* page progress (right edge on home, top edge on articles) */
.tm-progress { position: fixed; top: 0; right: 0; width: 2px; height: 100%; z-index: 60; pointer-events: none; background: rgba(42, 31, 25, 0.06); }
.tm-progress i { display: block; width: 100%; height: 100%; background: var(--burgundy); transform: scaleY(0); transform-origin: top; }
.ar-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.ar-progress i { display: block; height: 100%; background: var(--burgundy); transform: scaleX(0); transform-origin: left; }

/* ---------- hero ---------- */
.tm-hero { position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; padding: 7rem 6vw 5rem; }
.tm-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 50% at 50% 108%, rgba(196, 110, 70, 0.30) 0%, rgba(232, 200, 160, 0.40) 42%, transparent 74%),
    radial-gradient(80% 60% at 50% -5%, #ffffff 0%, transparent 62%),
    var(--bg);
}
.tm-grain {
  position: absolute; inset: 0; opacity: 0.07; mix-blend-mode: multiply; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.tm-hero-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.tm-hero-logo { width: min(80vw, 760px); height: auto; }
.tm-hero h1 { font-weight: 400; font-style: italic; font-size: clamp(1.4rem, 3.2vw, 2.3rem); line-height: 1.2; color: var(--ink); }
.tm-cue { position: absolute; z-index: 2; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.tm-cue span { width: 1px; height: 54px; background: linear-gradient(var(--ink), transparent); animation: tm-cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes tm-cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- manifesto ---------- */
.tm-manifesto { padding: 22vh 6vw; max-width: 1180px; margin: 0 auto; }
.tm-manifesto .big { margin-top: 1.4rem; font-size: clamp(1.9rem, 4.8vw, 4rem); line-height: 1.14; color: var(--ink); }
.tm-manifesto em { color: var(--burgundy); font-style: italic; }

/* ---------- pinned story ---------- */
.story-stage { min-height: 100svh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 6vw; padding: 5rem 6vw 3rem; position: relative; background: var(--bg-soft); border-top: 1px solid var(--line); }
.story-index { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 1.4rem; font-family: var(--display); color: var(--ink); }
.story-index .cur { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; }
.story-index .tot { font-size: 0.9rem; color: var(--muted); letter-spacing: 0.2em; }
.story-chapters { display: grid; }
.story-chapters .chapter { grid-area: 1 / 1; max-width: 30rem; }
.chapter h2 { margin-bottom: 1rem; font-family: var(--display); font-weight: 400; font-size: 0.8rem; letter-spacing: 0.34em; text-transform: uppercase; color: var(--tan); }
.chapter p { font-size: clamp(1.6rem, 2.7vw, 2.4rem); line-height: 1.22; color: var(--ink); }
html:not(.motion) .story-chapters { display: block; }
html:not(.motion) .chapter { margin-bottom: 3rem; }

.story-frame { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); width: min(100%, 520px); aspect-ratio: 4 / 5; max-height: 76svh; margin-inline: auto; background: #d9cdb8; box-shadow: 0 30px 60px -30px rgba(42, 31, 25, 0.35); }
.story-frame .sky { position: absolute; inset: 0; opacity: 0; }
.story-frame .sky-1 { opacity: 1; background: linear-gradient(180deg, #7f95b5 0%, #d6c3b2 55%, #f3d3a6 100%); }
.story-frame .sky-2 { background: linear-gradient(180deg, #6f9bd0 0%, #bcd3e6 50%, #f7e6c4 100%); }
.story-frame .sky-3 { background: linear-gradient(180deg, #8d86b0 0%, #e0a68e 55%, #f7bf82 100%); }
.story-frame .sky-4 { background: linear-gradient(180deg, #2b2140 0%, #7a2a3b 48%, #d9683c 100%); }
.story-frame .sun { position: absolute; left: 50%; top: 22%; width: 20%; aspect-ratio: 1; margin-left: -10%; border-radius: 50%; background: radial-gradient(circle, #fff6df 0%, #f8d38f 55%, #f2a64f 100%); box-shadow: 0 0 80px 30px rgba(248, 211, 143, 0.5); }
.story-frame svg.ridges { position: absolute; inset: auto 0 0 0; width: 100%; height: 62%; overflow: visible; }
.story-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.story-frame.has-frames canvas { display: block; }
.story-frame.has-frames .sky, .story-frame.has-frames .sun, .story-frame.has-frames svg.ridges { display: none; }
.story-frame .tm-caption { position: absolute; left: 1rem; bottom: 0.9rem; font-family: var(--display); font-size: 0.58rem; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(251, 248, 242, 0.7); }
.story-progress { position: absolute; left: 6vw; right: 6vw; bottom: 1.6rem; display: flex; gap: 6px; }
.story-progress b { flex: 1; height: 2px; background: rgba(42, 31, 25, 0.14); overflow: hidden; }
.story-progress i { display: block; height: 100%; background: var(--burgundy); transform: scaleX(0); transform-origin: left; }
@media (max-width: 767px) {
  .story-stage { grid-template-columns: 1fr; gap: 1.6rem; padding-top: 4.6rem; align-content: start; }
  .story-frame { order: -1; width: min(100%, 360px); max-height: 38svh; aspect-ratio: auto; height: 38svh; }
}

/* ---------- menu strip ---------- */
.tm-menu { position: relative; background: var(--bg); border-top: 1px solid var(--line); padding: 11vh 0 7vh; overflow: hidden; }
.tm-menu header { padding: 0 6vw; margin-bottom: 2.2rem; }
.tm-menu header h2 { margin-top: 1.1rem; font-weight: 400; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.1; }
.tm-track { display: flex; gap: 1.6rem; padding: 0 6vw; width: max-content; }
.tm-card { flex: 0 0 min(76vw, 340px); }
.tm-card .tile { position: relative; height: clamp(240px, 40svh, 400px); border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: linear-gradient(160deg, rgba(232, 217, 184, 0.9), rgba(243, 236, 221, 0.9) 60%, rgba(123, 30, 43, 0.10)); }
.tm-card:nth-child(even) .tile { background: linear-gradient(200deg, rgba(123, 30, 43, 0.10), rgba(243, 236, 221, 0.9) 45%, rgba(232, 217, 184, 0.9)); }
.tm-card .num { position: absolute; left: 1rem; top: 0.6rem; font-family: var(--display); font-size: 3.6rem; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(42, 31, 25, 0.35); }
.tm-card h3 { margin: 1.1rem 0 0.4rem; font-family: var(--display); font-weight: 400; font-size: 0.82rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--tan); }
.tm-card p { color: var(--muted); font-size: 1.15rem; line-height: 1.3; }
@media (max-width: 767px) {
  .tm-menu { overflow: visible; }
  .tm-track { overflow-x: auto; width: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; }
  .tm-card { scroll-snap-align: start; }
  .tm-card .tile { height: auto; aspect-ratio: 3 / 4; }
}

/* ---------- visit ---------- */
.tm-visit { border-top: 1px solid var(--line); padding: 14vh 6vw; background: var(--bg-soft); }
.tm-visit .grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; }
.tm-visit p { font-size: 1.5rem; line-height: 1.3; color: var(--ink); }
.tm-visit p small { display: block; margin-top: 0.4rem; font-size: 1rem; color: var(--muted); }
@media (max-width: 767px) { .tm-visit .grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- journal teaser ---------- */
.tm-journal { border-top: 1px solid var(--line); padding: 12vh 6vw; background: var(--bg); }
.tm-journal .grid { max-width: 1100px; margin: 2.4rem auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.tm-journal article h3 { margin: 0.9rem 0 0.4rem; font-family: var(--read); font-weight: 700; font-size: 1.35rem; line-height: 1.25; }
.tm-journal article p { color: var(--muted); font-family: var(--read); font-size: 1rem; }
.tm-journal article img { width: 100%; height: 190px; object-fit: cover; border-radius: 12px; }
.tm-journal a:hover h3 { text-decoration: underline; text-decoration-color: var(--burgundy); text-underline-offset: 5px; }
.tm-more { display: inline-block; margin-top: 2.4rem; padding-bottom: 4px; border-bottom: 1px solid var(--burgundy); }
@media (max-width: 767px) { .tm-journal .grid { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.tm-footer { border-top: 1px solid var(--line); padding: 8vh 6vw 3rem; text-align: center; background: var(--bg-soft); }
.tm-footer img { width: min(60vw, 260px); margin: 0 auto 1.6rem; }
.tm-footer p { margin: 0.4rem 0; color: var(--muted); }
.tm-footer a:hover { color: var(--ink); }
.tm-footer .links { display: flex; justify-content: center; gap: 1.6rem; margin: 1.2rem 0; }

/* ======================================================================
   Blog — Medium-style reading experience
   ====================================================================== */
.bl { max-width: 720px; margin: 0 auto; padding: 8.5rem 1.4rem 5rem; }
.bl-head { margin-bottom: 2.4rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.bl-head h1 { margin-top: 1rem; font-family: var(--read); font-weight: 700; font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.01em; }
.bl-head p { margin-top: 0.8rem; font-family: var(--read); font-size: 1.2rem; color: var(--muted); }
.bl-row { display: block; padding: 1.9rem 0; border-bottom: 1px solid var(--line); }
.bl-row.has-thumb { display: grid; grid-template-columns: 1fr auto; gap: 1.6rem; align-items: center; }
.bl-row h2 { font-family: var(--read); font-weight: 700; font-size: clamp(1.35rem, 3.2vw, 1.7rem); line-height: 1.22; }
.bl-row:hover h2 { text-decoration: underline; text-decoration-color: var(--burgundy); text-underline-offset: 5px; text-decoration-thickness: 1.5px; }
.bl-row .ex { margin-top: 0.5rem; font-family: var(--read); font-size: 1.05rem; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bl-meta { margin-top: 0.8rem; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 0.82rem; color: var(--muted); }
.bl-meta .dot { margin: 0 0.4rem; }
.bl-thumb { width: 124px; height: 124px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }
.bl-empty { padding: 3rem 0; font-family: var(--read); color: var(--muted); }
.bl-pager { display: flex; justify-content: space-between; margin-top: 2.2rem; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; }
.bl-pager a { padding-bottom: 3px; border-bottom: 1px solid var(--burgundy); }
@media (max-width: 560px) { .bl-row.has-thumb { grid-template-columns: 1fr 88px; gap: 1rem; } .bl-thumb { width: 88px; height: 88px; } }

.ar { max-width: 700px; margin: 0 auto; padding: 8.5rem 1.4rem 3rem; }
.ar-title { font-family: var(--read); font-weight: 700; font-size: clamp(2.2rem, 5.4vw, 3.4rem); line-height: 1.1; letter-spacing: -0.015em; }
.ar-deck { margin-top: 1.2rem; font-family: var(--read); font-size: 1.4rem; line-height: 1.42; color: var(--muted); }
.ar-by { display: flex; align-items: center; gap: 0.9rem; margin: 2rem 0 2.2rem; padding: 1.1rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 0.9rem; }
.ar-by .av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--display); font-size: 0.95rem; }
.ar-by .who { color: var(--ink); font-weight: 600; }
.ar-by .sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.ar-cover { max-width: 1000px; margin: 0 auto 2.6rem; padding: 0 1.4rem; }
.ar-cover img { width: 100%; border-radius: 10px; }

.ar-body { font-family: var(--read); font-size: 1.3rem; line-height: 1.75; color: #28211c; }
.ar-body > * + * { margin-top: 1.55em; }
.ar-body :where(h2, h3) + * { margin-top: 0.8em; }
.ar-body h2 { margin-top: 2.2em; font-weight: 700; font-size: 1.85rem; line-height: 1.25; letter-spacing: -0.01em; }
.ar-body h3 { margin-top: 1.9em; font-weight: 700; font-size: 1.45rem; line-height: 1.3; }
.ar-body a { color: inherit; text-decoration: underline; text-decoration-color: var(--burgundy); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.ar-body a:hover { color: var(--burgundy); }
.ar-body blockquote { margin-left: 0; padding: 0.2em 0 0.2em 1.4rem; border-left: 3px solid var(--burgundy); font-style: italic; font-size: 1.4rem; line-height: 1.55; }
.ar-body ul, .ar-body ol { padding-left: 1.5em; }
.ar-body li + li { margin-top: 0.5em; }
.ar-body img { border-radius: 10px; margin-inline: auto; }
.ar-body figure { margin-inline: 0; }
.ar-body figure.image { text-align: center; }
.ar-body figcaption { margin-top: 0.7rem; font-family: system-ui, -apple-system, sans-serif; font-size: 0.85rem; color: var(--muted); text-align: center; }
.ar-body hr { border: 0; height: 1px; background: var(--line); margin: 2.6em 0; }
.ar-body table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.ar-body th, .ar-body td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.ar-body .media iframe, .ar-body iframe { width: 100%; max-width: 100%; border: 0; border-radius: 10px; }

.ar-foot { max-width: 700px; margin: 0 auto; padding: 1rem 1.4rem 4rem; }
.ar-end { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); display: flex; gap: 1rem; align-items: center; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 0.92rem; color: var(--muted); }
.ar-end .av { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); font-family: var(--display); font-size: 1.1rem; }
.ar-end strong { color: var(--ink); }
.ar-more { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 4rem 1.4rem 5rem; }
.ar-more .in { max-width: 720px; margin: 0 auto; }
.ar-back { display: inline-block; margin-top: 2rem; font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.26em; text-transform: uppercase; padding-bottom: 3px; border-bottom: 1px solid var(--burgundy); }

.ar-preview { pointer-events: none; position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg); padding: 0.7rem 1.2rem; border-radius: 999px; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 0.82rem; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); max-width: 92vw; text-align: center; }
.ar-preview strong { color: #f0c987; }

/* ---------- Writer's guide ---------- */
.gd .callout { margin: 0 0 2rem; padding: 1.2rem 1.4rem; background: var(--bg-soft); border-left: 4px solid var(--burgundy); border-radius: 8px; font-size: 1.1rem; line-height: 1.6; }
.gd .callout ol { margin: 0.6rem 0 0; padding-left: 1.4em; }
.gd .callout li + li { margin-top: 0.3em; }
.gd .toc { margin: 0 0 2.4rem; padding: 1.1rem 1.4rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1.05rem; line-height: 1.5; }
.gd .toc ol { margin: 0.6rem 0 0; padding-left: 1.4em; }
.gd .toc li + li { margin-top: 0.2em; }
.gd .toc a { text-decoration: none; }
.gd .toc a:hover { text-decoration: underline; text-decoration-color: var(--burgundy); }
.gd .ar-body h2 { scroll-margin-top: 6rem; }
.gd code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--bg-soft); font-size: 0.9em; }
.gd ul.check { list-style: none; padding-left: 0; }
.gd ul.check li { position: relative; padding-left: 1.9em; }
.gd ul.check li::before { content: ""; position: absolute; left: 0; top: 0.42em; width: 1em; height: 1em; border: 2px solid var(--burgundy); border-radius: 3px; }
.gd .ar-body table { font-size: 1.02rem; }
.gd .ar-body td, .gd .ar-body th { vertical-align: top; }

@media print {
  .tm-nav, .tm-footer, .ar-progress, .tm-progress, .ar-back, .toc { display: none !important; }
  body.tm { background: #fff; font-size: 11pt; }
  .ar { padding-top: 0 !important; max-width: none; }
  .ar-body { font-size: 11pt; line-height: 1.55; color: #000; }
  .ar-title { font-size: 24pt; }
  .gd .ar-body h2 { break-after: avoid; margin-top: 1.6em; }
  .gd .ar-body table, .gd .callout { break-inside: avoid; }
}
