/* ============================================================
   chaeyoungpiano.com — stylesheet
   Colors and fonts are defined once below; change them here.
   ============================================================ */

:root {
  --bg: #faf9f6;          /* warm ivory page background */
  --bg-alt: #f3f1ec;      /* alternating section background (stone) */
  --ink: #121212;         /* main text */
  --ink-soft: #5f5b55;    /* secondary text */
  --line: #e5e5e5;        /* hairlines */
  --line-strong: #d1d1d1; /* hairlines that need more presence */
  --dark: #121212;        /* contact band */
  --on-dark: #faf9f6;     /* text on the contact band */

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max: 1152px;
  --gutter: clamp(16px, 5vw, 48px);
  --header: 64px;
}

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

/* smooth scrolling starts after load, so a shared link like /#about opens in place */
html { scroll-padding-top: var(--header); }
html.loaded { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 20;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
}
.skip:focus { top: 12px; }

/* ---------- Placeholders ----------
   On the public page, any item that still holds a placeholder is not shown
   (the script also hides groups and sections left with no finished items).
   With ?preview (html.preview) they show up in a dashed box instead. */
html:not(.preview) :is(li, figure, .contact-grid > div:not(.group)):has(.ph) { display: none; }
/* Without JavaScript, keep any section that still holds unfinished items off the page entirely */
html:not(.js) main > section:has(:is(li, figure, .contact-grid) .ph) { display: none; }
.ph {
  background: rgba(26, 26, 26, 0.05);
  outline: 1px dashed rgba(26, 26, 26, 0.35);
  outline-offset: 2px;
}

/* ---------- Links & buttons ---------- */
.text-link,
.nav-links a {
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s ease;
}
.text-link { background-size: 100% 1px; padding-bottom: 2px; }
.text-link:hover { background-size: 0 1px; background-position: 100% 100%; }
.nav-links a:hover { background-size: 100% 1px; }

.btn,
.c-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}
.btn:hover,
.c-link:hover { background: var(--ink); color: var(--bg); }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-header.scrolled,
.site-header.menu-open {
  background: rgba(250, 249, 246, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
}
.brand {
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.nav-links { display: flex; gap: clamp(18px, 2.2vw, 32px); }
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding-bottom: 3px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px 4px;
  cursor: pointer;
  color: var(--ink);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 0.3s;
}
.nav-toggle span + span { margin-top: 7px; }
.menu-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--header) + 32px) 0 64px;
  border-bottom: 1px solid var(--line);
}
.hero-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
}
/* No hero photo: the name alone carries the hero, so it can go larger */
.hero-grid.no-photo { grid-template-columns: minmax(0, 1fr); }
.hero-grid.no-photo h1 { font-size: clamp(56px, 18vw, 176px); }
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 128px);
  line-height: 0.86;
  letter-spacing: -0.01em;
  margin: 0 0 36px;
}
.hero-role {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0 0 20px;
}
.hero-intro {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 40ch;
  margin: 0 0 36px;
  text-wrap: balance;
}
.hero-photo { margin: 0; }
.hero-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 76svh;
  object-fit: cover;
  object-position: 50% 25%;
  background: var(--bg-alt);
}

/* ---------- Sections ---------- */
main > section:not(.hero) { padding: clamp(80px, 11vw, 128px) 0; }
section.alt { background: var(--bg-alt); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 48px;
  margin-bottom: clamp(48px, 6vw, 72px);
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 5.5vw, 68px);
  line-height: 1;
  margin: 0;
}
.section-head p {
  margin: 0;
  max-width: 56ch;
  color: var(--ink-soft);
  text-wrap: balance;
}

h3 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

/* Hairline rows: title above, detail below */
.rows { border-top: 1px solid var(--line-strong); }
.rows li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}
.rows li > span { display: block; }
.rows li > span:first-child { font-weight: 500; font-size: 15px; }
.rows li > span + span { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- About ----------
   One 3-column grid: portrait | bio (two columns), then the facts across all three.
   Without a portrait, the bio takes two columns and the facts stack in the third. */
.about-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  align-items: start;
}
.portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--bg-alt);
  position: sticky;
  top: calc(var(--header) + 24px);
}
.bio { grid-column: 2 / -1; }
.bio p { margin: 0 0 1.2em; max-width: 40rem; }
.bio .lead {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 31px);
  line-height: 1.35;
  margin-bottom: 1em;
}

.bio-switch {
  display: flex;
  align-items: flex-end;
  /* same height as a facts heading (24px × 1.2 + 16px) plus its rule, so the two lines meet */
  min-height: calc(28.8px + 17px);
  gap: 28px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.bio-switch button {
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.bio-switch button:hover { color: var(--ink); }
.bio-switch button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

.presskit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line-strong);
}
.presskit h3 { margin: 0; }
.presskit-links { display: flex; flex-wrap: wrap; gap: 12px; }
.presskit-links .btn { white-space: normal; }

.facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 40px;
  margin-top: clamp(16px, 5vw, 56px);
}
/* Fact columns share the heading row, so their hairlines line up even when a heading wraps */
.facts > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.facts h3 { align-self: end; }

.about-grid.no-portrait .bio { grid-column: 1 / 3; }
.about-grid.no-portrait .facts { grid-column: 3; grid-row: 1; grid-template-columns: minmax(0, 1fr); margin-top: 0; }

/* ---------- Calendar ---------- */
.events { border-top: 1px solid var(--line-strong); }
.events li {
  display: grid;
  grid-template-columns: 9rem 2fr 1.2fr 6.5rem;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.events .event-labels span:last-child { justify-self: end; }
.events .event-labels {
  padding: 10px 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.events p { margin: 0; }
.e-date { font-family: var(--serif); font-size: 20px; }
.e-title { font-family: var(--serif); font-size: 21px; line-height: 1.3; }
.events .e-works { font-size: 14px; color: var(--ink-soft); margin-top: 4px; }
.e-venue { font-size: 14px; line-height: 1.5; }
.e-venue p + p { color: var(--ink-soft); }
.c-link { justify-self: end; font-size: 13px; padding: 8px 14px; }
.past-head { margin-top: 72px; }
.past li { padding: 16px 0; }
.past .e-date { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); }
.past .e-title { font-size: 19px; }

/* ---------- Media ---------- */
.videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 56px 48px;
}
.video {
  aspect-ratio: 16 / 9;
  background: var(--line);
}
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.v-work {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.3;
  margin: 18px 0 4px;
}
.v-meta { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* ---------- Repertoire ---------- */
.rep { border-top: 1px solid var(--line-strong); }
.rep details { border-bottom: 1px solid var(--line-strong); }
.rep summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 22px 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 30px);
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}
.rep summary::-webkit-details-marker { display: none; }
.rep summary::after {
  content: "+";
  content: "+" / "";
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 300;
  color: var(--ink-soft);
  transition: transform 0.3s;
}
.rep details[open] summary::after { transform: rotate(45deg); }
.rep summary:hover::after { color: var(--ink); }
.rep ul {
  columns: 2;
  column-gap: 48px;
  padding-bottom: 28px;
}
.rep li {
  break-inside: avoid;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  line-height: 1.4;
}
.rep .composer { display: block; width: fit-content; font-size: 13px; color: var(--ink-soft); margin-bottom: 2px; }
.rep .work { font-family: var(--serif); font-size: 19px; }

/* ---------- Press ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 48px;
}
.quote {
  margin: 0;
  padding-top: 32px;
  border-top: 1px solid var(--line-strong);
}
.quote blockquote {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(23px, 2.5vw, 29px);
  line-height: 1.4;
}
.quote figcaption { font-size: 14px; color: var(--ink-soft); }

.articles-head { margin-top: 80px; }
.articles a {
  display: flex;
  justify-content: space-between;
  gap: 8px 24px;
  flex-wrap: wrap;
  align-items: baseline;
  text-decoration: none;
  transition: opacity 0.2s;
}
.articles a:hover { opacity: 0.6; }
.articles a > span:first-child { font-family: var(--serif); font-size: 20px; }
.articles a > span + span { font-size: 14px; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact {
  background: var(--dark);
  color: var(--on-dark);
}
.contact .section-head p,
.contact h3,
.contact .muted { color: rgba(250, 249, 246, 0.62); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
}
.contact-big {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.3;
  text-decoration: none;
  border-bottom: 1px solid rgba(250, 249, 246, 0.35);
  overflow-wrap: anywhere;
  transition: border-color 0.2s;
}
.contact-big:hover { border-bottom-color: currentColor; }
.contact-grid p { margin: 0 0 6px; }
.socials { display: grid; gap: 6px; }
.socials a { text-decoration: none; border-bottom: 1px solid rgba(250, 249, 246, 0.3); transition: border-color 0.2s; }
.socials a:hover { border-bottom-color: currentColor; }
.contact .ph { background: rgba(250, 249, 246, 0.08); outline-color: rgba(250, 249, 246, 0.45); }
.ph:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
/* Preview only: show buttons that are still waiting for their file */
html.preview .btn.ph[hidden] { display: inline-block !important; pointer-events: none; }
/* Without JavaScript the biography switch can't work, so leave only the full bio */
html:not(.js) .bio-switch { display: none; }

.site-footer {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { min-height: 0; padding-bottom: clamp(64px, 10vw, 96px); }
  .about-grid { gap: 32px; }
  .portrait { grid-column: 1 / -1; max-height: max(70svh, 480px); object-position: 50% 25%; position: static; }
  .bio,
  .about-grid.no-portrait .bio { grid-column: 1 / -1; }
  .about-grid.no-portrait .facts { grid-column: 1 / -1; grid-row: auto; grid-template-columns: subgrid; margin-top: 24px; }
  .events li { grid-template-columns: 7rem 1fr; gap: 10px 24px; }
  .events .event-labels { display: none; }
  .e-venue, .c-link { grid-column: 2; }
  .c-link { justify-self: start; }
}

@media (max-width: 760px) {
  .nav-toggle:not([hidden]) { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 28px;
  }
  .nav-links.open { display: flex; }
  .site-header.menu-open { background: var(--bg); }
  .nav-links a {
    display: inline-block;
    padding: 10px 0;
    font-family: var(--serif);
    font-size: 30px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
    line-height: 1.2;
  }

  .hero { padding-top: calc(var(--header) + 40px); }
  .hero h1 { font-size: 18vw; }  /* "Chaeyoung" is ~4.3em, so this fills the width without overflowing */
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .hero-photo img { max-height: 62svh; }

  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .bio { grid-column: auto; }
  .facts,
  .about-grid.no-portrait .facts { grid-template-columns: minmax(0, 1fr); margin-top: 16px; }
  .facts > div { display: block; grid-row: auto; }
  .videos, .quotes, .contact-grid { grid-template-columns: 1fr; }
  .rep ul { columns: 1; }

  .events li { grid-template-columns: 1fr; gap: 6px; }
  .e-venue, .c-link { grid-column: auto; }
  .e-date { font-size: 17px; }
  .c-link { margin-top: 8px; }
}

/* ---------- Scroll reveal ---------- */
/* The transition lives on .in only, so adding .reveal hides instantly (no fade-out flash) */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media print {
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .site-header { position: static; }
  .hero { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  html, html.loaded { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
