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

    :root {
      --ink: #0f0f0f;
      --ink-mid: #4a4a4a;
      --ink-light: #909090;
      --rule: #e6e6e4;
      --bg: #fafaf8;
      --accent: #1a56db;
      --tag-bg: #f0eeea;
      --serif: 'DM Sans', system-ui, sans-serif;
      --sans: 'DM Sans', system-ui, sans-serif;
      --col: 820px;
    }

    [data-theme="dark"] {
      --ink: #f0f0ee;
      --ink-mid: #b0b0ae;
      --ink-light: #666664;
      --rule: #2a2a28;
      --bg: #111110;
      --accent: #6b9fff;
      --tag-bg: #1e1e1c;
    }

    html { font-size: 16px; scroll-behavior: smooth; }
    body {
      font-family: var(--sans);
      background: var(--bg);
      color: var(--ink);
      line-height: 1.65;
      -webkit-font-smoothing: antialiased;
    }

    /* ── THEME TOGGLE ── */
    .theme-toggle {
      background: none;
      border: 1px solid var(--rule);
      border-radius: 4px;
      cursor: pointer;
      padding: 0.3rem 0.55rem;
      font-size: 0.75rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      color: var(--ink-light);
      font-family: var(--sans);
      transition: color 0.15s, border-color 0.15s;
      line-height: 1;
    }
    .theme-toggle:hover { color: var(--ink); border-color: var(--ink-light); }
    .theme-toggle .icon-dark { display: none; }
    [data-theme="dark"] .theme-toggle .icon-light { display: none; }
    [data-theme="dark"] .theme-toggle .icon-dark { display: inline; }

    /* ── PROFILE PHOTO ── */
    .hero-layout {
      display: flex;
      align-items: flex-start;
      gap: 2.4rem;
    }
    .hero-text { flex: 1; min-width: 0; }
    .hero-photo {
      border-radius: 8px;
      object-fit: cover;
      object-position: center top;
    }
    .hero-photo-desktop {
      flex-shrink: 0;
      width: 260px;
      height: 260px;
      margin-top: 0.1rem;
      display: block;
    }
    .hero-photo-mobile {
      display: none;
    }

    /* ── RESPONSIVE ── */
    @media (max-width: 640px) {
      h1 { font-size: 2.2rem; text-indent: 0; padding-left: 0; text-align: center; }
      .eyebrow { text-align: center; }
      section { padding: 3.5rem 0; }
      #about { padding-top: 4rem; }
      .areas-grid { grid-template-columns: 1fr; }
      .area-item:nth-child(odd) { padding-right: 0; border-right: none; }
      .area-item:nth-child(even) { padding-left: 0; }
      .course-item { grid-template-columns: 1fr; gap: 0.3rem; }
      .hero-layout { flex-direction: column; gap: 0; }
      .hero-photo-desktop { display: none; }
      .hero-photo-mobile {
        display: block;
        width: 200px;
        height: 200px;
        object-position: center 15%;
        margin: 1rem auto 1.2rem;
      }
    }

    /* ── NAV ── */
    nav {
      position: sticky; top: 0; z-index: 100;
      background: var(--bg);
      border-bottom: 1px solid var(--rule);
      padding: 0 clamp(1.5rem, 5vw, 4rem);
      display: flex; align-items: center; justify-content: space-between;
      height: 54px;
    }
    .nav-name {
      font-family: var(--serif);
      font-size: 1rem;
      color: var(--ink);
      text-decoration: none;
    }
    .nav-links { display: flex; gap: 2rem; list-style: none; }
    .nav-links a {
      font-size: 0.8rem;
      font-weight: 500;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--ink-light);
      text-decoration: none;
      transition: color 0.15s;
    }
    .nav-links a:hover { color: var(--ink); }

    /* ── LAYOUT ── */
    main { padding: 0 clamp(1.5rem, 5vw, 4rem); }
    section {
      max-width: var(--col);
      margin: 0 auto;
      padding: 5rem 0;
      border-bottom: 1px solid var(--rule);
    }
    section:last-child { border-bottom: none; }

    /* ── HERO ── */
    #about { padding-top: 6.5rem; }

    .eyebrow {
      font-size: 0.77rem;
      font-weight: 500;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--ink-light);
      margin-bottom: 1.1rem;
    }

    h1 {
      font-family: var(--sans);
      font-size: clamp(2.2rem, 5vw, 3rem);
      line-height: 1.15;
      letter-spacing: -0.02em;
      font-weight: 600;
      margin-bottom: 1.8rem;
      color: var(--ink);
    }
    .bio {
      font-size: 1.02rem;
      font-weight: 300;
      color: var(--ink-mid);
      max-width: 540px;
      line-height: 1.8;
      margin-bottom: 1.1rem;
    }
    .bio strong { font-weight: 500; color: var(--ink); }

    .bio-sub {
      font-size: 0.88rem;
      font-weight: 300;
      color: var(--ink-light);
      line-height: 1.75;
      max-width: 500px;
      margin-bottom: 1.1rem;
    }
    .bio-sub strong { font-weight: 500; color: var(--ink-mid); }

    .bio-sub:last-of-type { margin-bottom: 2rem; }

    .links-row { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center; }
    .link-pill {
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--accent);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      transition: border-color 0.15s;
    }
    .link-pill:hover { border-color: var(--accent); }
    .link-sep { color: var(--rule); user-select: none; }

    /* ── SECTION HEADERS ── */
    .section-header {
      display: flex; align-items: baseline; justify-content: space-between;
      margin-bottom: 2.6rem;
    }
    h2 {
      font-family: var(--sans);
      font-size: 1.5rem;
      font-weight: 600;
      letter-spacing: -0.02em;
    }

    /* ── WORK AREAS ── */
    .areas-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0;
    }
    .area-item {
      padding: 1.5rem 0;
      border-top: 1px solid var(--rule);
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
    }
    .area-item:nth-child(odd) { padding-right: 2rem; border-right: 1px solid var(--rule); }
    .area-item:nth-child(even) { padding-left: 2rem; }

    .area-title {
      font-size: 0.9rem;
      font-weight: 500;
      color: var(--ink);
      letter-spacing: 0.01em;
    }
    .area-desc {
      font-size: 0.83rem;
      font-weight: 300;
      color: var(--ink-light);
      line-height: 1.6;
    }

    /* ── TEACHING ── */
    .teaching-list { display: flex; flex-direction: column; }
    .course-item {
      display: grid;
      grid-template-columns: 76px 1fr;
      gap: 0 1.4rem;
      padding: 1.6rem 0;
      border-top: 1px solid var(--rule);
      align-items: start;
    }
    .course-item:last-child { border-bottom: 1px solid var(--rule); }
    .course-code {
      font-size: 0.73rem;
      font-weight: 500;
      letter-spacing: 0.07em;
      text-transform: uppercase;
      color: var(--ink-light);
      padding-top: 0.1rem;
    }
    .course-body { display: flex; flex-direction: column; gap: 0.35rem; }
    .course-title { font-size: 0.97rem; font-weight: 500; color: var(--ink); }
    .course-info {
      font-size: 0.84rem;
      font-weight: 300;
      color: var(--ink-mid);
      line-height: 1.6;
    }
    .course-link {
      color: inherit;
      text-decoration: none;
      border-bottom: 1px solid var(--rule);
      transition: border-color 0.15s;
    }
    .course-link:hover { border-color: var(--ink-mid); }
    .course-badge {
      display: inline-block;
      font-size: 0.69rem;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      border: 1px solid var(--rule);
      background: var(--tag-bg);
      color: var(--ink-mid);
      padding: 0.18rem 0.52rem;
      border-radius: 3px;
      margin-top: 0.3rem;
      width: fit-content;
    }
    .course-badge.ta {
      background: var(--tag-bg);
      border-color: var(--rule);
      color: var(--accent);
    }

    /* ── READING ── */
    .reading-list { display: flex; flex-direction: column; gap: 2.4rem; }
    .reading-subsection { display: flex; flex-direction: column; gap: 0; }
    .reading-label {
      font-size: 0.73rem;
      font-weight: 500;
      letter-spacing: 0.09em;
      text-transform: uppercase;
      color: var(--ink-light);
      margin-bottom: 0.2rem;
    }
    .reading-items { display: flex; flex-direction: column; }
    .reading-item {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 1rem;
      padding: 0.85rem 0;
      border-top: 1px solid var(--rule);
    }
    .reading-item:last-child { border-bottom: 1px solid var(--rule); }
    .reading-title {
      font-size: 0.93rem;
      font-weight: 500;
      color: var(--ink);
    }
    .reading-link {
      color: var(--ink);
      text-decoration: none;
      border-bottom: 1px solid var(--rule);
      transition: border-color 0.15s;
    }
    .reading-link:hover { border-color: var(--ink-mid); }
    .reading-meta {
      font-size: 0.8rem;
      font-weight: 300;
      color: var(--ink-light);
      white-space: nowrap;
      flex-shrink: 0;
    }

    /* ── EMAIL TOGGLE ── */
    .email-toggle {
      cursor: pointer;
      font-size: 0.82rem;
      font-weight: 500;
      color: var(--accent);
      user-select: none;
      border-bottom: 1px solid transparent;
      transition: border-color 0.15s;
    }
    .email-toggle:hover { border-color: var(--accent); }
    .email-reveal {
      display: none;
      font-weight: 400;
      color: var(--ink-mid);
      font-family: monospace;
      font-size: 0.8rem;
    }
    .email-toggle.revealed .email-label { display: none; }
    .email-toggle.revealed .email-reveal { display: inline; }

    /* ── LLM NOTE ── */
    .llm-note {
      margin-top: 1rem;
      font-size: 0.75rem;
      font-weight: 400;
      color: var(--ink-light);
      font-style: italic;
      opacity: 0;
      max-height: 0;
      overflow: hidden;
      transition: opacity 0.3s, max-height 0.3s;
    }
    .llm-note.visible {
      opacity: 1;
      max-height: 2rem;
    }

    /* ── WIP ── */
    .wip-note {
      display: flex;
      align-items: center;
      gap: 0.8rem;
      padding: 1.2rem 0;
      border-top: 1px solid var(--rule);
      border-bottom: 1px solid var(--rule);
    }
    .wip-badge {
      font-size: 0.69rem;
      font-weight: 500;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      background: var(--tag-bg);
      color: var(--ink-light);
      border: 1px solid var(--rule);
      padding: 0.2rem 0.55rem;
      border-radius: 3px;
      white-space: nowrap;
    }
    .wip-text {
      font-size: 0.85rem;
      font-weight: 300;
      color: var(--ink-light);
    }

    /* ── FOOTER ── */
    footer {
      max-width: var(--col);
      margin: 0 auto;
      padding: 2.2rem 0 4rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1rem;
    }
    .footer-left { font-family: var(--serif); font-size: 0.92rem; color: var(--ink-light); }
    .footer-links { display: flex; gap: 1.4rem; }
    .footer-links a {
      font-size: 0.78rem;
      font-weight: 500;
      letter-spacing: 0.04em;
      color: var(--ink-light);
      text-decoration: none;
      transition: color 0.15s;
    }
    .footer-links a:hover { color: var(--ink); }

    /* ── WAVE EMOJI ── */
    @keyframes wave {
      0%   { transform: rotate(0deg); }
      10%  { transform: rotate(14deg); }
      20%  { transform: rotate(-8deg); }
      30%  { transform: rotate(14deg); }
      40%  { transform: rotate(-4deg); }
      50%  { transform: rotate(10deg); }
      60%  { transform: rotate(0deg); }
      100% { transform: rotate(0deg); }
    }
    .wave {
      display: inline-block;
      transform-origin: 70% 70%;
      animation: wave 2.2s ease-in-out infinite;
    }
    h1 em { font-style: normal; font-weight: 300; color: var(--ink-mid); }

    /* ── ANIMATION ── */
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .hero-inner > * { animation: fadeUp 0.5s ease both; }
    .hero-inner > *:nth-child(1) { animation-delay: 0s; }
    .hero-inner > *:nth-child(2) { animation-delay: 0.07s; }
    .hero-inner > *:nth-child(3) { animation-delay: 0.14s; }
    .hero-inner > *:nth-child(4) { animation-delay: 0.21s; }
    .hero-inner > *:nth-child(5) { animation-delay: 0.28s; }
