/* therachelchen.com — site styles (light theme only, never dark backgrounds) */

:root {
  color-scheme: light;

  /* "Seattle sunset" palette */
  --bg: #fdf8fa;
  --surface: #ffffff;
  --text: #2a2030;
  --muted: #6a5f72;
  --line: #eee2ea;
  --accent: #a8326e;        /* links + buttons */
  --accent-strong: #861f55;

  --sky: #cfe6f5;
  --lavender: #dcd6f7;
  --pink: #f9d6e4;
  --peach: #fbe3d6;

  /* lighter tints for card backgrounds, darker inks for text on the pastels */
  --sky-tint: #edf5fb;
  --lavender-tint: #f1effc;
  --pink-tint: #fdf0f5;
  --peach-tint: #fef3ec;
  --sky-ink: #1f5578;
  --lavender-ink: #4f37a3;
  --pink-ink: #861f55;
  --peach-ink: #7a3a1c;

  /* Fonts: Newsreader for reading text, Fraunces (with its SOFT axis) for the
     wordmark and headings. Both are loaded by the Google Fonts <link> in each page's <head>. */
  --font: "Newsreader", Georgia, "Times New Roman", serif;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --head-soft: "SOFT" 100, "WONK" 0;

  --wrap: 1240px;           /* was 1080px; widened ~160px (Nov 23 feedback) */
  --measure: 42rem;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 32, 48, .04), 0 8px 24px rgba(42, 32, 48, .05);
  --header-h: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-head); font-variation-settings: var(--head-soft); line-height: 1.2; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.2rem); margin: 0 0 .5rem; font-weight: 600; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; font-weight: 600; }
h3 { font-size: 1.2rem; margin: 2rem 0 .75rem; font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); }
/* Narrower centered column for About, Interests, Contact and Writing; content fills it */
.wrap.narrow { max-width: 960px; }
.narrow .measure, .narrow .post { max-width: none; }
main { overflow-x: clip; }  /* keeps blurred blobs from causing sideways scroll */

.skip-link {
  position: absolute; left: -999px; top: .5rem; z-index: 20;
  background: var(--surface); padding: .5rem .75rem; border-radius: 8px;
}
.skip-link:focus { left: .5rem; }

/* ---------- Header (stays at the top while scrolling) ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(253, 248, 250, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.3) blur(10px);
  -webkit-backdrop-filter: saturate(1.3) blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .4rem 1.5rem;
  min-height: var(--header-h); padding-top: .55rem; padding-bottom: .55rem;
}

.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }

.wordmark {
  font-family: var(--font-head);
  font-variation-settings: var(--head-soft);
  font-weight: 600;
  font-size: 1.1rem;          /* the smaller letters (~0.78 of the caps) */
  letter-spacing: .07em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark .cap { font-size: 1.28em; }   /* T, R and C: 1 / 0.78 */

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: .15rem 1.35rem;
}
.site-nav a {
  display: block; padding: .3rem 0;
  font-size: .98rem; color: var(--text); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-strong); border-bottom-color: var(--pink); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Main ---------- */

main { padding: 2.75rem 0 4.5rem; }

.page-head { margin-bottom: 2.25rem; }
.page-head h1 { margin-bottom: .35rem; }
.page-head p { color: var(--muted); margin: .25rem 0 0; }

.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose li { margin-bottom: .4em; }
.prose strong { font-weight: 600; }
.prose > :last-child { margin-bottom: 0; }

.button {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font); font-size: .92rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; padding: .55rem 1rem; border-radius: 999px;
  border: 1px solid #e3d3de; background: var(--surface); color: var(--text);
}
.button:hover { border-color: var(--accent); color: var(--accent-strong); text-decoration: none; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.button svg { width: 1.05em; height: 1.05em; flex: none; }
.button.small { font-size: .85rem; padding: .4rem .8rem; }

.badge {
  display: inline-block; padding: .15rem .6rem; border-radius: 999px;
  font-size: .8rem; font-weight: 500; line-height: 1.5;
  background: var(--pink); color: var(--pink-ink); text-decoration: none;
}
a.badge:hover { color: var(--pink-ink); text-decoration: underline; }
.badge.award { background: var(--lavender); color: var(--lavender-ink); }
.badge.date { background: var(--sky); color: var(--sky-ink); }
.badge.event { background: var(--peach); color: var(--peach-ink); }
.badge.status { background: var(--surface); color: var(--accent-strong); border: 1px solid var(--pink); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: .9rem; color: var(--muted); }

/* ---------- Homepage intro ---------- */

.intro {
  display: flex; align-items: center; gap: 1.5rem 2rem;
  padding: 1.5rem 0 1rem;
}
.portrait {
  flex: none; width: 168px; height: 168px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 0 0 6px var(--surface), 0 0 0 7px var(--pink), var(--shadow);
}
.intro h1 { margin: 0 0 1rem; line-height: 1; }
.intro .wordmark { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.75rem); font-weight: 600; letter-spacing: .06em; white-space: normal; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }

/* ---------- Homepage sections ---------- */

.section { margin-top: 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin-bottom: 1.25rem; }
.section-head h2 { margin: 0; font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.4rem); }
.section-head a { font-size: .95rem; }
/* heading with a button underneath ("My GitHub"), ~8px more room than before */
.section-head.stacked { flex-direction: column; align-items: flex-start; gap: .85rem; }
.page-head .head-actions { margin-top: .9rem; }
.sub-head { font-size: 1.05rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 2.75rem 0 1rem; }

/* About text on the left, photo on the right */
.about-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 19rem); gap: 1.5rem 3rem; align-items: center; }
.about-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-split .about-photo { aspect-ratio: 1 / 1; object-position: 50% 30%; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.5rem 0 0; padding: 0; }
.tags li { padding: .3rem .85rem; border-radius: 10px; font-size: .92rem; border: 1px solid rgba(42, 32, 48, .06); }
.tags li:nth-child(4n+1) { background: var(--sky); color: var(--sky-ink); }
.tags li:nth-child(4n+2) { background: var(--lavender); color: var(--lavender-ink); }
.tags li:nth-child(4n+3) { background: var(--pink); color: var(--pink-ink); }
.tags li:nth-child(4n+4) { background: var(--peach); color: var(--peach-ink); }

/* Skills: one quiet gray row; the pills stretch to fill the row exactly */
.skills { display: flex; flex-direction: column; gap: .45rem; margin: .6rem 0 0; }
.skills-row { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.skills li {
  flex: 1 1 auto; text-align: center; white-space: nowrap;
  padding: .28rem .8rem; border-radius: 10px; font-size: .88rem;
  background: #f1eef1; color: #5d5663; border: 1px solid #e5e0e5;
}

/* ---------- Expandable cards (projects, experience) ---------- */

.card-grid {
  display: grid; gap: 1.1rem; align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  --card-bg: var(--sky-tint); --card-edge: var(--sky);
  background: var(--card-bg);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem 1.2rem;
  min-width: 0;
}
.card-grid > .card:nth-child(4n+2) { --card-bg: var(--lavender-tint); --card-edge: var(--lavender); }
.card-grid > .card:nth-child(4n+3) { --card-bg: var(--pink-tint); --card-edge: var(--pink); }
.card-grid > .card:nth-child(4n+4) { --card-bg: var(--peach-tint); --card-edge: var(--peach); }

/* Row 1: title · date · arrow. Row 2: the "made for" / status bubble under the title. */
.card summary {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .55rem .6rem; align-items: center;
  list-style: none; cursor: pointer; border-radius: 10px;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::marker { content: ""; }
.card-title { grid-column: 1; grid-row: 1; margin: 0; font-size: 1.22rem; line-height: 1.3; }
.card summary > .badge.date { grid-column: 2; grid-row: 1; white-space: nowrap; }
.card-meta { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: .35rem .4rem; }
.toggle {
  grid-column: 3; grid-row: 1;
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--card-edge);
  display: grid; place-items: center; color: var(--accent);
}
.toggle::before {
  content: ""; width: .5rem; height: .5rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
details[open] > summary .toggle::before { transform: translateY(2px) rotate(-135deg); }
.card summary:hover .toggle { border-color: var(--accent); }
.card summary:hover .card-title { color: var(--accent-strong); }

/* Skill tags: one neutral style on every card, shown on the closed card */
.skill-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .3rem; }
.skill-tag {
  display: inline-block; padding: .06rem .55rem; border-radius: 999px;
  font-size: .76rem; line-height: 1.5; white-space: nowrap;
  background: rgba(255, 255, 255, .85); border: 1px solid #ddd5dc; color: #5d5663;
}
.page-cards .skill-tag { font-size: .8rem; }

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

/* Experience cards: organization and location under the role */
.exp-meta { grid-column: 1 / -1; display: block; font-size: .95rem; line-height: 1.45; color: var(--muted); }
.exp-org { color: var(--text); font-weight: 500; }
.exp-loc { white-space: nowrap; }
.exp-loc::before { content: "\00B7"; margin: 0 .45rem 0 .15rem; color: var(--muted); }

.card-body { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--card-edge); font-size: 1.0625rem; line-height: 1.65; }
.card-body .note { font-size: .95rem; color: var(--muted); font-style: italic; }

/* Reserved area for screenshots / videos. Hidden until it has content. */
.card-media { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); margin-top: 1rem; }
.card-media:empty { display: none; }
.card-media img, .card-media video { width: 100%; border-radius: 10px; }

.card-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .9rem; }
.card-actions:empty { display: none; }

.card.plain { padding: 1.2rem 1.35rem; }
.card.plain h3, .card.plain h2 { margin: 0 0 .35rem; font-size: 1.22rem; }
.card.plain p { margin: 0; }

.placeholder { color: var(--muted); font-style: italic; margin: 0; }

/* ---------- Education cards: logo, and a soft campus photo that fades in on hover ---------- */

.edu-card { position: relative; isolation: isolate; overflow: hidden; }
.edu-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* white veil over the photo keeps the text readable */
  background: linear-gradient(rgba(255, 255, 255, .8), rgba(255, 255, 255, .8)), var(--campus) center / cover no-repeat;
  opacity: 0; transition: opacity .5s ease;
}
@media (hover: hover) {
  .edu-card:hover::before, .edu-card:focus-within::before { opacity: 1; }
}
/* touch screens have no hover: show the photo while the card is open */
@media (hover: none) {
  .edu-card:has(details[open])::before { opacity: 1; }
}
.edu-card summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: .5rem 1rem; }
.edu-logo {
  grid-column: 1; grid-row: 1; width: 56px; height: 56px; object-fit: contain;
  background: var(--surface); border: 1px solid var(--card-edge); border-radius: 12px; padding: 7px;
}
.edu-head { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.edu-card .toggle { grid-column: 3; }
.edu-degree { font-size: 1rem; }
.edu-dates { font-size: .9rem; color: var(--muted); }
.edu-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: .9rem 1.5rem; margin: 0; }
.edu-facts .wide { grid-column: 1 / -1; }
.edu-facts dt { font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.edu-facts dd { margin: .15rem 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .3rem 0 0; padding: 0; }
.chips li { font-size: .88rem; line-height: 1.4; padding: .18rem .6rem; border-radius: 8px; background: rgba(255, 255, 255, .8); border: 1px solid var(--card-edge); }
.credits { font-size: .78rem; color: var(--muted); margin: .9rem 0 0; }
.credits a { color: var(--muted); }

/* ---------- Colored boxes (About, Interests) ---------- */

.box { border-radius: var(--radius); padding: 1.35rem 1.55rem; border: 1px solid rgba(42, 32, 48, .06); box-shadow: var(--shadow); min-width: 0; }
.box h2 { margin: 0 0 .55rem; font-size: 1.35rem; }
.box p { margin: 0; }
.box ul { margin: 0; padding-left: 1.2rem; }
.box li { margin: .25rem 0; padding-left: .2rem; }
.box-sky { background: var(--sky); }
.box-lavender { background: var(--lavender); }
.box-pink { background: var(--pink); }
.box-peach { background: var(--peach); }
.box-sky li::marker { color: var(--sky-ink); }
.box-lavender li::marker { color: var(--lavender-ink); }
.box-pink li::marker { color: var(--pink-ink); }
.box-peach li::marker { color: var(--peach-ink); }
.box strong { font-weight: 600; }

/* About page */
.about-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 1.75rem 2.75rem; align-items: center; }

/* ---------- Frosted glass boxes over soft palette blobs (About, Contact) ---------- */
.glass-zone { position: relative; isolation: isolate; margin: 2.75rem 0 0; }
.blobs { position: absolute; inset: -2.5rem 0; z-index: -1; pointer-events: none; }
.blobs span { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .9; }
.blob-pink { width: 44%; height: 62%; left: -3%; top: 4%; background: var(--pink); }
.blob-lavender { width: 40%; height: 56%; right: -2%; top: -4%; background: var(--lavender); }
.blob-sky { width: 42%; height: 50%; left: 26%; bottom: -6%; background: var(--sky); }
.blob-peach { width: 32%; height: 46%; right: 6%; bottom: 2%; background: var(--peach); }

.glass {
  --tint: 255, 255, 255;
  position: relative; border-radius: 22px; padding: 1.4rem 1.6rem; min-width: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, .66), rgba(var(--tint), .42));
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 14px 34px rgba(42, 32, 48, .10), 0 2px 6px rgba(42, 32, 48, .05);
}
.glass-sky { --tint: 207, 230, 245; }
.glass-lavender { --tint: 220, 214, 247; }
.glass-pink { --tint: 249, 214, 228; }
.glass-peach { --tint: 251, 227, 214; }
/* no backdrop-filter support: solid tinted boxes instead */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgb(var(--tint)); }
}
.glass h2 { margin: 0 0 .55rem; font-size: 1.35rem; }
.glass p { margin: 0; }
.glass ul { margin: 0; padding-left: 1.2rem; }
.glass li { margin: .25rem 0; padding-left: .2rem; }
.glass li::marker { color: var(--accent); }
.glass strong { font-weight: 600; }
.glass-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.glass-row.facts-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }  /* Fun Facts ~60%, In the future ~40% */
.glass-row > * { margin: 0; }

/* ---------- Contact ---------- */
.contact-zone { margin-top: .25rem; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2rem 3rem; align-items: center; }
.contact-lead { font-size: 1.15rem; line-height: 1.5; margin: 0 0 1.1rem; padding: 1rem 1.3rem; }
.contact-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.contact-tile {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem;
  color: var(--text); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease;
}
.contact-tile:hover { color: var(--text); text-decoration: none; }
@media (hover: hover) {
  .contact-tile:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 40px rgba(42, 32, 48, .14), 0 2px 6px rgba(42, 32, 48, .06); }
}
.ct-icon {
  flex: none; width: 2.9rem; height: 2.9rem; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .88); color: var(--accent); box-shadow: 0 2px 8px rgba(42, 32, 48, .08);
}
.ct-icon svg { width: 1.35rem; height: 1.35rem; }
.ct-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ct-label { font-weight: 600; font-size: 1.08rem; }
.ct-value { color: var(--muted); font-size: .95rem; overflow-wrap: anywhere; }
/* "Copy" pill on the Email tile (filled in by site.js; empty and hidden without JS) */
.ct-action {
  margin-left: auto; flex: none; padding: .2rem .7rem; border-radius: 999px;
  font-size: .82rem; font-weight: 500; color: var(--accent-strong);
  background: rgba(255, 255, 255, .85); border: 1px solid rgba(168, 50, 110, .25);
}
.ct-action:empty { display: none; }
.contact-tile.is-copied .ct-action { background: var(--accent); border-color: var(--accent); color: #fff; }
.resume-buttons { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.3rem 0 0; }
.contact-places { margin-top: 1.1rem; }
.contact-photo {
  margin: 0; padding: 10px; border-radius: 28px; transform: rotate(2deg);
  background: rgba(255, 255, 255, .6); border: 1px solid rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 20px 44px rgba(42, 32, 48, .16), 0 3px 8px rgba(42, 32, 48, .06);
}
.contact-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 44% 50%; border-radius: 20px; }

/* ---------- About photos: Cover Flow carousel ----------
   Look and motion based on the 21st.dev "Cover Flow" component by Louis Studios
   (studios.lou15.com), rebuilt in plain CSS + vanilla JS (site.js) with a light stage,
   no reflection and no captions. Without JS (.cf-on missing) it is a plain scrollable row. */
.coverflow { margin: 2.75rem 0 0; --cf-stage: var(--lavender); }
.cf-track {
  list-style: none; margin: 0; padding: 0 0 .5rem;
  display: flex; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.cf-item { flex: 0 0 min(15rem, 70%); scroll-snap-align: start; }
.cf-item a { display: block; border-radius: 12px; overflow: hidden; }
.cf-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* JS on: a 3D stage. site.js sets the stage height and each cover's size and transform. */
.coverflow.cf-on .cf-track {
  display: block; position: relative; overflow: hidden; padding: 0;
  height: var(--cf-h, 24rem); border-radius: var(--cf-radius, 40px);
  background: var(--cf-stage);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab;
}
.coverflow.cf-on .cf-track.is-dragging { cursor: grabbing; }
.coverflow.cf-on .cf-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* soft fade into the stage color at the far left and right */
.coverflow.cf-on .cf-track::after {
  content: ""; position: absolute; inset: 0; z-index: 2000; pointer-events: none;
  background: linear-gradient(90deg, var(--cf-stage) 0%, transparent 7%, transparent 93%, var(--cf-stage) 100%);
}
.coverflow.cf-on .cf-item {
  position: absolute; left: 0; top: 0; width: var(--cf-s); height: var(--cf-s);
  transform-origin: 50% 50%; will-change: transform, opacity;
}
.coverflow.cf-on .cf-item a {
  width: 100%; height: 100%; border-radius: 6%;
  box-shadow: 0 10px 28px rgba(42, 32, 48, .18), 0 2px 6px rgba(42, 32, 48, .1);
  -webkit-user-drag: none;
}
.coverflow.cf-on .cf-item img { height: 100%; aspect-ratio: auto; object-position: 50% 35%; pointer-events: none; }
.cf-controls { display: flex; justify-content: center; align-items: center; gap: .9rem; margin: .9rem 0 0; }
.cf-controls[hidden] { display: none; }
.cf-btn {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; cursor: pointer;
  border: 1px solid #e3d3de; background: var(--surface); color: var(--accent);
  font: inherit; font-size: 1rem; line-height: 1;
}
.cf-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.cf-count { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: center; }

/* Interests page: each row is a text card beside a flat "peek" photo carousel, alternating sides.
   The row fills the column; the text card is exactly one slide (same width, height and corners). */
.interests {
  /* slide = text card size: ~39% of the column, up to 21rem */
  --slide-w: min(21rem, calc((min(100vw, 960px) - 3rem) * .39));
  --slide-hw: 1.25;        /* height / width (4:5 portrait) */
  --slide-h: calc(var(--slide-w) * var(--slide-hw));
  --slide-r: 18px;
  --slide-gap: .75rem;
}
.interest { margin: 0 0 3rem; }
.interest-group { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); margin: 0 0 1.1rem; }
.interest-row { display: grid; grid-template-columns: var(--slide-w) minmax(0, 1fr); gap: 1.25rem 2rem; align-items: center; }
.interest-row.flip { grid-template-columns: minmax(0, 1fr) var(--slide-w); }
.interest-row.flip .interest-card { order: 2; }

.interest-card {
  width: var(--slide-w); height: var(--slide-h); border-radius: var(--slide-r);
  padding: 1.4rem 1.5rem; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  font-size: 1.04rem; line-height: 1.58;
}

/* Carousel. Without JS: a horizontal scroll-snap strip with the neighbours peeking in. */
.peek { position: relative; min-width: 0; width: 100%; }
.peek-track {
  list-style: none; margin: 0; padding: 0 calc((100% - var(--slide-w)) / 2);
  display: flex; gap: var(--slide-gap); overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.peek-track::-webkit-scrollbar { display: none; }
.peek-slide { flex: 0 0 var(--slide-w); height: var(--slide-h); scroll-snap-align: center; }
.peek-slide a { display: block; width: 100%; height: 100%; border-radius: var(--slide-r); overflow: hidden; -webkit-user-drag: none; }
.peek-slide img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }

/* JS on: slides are positioned by site.js so the carousel can loop */
.peek.on .peek-track { display: block; position: relative; height: var(--slide-h); padding: 0; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; }
.peek.on .peek-track.is-dragging { cursor: grabbing; }
.peek.on .peek-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--slide-r); }
.peek.on .peek-slide { position: absolute; left: 0; top: 0; width: var(--slide-w); will-change: transform; }
.peek.on .peek-slide img { pointer-events: none; }
.peek-btn {
  position: absolute; top: 50%; z-index: 5; transform: translateY(-50%);
  width: 2.1rem; height: 2.1rem; border-radius: 50%; cursor: pointer;
  border: 1px solid #e3d3de; background: rgba(255, 255, 255, .92); color: var(--accent);
  font: inherit; font-size: .95rem; line-height: 1; box-shadow: var(--shadow);
}
/* centred on the peeking edge on each side */
.peek-btn.prev { left: calc(((100% - var(--slide-w)) / 2 - var(--slide-gap)) / 2 - 1.05rem); }
.peek-btn.next { right: calc(((100% - var(--slide-w)) / 2 - var(--slide-gap)) / 2 - 1.05rem); }
.peek-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.peek-btn[hidden] { display: none; }

/* "Photos coming soon" (A Cappella), same height as a slide */
.peek-placeholder {
  height: var(--slide-h); border-radius: var(--slide-r); display: grid; place-items: center;
  background: linear-gradient(135deg, var(--lavender-tint), var(--pink-tint));
  border: 2px dashed var(--lavender); color: var(--muted); font-style: italic;
}
.peek-placeholder p { margin: 0; }

/* Coaching & Choreography: four equal tiles, [text][photo][text][photo] */
.tile-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.tile { display: block; aspect-ratio: 2 / 3; border-radius: var(--slide-r); overflow: hidden; }
.tile.interest-card { width: auto; height: auto; padding: 1.05rem 1.1rem; font-size: .9rem; line-height: 1.5; }
.tile-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; transition: transform .3s ease; }
@media (hover: hover) { .tile-photo:hover img { transform: scale(1.03); } }

/* Larger cards on /projects/ and /experience/ */
.page-cards .card-grid { gap: 1.35rem; }
.page-cards .card { padding: 1.45rem 1.65rem 1.5rem; }
.page-cards .card-title, .page-cards .card.plain h2 { font-size: 1.45rem; }
.page-cards .card-body { font-size: 1.125rem; }
.page-cards .badge { font-size: .85rem; }

/* ---------- Galleries & figures ---------- */

figure { margin: 1.75rem 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.figure-single img { border-radius: var(--radius); }
.figure-narrow { max-width: 28rem; }

.gallery {
  list-style: none; padding: 0; margin: 1.5rem 0 2.5rem;
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}
.gallery li, .gallery figure { margin: 0; }
.gallery a { display: block; border-radius: 10px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .3s ease; }
.gallery a:hover img { transform: scale(1.03); }
.gallery-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.gallery-2 img { aspect-ratio: 1 / 1; }

/* ---------- Contact ---------- */

/* Contact styles live with the glass boxes above */

/* ---------- Writing list ---------- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.4rem 0; border-top: 1px solid var(--line); }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list h2 { margin: .4rem 0 .35rem; font-size: 1.3rem; line-height: 1.3; }
.post-list h2 a { color: var(--text); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent-strong); text-decoration: underline; }
.post-list p {
  margin: 0; color: #4a4150;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
/* posts with a photo get a square thumbnail on the right */
.post-list li.has-thumb { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; gap: 1.5rem; align-items: center; }
.post-item { min-width: 0; }
.post-thumb { display: block; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.post-thumb img { width: 7rem; height: 7rem; object-fit: cover; object-position: 50% 30%; }

/* ---------- Single post ---------- */

.post { max-width: var(--measure); margin: 0 auto; }
.post-head { margin-bottom: 2rem; }
.post-head h1 { font-size: clamp(1.8rem, 1.35rem + 1.9vw, 2.5rem); margin-top: .7rem; line-height: 1.2; }
.post-body { font-size: 1.1875rem; line-height: 1.75; }
.post-body img { border-radius: 10px; }
.post-body figure > img { margin: 0 auto; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.post-body table { border-collapse: collapse; width: 100%; min-width: 36rem; font-size: .95rem; line-height: 1.55; background: var(--surface); }
.post-body td { border: 1px solid var(--line); padding: .65rem .75rem; vertical-align: top; }
.post-body tr:first-child td { background: var(--pink); }
.post-body td img { max-width: 9rem; margin-top: .4rem; }

.post-nav { display: grid; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav a { text-decoration: none; display: block; }
.post-nav small { display: block; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.post-nav span { font-weight: 600; }
.post-nav .next { text-align: right; }

/* "Entry #… First published" and "Use of AI" notes: set apart from the essay */
.post-notes {
  margin-top: 2.75rem; padding: 1rem 1.25rem;
  background: var(--lavender-tint); border: 1px solid var(--lavender); border-radius: 12px;
  font-size: .9rem; line-height: 1.55; color: var(--muted);
}
.post-body .post-notes p { margin: 0 0 .45rem; }
.post-body .post-notes p:last-child { margin-bottom: 0; }
.post-notes strong { color: var(--text); }

/* "Articles" dropdown at the top of each post (native <details>; site.js only adds close-on-outside-click) */
.articles-menu { position: relative; display: inline-block; margin-bottom: 1.1rem; }
.articles-menu > summary { list-style: none; cursor: pointer; }
.articles-menu > summary::-webkit-details-marker { display: none; }
.articles-menu > summary::marker { content: ""; }
.articles-menu .caret {
  width: .4rem; height: .4rem; margin-left: .1rem;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s ease;
}
.articles-menu[open] .caret { transform: translateY(1px) rotate(-135deg); }
.articles-menu[open] > summary { border-color: var(--accent); color: var(--accent-strong); }
.articles-panel {
  position: absolute; top: calc(100% + .4rem); left: 0; z-index: 5;
  width: min(25rem, calc(100vw - 2rem)); max-height: 19rem; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(42, 32, 48, .13); padding: .35rem;
}
.articles-panel ol { list-style: none; margin: 0; padding: 0; }
.articles-panel a {
  display: flex; justify-content: space-between; align-items: baseline; gap: .9rem;
  padding: .5rem .65rem; border-radius: 8px; text-decoration: none;
  color: var(--text); font-size: .92rem; line-height: 1.35;
}
.articles-panel a:hover { background: var(--pink-tint); color: var(--accent-strong); }
.articles-panel a[aria-current="page"] { background: var(--pink); color: var(--pink-ink); font-weight: 600; }
.articles-panel time { flex: none; font-size: .78rem; font-weight: 400; color: var(--muted); white-space: nowrap; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: .92rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent-strong); }

/* ---------- Smaller screens ---------- */

@media (max-width: 820px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .about-split { grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); gap: 1.5rem 2rem; }
  .about-top { grid-template-columns: minmax(0, 1fr) minmax(0, 15rem); gap: 1.5rem 2rem; }
}
@media (max-width: 960px) {
  .interest-card { font-size: .96rem; line-height: 1.52; padding: 1.2rem 1.25rem; }
  /* Coaching & Choreography: 2×2, each text card next to its photo */
  .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { aspect-ratio: 4 / 5; }
  .tile.interest-card { font-size: .96rem; }
}
@media (max-width: 620px) {
  /* phones: narrow tiles get taller so the text fits */
  .tile-row { gap: .7rem; }
  .tile { aspect-ratio: 9 / 16; }
  .tile.interest-card { font-size: .84rem; line-height: 1.45; padding: .85rem .9rem; }
}
@media (max-width: 380px) {
  .tile { aspect-ratio: 1 / 2; }
  .tile.interest-card { font-size: .8rem; padding: .75rem .8rem; }
}
@media (max-width: 760px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .contact-photo { max-width: 22rem; justify-self: center; }
  .tile-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  /* Interests on phones: text card on top, carousel under it, both centred */
  .interests {
    --slide-gap: .5rem;
    --slide-w: min(19rem, calc(100vw - 2rem - 2 * (2.25rem + .5rem)));  /* screen minus gutters minus two peeking edges */
    --slide-hw: 1.4;
  }
  .interest-row, .interest-row.flip { grid-template-columns: minmax(0, 1fr); }
  .interest-row.flip .interest-card { order: 0; }
  .interest-card { justify-self: center; font-size: .93rem; line-height: 1.5; padding: 1.1rem 1.15rem; }
  .tile.interest-card { justify-self: stretch; }
}
@media (max-width: 380px) {
  /* narrowest phones: cards and slides get taller so the longest text still fits */
  .interests { --slide-hw: 1.55; }
  .interest-card { font-size: .9rem; padding: 1rem 1.05rem; }
}
@media (max-width: 620px) {
  .about-split, .about-top, .glass-row, .glass-row.facts-row { grid-template-columns: minmax(0, 1fr); }
  .about-split .about-photo, .about-top .about-photo { max-width: 15rem; }
  .glass { padding: 1.15rem 1.25rem; }
}

@media (max-width: 720px) {
  :root { --header-h: 5.5rem; }
  body { font-size: 1.0625rem; }
  .wrap { padding: 0 1rem; }
  .site-header .wrap { gap: .2rem 1rem; padding-top: .5rem; padding-bottom: .4rem; }
  .brand img { width: 26px; height: 26px; }
  .wordmark { font-size: 1rem; }
  .site-nav { width: 100%; }
  .site-nav ul { gap: 0 .9rem; }
  .site-nav a { font-size: .88rem; padding: .15rem 0; }
  main { padding-top: 1.75rem; }
  .intro { gap: 1rem 1.15rem; padding-top: .5rem; }
  .portrait { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--pink); }
  .intro h1 { margin-bottom: .75rem; }
  .section { margin-top: 3rem; }
  .card, .page-cards .card { padding: 1rem 1.05rem 1.1rem; }
  .card-title, .page-cards .card-title { font-size: 1.12rem; }
  .card-body, .page-cards .card-body { font-size: 1.0625rem; }
  .post-body { font-size: 1.125rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 460px) {
  :root { --header-h: 4.5rem; }
  .intro { flex-direction: column; align-items: flex-start; }
  /* all six nav words on one line at phone width */
  .site-nav ul { flex-wrap: nowrap; justify-content: space-between; gap: 0 .4rem; }
  .site-nav a { font-size: .82rem; }
  .card summary { gap: .5rem .45rem; }
  .card summary > .badge.date { font-size: .74rem; padding: .1rem .5rem; }
  .edu-logo { width: 46px; height: 46px; padding: 5px; }
  .post-list li.has-thumb { grid-template-columns: minmax(0, 1fr) 4.75rem; gap: 1rem; }
  .post-thumb img { width: 4.75rem; height: 4.75rem; }
}
@media (max-width: 345px) {
  .site-nav ul { flex-wrap: wrap; justify-content: flex-start; gap: 0 .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery img, .toggle::before, .edu-card::before, .articles-menu .caret { transition: none; }
}
