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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

main,
#contact,
.footer {
  background: transparent;
}

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

p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
img { max-width: 100%; display: block; }

/* justified body copy — About section only */
#about .thesis,
#about .about-body p,
#about .about-foot {
  text-align: justify;
  text-align-last: left;
  hyphens: auto;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--muted); }

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

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

.section { padding: var(--s9) 0; position: relative; }
.section + .section { border-top: none; }

.kicker {
  font-size: var(--fs-kicker);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--sans);
}

/* section header: serif title + thick black rule */
.section-head { margin-bottom: var(--s7); }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: var(--s3); }
.section-head::after {
  content: ""; display: none;
}
.section-head .note {
  font-size: var(--fs-sm); color: var(--muted);
  margin-top: var(--s4); font-style: italic;
}

/* collapsible section header (Professional / Creative / Outreach) */
.section-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  width: 100%; background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.section-toggle:hover h2 { color: var(--accent); }
.section-chev {
  width: 24px; height: 24px; flex: none; color: var(--muted);
  transition: transform 0.3s var(--ease), color 0.2s var(--ease);
}
.section-toggle:hover .section-chev { color: var(--ink); }
.section-toggle[aria-expanded="false"] .section-chev { transform: rotate(-90deg); }

.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.35s var(--ease);
}
.section-body-inner { overflow: hidden; min-height: 0; }
.section[data-collapsed] .section-body { grid-template-rows: 0fr; }

@media print {
  .section-chev { display: none; }
  .section-body { grid-template-rows: 1fr !important; }
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  nav, #progress, #to-top, .bg-texture, .theme-btn, .lang-btn { display: none !important; }
  body { background: #fff; color: #000; }
  .section { page-break-inside: avoid; border-top: 1px solid #ccc; }
}
