/* PhD defense event page — standalone, follows the system light/dark scheme */
:root {
  --bg: #f4f5fb;
  --bg-alt: #eceef8;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --line: rgba(20, 24, 45, .10);
  --ink: #0d1526;
  --ink-2: #3c3c44;
  --ink-3: #5b5b65;
  --teal: #0fa79a;
  --blue: #2f6fe0;
  --violet: #6355e8;
  --pink: #e0457b;
  --orange: #f08a24;
  --green: #1fa855;
  --red: #e5383b;
  --grad: linear-gradient(100deg, #12b5a6 0%, #3b7be0 50%, #6355e8 78%, #c04ad8 100%);
  --shadow: 0 1px 2px rgba(15, 20, 40, .06), 0 12px 40px -12px rgba(30, 40, 90, .22);
  --radius: 22px;
  --font-display: "Space Grotesk", "Noto Sans KR", system-ui, sans-serif;
  --font-body: "Inter", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
/* Dark only when chosen with the toggle (assets/js/theme.js); light is the default */
html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0d18;
  --bg-alt: #0f1322;
  --surface: rgba(24, 29, 48, .72);
  --surface-solid: #161b2c;
  --line: rgba(235, 240, 255, .10);
  --ink: #eef1f8;
  --ink-2: #b6b6bd;
  --ink-3: #97979f;
  --teal: #35e0d0;
  --blue: #6ea8fe;
  --violet: #8c7cff;
  --pink: #ff6b9a;
  --orange: #ffa64d;
  --green: #3ddc84;
  --red: #ff5a5f;
  --grad: linear-gradient(100deg, #35e0d0 0%, #6ea8fe 50%, #8c7cff 78%, #e07cf0 100%);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 48px -16px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: 72px; } /* clear the sticky top bar when jumped to */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
[lang="ko"] { font-family: "Noto Sans KR", var(--font-body); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 10px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.mark { width: 32px; height: 32px; flex: none; }
.mark__tails { stroke: #0d1526; }
.mk0 { stop-color: #12b5a6; } .mk1 { stop-color: #3b7be0; } .mk2 { stop-color: #6355e8; }
html[data-theme="dark"] .mark__tails { stroke: #e9edf5; }
html[data-theme="dark"] .mk0 { stop-color: #35e0d0; }
html[data-theme="dark"] .mk1 { stop-color: #6ea8fe; }
html[data-theme="dark"] .mk2 { stop-color: #7c6cf7; }
.brand > span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand strong { font: 600 .95rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: .8125rem; font-weight: 500; color: var(--ink-3); }

.status {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 12px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600;
  background: color-mix(in srgb, var(--blue) 12%, transparent);
  color: var(--blue);
}
.status i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status[data-state="live"] { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.status[data-state="live"] i { animation: pulse 1.6s ease-in-out infinite; }
.status[data-state="soon"] { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.status[data-state="ended"] { background: color-mix(in srgb, var(--ink-3) 14%, transparent); color: var(--ink-3); }
/* Light theme: the pill text sits a shade darker than its own tint so every state reads
   at 5:1 or better (WCAG AA is 4.5; the margin covers the moving background behind the
   translucent pill); the tints themselves are unchanged. Dark theme already passes. */
html:not([data-theme="dark"]) .status { color: #285bb7; }
html:not([data-theme="dark"]) .status[data-state="live"] { color: #ab2f35; }
html:not([data-theme="dark"]) .status[data-state="soon"] { color: #885425; }
html:not([data-theme="dark"]) .status[data-state="ended"] { color: var(--ink-3); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- full-page backdrop ----------
   The colour glow and the animated canvas are both fixed to the viewport and sit
   behind everything, so the content scrolls over them on every section. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(48% 40% at 14% 18%, rgba(18, 181, 166, .16), transparent 70%),
    radial-gradient(44% 42% at 84% 14%, rgba(59, 123, 224, .15), transparent 70%),
    radial-gradient(52% 46% at 70% 82%, rgba(99, 85, 232, .14), transparent 72%),
    radial-gradient(40% 36% at 6% 92%, rgba(224, 69, 123, .10), transparent 70%);
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(48% 40% at 14% 18%, rgba(53, 224, 208, .16), transparent 70%),
    radial-gradient(44% 42% at 84% 14%, rgba(110, 168, 254, .15), transparent 70%),
    radial-gradient(52% 46% at 70% 82%, rgba(124, 108, 247, .18), transparent 72%),
    radial-gradient(40% 36% at 6% 92%, rgba(240, 122, 192, .10), transparent 70%);
}
/* 100lvh: the large viewport, so a phone's collapsing address bar does not resize it */
.page-art {
  position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh;
  z-index: -1; pointer-events: none; opacity: .9;
}

/* ---------- hero ---------- */
/* No overflow:hidden here: clipping the hero cut off the "Add to calendar" menu. */
.hero { position: relative; z-index: 1; }
.hero__inner {
  max-width: 1440px; margin: 0 auto;
  padding: clamp(36px, 7vw, 88px) 20px clamp(56px, 8vw, 104px);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip {
  display: inline-flex; align-items: center; padding: 6px 13px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .01em;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip--grad { background: var(--grad); color: #fff; border-color: transparent; }
.title {
  margin: 0 0 20px;
  /* the 15vw cap only bites at raised phone text sizes, so "Defense" still fits */
  font: 700 min(clamp(2.9rem, 8.4vw, 6.2rem), 15vw)/.98 var(--font-display);
  letter-spacing: -.035em;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* headline gradient sweeps in once, then drifts slowly */
.title .grad { background-size: 240% 100%; animation: gradSweep 2.4s var(--ease-out) .3s both, gradDrift 9s ease-in-out 2.8s infinite alternate; }
@keyframes gradSweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes gradDrift { from { background-position: 0 0; } to { background-position: 60% 0; } }
.lede { margin: 0 0 30px; max-width: 34em; font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--ink-2); }

.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 500px; }
/* Photo on top, details below; sized so the whole card is about as tall as the
   photo alone was in the large version. */
.person {
  margin: 0; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
/* Zoomed-out portrait: the photo is drawn at 118% of the box height (cover would
   need ~156%), top-aligned. The side gaps take the photo's own studio-background
   colour (--l / --r, sampled from its edges, set inline per card) and the photo's
   side edges fade into it, so there is no visible seam. */
.person__photo {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  display: flex; justify-content: center; align-items: flex-start;
  background: linear-gradient(90deg, var(--l, #eee) 0 50%, var(--r, #eee) 50% 100%);
}
.person__img {
  position: relative; height: 118%; width: auto; max-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.person figcaption { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px 14px; line-height: 1.3; }
.person small {
  align-self: flex-start; margin-bottom: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet);
}
.person:nth-child(2) small { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.person strong { font: 700 clamp(1.05rem, 1.8vw, 1.2rem)/1.25 var(--font-display); letter-spacing: -.01em; }
.person span { font-size: .8125rem; color: var(--ink-3); font-weight: 500; line-height: 1.35; }

/* ---------- ticket card ---------- */
.ticket {
  position: relative;
  padding: 24px; border-radius: 28px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
}
.ticket::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--grad); opacity: .55;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); /* standard form; the shorthand resets composite, so composite comes after */
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.ticket__date { display: flex; gap: 16px; align-items: center; }
.cal {
  flex: none; width: 68px; border-radius: 16px; overflow: hidden; text-align: center;
  background: var(--surface-solid); border: 1px solid var(--line);
}
.cal span { display: block; padding: 3px 0; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.cal b { display: block; padding: 4px 0 6px; font: 700 2rem/1.1 var(--font-display); }
.ticket__day { margin: 0; font: 600 1.12rem/1.3 var(--font-display); }
.ticket__time { margin: 2px 0 0; font-weight: 600; color: var(--ink-2); }
.ticket__time abbr { text-decoration: none; color: var(--ink-3); }
.ticket__local { margin: 4px 0 0; font-size: .875rem; font-weight: 500; color: var(--violet); }

.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0; }
.countdown div {
  padding: 10px 4px; border-radius: 14px; text-align: center;
  background: color-mix(in srgb, var(--blue) 7%, var(--surface-solid));
  border: 1px solid var(--line);
}
.countdown div:nth-child(2) { background: color-mix(in srgb, var(--violet) 8%, var(--surface-solid)); }
.countdown div:nth-child(3) { background: color-mix(in srgb, var(--pink) 8%, var(--surface-solid)); }
.countdown div:nth-child(4) { background: color-mix(in srgb, var(--orange) 9%, var(--surface-solid)); }
.countdown b { display: block; font: 700 1.6rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
/* a changed digit rolls in from above */
.countdown b.roll { animation: roll 320ms var(--ease-out); }
@keyframes roll { from { transform: translateY(-38%); opacity: 0; } to { transform: none; opacity: 1; } }
.countdown span { font-size: min(.75rem, 13.5px); /* label grows a little with phone text size, then stops: four boxes share one row */ font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.countdown[hidden] { display: none; }

.where { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 14px; }
.where li { display: flex; gap: 12px; align-items: flex-start; }
.where strong { display: block; font-weight: 600; line-height: 1.35; }
.where span { font-size: .875rem; color: var(--ink-3); font-weight: 500; }
.ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico--teal { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.ico--violet { background: color-mix(in srgb, var(--violet) 15%, transparent); color: var(--violet); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  font: 600 .9375rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
  user-select: none; -webkit-user-select: none;
}
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--blue) 70%, transparent); }
.btn--primary[aria-disabled="true"] {
  background: color-mix(in srgb, var(--violet) 11%, var(--surface-solid));
  color: var(--violet); border: 1px dashed color-mix(in srgb, var(--violet) 45%, transparent);
  box-shadow: none; cursor: default;
}
.btn--primary[aria-disabled="true"]:active { transform: none; }
.btn--ghost { background: var(--surface-solid); border-color: var(--line); color: var(--ink); }
.btn--wide { width: 100%; min-height: 52px; font-size: 1rem; border-radius: 16px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: .875rem; border-radius: 12px; }
.btn--live { animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--violet) 22%, transparent); } }
@media (hover: hover) and (pointer: fine) {
  .btn--ghost:hover { background: color-mix(in srgb, var(--blue) 8%, var(--surface-solid)); }
  .btn--primary:not([aria-disabled="true"]):hover { box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--violet) 80%, transparent); }
}
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row > * { flex: 1 1 auto; }

.addcal { position: relative; }
.addcal summary { list-style: none; width: 100%; }
.addcal summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 10; min-width: 220px;
  display: grid; padding: 6px; border-radius: 16px;
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  transform-origin: top left;
  animation: menu-in 180ms var(--ease-out);
}
@keyframes menu-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu a { padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: .9375rem; }
.menu a:hover, .menu a:focus-visible { background: color-mix(in srgb, var(--blue) 10%, transparent); }

/* ---------- sections ---------- */
.band { padding: clamp(48px, 7vw, 88px) 0; }
.band--alt { background: color-mix(in srgb, var(--bg-alt) 55%, transparent); } /* lets the backdrop show through */
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 20px; }  /* matches the lab site's --wrap */
.h2 {
  display: flex; align-items: baseline; gap: 14px; margin: 0 0 28px;
  /* the 9vw cap only bites at raised phone text sizes, so "Examination" still fits */
  font: 700 min(clamp(1.7rem, 3.6vw, 2.5rem), 9vw)/1.1 var(--font-display); letter-spacing: -.025em;
}
.h2 span {
  font-size: .875rem; font-weight: 700; letter-spacing: .04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 26px; border-radius: var(--radius);
  background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.card h3 { margin: 12px 0 8px; font: 600 1.3rem/1.25 var(--font-display); letter-spacing: -.01em; }
.card p { margin: 0 0 6px; color: var(--ink-2); }
.card .row { margin-top: auto; padding-top: 16px; width: 100%; }
.card .row > * { flex: 0 1 auto; }
.ko { font-size: .9375rem; color: var(--ink-3); }
.badge { padding: 5px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.badge--violet { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.badge--teal { background: color-mix(in srgb, var(--teal) 15%, transparent); color: var(--teal); }
.map { width: 100%; margin-top: 14px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 9; background: var(--bg-alt); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.meta { width: 100%; margin: 12px 0 0; display: grid; gap: 8px; }
.meta div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg-alt); }
.meta dt { color: var(--ink-3); font-weight: 500; }
.meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.timeline { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.timeline li { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 20px; padding: 0 0 26px; }
.timeline li::before {
  content: ""; position: absolute; left: 101px; top: 8px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface-solid); border: 3px solid var(--blue);
}
.timeline li:nth-child(2)::before { border-color: var(--violet); }
.timeline li:nth-child(3)::before { border-color: var(--pink); }
.timeline li:nth-child(4)::before { border-color: var(--teal); }
.timeline li:not(:last-child)::after {
  content: ""; position: absolute; left: 107px; top: 26px; bottom: 2px; width: 2px;
  background: linear-gradient(var(--line), var(--line));
}
.timeline time { font: 600 .9375rem/1.6 var(--font-display); color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.timeline div { padding-left: 24px; }
.timeline strong { display: block; font: 600 1.08rem/1.5 var(--font-display); }
.timeline span { color: var(--ink-3); font-weight: 500; font-size: .9375rem; }

/* Committee: five identical vertical cards (avatar, name, university on two
   lines, role chip). Every card carries a role, so none is laid out differently. */
.committee { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.committee li {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 22px 14px 18px; border-radius: 20px;
  background: var(--surface-solid); border: 1px solid var(--line);
}
.committee .av { margin-bottom: 12px; }
.committee strong { font: 600 1rem/1.3 var(--font-display); }
.committee .uni { margin: 4px 0 12px; font-size: .875rem; line-height: 1.4; color: var(--ink-3); font-weight: 500; }
.committee .role {
  margin-top: auto; font-style: normal;
  padding: 3px 11px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink-2);
}
.committee .role--chair { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.committee .role--sup { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
@media (max-width: 1020px) { .committee { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Phone: one identical row per member (avatar | name over university | role). */
@media (max-width: 620px) {
  .committee { grid-template-columns: 1fr; gap: 10px; }
  .committee li {
    display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px;
    grid-template-areas: "av name role" "av uni role";
    align-items: center; text-align: left; padding: 13px 14px;
  }
  .committee .av { grid-area: av; margin: 0; }
  /* one-column rows here, so a long name may wrap (needed at large phone text sizes) */
  .committee strong { grid-area: name; align-self: end; font-size: .9375rem; text-wrap: balance; }
  .committee .av { width: 40px; height: 40px; border-radius: 12px; font-size: .875rem; }
  .committee .uni { grid-area: uni; align-self: start; margin: 1px 0 0; }
  .committee .uni br { display: none; }
  .committee .role { grid-area: role; margin: 0; }
}
@media (max-width: 360px) { .committee strong { white-space: normal; } }
.av {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font: 700 .95rem/1 var(--font-display); color: #fff;
}
.av--1 { background: linear-gradient(135deg, #12b5a6, #3b7be0); }
.av--2 { background: linear-gradient(135deg, #3b7be0, #6355e8); }
.av--3 { background: linear-gradient(135deg, #6355e8, #c04ad8); }
.av--4 { background: linear-gradient(135deg, #e0457b, #f08a24); }
.av--5 { background: linear-gradient(135deg, #f08a24, #1fa855); }

.foot { padding: 28px 0 max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: .875rem; font-weight: 500; color: var(--ink-3); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50;
  padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: .875rem; font-weight: 600; box-shadow: var(--shadow);
  transform: translate(-50%, 0); transition: opacity 200ms ease, transform 200ms var(--ease-out);
}
.toast[hidden] { display: block !important; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .top { padding-left: 16px; padding-right: 16px; }
  .hero__inner, .wrap { padding-left: 16px; padding-right: 16px; }
  .ticket { padding: 18px; border-radius: 24px; }
  .countdown b { font-size: 1.35rem; }
  .people { gap: 12px; }
  .person { border-radius: 18px; }
  .person figcaption { padding: 10px 11px 12px; }
  .person small { margin-bottom: 4px; padding: 2px 8px; font-size: .625rem; }
  .person strong { font-size: 1rem; }
  .person span { font-size: .75rem; }
  .card { padding: 20px; }
  .timeline li { grid-template-columns: 64px 1fr; gap: 12px; }
  .timeline li::before { left: 69px; }
  .timeline li:not(:last-child)::after { left: 75px; }
  .timeline time { font-size: .8125rem; }
  .menu { left: 0; right: auto; }
}
/* ---------- motion: entrances and hover lift ---------- */
/* Only hidden once JS has marked the page, so content never stays invisible. */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.hero__text > *, .ticket { animation: rise 760ms var(--ease-out) both; }
.hero__text > :nth-child(2) { animation-delay: 80ms; }
.hero__text > :nth-child(3) { animation-delay: 160ms; }
.hero__text > :nth-child(4) { animation-delay: 240ms; }
.ticket { animation-delay: 200ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.person, .card, .committee li { transition: transform 260ms var(--ease-out), box-shadow 260ms ease; }
@media (hover: hover) and (pointer: fine) {
  .person:hover, .committee li:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(15,20,40,.06), 0 18px 44px -14px rgba(60,60,140,.32); }
  .card:hover { transform: translateY(-3px); }
  .committee li:hover .av { transform: rotate(-6deg) scale(1.06); }
}
.av { transition: transform 320ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .status[data-state="live"] i, .btn--live, .menu { animation: none; }
  .title .grad, .countdown b.roll, .hero__text > *, .ticket { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .person, .card, .committee li, .av { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .top, .ticket, .chip, .person { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-solid); }
}

/* ---------- admin: button (same look as the PTS Lab Calendar's), sign-in and editor ---------- */
.top__tools { display: flex; align-items: center; gap: 10px; flex: none; }
.ev-admin {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-solid); color: var(--ink);
  font: 600 .8125rem/1 var(--font-body); cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), border-color 120ms ease, color 120ms ease;
}
.ev-admin svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ev-admin.on { border-color: var(--violet); color: var(--violet); }
/* the home link shares the button look (as on the PTS Lab Calendar) */
.ev-home { text-decoration: none; }
/* theme toggle: a round icon button; it shows the theme now in use */
.ev-theme { width: 36px; padding: 0; justify-content: center; }
.ev-theme svg { width: 17px; height: 17px; stroke-width: 1.8; }
.ev-theme .i-moon, html[data-theme="dark"] .ev-theme .i-sun { display: none; }
html[data-theme="dark"] .ev-theme .i-moon { display: block; }
/* the theme switch is a circle wipe (theme.js); no default cross-fade under it */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
.ev-admin:active { transform: scale(.96); }
@media (hover: hover) and (pointer: fine) { .ev-admin:hover { border-color: var(--violet); } }
/* Phones and narrow tablets: the lab name on two lines instead of an ellipsis,
   round icon buttons, and the status pill beside the event chip (moved by defense.js) */
@media (max-width: 680px) {
  .brand small { display: none; }
  .brand { gap: 8px; }
  .mark { width: 28px; height: 28px; }
  /* grows with the phone's text size up to ~130%, then stops (bar chrome, as on iOS) */
  .brand strong { white-space: normal; overflow: visible; font-size: min(.9rem, 18.7px); line-height: 1.16; }
  .brand strong > span { display: block; white-space: nowrap; }
  .top__tools { gap: 8px; }
  .chips { align-items: center; }
  .ev-admin { width: 36px; padding: 0; justify-content: center; }
  .ev-admin span { display: none; }
  /* JS fallback (Safari, Firefox): defense.js sets .top--away while scrolling down */
  .top.top--away:not(:focus-within) { transform: translateY(-100%); }
}
/* The top bar slides away while scrolling down and returns on any scroll up. Where
   scroll-state queries exist (Chrome/Edge 144+) the root scroller remembers the last
   scroll direction and CSS alone does it; (scrollable: top) keeps it shown at the very
   top, and it stays while it holds keyboard focus. */
@media (max-width: 680px) {
  html { container-type: scroll-state; }
  @container scroll-state((scrolled: bottom) and (scrollable: top)) {
    .top:not(:focus-within) { transform: translateY(-100%); }
  }
}
@media (max-width: 680px) and (prefers-reduced-motion: no-preference) {
  .top { transition: transform 280ms var(--ease-out); }
}

.ev-sheet {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line);
  border-radius: 24px; background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow);
}
.ev-sheet--wide { width: min(760px, calc(100vw - 24px)); }
.ev-sheet::backdrop { background: rgba(10, 13, 24, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ev-sheet[open] { animation: sheetIn 260ms var(--ease-out); }
@keyframes sheetIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.ev-form { display: grid; gap: 14px; padding: 24px; }
.ev-form h2 { margin: 0; font: 700 1.35rem/1.2 var(--font-display); letter-spacing: -.01em; }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ev-signout { border: 0; background: none; color: var(--ink-3); font: 600 .875rem var(--font-body); cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.ev-signout:hover { color: var(--red); }
.ev-hint { margin: 0; font-size: .875rem; color: var(--ink-3); }
.ev-form fieldset { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 16px; display: grid; gap: 10px; min-width: 0; }
.ev-form legend { padding: 0 6px; font: 700 .8125rem var(--font-body); text-transform: uppercase; letter-spacing: .06em; color: var(--violet); }
.ev-field { display: grid; gap: 5px; min-width: 0; }
.ev-field > span { font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.ev-form input, .ev-form textarea, .ev-form select {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); color: var(--ink); font: 500 16px/1.4 var(--font-body);
}
.ev-form textarea { resize: vertical; }
.ev-form input:focus-visible, .ev-form textarea:focus-visible, .ev-form select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ev-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ev-three { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }
.ev-prow { display: grid; grid-template-columns: 112px 1fr 1.3fr 36px; gap: 8px; margin-bottom: 8px; }
.ev-x { border: 1px solid var(--line); border-radius: 10px; background: var(--surface-solid); color: var(--ink-3); font-size: 1.2rem; cursor: pointer; }
.ev-x:hover { color: var(--red); border-color: var(--red); }
.ev-og { width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-alt); }
.ev-msg { margin: 0; min-height: 1.2em; font-size: .875rem; font-weight: 600; color: var(--red); }
.ev-actions { display: flex; justify-content: flex-end; gap: 10px; }
.ev-actions .btn { min-width: 110px; }
@media (max-width: 620px) {
  .ev-form { padding: 18px; }
  .ev-two, .ev-three { grid-template-columns: 1fr; }
  .ev-prow { grid-template-columns: 132px 1fr 36px; }
  .ev-prow input:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .ev-prow .ev-x { grid-column: 3; grid-row: 1; }
}
@media (prefers-reduced-motion: reduce) { .ev-sheet[open] { animation: none; } }

/* <picture> only chooses the file format (AVIF / WebP / JPEG); it must not add a box
   of its own, so every existing img rule keeps applying exactly as before */
picture { display: contents; }

/* Small uppercase labels on tinted chips: text solved to 5.2:1+ against the chip as
   composited on its card (axe-core measurements, 2026-11-19); the tints are unchanged */
html:not([data-theme="dark"]) .committee .role--chair { color: #8a5525; }
html:not([data-theme="dark"]) .badge--teal { color: #0e6d6c; }
html:not([data-theme="dark"]) :is(.badge--violet, .committee .role--sup) { color: #574ccd; }
html[data-theme="dark"] :is(.badge--violet, .committee .role--sup) { color: #9d90fe; }
