/* ==========================================================================
   Sophia Wang — site stylesheet
   Everything visual lives here. Colors and fonts are set once, at the top,
   in the :root block. Change a value there and it updates everywhere.
   ========================================================================== */

:root {
  /* Colors — warm, light-dominant */
  --ink:        #33291f;   /* deep warm brown, used for the one dark band */
  --ink-2:      #3d3226;   /* slightly lifted */
  --ink-line:   #4d4133;   /* hairlines on the dark band */
  --ink-panel:  #443729;

  --paper:      #fdfaf3;   /* warm cream — the main ground */
  --paper-2:    #f5ece0;   /* warm sand — alternating sections */
  --card:       #ffffff;

  --text:       #4a3f34;   /* warm brown, not black */
  --text-2:     #5d5145;
  --heading:    #33291f;
  --muted:      #6e6151;
  --muted-dark: #c3b5a2;   /* muted text on the dark band */
  --dim:        #756855;

  --line:       #e8ddcb;   /* hairlines on light */
  --line-2:     #e0d3bd;

  --accent:        oklch(0.55 0.13 48);   /* terracotta, for light backgrounds */
  --accent-bright: oklch(0.70 0.13 55);   /* warm amber, buttons */
  --accent-soft:   oklch(0.82 0.09 62);   /* on the dark band */
  --sage:          oklch(0.56 0.05 150);  /* quiet green, second accent */

  /* Type */
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Layout */
  --max:  1160px;
  --pad:  clamp(22px, 5vw, 140px);
  --radius: 10px;
}

/* --- Reset ------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: oklch(0.45 0.12 62); }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* Screen-reader-only text */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent-bright); color: var(--ink);
  padding: 12px 20px; font-weight: 600;
}
.skip:focus { left: 0; }

/* --- Layout helpers ---------------------------------------------------- */

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

.section { padding: clamp(56px, 8vw, 104px) var(--pad); }
.section--paper2 {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section--dark { background: var(--ink); color: #f6f1e8; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #f6f1e8; }

.stack { display: flex; flex-direction: column; }
.gap-8  { gap: 8px; }  .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.gap-20 { gap: 20px; } .gap-24 { gap: 24px; } .gap-32 { gap: 32px; }

/* --- Type styles ------------------------------------------------------- */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.section--dark .eyebrow { color: var(--accent-soft); }

.eyebrow-rule {
  display: flex; align-items: center; gap: 12px;
}
.eyebrow-rule::before {
  content: ""; width: 34px; height: 1px; background: var(--accent-bright);
  flex: none;
}

.display {
  font-family: var(--serif);
  font-size: clamp(40px, 5.6vw, 78px);
  line-height: 1.03;
  letter-spacing: -0.015em;
  text-wrap: balance;
  color: var(--heading);
}
.display em { font-style: italic; color: var(--accent-soft); }

.h2 {
  font-family: var(--serif);
  font-size: clamp(31px, 3.6vw, 46px);
  line-height: 1.1;
  text-wrap: balance;
  color: var(--heading);
}
.h3 {
  font-family: var(--serif);
  font-size: clamp(25px, 2.4vw, 30px);
  line-height: 1.15;
  color: var(--heading);
}

.lede {
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.6;
  color: var(--text-2);
  max-width: 62ch;
}
.section--dark .lede { color: #ded5c6; }

.body { font-size: 16px; line-height: 1.7; color: var(--text-2); max-width: 68ch; }
.body + .body { margin-top: 18px; }
.section--dark .body { color: #ded5c6; }

.small { font-size: 14px; line-height: 1.65; color: var(--muted); }

/* --- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 16px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  text-align: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  min-height: 48px;
}
.btn--primary { background: var(--accent-bright); color: #1a1410; }
.btn--primary:hover { background: oklch(0.63 0.12 62); color: #1a1410; }

.btn--dark { background: var(--ink); color: #f6f1e8; }
.btn--dark:hover { background: #2a2320; color: #f6f1e8; }

.btn--ghost { border-color: #cdbda5; color: var(--text); font-weight: 500; }
.btn--ghost:hover { border-color: var(--accent); color: var(--heading); }
.section--dark .btn--ghost { border-color: #5c4d3c; color: #f7f1e6; }
.section--dark .btn--ghost:hover { border-color: #7d6a53; color: #fff; }

.btn--outline { border-color: #cfc4b3; color: var(--text); font-weight: 500; }
.btn--outline:hover { border-color: var(--muted); color: var(--heading); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.arrow-link {
  font-size: 14px; font-weight: 600; color: var(--accent);
  display: inline-block;
}
.arrow-link:hover { color: oklch(0.45 0.12 62); }

/* --- Header / nav ------------------------------------------------------ */

.site-header {
  background: var(--ink);
  color: #f6f1e8;
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 18px var(--pad);
  max-width: var(--max); margin: 0 auto;
}
.brand { display: flex; flex-direction: column; gap: 2px; color: #f6f1e8; }
.brand:hover { color: #f6f1e8; }
.brand__name { font-family: var(--serif); font-size: 21px; letter-spacing: 0.01em; }
.brand__creds {
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-dark);
}

.header-controls { display: flex; align-items: center; gap: 20px; }

.lang-switch { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.lang-switch a { color: var(--muted-dark); padding: 5px 8px; border-radius: 6px; }
.lang-switch a:hover { color: #fff; }
.lang-switch a[aria-current="true"] { color: #fff; background: var(--ink-line); font-weight: 500; }
.lang-switch .lang-sep { color: var(--ink-line); font-size: 11px; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a { font-size: 14px; color: #ded5c6; }
.nav a:hover { color: #fff; }
.nav a[aria-current="page"] { color: var(--accent-soft); }

/* The dropdown sits --nav-gap below the trigger. The gap is kept visually but
   bridged for hover in two ways: the .nav-item's bottom padding extends the
   trigger's hover box, and the dropdown's ::before is a transparent strip
   that fills the gap above the panel, so the pointer never leaves the pair.
   A short close delay lives in site.js. */
.nav-item { --nav-gap: 14px; position: relative; padding-bottom: var(--nav-gap); margin-bottom: calc(-1 * var(--nav-gap)); }
.nav-dropdown {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%; left: 0;
  padding: 6px;
  min-width: 230px;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  z-index: 60;
}
.nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: calc(-1 * var(--nav-gap) - 1px);
  height: calc(var(--nav-gap) + 1px);
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown,
.nav-item.is-open .nav-dropdown { display: flex; }
.nav-dropdown a {
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.nav-dropdown a:hover { background: var(--ink-line); color: #fff; }

.nav-toggle {
  display: none;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  background: none; border: 0; color: #f6f1e8; cursor: pointer;
}

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink-2);
    border-top: 1px solid var(--ink-line);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--pad) 20px;
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 15px 0;
    border-bottom: 1px solid var(--ink-line);
    font-size: 16px;
  }
  .nav-dropdown {
    display: flex !important;
    position: static;
    margin-top: 0;
    padding: 0 0 0 18px;
    background: none;
    border: 0;
    border-radius: 0;
  }
  .nav-dropdown::before { display: none; }
  .nav-dropdown a {
    padding: 12px 0;
    border-bottom: 1px solid var(--ink-line);
    font-size: 14px;
    color: var(--muted-dark);
    white-space: normal;
  }
}

/* --- Hero -------------------------------------------------------------- */

.hero {
  background: linear-gradient(168deg, #fdfaf3 0%, #f7efe2 100%);
  color: var(--text);
  padding: clamp(48px, 7vw, 96px) var(--pad) clamp(56px, 8vw, 110px);
}
.hero__grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.35fr 1fr;
  gap: clamp(32px, 4vw, 48px); align-items: center;
}
/* Text inside the dark hero and page-intro bands must be light. Without
   this, .lede and .body keep their dark-on-light colors and become
   unreadable on the near-black background. */
/* Hero and page-intro are light now; only the dark band inverts. */
.hero .display, .hero .h2, .hero .h3 { color: var(--heading); }
.hero .lede, .hero .body { color: var(--text-2); }
.hero .small { color: var(--muted); }
.hero .display em { color: var(--accent); }

.page-intro .display, .page-intro .h2, .page-intro .h3 { color: var(--heading); }
.page-intro .lede, .page-intro .body { color: var(--text-2); }
.page-intro .small { color: var(--muted); }
.page-intro .display em { color: var(--accent); }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
}

/* --- Image placeholder ------------------------------------------------- */

.ph {
  width: 100%;
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 20px;
}
.ph--dark {
  background: linear-gradient(155deg, #2b2320 0%, #1c1714 100%);
  border: 1px solid #352d27; color: var(--dim);
}
.ph--light {
  background: #ece5d8; border: 1px solid var(--line); color: var(--muted-dark);
}
.ph--tall  { min-height: 480px; }
.ph--mid   { min-height: 360px; }

@media (max-width: 900px) { .ph--tall { min-height: 320px; } }

/* --- Credential strip -------------------------------------------------- */

.creds {
  background: var(--paper-2); color: var(--muted);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px var(--pad);
}
.creds__list {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 20px;
  font-size: 12px; letter-spacing: 0.11em; text-transform: uppercase;
}
.creds__list li::after { content: " /"; color: var(--line-2); margin-left: 18px; }
.creds__list li:last-child::after { content: ""; margin: 0; }

/* --- Section headers --------------------------------------------------- */

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 48px; margin-bottom: clamp(32px, 4vw, 52px);
  flex-wrap: wrap;
}
.section-head__main { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }

/* --- Cards ------------------------------------------------------------- */

.cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; gap: 18px;
  padding: clamp(26px, 3vw, 40px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(94, 72, 44, .04), 0 8px 24px rgba(94, 72, 44, .045);
}
.card p { font-size: 15px; line-height: 1.68; color: var(--text-2); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.tag {
  font-size: 12px; padding: 5px 11px;
  background: var(--paper-2); color: var(--dim);
  border-radius: 999px;
}
.card--white .tag { background: var(--paper-2); }

/* --- Numbered steps ---------------------------------------------------- */

.steps { display: flex; flex-direction: column; }
.step {
  display: flex; gap: 24px; padding: 26px 0;
  border-bottom: 1px solid var(--line-2);
}
.step:first-child { border-top: 1px solid var(--line-2); }
.step__num {
  font-family: var(--serif); font-size: 34px;
  color: oklch(0.74 0.11 55); min-width: 54px; line-height: 1.1;
}
.step__body { display: flex; flex-direction: column; gap: 7px; }
.step__title { font-size: 17px; font-weight: 600; color: var(--heading); }
.step p { font-size: 15px; line-height: 1.65; color: var(--dim); }

@media (max-width: 560px) {
  .step { gap: 16px; }
  .step__num { font-size: 26px; min-width: 38px; }
}

/* --- Two-column split -------------------------------------------------- */

.split {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 4vw, 56px);
}
.split--even  { grid-template-columns: 1fr 1fr; align-items: center; }
.split--media { grid-template-columns: 4fr 8fr; align-items: start; }
@media (max-width: 900px) {
  .split, .split--even, .split--media { grid-template-columns: 1fr; }
}

/* --- Events list ------------------------------------------------------- */

.events { border-top: 1px solid var(--line); }
.event {
  display: grid;
  grid-template-columns: 120px 1fr 190px 150px;
  gap: 28px; align-items: center;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.event__date { display: flex; flex-direction: column; gap: 2px; }
.event__day {
  font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--heading);
}
.event__month {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.event__title { font-size: 20px; font-weight: 600; color: var(--heading); }
.event__desc { font-size: 14px; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.event__where {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 14px; color: var(--muted);
}
.event__time { color: var(--text-2); }
.event__kind {
  display: inline-block; margin-bottom: 8px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
}

@media (max-width: 900px) {
  .event { grid-template-columns: 90px 1fr; gap: 20px; }
  .event__where { grid-column: 2; }
  .event .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 520px) {
  .event { grid-template-columns: 1fr; gap: 12px; }
  .event__where, .event .btn { grid-column: 1; }
  .event__date { flex-direction: row; align-items: baseline; gap: 10px; }
}

.events-empty {
  padding: 40px 0; border-bottom: 1px solid var(--line);
  font-size: 16px; color: var(--muted);
}

/* --- Callout box ------------------------------------------------------- */

.callout {
  padding: clamp(24px, 3vw, 34px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 14px;
}
.callout--warn { background: #fdf8ef; border-color: #e8dcc2; }
.callout__title { font-size: 17px; font-weight: 600; color: var(--heading); }

/* --- Plain prose list -------------------------------------------------- */

.checklist { display: flex; flex-direction: column; gap: 14px; }
/* The bullet is absolutely positioned rather than a flex sibling. With flex,
   a <strong> and the text after it became separate flex items and got pushed
   apart — text must stay in normal inline flow. */
.checklist li {
  position: relative;
  padding-left: 21px;
  font-size: 16px; line-height: 1.65; color: var(--text-2);
}
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: 0.62em;
  width: 7px; height: 7px;
  background: var(--accent-bright); border-radius: 50%;
}

/* --- Form -------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--heading); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 16px; color: var(--text);
  padding: 14px 16px; min-height: 50px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent-bright); outline: none;
}
.field__hint { font-size: 13px; color: var(--muted); }

/* --- CTA band ---------------------------------------------------------- */

.cta-band {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding: clamp(56px, 7vw, 92px) var(--pad);
}
.cta-band__inner {
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px; text-align: center;
}
.cta-band .h2 { font-size: clamp(32px, 4vw, 50px); }

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

.site-footer {
  background: var(--ink); color: var(--muted-dark);
  padding: clamp(44px, 6vw, 64px) var(--pad) 40px;
}
.site-footer__grid {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--ink-line);
}
@media (max-width: 860px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 520px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}
.site-footer a { color: var(--muted-dark); font-size: 14px; }
.site-footer a:hover { color: #f6f1e8; }
.footer__title { font-family: var(--serif); font-size: 23px; color: #f6f1e8; }
.footer__label {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #a9997f; margin-bottom: 4px;
}
.footer__col { display: flex; flex-direction: column; gap: 11px; }
.legal {
  max-width: var(--max); margin: 0 auto;
  font-size: 12px; line-height: 1.7; color: #a9997f;
  padding-top: 26px;
}

/* --- Page intro (inner pages) ------------------------------------------ */

.page-intro {
  background: linear-gradient(168deg, #fdfaf3 0%, #f7efe2 100%);
  color: var(--text);
  padding: clamp(48px, 6vw, 84px) var(--pad) clamp(48px, 6vw, 76px);
  border-bottom: 1px solid var(--line);
}
.page-intro__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
}
.page-intro .display { font-size: clamp(36px, 4.6vw, 62px); }

/* --- Print ------------------------------------------------------------- */

@media print {
  .site-header, .nav-toggle, .cta-band, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}

/* --- Two-line wordmark for the Center ---------------------------------- */
.brand__name { line-height: 1.06; }
@media (max-width: 940px) { .brand__name { font-size: 18px; } }

/* --- Inline code, and long-string safety ------------------------------- */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 2px 5px;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
p, li, h1, h2, h3, .display, .h2, .h3 { overflow-wrap: break-word; }

/* --- Grid children must be allowed to shrink -----------------------------
   Grid and flex items default to min-width:auto, which lets form inputs
   (and long words) push a column wider than the screen. This is the fix. */
.split > *, .cards > *, .hero__grid > *, .site-footer__grid > * { min-width: 0; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
.form { width: 100%; }

/* --- Photographs dropped into assets/img/ ------------------------------- */
.ph--filled {
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
}
.ph-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
