:root {
    --bg: #0c0b0a;
    --bg-subtle: #141312;
    --accent: #c8bfa8;
    --accent-dim: rgba(200, 191, 168, 0.5);
    --border: #1f1d1a;
    --border-mid: #2a2825;
    --border-accent: rgba(200, 191, 168, 0.2);
    --text-primary: #e6e2dc;
    --text-mid: #ccc8c0;
    --text-body: #b8b2aa;
    --text-secondary: #7a7570;
    --text-tertiary: #3d3a36;
    --error: #a05050;
    --sans: 'Mona Sans', sans-serif;
    --mono: 'DM Mono', monospace;
    --serif: 'IBM Plex Serif', serif;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { -webkit-font-smoothing: antialiased; }

  body {
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 24px;
    font-weight: 300;
    line-height: 1.75;
  }
  .serif { font-family: var(--serif); font-style: italic; letter-spacing: 1%; }  
  strong { font-weight: 600; }

  a.external {
    color: var(--text-primary);
    text-decoration: none;
  }
  a.external span {
    border-bottom: 1px dotted var(--accent-dim);
    transition: border-color 0.15s ease;
  }
  a.external:hover span {
    border-bottom-color: transparent;
  }
  a.external::after {
    content: '';
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    margin: 0 2px 0 4px;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 1h10v10M15 1L1 15'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 1h10v10M15 1L1 15'/%3E%3C/svg%3E") no-repeat center / contain;
  }

  /* -- About -- */
  .about-header {
    padding-top:96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
  }
  .about-eyebrow {
    font-size: clamp(20px, 2vw, 24px);
    color: var(--accent);
    line-height: 1.0;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
  }
  .about-name {
    font-size: clamp(48px, 8vw, 56px);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.0;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
  }
  .about-body .about-intro {
    font-size: 16px;
    font-family: var(--mono);
    line-height: 1.5;
    color: var(--accent-dim);
    text-align: center;
    margin: 64px 0;
    padding: 32px 96px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }
  .about-intro::after {
    content: '█';
    color: var(--accent);
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
  }
  .about-intro.done::after { display: none; }
  @keyframes blink {
    50% { opacity: 0; }
  }
  .about-heading {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5em;
    color: var(--accent);
    margin-bottom: 24px;
  }
  .about-section {
    margin-bottom: 64px;
  }
  .about-section:last-child {
    margin-bottom: 72px;
  }
  .about-body p {
  margin-bottom: 24px;
  }
  .about-body p:last-child { margin-bottom: 0; }
  .text-small {
    font-size: 20px;
    line-height: 1.8;
  }
  .resume-role .text-dim { display: inline; font-size: inherit; margin-top: 0; color: var(--text-tertiary); }
  .about-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--border-mid);
    border-radius: 100%;
  }
  .career-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    width: calc(100% + 400px);
    margin-left: -200px;
  }
  .career-card {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    display: grid;
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.001fr);
    height: 300px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: grid-template-rows 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
      background 0.5s ease,
      border-color 0.3s ease;
  }
  .career-card:hover {
    border-color: var(--border-mid);
    grid-template-rows: minmax(0, 0.001fr) minmax(0, 1fr);
  }
  .career-card-bg {
    position: absolute;
    inset: 1px;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
  }
  .career-card.has-bg .career-card-bg {
    opacity: 1;
  }
  .career-card p {
    margin-bottom: 0;
  }
  .career-card-default {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0;
    z-index: 1;
  }
  .career-card-logo {
    max-width: 180px;
    transition: max-width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1),
                opacity 0.4s ease;
  }
  .career-card:hover .career-card-logo {
    max-width: 64px;
  }
  .career-card-logo.logo-sq {
    max-width: 96px;
  }
  .career-card:hover .career-card-logo.logo-sq {
    max-width: 32px;
  }
  .career-card-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    padding: 32px;
    background: rgba(12, 11, 10, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
  }
  .career-card:hover .career-card-hover {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .container { max-width: 720px; margin: 0 auto; padding: 0 32px; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .fade-up {
    opacity: 0;
    transform: translateY(10px);
  }
  .fade-up.visible {
    animation: fadeUp 0.45s ease forwards;
  }

  .bottom-blur {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 240px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg) 90%);
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.3s ease;
  }
  .bottom-blur.hidden { opacity: 0; }

  .footer-scene {
    width: 100%;
    height: 600px;
    margin: -64px 0;
  }
  .section { margin-bottom: 72px; }

  .sect-edu { margin-bottom: 0; }
  .sect-essays { display: none; }

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .section-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
  }
  .section-link {
    font-family: var(--mono);
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
  }
  .section-link:hover { color: var(--accent-dim); opacity: 0.7; }
  .section-link.external span { border-bottom: none; }
  .section-link.external { color: var(--accent); }
  .resume-links { grid-column: 1 / -1; display: flex; justify-content: space-evenly; font-size: 12px; }
  .section-link.download::before {
    content: '';
    display: inline-block;
    width: 0.65em;
    height: 0.65em;
    margin: 0 4px 0 0;
    vertical-align: middle;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3M8 2v8M4.5 6.5L8 10l3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 10v3a1 1 0 001 1h10a1 1 0 001-1v-3M8 2v8M4.5 6.5L8 10l3.5-3.5'/%3E%3C/svg%3E") no-repeat center / contain;
  }

  .resume-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
  }
  .resume-role { font-size: 16px; color: var(--text-primary); font-weight: 400; line-height: 1.5; }
  .resume-role span { display: block; font-size: 15px; color: var(--text-secondary); font-weight: 500; margin-top: 3px; }
  .resume-year { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); letter-spacing: 0.06em; white-space: nowrap; }

  .tagline-promo { margin: 80px 0 0; padding: 48px 0; border-top: 1px solid var(--border); }
  .tagline-promo-text {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.8;
    max-width: 480px;
  }
  .tagline-promo-text strong { color: var(--accent); font-weight: 400; }

  /* -- Shared page styles -- */
  .page-header { padding-top: 140px; margin-bottom: 56px; }
  .page-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.0;
    margin-bottom: 16px;
  }
  .page-subtitle { font-size: 16px; color: var(--text-secondary); line-height: 1.6; }

  /* -- Footer -- */
  .footer-scene canvas {
    mix-blend-mode: lighten;
  }
  .footer {
    padding: 32px 0 40px;
    border-top: 1px solid var(--border);
    position: relative;
    z-index: 10;
  }
  .footer-wrap { max-width: 720px; margin: 0 auto; padding: 0 32px; }
  .footer-inner { display: flex; justify-content: space-between; align-items: end; }
  .footer-left,
  .footer-right {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
  }
  .footer a { text-decoration: none; }
  .footer-right { text-align: right; }
  .footer-links { display: flex; gap: 24px; }
  .footer-links a { color: var(--accent); transition: color 0.15s ease; cursor: pointer; }
  .footer-links a:hover { color: var(--text-primary); }
  .footer-url a {
    color: var(--accent);
    font-weight: 300;
    margin-bottom: -4px;
  }
  .footer-tagline {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-style: italic;
    color: var(--text-tertiary);
  }

  @media (max-width: 1200px) {
    .career-grid {
      width: calc(100vw - 64px);
      margin-left: calc((100vw - 64px - 100%) / -2);
    }
  }

  @media (max-width: 720px) {
    .career-grid { grid-template-columns: 1fr; width: 100%; margin-left: 0; }
  }

  @media (max-width: 600px) {
    nav { gap: 24px; }
    .container { padding: 0 24px; }
    .footer-wrap { padding: 0 20px; }
    .about-photo { width: 200px; height: 200px; }
    .about-body .about-intro { padding: 24px 20px; font-size: 16px; }

    .resume-item { grid-template-columns: 1fr; gap: 4px; }
    .footer-inner { flex-direction: column-reverse; gap: 16px; align-items: stretch; }
    .footer { padding-bottom: 32px; }
    .footer-right { text-align: center; width: 100%; }
    .footer-links { justify-content: center; }
    .about-header, .page-header { padding-top: 96px; }
  }