@layer reset, base, layout;

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

  html {
    scroll-behavior: smooth;
  }

  body,
  h1,
  h2,
  h3,
  p,
  ul,
  dl,
  dd {
    margin: 0;
  }

  ul {
    padding: 0;
    list-style: none;
  }
}

@layer base {
  :root {
    color-scheme: light;
    --ink: oklch(20% 0.025 264);
    --paper: oklch(97% 0.012 88);
    --blue: oklch(55% 0.23 264);
    --blue-light: oklch(92% 0.04 264);
    --line: oklch(77% 0.025 88);
    --muted: oklch(47% 0.025 264);
    font-family: Arial, "Helvetica Neue", sans-serif;
    font-synthesis: none;
  }

  body {
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
  }

  ::selection {
    background: var(--ink);
    color: var(--paper);
  }

  h1,
  h2,
  h3 {
    text-wrap: balance;
  }

  p,
  dd {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.28em;
  }

  a:hover {
    text-decoration-thickness: 2px;
  }

  a:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 5px;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@layer layout {
  .masthead {
    display: grid;
    min-height: min(680px, 76svh);
    padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 4.5rem) clamp(2.5rem, 6vw, 5.5rem);
    background: var(--blue);
    color: var(--paper);
  }

  nav {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2rem;
    align-self: start;
  }

  .name {
    font-weight: 750;
    text-decoration: none;
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem clamp(1rem, 2.5vw, 2.5rem);
  }

  .intro {
    align-self: end;
  }

  .intro p,
  .status,
  .project-number,
  .stack {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
  }

  h1 {
    max-width: 13ch;
    margin-top: clamp(1rem, 2vw, 2rem);
    font-size: clamp(3.75rem, 8.5vw, 8.75rem);
    font-weight: 750;
    letter-spacing: -0.065em;
    line-height: 0.86;
  }

  .profile {
    display: grid;
    grid-template-columns: minmax(2rem, 0.5fr) minmax(0, 3.2fr) minmax(8rem, 0.8fr);
    gap: clamp(1rem, 3vw, 3rem);
    padding: clamp(3.5rem, 8vw, 8rem) clamp(1.25rem, 4vw, 4.5rem);
    background: var(--blue-light);
  }

  .section-label,
  dt,
  .projects-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
  }

  .section-label {
    padding-top: 0.65rem;
    color: var(--blue);
  }

  .profile-main {
    grid-column: 2;
    max-width: 64rem;
  }

  .profile h2 {
    max-width: 16ch;
    font-size: clamp(2.7rem, 5vw, 5.5rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 0.96;
  }

  .profile-copy {
    max-width: 63ch;
    margin-top: clamp(2rem, 4vw, 4rem);
    font-size: clamp(1.15rem, 1.8vw, 1.55rem);
    line-height: 1.5;
  }

  .skills {
    margin-top: clamp(2.5rem, 5vw, 5rem);
    border-bottom: 1px solid color-mix(in oklch, var(--blue) 28%, transparent);
  }

  .skills > div {
    display: grid;
    grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 2.3fr);
    gap: 1.5rem;
    padding-block: 1rem;
    border-top: 1px solid color-mix(in oklch, var(--blue) 28%, transparent);
  }

  dt {
    color: var(--blue);
  }

  dd {
    font-size: 1.05rem;
  }

  .projects {
    padding-inline: clamp(1.25rem, 4vw, 4.5rem);
  }

  .projects-title {
    padding-block: clamp(2.5rem, 5vw, 4.5rem) 1.25rem;
    border-bottom: 1px solid var(--line);
    color: var(--blue);
  }

  .project {
    display: grid;
    grid-template-columns: minmax(2rem, 0.5fr) minmax(0, 3.2fr) minmax(8rem, 0.8fr);
    gap: clamp(1rem, 3vw, 3rem);
    padding-block: clamp(2.5rem, 5vw, 5rem);
    border-bottom: 1px solid var(--line);
  }

  .project-number {
    padding-top: 0.55rem;
    color: var(--blue);
  }

  .project-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    max-width: 54rem;
  }

  h3 {
    font-size: clamp(2.1rem, 4vw, 4.75rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1;
  }

  .status {
    flex: none;
    color: var(--muted);
  }

  .project-copy {
    max-width: 56ch;
    margin-top: clamp(1.25rem, 2.5vw, 2.25rem);
    font-size: clamp(1.15rem, 1.8vw, 1.65rem);
    line-height: 1.42;
  }

  .stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    margin-top: 2rem;
    color: var(--muted);
  }

  .project-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    padding-top: 0.55rem;
    font-weight: 700;
  }

  footer {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(3rem, 7vw, 7rem) clamp(1.25rem, 4vw, 4.5rem);
    background: var(--ink);
    color: var(--paper);
  }

  footer a {
    font-weight: 700;
  }

  @media (max-width: 720px) {
    .masthead {
      min-height: 72svh;
    }

    nav,
    footer {
      align-items: flex-start;
      flex-direction: column;
    }

    .profile,
    .project {
      grid-template-columns: 2rem minmax(0, 1fr);
    }

    .profile-main {
      grid-column: 2;
    }

    .skills > div {
      grid-template-columns: 1fr;
      gap: 0.35rem;
    }

    .project-links {
      grid-column: 2;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 1rem 1.5rem;
      padding-top: 0.5rem;
    }

    .project-heading {
      align-items: flex-start;
      flex-direction: column;
      gap: 0.6rem;
    }
  }

  @media (max-width: 420px) {
    .nav-links {
      gap-inline: 1rem;
    }

    h1 {
      font-size: clamp(3.35rem, 18vw, 5rem);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
}
