/* ==========================================================================
   Tristan Hsieh — Publications Mid-Year Review 2026
   Clean, minimal sans-serif layout with subtle sky-blue yearbook gradient
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-tint: #f6f9fe;
  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-w: 940px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 85% -120px, rgba(191, 219, 254, 0.45), transparent 70%),
    linear-gradient(180deg, #f0f6ff 0%, #f8fbff 260px, #ffffff 620px);
  background-repeat: no-repeat;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Top Navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 6px 0;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.is-active {
  color: var(--ink);
  font-weight: 600;
}

.nav-links a.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--blue);
}

/* ---------- Main Container & Sections ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px 110px;
}

.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 64px;
}

.section:last-of-type {
  border-bottom: none;
}

.hero-section {
  padding-top: 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 36px;
  align-items: start;
  margin-bottom: 40px;
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
}

.hero-sub {
  margin: 0 0 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--blue);
}

.hero-bio {
  margin: 0 0 24px;
  max-width: 600px;
  font-size: 16px;
  line-height: 1.68;
  color: var(--ink-2);
}

.hero-portrait {
  width: 172px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-tint);
}

.hero-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.timeline-item span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 2px;
}

.timeline-item strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Section Headings (Simple Section Names Only) ---------- */
.section-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
}

.section-intro {
  margin: 0 0 28px;
  max-width: 660px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------- Spread Frame ---------- */
.spread-box {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.spread-img-btn {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  background: #f9fafb;
}

.spread-img-btn img {
  width: 100%;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}

.spread-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}

.spread-caption {
  font-size: 13.5px;
  color: var(--ink-2);
}

.spread-caption strong {
  color: var(--ink);
  font-weight: 600;
}

.inline-switch {
  display: inline-flex;
  gap: 14px;
}

.inline-switch button {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 3px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.inline-switch button:hover {
  color: var(--ink);
}

.inline-switch button.is-active {
  color: var(--blue);
  font-weight: 600;
  border-bottom-color: var(--blue);
}

/* ---------- Clean Editorial Underline Tabs (Zero Bubbles/Pills) ---------- */
.underline-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.underline-tabs::-webkit-scrollbar {
  display: none;
}

.utab {
  position: relative;
  padding: 10px 0 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.15s ease;
}

.utab:hover {
  color: var(--ink);
}

.utab.is-active {
  color: var(--ink);
  font-weight: 600;
}

.utab.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--blue);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ---------- Opening / Theme Copy Formatting (Preserves Stanza Breaks & Bolding) ---------- */
.copy-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
  gap: 36px;
  align-items: start;
}

.copy-doc {
  background: linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px 30px;
}

.copy-doc-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.copy-doc-sub {
  margin: 0 0 22px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.page-break {
  margin: 24px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
}

.page-break:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.stanza {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.7;
  color: #1f2937;
}

.stanza:last-child {
  margin-bottom: 0;
}

.stanza strong {
  color: var(--ink);
  font-weight: 700;
}

.copy-note h3 {
  margin: 0 0 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}

.copy-note p {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.meta-table {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  gap: 12px;
}

.meta-row span {
  color: var(--ink-3);
}

.meta-row strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Leadership Section ---------- */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.text-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.text-block h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.text-block p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--ink-2);
}

/* ---------- Law & Ethics Section ---------- */
.ethics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 32px;
  align-items: start;
}

.ethics-summary {
  padding: 24px;
  border-radius: 10px;
  background: linear-gradient(160deg, #eff6ff 0%, #f8fbff 100%);
  border: 1px solid #dbeafe;
}

.ethics-summary h3 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.ethics-summary p {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.ethics-summary p:last-child {
  margin-bottom: 0;
}

.accordion {
  border-top: 1px solid var(--line);
}

.acc-item {
  border-bottom: 1px solid var(--line);
}

.acc-trigger {
  width: 100%;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.acc-plus {
  font-size: 18px;
  font-weight: 400;
  color: var(--blue);
  transition: transform 0.2s ease;
}

.acc-item.is-open .acc-plus {
  transform: rotate(45deg);
}

.acc-body {
  display: none;
  padding: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

.acc-item.is-open .acc-body {
  display: block;
}

/* ---------- Design Section (Clean & Uncluttered) ---------- */
.design-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dthumb {
  text-align: left;
  padding: 0;
  opacity: 0.62;
  transition: opacity 0.18s ease;
}

.dthumb:hover,
.dthumb.is-active {
  opacity: 1;
}

.dthumb img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  margin-bottom: 6px;
}

.dthumb.is-active img {
  border-color: var(--blue);
}

.dthumb span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.design-note {
  margin-top: 18px;
  max-width: 720px;
}

.design-note h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.design-note p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------- Diversity Section ---------- */
.diversity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 36px;
}

.diversity-item {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.diversity-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.diversity-item p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */
.site-footer {
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 24, 39, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-inner {
  max-width: 1240px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.lightbox-img {
  max-height: 85vh;
  width: auto;
  border-radius: 6px;
}

.lightbox-caption {
  margin: 0;
  color: #e5e7eb;
  font-size: 14px;
  text-align: center;
  max-width: 720px;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 22px;
  display: grid;
  place-items: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-grid,
  .copy-layout,
  .ethics-grid,
  .three-col,
  .diversity-list {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    width: 136px;
    order: -1;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .design-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
