  :root{
    --bg: #ffffff;
    --ink: #333333;
    --ink-soft: #6f6f6f;
    --line: #e4e4e4;
    --accent: #5f7d72;
    --black: #121212;
    --black-ink: #ededed;
    --black-ink-soft: #9a9a9a;
  }

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

  html{
    scroll-behavior:smooth;
  }

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

  body{
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
  }

  h1, h2, h3, .brand{
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
  }

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

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

  @keyframes rise{
    from{ opacity:0; transform: translateY(18px); }
    to{ opacity:1; transform: translateY(0); }
  }

  .reveal{
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .75s ease, transform .75s cubic-bezier(.25,.7,.35,1);
    will-change: opacity, transform;
  }

  .reveal.in-view{
    opacity: 1;
    transform: translateY(0);
  }

  .wrap{
    max-width: 820px;
    margin-left: 12%;
    margin-right: auto;
    padding: 0 32px;
  }

  /* ---------- Header ---------- */
header .wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
  }

  .brand{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.08em;
    line-height: 1;
    transition: transform .25s ease, background .25s ease, color .25s ease;
  }

  .brand:hover{
    transform: rotate(-8deg);
    background: var(--black);
    color: var(--black-ink);
  }

  nav ul{
    list-style:none;
    display:flex;
    gap: 30px;
  }

  nav a{
    font-size: 1rem;
    color: var(--ink-soft);
    position: relative;
    padding-bottom: 2px;
  }

  nav a::after{
    content:'';
    position:absolute;
    left:0; bottom:-2px;
    width:0%; height:1px;
    background: var(--accent);
    transition: width .25s ease;
  }

  nav a:hover::after,
  nav a:focus-visible::after{ width:100%; }

  /* ---------- Hero ---------- */
  .hero{
    padding: 96px 0 84px;
  
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
}

  .hero .kicker{
    color: var(--accent);
    font-size: 1.05rem;
    margin-bottom: 20px;
    opacity: 0;
    animation: rise .8s cubic-bezier(.25,.7,.35,1) .1s forwards;
  }

  .hero h1{
    font-size: clamp(3rem, 7vw, 5.5rem);
    line-height: 1.05;
    max-width: 11ch;
    opacity: 0;
    animation: rise .8s cubic-bezier(.25,.7,.35,1) .22s forwards;
  }

  .hero p{
    margin-top: 24px;
    max-width: 48ch;
    color: var(--ink-soft);
    font-size: 1.15rem;
    opacity: 0;
    animation: rise .8s cubic-bezier(.25,.7,.35,1) .36s forwards;
  }

  /* ---------- Section shell ---------- */
  section{
    padding: 72px 0;
    border-bottom: 1px solid var(--line);
  }



  section h2{
    font-size: 1.9rem;
    margin-bottom: 44px;
  }

  /* ---------- Education ---------- */
  .edu-entry{
    display:grid;
    grid-template-columns: 88px 1fr;
    gap: 24px;
    position: relative;
    padding-left: 4px;
  }

  .edu-entry .year{
    color: var(--ink-soft);
    font-size: 0.98rem;
    padding-top: 4px;
  }

  .edu-entry .rule{
    position:absolute;
    left: 96px;
    top: 8px;
    bottom: -8px;
    width: 1px;
    background: var(--line);
  }

  .edu-entry h3{
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .edu-entry .school{
    color: var(--accent);
    font-size: 1.05rem;
    margin-bottom: 10px;
  }

  .edu-entry p{
    color: var(--ink-soft);
    max-width: 48ch;
    font-size: 1.02rem;
  }

  /* ---------- Interests ---------- */
  .interest-grid{
    display:grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .interest-grid div{
    transition: transform .35s cubic-bezier(.25,.7,.35,1);
  }

  .interest-grid div:hover{
    transform: translateY(-4px);
  }

  .interest-grid div h3{
    font-size: 1.12rem;
    margin-bottom: 8px;
    transition: color .25s ease;
  }

  .interest-grid div:hover h3{
    color: var(--accent);
  }

  .interest-grid div p{
    color: var(--ink-soft);
    font-size: 1rem;
  }

  .interest-lead{
    color: var(--ink-soft);
    max-width: 58ch;
    margin-bottom: 44px;
    font-size: 1.1rem;
  }

  /* ---------- Contact (dark) ---------- */
  .contact{
    background: var(--black);
    color: var(--black-ink);
    border-bottom: none;
  }

  .contact h2{ color: var(--black-ink); }

  .contact p.lead{
    color: var(--black-ink-soft);
    max-width: 48ch;
    margin-bottom: 44px;
    font-size: 1.1rem;
  }

  .contact-links{
    display:flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #2a2a2a;
  }

  .contact-links a{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 22px 2px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 1.2rem;
    color: var(--black-ink);
    transition: padding-left .2s ease, color .2s ease;
    gap: 16px;
  }

  .contact-links a span.handle{
    color: var(--black-ink-soft);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
  }

  .contact-links a:hover,
  .contact-links a:focus-visible{
    padding-left: 10px;
    color: var(--accent);
  }

  /* ---------- Footer ---------- */
  footer{
    background: var(--black);
    color: var(--black-ink-soft);
    padding: 26px 0 34px;
  }

  footer .wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  footer .name{
    color: var(--black-ink);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.02rem;
  }

  footer .meta{
    font-size: 0.9rem;
  }

  /* ---------- Responsive ---------- */
  @media (max-width: 900px){
    .wrap{
      max-width: 640px;
      margin-left: auto;
      margin-right: auto;
    }

    .interest-grid{ grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
  }

  @media (max-width: 640px){
    .wrap{
      padding: 0 20px;
      margin-left: auto;
      margin-right: auto;
    }

    /* Keep the navigation visible on phones, but compact enough to fit. */
    header{ padding: 16px 0; }

    header .wrap{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap: 10px;
    }

    nav{
      display:block;
      margin-left:auto;
    }

    nav ul{
      gap: 12px;
      align-items:center;
    }

    nav a{
      font-size: 0.78rem;
    }

    .brand{ width: 36px; height: 36px; font-size: 0.82rem; flex-shrink:0; }

    /* The name section fills the phone viewport. */
    .hero{
      min-height: 100vh;
      min-height: 100svh;
      padding: 40px 0;
      display:flex;
      align-items:center;
    }

    .hero h1{
      max-width: none;
      font-size: clamp(2rem, 8vw, 2.6rem);
    }

    .hero p{
      margin-top: 20px;
      font-size: 0.94rem;
      line-height: 1.65;
    }

    section{
      padding: 76px 0;
      }

    .contact{
      padding: 56px 0;
    }

    section h2{
      font-size: 1.4rem;
      margin-bottom: 34px;
    }

    .edu-entry{
      grid-template-columns: 1fr;
      gap: 8px;
    }

    .edu-entry .rule{ display:none; }

    .edu-entry .year{
      font-size: 0.9rem;
    }

    .edu-entry h3{
      font-size: 1.08rem;
      line-height: 1.4;
    }

    .edu-entry .school{
      font-size: 0.94rem;
    }

    .edu-entry p{
      font-size: 0.92rem;
    }

    .interest-grid{
      grid-template-columns: 1fr;
      gap: 38px;
    }

    .interest-grid div:hover{ transform: none; }

    .interest-grid div h3{
      font-size: 1.02rem;
    }

    .interest-grid div p{
      font-size: 0.92rem;
      line-height: 1.65;
    }

    .interest-lead{
      font-size: 0.94rem;
      line-height: 1.65;
      margin-bottom: 38px;
    }

    .contact-links a{
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      padding: 20px 2px;
      font-size: 1rem;
    }

    .contact-links a span.handle{
      font-size: 0.84rem;
    }

    .contact-links a:hover,
    .contact-links a:focus-visible{ padding-left: 2px; }

    footer{
      padding: 22px 0 28px;
    }

    footer .wrap{
      flex-direction: column;
      align-items:flex-start;
      gap: 8px;
    }

    footer .meta{
      font-size: 0.82rem;
    }
  }

  @media (max-width: 380px){
    nav ul{ gap: 8px; }
    nav a{ font-size: 0.72rem; }

    .hero h1{ font-size: clamp(1.9rem, 10vw, 2.4rem); }

    section h2{ font-size: 1.35rem; }
  }

    .edu-entry + .edu-entry {
      margin-top: 48px;
    }

    @media (max-width: 700px) {
      .edu-entry + .edu-entry {
        margin-top: 36px;
      }
    }


/* Keep desktop navigation links on the right with comfortable border spacing. */
@media (min-width: 701px) {
  header .wrap {
    max-width: none;
    width: auto;
    margin-left: 0;
    margin-right: 0;
    padding-left: 12%;
    padding-right: 40px;
  }
}


/* Hero positioning and typography */
@media (min-width: 641px) {
  .hero {
    align-items: center;
  }

  .hero .wrap {
    transform: translateY(-6vh);
  }

  .hero h1 {
    font-size: clamp(4.5rem, 7vw, 7rem);
  }

  .hero p {
    font-size: 1.18rem;
  }
}

@media (max-width: 640px) {
  .hero .wrap {
    transform: translateY(-7vh);
  }

  .hero h1 {
    font-size: clamp(2.4rem, 9vw, 3.2rem);
  }

  .hero p {
    font-size: 1.05rem;
  }
}


    #projects .edu-entry + .edu-entry { margin-top: 44px; }
    #skills .edu-entry + .edu-entry { margin-top: 36px; }

    /* Full-width dark contact/footer areas on every screen size. */
    .contact,
    footer {
      width: 100vw;
      margin-left: calc(50% - 50vw);
      margin-right: calc(50% - 50vw);
    }


    .certificate-link {
      color: inherit;
      text-decoration: none;
      transition: color .2s ease;
    }

    .certificate-link:hover,
    .certificate-link:focus-visible {
      color: var(--accent);
    }


    .interest-item + .interest-item {
      margin-top: 38px;
    }

    .interest-item h3 {
      margin-bottom: 8px;
    }
    /* Portfolio readability and horizontal interests */
    #education p, #education .year, #education .school,
    #experience p, #experience .year,
    #projects p, #projects .year,
    #skills p, #skills .year,
    #interests p {
      font-size: 1.1rem;
    }

    #interests .interest-intro {
      margin-top: 16px;
      margin-bottom: 48px;
      max-width: 700px;
    }

    #interests .wrap {
      display: block;
    }

    #interests .wrap > .interest-item {
      display: flex;
      width: 100%;
      margin: 0;
      justify-content: space-between;
    }

    #interests .interest-item + .interest-item {
      margin-top: 0;
    }

    #interests .interest-item h3,
    #interests .interest-item p {
      width: 30%;
      margin: 0;
    }

    #interests .interest-item h3 {
      margin-bottom: 10px;
    }

    /* Put each interest into its own column while distributing the
       columns across the entire content width. */
    #interests .wrap {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      column-gap: 7vw;
    }

    #interests .wrap > h2,
    #interests .wrap > .interest-intro {
      grid-column: 1 / -1;
    }

    #interests .wrap > .interest-item {
      display: block;
      width: auto;
    }

    #interests .wrap > .interest-item h3,
    #interests .wrap > .interest-item p {
      width: auto;
    }

    @media (max-width: 699px) {
      #interests .wrap {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 5vw;
      }

      #interests .interest-item h3 {
        font-size: 1rem;
      }

      #interests .interest-item p {
        font-size: 1rem;
      }
    }


    header {
      width: 100%;
      min-height: 86px;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      padding: 0 7%;
      border-bottom: 1px solid #e5e5e5;
      position: relative;
      z-index: 20;
    }

    .brand {
      flex: 0 0 auto;
    }

    header nav {
      margin-left: auto;
    }

    header nav ul {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 30px;
      margin: 0;
      padding: 0;
      list-style: none;
    }

    header nav a {
      white-space: nowrap;
    }

    .menu-toggle {
      display: none;
      width: 40px;
      height: 40px;
      padding: 8px;
      border: 1px solid #333;
      border-radius: 50%;
      background: transparent;
      cursor: pointer;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 4px;
      flex: 0 0 auto;
    }

    .menu-toggle span {
      display: block;
      width: 15px;
      height: 1.5px;
      background: #333;
      transition: transform .2s ease, opacity .2s ease;
    }

    @media (max-width: 699px) {
      header {
        min-height: 78px;
        padding: 0 18px;
      }

      .menu-toggle {
        display: flex;
        margin-left: auto;
      }

      header nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 18px;
        width: min(210px, calc(100vw - 36px));
        box-sizing: border-box;
        padding: 8px 0;
        background: #fff;
        border: 1px solid #e5e5e5;
        border-top: none;
        box-shadow: 0 8px 20px rgba(0,0,0,.08);
      }

      header nav.open {
        display: block;
      }

      header nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
      }

      header nav li {
        width: 100%;
      }

      header nav a {
        display: block;
        padding: 12px 18px;
        font-size: .9rem;
      }

      header nav a:hover {
        background: #f7f7f7;
      }

      .menu-toggle.open span:nth-child(1) {
        transform: translateY(5.5px) rotate(45deg);
      }

      .menu-toggle.open span:nth-child(2) {
        opacity: 0;
      }

      .menu-toggle.open span:nth-child(3) {
        transform: translateY(-5.5px) rotate(-45deg);
      }
    }


    @media (max-width: 699px) {
      /* Keep the section/item divider visible on small screens */
      #education .item,
      #experience .item,
      #projects .item,
      #skills .item {
        border-left: 1px solid #e5e5e5;
        padding-left: 18px;
        margin-left: 0;
      }

      /* Interests become vertical on small screens */
      #interests .wrap {
        display: block;
      }

      #interests .wrap > .interest-item {
        display: block;
        width: 100%;
        margin: 0 0 32px 0;
      }

      #interests .wrap > .interest-item:last-child {
        margin-bottom: 0;
      }
    }

