/* ============================================================
   Peter Walters / links — dark editorial
   ============================================================ */

:root {
  /* Type — brand uses HK Grotesk Wide (Manrope digital sub) + IBM Plex Mono */
  --font-sans:  "Manrope", "HK Grotesk Wide", system-ui, -apple-system, sans-serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  /* Layout */
  --maxw: 520px;
  --pad:  20px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* ── BUILD theme (default) — peterwalters.app warm charcoal with topo motif ── */
  --bg:        oklch(0.215 0.006 60);   /* warm charcoal */
  --bg-elev:   oklch(0.245 0.007 58);
  --bg-card:   oklch(0.275 0.009 56);
  --fg:        oklch(0.965 0.008 85);
  --fg-dim:    oklch(0.80  0.012 78);
  --fg-mute:   oklch(0.60  0.014 70);
  --fg-faint:  oklch(0.44  0.014 65);
  --rule:      oklch(0.30  0.013 60);
  --rule-hi:   oklch(0.42  0.015 60);
  --accent:    oklch(0.84  0.075 80);   /* warm cream */
  --accent-hi: oklch(0.90  0.090 82);
  --gold:      oklch(0.86  0.135 88);   /* warm gold */

  --body-grad:
    radial-gradient(120% 60% at 50% -10%, oklch(0.30 0.025 65 / 0.5), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, oklch(0.26 0.020 80 / 0.4), transparent 70%);
  --topo-opacity: 0.045;

  --hero-bg:
    linear-gradient(135deg, oklch(0.28 0.022 65) 0%, oklch(0.20 0.012 60) 100%);
  --hero-glow: radial-gradient(60% 80% at 100% 0%, oklch(0.84 0.08 80 / 0.18), transparent 60%);
  --img-overlay: linear-gradient(180deg, transparent 50%, oklch(0.08 0.005 60 / 0.88) 100%);
  --marquee-bg: oklch(0.18 0.007 60);
  --overlay-fg: oklch(0.97 0.008 80);
  --overlay-date-bg: oklch(0 0 0 / 0.38);
  --overlay-date-border: oklch(1 0 0 / 0.18);
}

/* ── YOGA theme — brand cream/midnight/navy, editorial light ── */
:root[data-theme="yoga"] {
  --bg:        #F7EFDA;            /* CREAM */
  --bg-elev:   #FBF5E4;            /* slightly warmer cream */
  --bg-card:   #F5F4F1;            /* CLOUD */
  --fg:        #303030;            /* MIDNIGHT */
  --fg-dim:    oklch(0.42 0.006 80);
  --fg-mute:   oklch(0.52 0.012 80);
  --fg-faint:  oklch(0.62 0.018 80);
  --rule:      oklch(0.86 0.020 85);
  --rule-hi:   oklch(0.74 0.030 85);
  --accent:    #2D4A77;            /* NAVY */
  --accent-hi: #407BD8;            /* OCEAN */
  --gold:      #FFE164;            /* GOLD — used sparingly */

  --body-grad:
    radial-gradient(120% 60% at 50% -10%, oklch(0.94 0.02 80 / 0.55), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, oklch(0.88 0.04 85 / 0.45), transparent 70%);

  --hero-bg:
    linear-gradient(135deg, #2D4A77 0%, #1E3358 100%);
  --hero-glow: radial-gradient(60% 80% at 100% 0%, oklch(0.78 0.16 250 / 0.35), transparent 60%);
  --img-overlay: linear-gradient(180deg, transparent 50%, oklch(0.15 0.02 250 / 0.85) 100%);
  --marquee-bg: #2D4A77;
  --overlay-fg: #F7EFDA;
  --overlay-date-bg: oklch(0 0 0 / 0.22);
  --overlay-date-border: oklch(1 0 0 / 0.2);
  --topo-opacity: 0;
}

/* Topo motif overlay — only visible in build theme, fixed behind app */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("assets/topo.svg");
  background-repeat: repeat;
  background-size: 600px 600px;
  opacity: var(--topo-opacity, 0);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
  transition: opacity .6s ease;
}
.app { position: relative; z-index: 1; }

/* Smooth theme crossfade on the chrome that actually carries the theme */
html, body { transition: background-color .6s ease, color .6s ease; }
.row, .studio, .expand, .build-card, .build-contact, .greece, .hero, .monthly, .marquee,
.tabs-rail, .tabs-ind, .foot, .socials, .section-label .line {
  transition: background-color .5s ease, border-color .5s ease, color .5s ease, background .5s ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  /* mobile niceties */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--body-grad), var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ── App shell ─────────────────────────────────────────── */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding:
    calc(32px + env(safe-area-inset-top, 0px))
    max(var(--pad), env(safe-area-inset-right, 0px))
    calc(80px + env(safe-area-inset-bottom, 0px))
    max(var(--pad), env(safe-area-inset-left, 0px));
}

/* ── Header ────────────────────────────────────────────── */
.hdr { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }

.portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 1px var(--rule), 0 14px 40px -18px oklch(0 0 0 / 0.6);
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: 62% 8%;
  filter: contrast(1.02) saturate(0.92);
}

.name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 30px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
}

.bio {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.45;
  color: var(--fg-dim);
  max-width: 380px;
  margin: 0;
  text-wrap: balance;
}
.bio .sep { color: var(--fg-faint); margin: 0 0.35em; }

.handle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.handle::before { content: "— "; }
.handle::after  { content: " —"; }

/* socials */
.socials {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 10px 0;
  width: 100%;
  max-width: 360px;
  justify-content: space-between;
}
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--fg-dim);
  transition: color .2s ease, transform .2s ease;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}
.socials a:hover, .socials a:focus-visible { color: var(--accent-hi); transform: translateY(-1px); }
.socials a:active { background: color-mix(in oklab, var(--accent) 8%, transparent); }
.socials svg { width: 20px; height: 20px; display: block; }

/* ── Tab switch ────────────────────────────────────────── */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 28px 0 22px;
}
.tab {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  padding: 14px 0 18px;
  color: var(--fg-faint);
  transition: color .25s ease;
  text-align: center;
  position: relative;
  z-index: 1;
}
.tab .num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 500;
  display: block;
  color: var(--fg-faint);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.tab[aria-selected="true"] { color: var(--fg); }
.tab[aria-selected="true"] .num { color: var(--accent); }
.tabs-rail {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--rule);
}
.tabs-ind {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--accent);
  transition: transform .45s cubic-bezier(0.7, 0, 0.2, 1);
  transform-origin: left center;
}
.tabs-ind.is-right { transform: translateX(100%); }

/* ── Panels & lists ────────────────────────────────────── */
.panel { display: flex; flex-direction: column; gap: 12px; }

/* stagger animation — applied via inline style */
@keyframes riseFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise {
  opacity: 0;
  animation: riseFade .5s cubic-bezier(0.2, 0, 0.1, 1) forwards;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 16px 2px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label > span:first-child { white-space: nowrap; }
.section-label .line {
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* ── Link rows ─────────────────────────────────────────── */
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  min-height: 56px;
}
.row:hover, .row:focus-visible {
  border-color: var(--rule-hi);
  background: var(--bg-card);
}
.row:active { transform: scale(0.995); }

.row .meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.row .title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.25;
}
.row .sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.row .arrow {
  width: 16px; height: 16px;
  color: var(--fg-mute);
  transition: transform .2s ease, color .2s ease;
  flex-shrink: 0;
}
.row:hover .arrow { transform: translate(2px, -2px); color: var(--accent-hi); }

.row .tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 4px 7px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 3px;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Hero (free trial) ─────────────────────────────────── */
.hero {
  display: block;
  padding: 22px 22px 22px;
  background: var(--hero-bg);
  border: 1px solid var(--rule-hi);
  color: oklch(0.97 0.005 80);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.hero-kicker .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.85); }
}
.hero-title {
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 6px;
  text-wrap: balance;
}
.hero-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: oklch(0.92 0.01 80);
  margin: 0;
  line-height: 1.4;
}
.hero-foot {
  margin-top: 18px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: oklch(0.82 0.015 80);
}
.hero-foot > span { white-space: nowrap; }
.hero-foot > span:last-child { color: var(--gold); }

/* ── Greece visual card ────────────────────────────────── */
.greece {
  display: block;
  border: 1px solid var(--rule-hi);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-elev);
  position: relative;
}
.greece-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.greece-img img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
  transition: transform 0.8s cubic-bezier(0.2,0,0.1,1);
}
.greece:hover .greece-img img { transform: scale(1.04); }
.greece-img::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--img-overlay);
}
.greece-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  z-index: 1;
}
.greece-overlay .top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--overlay-fg);
  text-shadow: 0 1px 8px oklch(0 0 0 / 0.4);
  white-space: nowrap;
}
.greece-overlay .top .date {
  background: var(--overlay-date-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 9px;
  border-radius: 4px;
  border: 1px solid var(--overlay-date-border);
}
.greece-overlay .bot {
  display: flex; flex-direction: column; gap: 4px;
}
.greece-overlay .bot h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  color: #fff;
  line-height: 1;
}
.greece-overlay .bot p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: oklch(0.92 0.01 80);
  margin: 0;
  line-height: 1.35;
}

.marquee {
  background: var(--marquee-bg);
  border-top: 1px solid var(--rule);
  overflow: hidden;
  white-space: nowrap;
  padding: 9px 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: oklch(0.85 0.01 80);
}
:root[data-theme="yoga"] .marquee { color: oklch(0.92 0.02 80); }
.marquee span .dot { color: var(--gold); margin: 0 4px; }
.marquee-track {
  display: inline-flex;
  gap: 32px;
  padding-left: 32px;
  animation: marq 28s linear infinite;
}
@keyframes marq { to { transform: translateX(-50%); } }

/* ── Studio card ───────────────────────────────────────── */
.studio {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 6px 18px;
  display: flex;
  flex-direction: column;
}
.studio-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "place arrow"
    "meta  arrow";
  align-items: center;
  column-gap: 14px;
  row-gap: 4px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
  transition: opacity .2s ease;
}
.studio-row:last-child { border-bottom: 0; }
.studio-row:hover { opacity: 1; }
.studio:hover .studio-row { opacity: 0.55; }
.studio:hover .studio-row:hover { opacity: 1; }
.studio-row .place {
  grid-area: place;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.studio-row .meta {
  grid-area: meta;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.studio-row .when {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  text-transform: uppercase;
  white-space: nowrap;
}
.studio-row .city {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  text-transform: uppercase;
  white-space: nowrap;
}
.studio-row .city::before {
  content: "·";
  margin-right: 10px;
  color: var(--fg-faint);
}
.studio-row .arrow { grid-area: arrow; }

/* ── Expand / accordion ────────────────────────────────── */
.expand { border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; background: var(--bg-elev); }
.expand-head {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 16px 18px;
  text-align: left;
  gap: 14px;
  transition: background .2s ease;
}
.expand-head:hover { background: var(--bg-card); }
.expand-head .title { font-size: 16px; color: var(--fg); flex: 1; font-weight: 500; letter-spacing: -0.01em; }
.expand-head .count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  white-space: nowrap;
  flex-shrink: 0;
}
.expand-head .chev {
  width: 14px; height: 14px;
  color: var(--fg-mute);
  transition: transform .35s ease;
}
.expand[data-open="true"] .chev { transform: rotate(180deg); color: var(--accent); }

.expand-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(0.2,0,0.1,1);
}
.expand[data-open="true"] .expand-body { grid-template-rows: 1fr; }
.expand-body > .inner { overflow: hidden; }
.expand-list {
  display: flex;
  flex-direction: column;
  padding: 0 18px 6px;
}
.expand-list a {
  display: flex;
  align-items: center;
  padding: 14px 0;
  gap: 12px;
  border-top: 1px dashed var(--rule);
}
.expand-list a .ttl { flex: 1; font-size: 15px; color: var(--fg-dim); letter-spacing: -0.005em; }
.expand-list a:hover .ttl { color: var(--fg); }
.expand-list a .code {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  padding: 3px 6px;
  border-radius: 3px;
}
.expand-list a .ext {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
  text-transform: uppercase;
}

/* ── Building tab ──────────────────────────────────────── */
.build-card {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color .25s ease;
}
.build-card:hover { border-color: var(--accent); }
.build-card .kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
  min-width: 0;
}
.build-card .kicker > span:first-child { flex-shrink: 0; }
.build-card .kicker .yr {
  font-family: var(--font-mono);
  letter-spacing: 0.22em;
  color: var(--fg-mute);
}
.build-card .kicker .url { color: var(--fg-mute); }
.build-card h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--fg);
  line-height: 1.1;
}
.build-card p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--fg-dim);
  margin: 0 0 18px;
  line-height: 1.45;
  text-wrap: pretty;
}
.build-card .foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  white-space: nowrap;
}
.build-card .foot .go {
  color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
/* removed ascii decoration; was clashing with kicker label */

.build-contact {
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px dashed var(--rule);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  flex-wrap: wrap;
}
.build-contact > span { white-space: nowrap; text-transform: uppercase; letter-spacing: 0.14em; font-size: 10px; }
.build-contact a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--fg-faint); text-underline-offset: 3px; white-space: nowrap; }
.build-contact a:hover { color: var(--accent-hi); text-decoration-color: var(--accent); }

/* ── Footer ────────────────────────────────────────────── */
.foot {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
  text-transform: uppercase;
}
.foot .heart { color: var(--accent); }

/* ── Responsive nudges ─────────────────────────────────── */
@media (max-width: 420px) {
  .app { padding-top: 24px; padding-bottom: 64px; }
  .name { font-size: 26px; }
  .tab  { font-size: 24px; padding: 12px 0 16px; }
  .hero { padding: 20px 18px; }
  .hero-title { font-size: 22px; }
  .hero-sub { font-size: 14px; }
  .hero-foot { font-size: 9px; letter-spacing: 0.16em; }
  .greece-overlay { padding: 14px 14px; }
  .greece-overlay .bot h3 { font-size: 24px; }
  .greece-overlay .bot p { font-size: 13px; }
  .build-card { padding: 18px; }
  .build-card h3 { font-size: 22px; }
  .build-card p { font-size: 14px; }
  .row { padding: 14px 14px; gap: 10px; }
  .row .title { font-size: 15px; }
  .row .tag { font-size: 8.5px; padding: 3px 6px; letter-spacing: 0.12em; }
  .monthly-cal { width: 60px; }
  .monthly-cal .label { font-size: 8.5px; letter-spacing: 0.18em; }
  .monthly-body { padding: 12px 14px; }
  .monthly-head .title { font-size: 15px; }
  .monthly-head .tag { font-size: 8.5px; padding: 3px 5px; letter-spacing: 0.12em; }
  .monthly-body .desc { font-size: 13px; }
  .monthly > .arrow { margin: 14px 12px 0 0; }
  .studio { padding: 4px 14px; }
  .studio-row .place { font-size: 14px; }
  .studio-row .when { font-size: 10.5px; }
  .studio-row .city { font-size: 9.5px; }
  .expand-head { padding: 14px 14px; }
  .expand-head .title { font-size: 15px; }
  .expand-list { padding: 0 14px 4px; }
  .build-contact { padding: 12px 14px; font-size: 10px; }
  .marquee { padding: 8px 0; font-size: 9.5px; letter-spacing: 0.22em; }
  .section-label { font-size: 9.5px; letter-spacing: 0.18em; margin: 12px 2px 0; }
}

/* Very narrow phones (iPhone SE / Galaxy small) */
@media (max-width: 340px) {
  :root { --pad: 16px; }
  .name { font-size: 24px; }
  .tab  { font-size: 22px; }
  .hero-title { font-size: 20px; }
  .greece-overlay .bot h3 { font-size: 22px; }
  .build-card h3 { font-size: 20px; }
  .studio-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "place arrow"
      "meta  arrow";
  }
  .studio-row .meta { gap: 6px; }
  .row .meta { gap: 2px; }
  /* allow tag to drop to second row if cramped */
  .row { flex-wrap: wrap; }
  .row .meta { flex: 1 1 100%; }
  .row .tag { order: 3; }
  .row .arrow { order: 4; margin-left: auto; }
}

@media (min-width: 560px) {
  .app { padding-top: 56px; }
  .portrait { width: 112px; height: 112px; }
}

/* Touch-only: drop hover scale on rows so tapping doesn't shimmer */
@media (hover: none) {
  .row:hover, .row:focus-visible { background: var(--bg-elev); border-color: var(--rule); }
  .row:hover .arrow { transform: none; color: var(--fg-mute); }
  .studio:hover .studio-row { opacity: 1; }
  .greece:hover .greece-img img { transform: none; }
  .build-card:hover { border-color: var(--rule); }
  .monthly:hover { border-color: var(--rule); background: var(--bg-elev); }
  .monthly:hover > .arrow { transform: none; color: var(--fg-mute); }
  .expand-head:hover { background: transparent; }
}

/* ── A11y ─────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 4px; }

/* ── Monthly Online Class card ─────────────────────────── */
.monthly {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  min-height: 92px;
  transition: border-color .25s ease, background .25s ease, transform .2s ease;
}
.monthly:hover { border-color: var(--accent); background: var(--bg-card); }
.monthly:active { transform: scale(0.995); }
.monthly-cal {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border-right: 1px solid var(--rule);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.monthly-cal .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in oklab, var(--accent) 60%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}
.monthly-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  min-width: 0;
}
.monthly-head {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.monthly-head .title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.2;
}
.monthly-head .tag {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 3px 6px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.monthly-body .date {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.monthly-body .desc {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  color: var(--fg-dim);
  margin: 2px 0 0;
  line-height: 1.4;
  text-wrap: pretty;
}
.monthly > .arrow {
  align-self: flex-start;
  margin: 16px 16px 0 0;
  width: 16px; height: 16px;
  color: var(--fg-mute);
  flex-shrink: 0;
  transition: transform .2s ease, color .2s ease;
}
.monthly:hover > .arrow { transform: translate(2px, -2px); color: var(--accent-hi); }

/* ── Retreat image placeholder (when no image asset yet) ── */
.greece-img.is-placeholder { background: linear-gradient(135deg, var(--accent) 0%, color-mix(in oklab, var(--accent) 65%, #000) 100%); }
.placeholder-pattern {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg,
      transparent 0 14px,
      color-mix(in oklab, #fff 8%, transparent) 14px 15px);
  display: flex; align-items: center; justify-content: center;
  color: color-mix(in oklab, #fff 75%, transparent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.placeholder-pattern::before {
  content: "Image · ";
  opacity: 0.55;
  margin-right: 4px;
}

/* ── Loading state ─────────────────────────────────────── */
.loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.loading-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

/* ── Yoga theme — subtle adjustments for light surfaces ── */
:root[data-theme="yoga"] .portrait img { filter: contrast(1.03) saturate(0.96); }
:root[data-theme="yoga"] .build-card:hover { border-color: var(--accent); }
:root[data-theme="yoga"] .row .tag,
:root[data-theme="yoga"] .monthly-head .tag {
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}
:root[data-theme="yoga"] .build-contact a { text-decoration-color: var(--rule-hi); }
:root[data-theme="yoga"] .foot .heart { color: var(--accent-hi); }
:root[data-theme="yoga"] .name,
:root[data-theme="yoga"] .tab[aria-selected="true"] { color: var(--fg); }
:root[data-theme="yoga"] .bio em,
:root[data-theme="yoga"] .name { letter-spacing: -0.025em; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   v2 — Live ribbon, sticky nav, NEXT pill, retreat countdown,
   film grain, view transitions, print
   ============================================================ */

/* ── Live "Next Up" ribbon ─────────────────────────────── */
.nextup {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 -4px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background:
    linear-gradient(90deg,
      color-mix(in oklab, var(--accent) 8%, transparent),
      transparent 70%),
    var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  transition: border-color .25s ease, background .25s ease, transform .2s ease;
}
.nextup:hover { border-color: var(--accent); }
.nextup:active { transform: scale(0.997); }
.nextup-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent);
  animation: nextpulse 2.2s ease-out infinite;
  flex-shrink: 0;
}
@keyframes nextpulse {
  0%   { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in oklab, var(--accent) 0%,  transparent); }
  100% { box-shadow: 0 0 0 0   color-mix(in oklab, var(--accent) 0%,  transparent); }
}
.nextup-kicker {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.22em;
}
.nextup-when { color: var(--fg); letter-spacing: 0.08em; }
.nextup-sep  { color: var(--fg-faint); margin: 0 -2px; }
.nextup-where {
  color: var(--fg-dim);
  letter-spacing: 0.08em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nextup-city { color: var(--fg-faint); }
@media (max-width: 440px) {
  .nextup { font-size: 10px; padding: 9px 12px; }
  .nextup-sep, .nextup-city { display: none; }
}

/* ── Sticky compact nav ────────────────────────────────── */
.sticky-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 8px max(var(--pad), env(safe-area-inset-right, 0px))
           8px max(var(--pad), env(safe-area-inset-left, 0px));
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  transform: translateY(-110%);
  transition: transform .35s cubic-bezier(0.2, 0, 0.1, 1), opacity .25s ease;
  opacity: 0;
  pointer-events: none;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.sticky-nav.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.sticky-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sticky-id {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  min-width: 0;
}
.sticky-id img {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; object-position: 62% 8%;
  box-shadow: 0 0 0 1px var(--rule);
}
.sticky-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: color-mix(in oklab, var(--fg) 4%, transparent);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
}
.sticky-tabs button {
  position: relative;
  z-index: 1;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
  transition: color .25s ease;
}
.sticky-tabs button[aria-selected="true"] { color: var(--fg); }
.sticky-ind {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px);
  background: var(--bg-elev);
  border: 1px solid var(--rule-hi);
  border-radius: 999px;
  transition: transform .35s cubic-bezier(0.7, 0, 0.2, 1);
  z-index: 0;
}
.sticky-ind.is-right { transform: translateX(100%); }
@media (max-width: 340px) {
  .sticky-id span { display: none; }
  .sticky-tabs button { padding: 6px 10px; font-size: 9px; }
}

/* ── Studio "NEXT" pill on chronological next class ────── */
.studio-row .next-pill {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent);
  color: var(--bg);
  vertical-align: 2px;
  animation: nudge 4s ease-in-out infinite;
}
:root[data-theme="yoga"] .studio-row .next-pill { color: #FBF5E4; }
@keyframes nudge {
  0%, 92%, 100% { transform: translateY(0); }
  94%           { transform: translateY(-1px); }
  96%           { transform: translateY(0); }
  98%           { transform: translateY(-1px); }
}
.studio-row.is-next {
  /* keep it subtle — pill carries the weight */
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 6%, transparent) 0%,
    transparent 70%);
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
}

/* ── Retreat countdown badge inside overlay date ──────── */
.greece-overlay .top {
  /* allow the date column to shrink and the badge to wrap */
  flex-wrap: wrap;
  row-gap: 6px;
}
.greece-overlay .top .date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}
.greece-overlay .top .date-countdown {
  font-size: 9px;
  letter-spacing: 0.2em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--gold);
  color: oklch(0.18 0.02 60);
  font-weight: 600;
  text-shadow: none;
  white-space: nowrap;
}

/* ── Film grain overlay (very subtle, both themes) ─────── */
body::after {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.05;
  mix-blend-mode: multiply;
}
:root[data-theme="build"] body::after,
:root:not([data-theme="yoga"]) body::after {
  mix-blend-mode: screen;
  opacity: 0.035;
}
@media (prefers-reduced-motion: no-preference) {
  body::after { animation: grainShift 8s steps(8) infinite; }
}
@keyframes grainShift {
  0%   { transform: translate(0,    0); }
  20%  { transform: translate(-3%, -2%); }
  40%  { transform: translate(2%,  -3%); }
  60%  { transform: translate(-2%,  3%); }
  80%  { transform: translate(3%,   2%); }
  100% { transform: translate(0,    0); }
}

/* Sticky nav + grain need to sit above the topo */
.sticky-nav { z-index: 50; }

/* ── View Transitions API — theme metamorphosis ─────────
   The signature moment: Yoga↔Building is a full re-tint of
   the page. The root snapshot (old cream / new charcoal,
   or vice-versa) cross-fades cleanly while three anchors —
   portrait, name, tab indicator — persist and re-tint in
   place, so it reads as "two worlds, one person" rather
   than a content swap. */
@supports (view-transition-name: a) {
  ::view-transition-group(root) {
    animation-duration: 0.52s;
    animation-timing-function: cubic-bezier(0.33, 0, 0.12, 1);
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 0.52s;
    animation-timing-function: cubic-bezier(0.33, 0, 0.12, 1);
    /* clean opacity cross-fade — no slide/scale jank */
    mix-blend-mode: normal;
  }
  ::view-transition-old(root) { animation-name: vtThemeOut; }
  ::view-transition-new(root) { animation-name: vtThemeIn; }
  @keyframes vtThemeOut { to   { opacity: 0; } }
  @keyframes vtThemeIn  { from { opacity: 0; } }

  /* anchored shared elements — stay put, re-tint with theme */
  .panel-wrap { view-transition-name: panel; }
  .hdr .portrait { view-transition-name: pw-portrait; }
  .hdr .name     { view-transition-name: pw-name; }
  .tabs-ind      { view-transition-name: pw-ind; }

  /* anchors hold position; their own old/new fade fast so
     the re-tint looks like one element changing, not two */
  ::view-transition-group(pw-portrait),
  ::view-transition-group(pw-name),
  ::view-transition-group(pw-ind) {
    animation-duration: 0.52s;
    animation-timing-function: cubic-bezier(0.33, 0, 0.12, 1);
  }
  ::view-transition-old(pw-portrait),
  ::view-transition-new(pw-portrait),
  ::view-transition-old(pw-name),
  ::view-transition-new(pw-name) {
    animation-duration: 0.30s;
    animation-timing-function: ease;
  }
  /* the indicator glides between Yoga/Building positions */
  ::view-transition-old(pw-ind) { animation: none; opacity: 0; }
  ::view-transition-new(pw-ind) { animation: none; opacity: 1; }
}

/* the theme owns the morph: shorten the post-commit color
   transition so it doesn't double against the VT snapshot.
   Browsers without VT still get the .6s fallback via @supports
   not. */
@supports (view-transition-name: a) {
  html, body { transition: background-color .28s ease, color .28s ease; }
}

/* ── Tier 2: microcraft ─────────────────────────────────── */

/* Magnetic pull on link rows. Uses the standalone `translate`
   property so it composes with existing transform rules
   (active-press scale, image zoom) instead of fighting them.
   JS sets --mx/--my; pointerleave resets → springs back. */
@media (hover: hover) and (pointer: fine) {
  .row, .hero, .greece, .monthly, .build-card, .nextup,
  .studio-row, .expand-head {
    translate: var(--mx, 0px) var(--my, 0px);
    transition: translate .35s cubic-bezier(0.2, 0, 0.1, 1),
                border-color .5s ease, background .5s ease, color .5s ease;
    will-change: translate;
  }
  /* drawn accent hairline under the hero headline on hover —
     one precise Linear-grade touch, not everywhere */
  .hero h2 { position: relative; }
  .hero h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: -4px;
    width: 100%; height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .42s cubic-bezier(0.2, 0, 0.1, 1);
  }
  .hero:hover h2::after { transform: scaleX(1); }
}

/* One-time header reveal on first load: portrait settles,
   then name, bio, socials follow. Header mounts once for the
   app's life, so this plays once and never on tab switch. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes hdrRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .hdr .portrait { animation: hdrRise .6s cubic-bezier(0.2, 0, 0.1, 1) both; }
  .hdr .name     { animation: hdrRise .6s cubic-bezier(0.2, 0, 0.1, 1) .10s both; }
  .hdr .bio      { animation: hdrRise .6s cubic-bezier(0.2, 0, 0.1, 1) .18s both; }
  .hdr .socials  { animation: hdrRise .6s cubic-bezier(0.2, 0, 0.1, 1) .26s both; }
}

/* count-up numeral never reflows its row */
.date-countdown .cu-n { font-variant-numeric: tabular-nums; }

/* ── Print stylesheet — looks nice on paper / PDF ─────── */
@media print {
  :root { color-scheme: light; }
  html, body {
    background: #fff !important;
    color: #1a1a1a !important;
  }
  body::before, body::after { display: none !important; }
  .sticky-nav, .tabs, .nextup, .marquee { display: none !important; }
  .app {
    max-width: 100% !important;
    padding: 32px !important;
  }
  .rise { opacity: 1 !important; animation: none !important; }
  .panel { display: block !important; }
  .panel + .panel { page-break-before: always; }
  /* Force both panels visible when printing */
  [role="tabpanel"] { display: block !important; }
  .row, .studio, .expand, .build-card, .build-contact, .hero, .greece, .monthly {
    background: #fff !important;
    color: #1a1a1a !important;
    border-color: #ddd !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  .hero, .greece-overlay {
    color: #1a1a1a !important;
  }
  .hero-title, .greece-overlay .bot h3, .build-card h3 { color: #1a1a1a !important; }
  .hero-kicker, .hero-foot, .greece-overlay .top { color: #555 !important; }
  a { color: #1a1a1a !important; }
  a[href]::after {
    content: " (" attr(href) ")";
    font-family: monospace;
    font-size: 9px;
    color: #888;
    word-break: break-all;
  }
  /* Don't print full URL after socials / icon-only links / mailto */
  .socials a[href]::after, .build-contact a[href]::after { content: ""; }
}

/* Push main content below sticky nav while it's visible —
   purely visual padding via the fixed bar; main itself stays where it is. */

/* ── Podcast — Spotify embed wrapper ───────────────────── */
.podcast {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.podcast iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  /* Spotify embed already has its own rounded chrome — clip ours flush */
  border-radius: 0;
  background: var(--bg-elev);
}
.podcast-out {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  transition: color .2s ease, background .2s ease;
}
.podcast-out svg { width: 12px; height: 12px; transition: transform .2s ease; }
.podcast-out:hover { color: var(--accent-hi); background: var(--bg-card); }
.podcast-out:hover svg { transform: translate(2px, -2px); }
.podcast-out:active { background: var(--bg-card); }

/* ── Mobile tap-target polish (Instagram in-app browser) ─ */
@media (hover: none), (pointer: coarse) {
  /* Ensure every actionable surface is comfortably tappable */
  .row, .monthly, .podcast, .greece, .hero, .build-card,
  .expand-head, .studio-row, .nextup, .build-contact a {
    min-height: 48px;
  }
  /* Larger arrows on touch — they're decorative, but signal "tap me" */
  .row .arrow, .monthly > .arrow {
    width: 18px; height: 18px;
  }
  /* Tap feedback that doesn't depend on hover */
  .row:active, .monthly:active, .podcast:active, .greece:active,
  .hero:active, .build-card:active, .expand-head:active, .studio-row:active,
  .nextup:active {
    background: var(--bg-card);
  }
  /* Underline social affordance on touch — icons alone can be ambiguous */
  .socials a { position: relative; }
  .socials a::after {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%; transform: translateX(-50%);
    width: 4px; height: 2px; border-radius: 2px;
    background: var(--fg-faint);
    opacity: 0.5;
  }
}

/* Ensure portrait + sticky-nav avatar don't get cropped on tiny mobiles */
@media (max-width: 340px) {
  .portrait { width: 88px; height: 88px; }
}
