/* ==========================================================================
   Los Gatos Math Circle
   A quiet, editorial, minimal theme. Warm paper, ink type, hairline rules,
   a serif for headings. No gradients, no heavy shadows.
   ========================================================================== */

:root {
  --paper: #faf8f4;     /* warm near-white page background */
  --bg: #ffffff;        /* cards / panels */
  --ink: #1b1915;       /* warm near-black text */
  --ink-soft: #43403a;  /* secondary text */
  --muted: #79756c;     /* captions, meta */
  --line: #e6e1d7;      /* hairline borders */
  --line-strong: #d8d2c5;
  --accent: #5b5346;    /* restrained warm taupe for small touches */

  --maxw: 1100px;
  --measure: 40rem;     /* comfortable reading width */

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1rem; }

a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--line-strong); transition: text-decoration-color .15s ease, color .15s ease; }
a:hover { text-decoration-color: var(--ink); }

/* ----- Layout ----- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 1.5rem; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--hairline { border-top: 1px solid var(--line); }

.measure { max-width: var(--measure); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  display: block;
}

.lede { font-size: 1.18rem; line-height: 1.6; color: var(--ink-soft); }
.muted { color: var(--muted); }

/* ----- Buttons / links ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: #000; color: #fff; }
.btn--outline:hover { background: var(--ink); color: var(--paper); }
.btn--light { border-color: rgba(255,255,255,0.6); color: #fff; }
.btn--light:hover { background: #fff; color: var(--ink); border-color: #fff; }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--sans);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.arrow-link:hover { color: var(--accent); border-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* ----- Header / nav ----- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }

.brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  min-width: 0;
}
.brand span { white-space: nowrap; }
.brand__mark { width: 26px; height: 26px; flex: none; display: block; object-fit: contain; transition: opacity .15s ease; }
.brand:hover { color: var(--ink); }
.brand:hover .brand__mark { opacity: 0.7; }

.nav__links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-family: var(--sans);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.is-active { color: var(--ink); border-color: var(--ink); }

.nav__toggle {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav__toggle span { display: block; width: 19px; height: 1.5px; background: var(--ink); }

/* ----- Hero ----- */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 { margin-bottom: 1.2rem; }
.hero .lede { max-width: 32rem; }
.hero__media {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__actions { margin-top: 1.8rem; }

/* ----- Generic media frame ----- */
.frame { border: 1px solid var(--line); overflow: hidden; background: var(--bg); }
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* ----- Two-column feature ----- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split--media-first .split__media { order: -1; }
.split--media-wide { grid-template-columns: 0.82fr 1.18fr; }
.split__media { aspect-ratio: 5 / 4; }

/* ----- Columns (simple, no chips) ----- */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 3rem); }
.col__n {
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.col h3 { margin-bottom: 0.4rem; }
.col p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.98rem; }
.col + .col { /* hairline divider on wide screens handled by gap */ }

/* ----- Newsletter signup ----- */
.signup {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
}
.signup__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.signup h2 { margin-bottom: 0.5rem; }
.signup p { color: var(--ink-soft); margin-bottom: 0; }
.signup form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }
.signup form label { flex: 1 1 100%; margin-bottom: 0; }
.signup input[type="email"] {
  flex: 1 1 14rem;
  min-width: 0;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
}
.signup form .btn { flex: 0 0 auto; }
.signup input[type="email"]:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.signup .note { font-size: 0.82rem; color: var(--muted); margin: 0.7rem 0 0; }
.signup__ok { font-size: 0.95rem; color: var(--ink); margin: 0.7rem 0 0; display: none; }
.signup.is-done .signup__ok { display: block; }

/* ----- Facts list (meetings) ----- */
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.facts li:last-child { border-bottom: 1px solid var(--line); }
.facts .k { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 0.15rem; }
.facts .v { color: var(--ink); }
.facts .v strong { font-weight: 600; }

/* ----- Map ----- */
.map { border: 1px solid var(--line); overflow: hidden; }
.map iframe { width: 100%; height: 380px; border: 0; display: block; filter: grayscale(0.2); }
.map.split__media { aspect-ratio: 4 / 3; }
.map.split__media iframe { height: 100%; }

/* ----- Schedule ----- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.schedule { width: 100%; border-collapse: collapse; }
.schedule th, .schedule td { text-align: left; padding: 0.85rem 0.5rem; border-bottom: 1px solid var(--line); font-size: 0.97rem; vertical-align: top; }
.schedule thead th { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.schedule td:first-child { white-space: nowrap; color: var(--muted); width: 9rem; }
.schedule .a { font-weight: 600; }

/* ----- Levels ----- */
.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
.level { border-top: 2px solid var(--ink); padding-top: 1rem; }
.level .grade { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.level h3 { margin: 0.3rem 0 0.4rem; }
.level p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }

/* ----- Issues (newsletter archive) ----- */
.issue-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.75rem, 4vw, 2.75rem); }
.issue { display: flex; flex-direction: column; }
.issue__media { aspect-ratio: 3 / 2; overflow: hidden; border: 1px solid var(--line); margin-bottom: 1rem; }
.issue__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.issue:hover .issue__media img { transform: scale(1.03); }
.issue__meta { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.issue__stats { margin-bottom: 0.5rem; }
.issue h3 { font-size: 1.3rem; margin-bottom: 0.5rem; line-height: 1.25; }
.issue h3 a { text-decoration: none; }
.issue h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.issue p { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0.9rem; }
.issue .arrow-link { margin-top: auto; font-size: 0.92rem; }

/* ----- View / like stats ----- */
.issue-stats { display: inline-flex; align-items: center; gap: 1rem; }
.stat { display: inline-flex; align-items: center; gap: 0.32rem; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; letter-spacing: 0; text-transform: none; }
.stat-ic { width: 1em; height: 1em; flex: none; display: block; }
.stat--like { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: var(--muted); transition: color .15s ease; }
.stat--like:hover { color: #d23b53; }
.stat.is-liked, .stat--like.is-liked { color: #d23b53; --heart-fill: currentColor; }

/* ----- Page intro (interior pages) ----- */
.page-intro { padding-block: clamp(3rem, 7vw, 5rem); border-bottom: 1px solid var(--line); }
.page-intro h1 { margin-bottom: 1rem; }
.page-intro p { color: var(--ink-soft); max-width: 38rem; margin: 0; font-size: 1.1rem; }

/* ----- Article (single issue) ----- */
.issue-header { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2rem); }
.issue-header .container { max-width: var(--measure); }
.issue-header .kicker { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; }
.issue-header h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
.issue-header .byline { color: var(--muted); font-size: 0.92rem; margin-top: 0.6rem; }

.issue-cover { max-width: var(--maxw); margin: 0 auto; padding-inline: 1.5rem; }
.issue-cover .frame { aspect-ratio: 16 / 7; }

.article { max-width: var(--measure); margin-inline: auto; padding-block: clamp(2rem, 5vw, 3rem); font-size: 1.08rem; color: var(--ink-soft); }
.article h2 { margin-top: 2.4rem; font-size: 1.55rem; color: var(--ink); }
.article h3 { margin-top: 1.8rem; font-size: 1.2rem; color: var(--ink); }
.article p { margin-bottom: 1.2rem; }
.article ul, .article ol { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.article li { margin-bottom: 0.4rem; }
.article a { color: var(--ink); }
.article strong { color: var(--ink); }
.article blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.3rem;
  border-left: 2px solid var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink);
}
.article hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Note (callout, no emoji) */
.note {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 1.1rem 0;
  margin: 1.8rem 0;
  font-size: 1rem;
  color: var(--ink);
}
.note .label { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.35rem; }

/* Display math spacing */
/* Display math spacing, and keep long equations from breaking the layout */
mjx-container[display="true"] { margin: 1.4rem 0 !important; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
mjx-container { max-width: 100%; }

.issue-nav { max-width: var(--measure); margin: 0 auto; padding: 1.5rem 1.5rem 0; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); }
.issue-nav a { font-size: 0.92rem; max-width: 48%; }

.back-link { display: inline-block; font-family: var(--sans); font-size: 0.9rem; margin-bottom: 1.2rem; text-decoration: none; color: var(--muted); }
.back-link:hover { color: var(--ink); }

/* ----- Footer ----- */
.site-footer { border-top: 1px solid var(--line); padding-block: 3rem 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; }
.site-footer .brand { margin-bottom: 0.6rem; }
.site-footer p { color: var(--muted); font-size: 0.95rem; max-width: 24rem; }
.site-footer h4 { font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 0.9rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer-links a { font-size: 0.95rem; text-decoration: none; color: var(--ink-soft); }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { margin-top: 2.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); }

/* ----- Utilities ----- */
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.6rem; }
.mb-0 { margin-bottom: 0; }

/* ----- Responsive ----- */
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; aspect-ratio: 16 / 10; }
  .split { grid-template-columns: 1fr; }
  .split--media-first .split__media { order: -1; }
  .signup__grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .levels { grid-template-columns: 1fr; }
  .issue-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .issue-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .facts li { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ==========================================================================
   Achievements
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
.stat { border-top: 2px solid var(--ink); padding-top: 1rem; }
.stat .n { font-family: var(--serif); font-size: 2.6rem; line-height: 1; }
.stat .l { color: var(--muted); font-size: 0.92rem; margin-top: 0.4rem; }

.achievement-list { list-style: none; margin: 0; padding: 0; }
.achievement { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.5rem; padding: 1.7rem 0; border-top: 1px solid var(--line); }
.achievement:last-child { border-bottom: 1px solid var(--line); }
.achievement .year { font-family: var(--serif); font-size: 1.25rem; color: var(--muted); }
.achievement h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.achievement p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.achievement .where { font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 0.5rem; }

.badge {
  display: inline-block; font-family: var(--sans);
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 0.16rem 0.5rem; border-radius: 2px;
  margin-left: 0.5rem; vertical-align: middle; color: var(--ink);
}

/* Highlighted feature card (e.g., HiMCM) */
.feature-card {
  border: 1px solid var(--ink);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center;
}
.feature-card h2 { margin-bottom: 0.5rem; }
.feature-card p { margin-bottom: 0; color: var(--ink-soft); }
.feature-card .mark { text-align: center; border-left: 1px solid var(--line); padding-left: 2rem; }
.feature-card .mark .big { font-family: var(--serif); font-size: 2.4rem; line-height: 1; }
.feature-card .mark .sub { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 0.4rem; }

/* ==========================================================================
   Team roster: member cards with photo + LinkedIn
   ========================================================================== */
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.team-grid--leads { margin-top: 1.75rem; }

.person {
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color .2s ease, transform .2s ease;
}
.person:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.person__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  flex: none;
  overflow: hidden;
  background: #f0ece3;
  border-bottom: 1px solid var(--line);
}
.person__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.person__role {
  position: absolute; top: 0.85rem; left: 0.85rem;
  font-family: var(--sans); font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper); background: var(--ink);
  padding: 0.26rem 0.55rem; border-radius: 2px;
}
.person--lead .person__role { color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); }

.person__body { padding: 1.05rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.person__name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0; line-height: 1.2; }
.person__meta { font-size: 0.86rem; color: var(--muted); margin: 0; }
.person__links { margin-top: 0.7rem; }
.person__linkedin {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
  text-decoration: none; color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 2px;
  padding: 0.32rem 0.6rem;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.person__linkedin:hover { color: var(--ink); border-color: var(--ink); background: var(--paper); }
.person__linkedin svg { width: 15px; height: 15px; flex: none; }

/* ==========================================================================
   Forms (apply, generic confirm-in-place)
   ========================================================================== */
.form { border: 1px solid var(--line-strong); background: var(--bg); padding: clamp(1.5rem, 4vw, 2.5rem); }
.form__head { margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.form__head h3 { margin: 0 0 0.2rem; font-size: 1.4rem; }
.form__head p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
.field { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.field label { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.field .req { color: var(--ink); }
.field input, .field select, .field textarea {
  font-family: var(--sans); font-size: 1rem; padding: 0.72rem 0.85rem;
  border: 1px solid var(--line-strong); border-radius: 2px;
  background: var(--paper); color: var(--ink); width: 100%;
}
.field textarea { resize: vertical; min-height: 6.5rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.form__actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.4rem; }
.form__actions .btn { width: auto; }
.form__note { margin: 0; color: var(--muted); font-size: 0.86rem; }
.form__ok { display: none; }
.form.is-done .form__ok { display: block; }
.form.is-done .form__fields { display: none; }

/* ==========================================================================
   Problem set
   ========================================================================== */
.ruleset { list-style: none; margin: 0; padding: 0; }
.ruleset li { display: grid; grid-template-columns: 1.8rem 1fr; gap: 0.6rem; padding: 0.5rem 0; color: var(--ink-soft); }
.ruleset .num { font-family: var(--serif); color: var(--muted); }

.problem { padding: 1.9rem 0; border-top: 1px solid var(--line); }
.problem:last-child { border-bottom: 1px solid var(--line); }
.problem__head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 0.7rem; flex-wrap: wrap; }
.problem__n { font-family: var(--serif); font-size: 1.4rem; line-height: 1; }
.problem__topic { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); padding: 0.14rem 0.5rem; border-radius: 2px; }
.problem__star { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-left: auto; }
.problem p { margin: 0 0 0.7rem; color: var(--ink); }
.problem .hint { color: var(--muted); font-size: 0.92rem; margin-bottom: 0; }

/* ==========================================================================
   Apply section
   ========================================================================== */
.apply-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; margin-top: 2rem; }
.apply-step { border-top: 2px solid var(--ink); padding-top: 1rem; }
.apply-step .s { font-family: var(--serif); font-size: 1.4rem; line-height: 1; color: var(--muted); }
.apply-step h3 { margin: 0.4rem 0 0.3rem; font-size: 1.05rem; }
.apply-step p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }
.apply-form { max-width: 720px; margin: 2.5rem auto 0; }

/* Wide image band */
.frame--wide { aspect-ratio: 16 / 6; }
.media-cap { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--muted); }
@media (max-width: 720px) { .frame--wide { aspect-ratio: 4 / 3; } }

@media (max-width: 860px) {
  /* Collapse nav to a slide-down menu before the 5 links crowd the brand */
  .nav__links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.5rem 1.5rem 1.2rem;
    transform: translateY(-130%); transition: transform .25s ease;
    box-shadow: 0 16px 30px -22px rgba(27, 25, 21, 0.5);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .nav__toggle { display: flex; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .achievement { grid-template-columns: 1fr; gap: 0.3rem; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-card .mark { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 1.5rem; text-align: left; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .apply-steps { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .container { padding-inline: 1.15rem; }
  .team-grid { grid-template-columns: 1fr; }
  .schedule th, .schedule td { padding: 0.6rem 0.4rem; font-size: 0.9rem; }
  .schedule td:first-child { width: auto; }
  .signup, .form { padding: 1.25rem; }
  .actions .btn { width: 100%; justify-content: center; }
  .form__actions .btn { width: 100%; }
}

/* ==========================================================================
   Presentations schedule
   ========================================================================== */
.year-block { margin-bottom: 3.5rem; }
.year-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 0.8rem; border-bottom: 2px solid var(--ink); margin-bottom: 0.5rem; }
.year-head h2 { margin: 0; }
.year-head .yr-meta { font-size: 0.85rem; color: var(--muted); }

.sched-row { display: grid; grid-template-columns: 3rem 9.5rem 1fr auto; gap: 1rem; align-items: baseline; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.sched-row .sr-n { font-family: var(--serif); color: var(--muted); font-size: 1rem; }
.sched-row .sr-date { font-size: 0.86rem; color: var(--muted); white-space: nowrap; }
.sched-row .sr-title { color: var(--ink); }
.sched-row .sr-title .sr-topic { display: block; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 0.15rem; }
.sched-row .sr-link { font-family: var(--sans); font-weight: 500; font-size: 0.9rem; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 1px; white-space: nowrap; }
.sched-row .sr-link:hover { color: var(--accent); border-color: var(--accent); }

.sched-row--break { grid-template-columns: 3rem 9.5rem 1fr; background: var(--bg); }
.sched-row--break .sr-break { font-size: 0.86rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-style: italic; font-family: var(--serif); text-transform: none; }
.sched-row--break .sr-date { color: var(--line-strong); }

/* ==========================================================================
   Slide deck viewer
   ========================================================================== */
.deck-wrap { max-width: 960px; margin-inline: auto; padding-inline: 1.5rem; }
.deck-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 0; flex-wrap: wrap; }
.deck-top .back-link { margin: 0; }
.deck-meta { font-size: 0.85rem; color: var(--muted); }

.stage {
  position: relative;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  box-shadow: 0 24px 50px -30px rgba(27,25,21,0.45);
}
.slide {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  overflow-y: auto;
}
.slide.is-active { display: flex; }
.slide__kicker { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.9rem; }
.slide h2 { font-size: clamp(1.5rem, 4vw, 2.4rem); margin: 0 0 1rem; }
.slide__body { font-size: clamp(1rem, 2.3vw, 1.25rem); color: var(--ink-soft); line-height: 1.6; }
.slide__body p { margin: 0 0 0.8rem; }
.slide__body ul, .slide__body ol { margin: 0 0 0.8rem; padding-left: 1.3rem; }
.slide__body li { margin-bottom: 0.4rem; }
.slide__body strong { color: var(--ink); }
.slide mjx-container[display="true"] { margin: 1rem 0 !important; max-width: 100%; overflow-x: auto; }

/* Image slides */
.slide__cols { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.2rem, 4vw, 2.5rem); align-items: center; width: 100%; }
.slide__media { margin: 0; }
.slide__media img { width: 100%; height: 100%; max-height: 62vh; object-fit: cover; border: 1px solid var(--line); display: block; }
.slide__media figcaption { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }
.slide--photo { align-items: stretch; }
.slide__media--wide { width: 100%; }
.slide__media--wide img { max-height: 64vh; }
@media (max-width: 720px) {
  .slide__cols { grid-template-columns: 1fr; gap: 1rem; }
  .slide__media img { max-height: 38vh; }
}

/* Title slide */
.slide--title { background: var(--ink); color: var(--paper); }
.slide--title .slide__kicker { color: rgba(250,248,244,0.6); }
.slide--title h1 { color: var(--paper); font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 1rem; }
.slide--title .st-topic { display: inline-block; font-family: var(--sans); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; border: 1px solid rgba(250,248,244,0.4); border-radius: 2px; padding: 0.3rem 0.7rem; color: var(--paper); }
.slide--title .st-date { color: rgba(250,248,244,0.7); margin-top: 1.2rem; font-size: 1rem; }

.deck-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; }
.deck-btn {
  font-family: var(--sans); font-size: 0.95rem; font-weight: 500;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 2px; padding: 0.6rem 1.1rem; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.deck-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.deck-btn:disabled { opacity: 0.35; cursor: default; }
.deck-dots { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.deck-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; padding: 0; }
.deck-dot.is-on { background: var(--ink); border-color: var(--ink); }
.deck-count { font-size: 0.88rem; color: var(--muted); min-width: 3.5rem; text-align: center; }

@media (max-width: 600px) {
  .sched-row, .sched-row--break { grid-template-columns: 1fr auto; gap: 0.3rem 0.8rem; }
  .sched-row .sr-n { display: none; }
  .sched-row .sr-date { grid-column: 1; }
  .sched-row .sr-link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .sched-row .sr-title { grid-column: 1; }
  .sched-row--break .sr-break { grid-column: 1; }
  .stage { aspect-ratio: 4 / 5; }
}
