@layer reset, base, layout, components, utilities;

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

  html {
    scroll-behavior: smooth;
  }

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

  img {
    display: block;
    max-width: 100%;
  }

  button,
  input {
    font: inherit;
  }
}

@layer base {
  :root {
    color-scheme: dark;
    --color-page: #100b14;
    --color-surface: rgba(15, 16, 24, 0.9);
    --color-surface-muted: rgba(25, 28, 40, 0.92);
    --color-ink: #f7fbff;
    --color-muted: #a7a8b6;
    --color-border: rgba(149, 91, 222, 0.34);
    --color-accent: #62c7b8;
    --color-accent-strong: #9fd7ff;
    --color-accent-soft: rgba(98, 199, 184, 0.14);
    --color-warm: #c4a1ff;
    --color-gold: #e5bd67;
    --shadow-soft: 0 0 32px rgba(139, 92, 246, 0.24), 0 18px 44px rgba(0, 0, 0, 0.34);
    --shadow-tight: 0 12px 28px rgba(0, 0, 0, 0.28);
    --radius: 8px;
    --shell: 1120px;
    --space-1: 0.5rem;
    --space-2: 0.75rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 4.5rem;
    --section-space: clamp(3.75rem, 7vw, 5.25rem);
    --section-heading-gap: clamp(1.5rem, 3vw, 2.25rem);
    --section-column-gap: clamp(2rem, 5vw, 3.5rem);
    --section-divider: linear-gradient(90deg, transparent, rgba(149, 91, 222, 0.68), rgba(98, 199, 184, 0.38), transparent);
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    background:
      radial-gradient(circle at 76% 12%, rgba(90, 117, 230, 0.28), transparent 24rem),
      radial-gradient(circle at 18% 74%, rgba(15, 118, 110, 0.22), transparent 25rem),
      linear-gradient(180deg, #130a17 0%, #0b101b 48%, #100b14 100%);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 0;
    text-rendering: optimizeLegibility;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
      linear-gradient(26deg, transparent calc(50% - 1px), rgba(150, 207, 255, 0.28) 50%, transparent calc(50% + 1px)),
      linear-gradient(149deg, transparent calc(50% - 1px), rgba(150, 207, 255, 0.24) 50%, transparent calc(50% + 1px)),
      linear-gradient(12deg, transparent calc(50% - 1px), rgba(150, 207, 255, 0.18) 50%, transparent calc(50% + 1px)),
      linear-gradient(68deg, transparent calc(50% - 1px), rgba(150, 207, 255, 0.2) 50%, transparent calc(50% + 1px)),
      linear-gradient(132deg, transparent calc(50% - 1px), rgba(150, 207, 255, 0.2) 50%, transparent calc(50% + 1px)),
      radial-gradient(circle at 8% 16%, rgba(174, 216, 255, 0.85) 0 2px, transparent 2.5px),
      radial-gradient(circle at 19% 24%, rgba(174, 216, 255, 0.75) 0 2px, transparent 2.5px),
      radial-gradient(circle at 55% 14%, rgba(174, 216, 255, 0.72) 0 2px, transparent 2.5px),
      radial-gradient(circle at 86% 51%, rgba(174, 216, 255, 0.72) 0 2px, transparent 2.5px),
      linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-position:
      2% 10%,
      10% 18%,
      58% 8%,
      72% 30%,
      28% 66%,
      8% 16%,
      19% 24%,
      55% 14%,
      86% 51%,
      0 0,
      0 0;
    background-size:
      18rem 9rem,
      18rem 10rem,
      22rem 8rem,
      26rem 13rem,
      24rem 13rem,
      100% 100%,
      100% 100%,
      100% 100%,
      100% 100%,
      28px 28px,
      28px 28px;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat;
    opacity: 0.82;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.36));
  }

  body > * {
    position: relative;
    z-index: 1;
  }

  a {
    color: inherit;
  }

  :focus-visible {
    outline: 3px solid var(--color-gold);
    outline-offset: 4px;
  }
}

@layer layout {
  .page-shell {
    width: min(100% - 2rem, var(--shell));
    margin-inline: auto;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-3);
    min-height: 4.25rem;
    padding: var(--space-2) max(1rem, calc((100% - var(--shell)) / 2));
    border-bottom: 1px solid rgba(149, 91, 222, 0.22);
    background: rgba(12, 12, 19, 0.78);
    backdrop-filter: blur(18px);
  }

  .site-nav {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--space-1);
  }

  main > section {
    scroll-margin-top: 5.5rem;
  }

  .presentation {
    position: relative;
    isolation: isolate;
    min-height: 34rem;
    display: grid;
    align-items: center;
    overflow: hidden;
    padding-block: clamp(4.5rem, 8vw, 5.75rem) var(--section-space);
    background: transparent;
    color: #f7fbff;
  }

  .presentation::before {
    display: none;
  }

  .presentation::after {
    display: none;
  }

  .presentation__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 24rem);
    align-items: center;
    gap: var(--space-7);
  }

  .presentation__copy {
    max-width: 42rem;
  }

  .contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: 0;
  }

  .about,
  .projects,
  .skills,
  .timeline,
  .credentials,
  .contact {
    position: relative;
    padding-block: var(--section-space);
  }

  .about::before,
  .projects::before,
  .timeline::before,
  .skills::before,
  .credentials::before,
  .contact::before,
  .site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--section-divider);
  }

  .about {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 1.1fr);
    gap: var(--section-column-gap);
  }

  .about__copy {
    display: grid;
    gap: var(--space-3);
    color: var(--color-muted);
    font-size: 1.06rem;
  }

  .section-heading {
    position: relative;
    max-width: 48rem;
    margin-bottom: var(--section-heading-gap);
    color: var(--color-ink);
  }

  .about .section-heading {
    margin-bottom: 0;
  }

  .section-heading::before {
    content: "";
    display: block;
    width: 4.5rem;
    height: 0.28rem;
    margin-bottom: var(--space-3);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-accent), #8ecbff, var(--color-gold));
  }

  .section-heading--split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 0.75fr);
    align-items: end;
    gap: var(--section-column-gap);
    max-width: none;
  }

  .section-heading--split::before {
    grid-column: 1 / -1;
  }

  .project-grid,
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
  }

  .timeline-list {
    display: grid;
    gap: var(--space-3);
    list-style: none;
    padding: 0;
    counter-reset: timeline;
  }

  .credential-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--section-column-gap);
    background: linear-gradient(180deg, rgba(15, 16, 24, 0.22), rgba(15, 16, 24, 0));
  }

  .site-footer {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-5);
    color: var(--color-muted);
  }
}

@layer components {
  .skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
    transform: translateY(-150%);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    background: var(--color-ink);
    color: var(--color-page);
    text-decoration: none;
    transition: transform 180ms ease;
  }

  .skip-link:focus {
    transform: translateY(0);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 2.75rem;
    text-decoration: none;
    font-weight: 800;
  }

  .brand__mark {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: var(--radius);
    background: var(--color-ink);
    color: var(--color-page);
    font-size: 0.9rem;
  }

  .site-nav a {
    min-height: 2.5rem;
    padding: 0.58rem 0.85rem;
    border-radius: var(--radius);
    color: rgba(247, 251, 255, 0.72);
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: rgba(149, 91, 222, 0.16);
    color: #ffffff;
  }

  .eyebrow {
    color: var(--color-accent-strong);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
  }

  h1,
  h2,
  h3 {
    line-height: 1.08;
    letter-spacing: 0;
  }

  h1 {
    max-width: 46rem;
    margin-top: var(--space-2);
    font-size: 4rem;
  }

  h2 {
    margin-top: var(--space-2);
    font-size: 2.35rem;
  }

  h3 {
    font-size: 1.18rem;
  }

  .section-heading p:last-child,
  .contact__content p:last-child {
    color: var(--color-muted);
  }

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  }

  .button:hover {
    transform: translateY(-1px);
  }

  .button--primary {
    background: var(--color-accent);
    color: #fffdf8;
    box-shadow: var(--shadow-tight);
  }

  .button--primary:hover {
    background: var(--color-accent-strong);
  }

  .button--secondary {
    border-color: rgba(149, 91, 222, 0.38);
    background: rgba(15, 16, 24, 0.72);
    color: inherit;
  }

  .contact .button--secondary {
    background: rgba(15, 16, 24, 0.84);
  }

  .button--text {
    padding-inline: 0.25rem;
    color: #9fd7ff;
  }

  .presentation__photo-frame {
    width: min(17rem, 72vw);
    aspect-ratio: 1;
    padding: 0.38rem;
    border-radius: 50%;
    background:
      linear-gradient(135deg, #8ecbff, #62c7b8 48%, #e5bd67);
    box-shadow: 0 24px 54px rgba(0, 0, 0, 0.36);
  }

  .presentation__photo-frame img {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(247, 251, 255, 0.88);
    border-radius: 50%;
    object-fit: cover;
    object-position: center 25%;
  }

  .presentation__eyebrow {
    color: #9fd7ff;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.82rem;
  }

  .presentation h1 {
    max-width: 54rem;
    margin-top: var(--space-1);
    font-size: 4.3rem;
    color: #ffffff;
  }

  .presentation__summary {
    max-width: 42rem;
    margin-top: var(--space-3);
    color: rgba(232, 242, 250, 0.82);
    font-size: 1.18rem;
    line-height: 1.45;
  }

  .presentation__stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: var(--space-2);
    max-width: 46rem;
    padding: 0;
    margin: var(--space-4) 0 0;
    list-style: none;
  }

  .presentation__stack li {
    min-height: 2.1rem;
    padding: 0.34rem 0.72rem;
    border: 1px solid rgba(174, 216, 255, 0.26);
    border-radius: var(--radius);
    background: rgba(10, 17, 29, 0.72);
    color: rgba(247, 251, 255, 0.9);
    font-size: 0.88rem;
    font-weight: 850;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  }

  .presentation__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: var(--space-3);
    margin-top: var(--space-5);
  }

  .icon-link {
    display: inline-grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border: 1px solid rgba(174, 216, 255, 0.22);
    border-radius: 50%;
    background: rgba(10, 17, 29, 0.86);
    color: rgba(247, 251, 255, 0.8);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    transition: transform 160ms ease, color 160ms ease, background 160ms ease, border-color 160ms ease;
  }

  .icon-link:hover {
    transform: translateY(-2px);
    border-color: rgba(159, 226, 216, 0.72);
    background: rgba(98, 199, 184, 0.78);
    color: #ffffff;
  }

  .icon-link svg {
    width: 1.8rem;
    height: 1.8rem;
    fill: currentColor;
  }

  .presentation__portrait {
    position: relative;
    display: grid;
    justify-items: center;
  }

  .presentation__portrait::before {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: var(--radius);
  }

  .presentation__portrait::before {
    right: -0.8rem;
    bottom: 3.2rem;
    width: 11rem;
    height: 8.5rem;
    border: 1px solid rgba(174, 216, 255, 0.4);
    background:
      linear-gradient(90deg, rgba(174, 216, 255, 0.3) 1px, transparent 1px),
      linear-gradient(rgba(174, 216, 255, 0.3) 1px, transparent 1px);
    background-size: 18px 18px;
  }

  .presentation__note {
    width: min(18rem, 100%);
    margin-top: var(--space-3);
    padding: var(--space-3);
    border: 1px solid rgba(174, 216, 255, 0.24);
    border-radius: var(--radius);
    background: rgba(10, 17, 29, 0.84);
    color: rgba(247, 251, 255, 0.9);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
  }

  .presentation__note span {
    color: #9fd7ff;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .presentation__note strong {
    display: block;
    margin-top: 0.1rem;
    line-height: 1.2;
  }

  .project-card__meta,
  .credential-grid span,
  .timeline-list > li > span {
    color: var(--color-warm);
    font-size: 0.82rem;
    font-weight: 800;
  }

  .credential-grid p,
  .project-card p,
  .skills-grid li,
  .timeline-list p,
  .experience-bullets {
    color: var(--color-muted);
  }

  .project-card,
  .credential-grid article,
  .skills-grid article,
  .timeline-list > li {
    border: 1px solid rgba(149, 91, 222, 0.38);
    border-radius: var(--radius);
    background:
      linear-gradient(180deg, rgba(20, 20, 30, 0.94), rgba(12, 13, 20, 0.94));
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.26);
  }

  .project-card,
  .credential-grid article,
  .skills-grid article {
    padding: var(--space-4);
  }

  .project-card {
    position: relative;
    display: grid;
    gap: var(--space-3);
    align-content: start;
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .project-card::before,
  .skills-grid article::before,
  .credential-grid article::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
      linear-gradient(90deg, rgba(149, 91, 222, 0.78), rgba(98, 199, 184, 0.42), rgba(142, 203, 255, 0.7)) 0 0 / 100% 1px no-repeat;
    opacity: 0.82;
  }

  .project-card:hover {
    transform: translateY(-2px);
    border-color: rgba(170, 114, 255, 0.78);
    box-shadow:
      0 0 22px rgba(149, 91, 222, 0.24),
      0 0 58px rgba(98, 199, 184, 0.12),
      0 20px 44px rgba(0, 0, 0, 0.32);
  }

  .project-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: space-between;
  }

  .tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: 0;
    list-style: none;
  }

  .tag-list li {
    min-height: 1.9rem;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius);
    border: 1px solid rgba(98, 199, 184, 0.18);
    background: rgba(98, 199, 184, 0.1);
    color: #b8f4e8;
    font-size: 0.84rem;
    font-weight: 800;
  }

  .project-link {
    width: max-content;
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(142, 203, 255, 0.28);
    border-radius: var(--radius);
    background: rgba(142, 203, 255, 0.08);
    color: #eaf8ff;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }

  .project-link:hover,
  .project-link:focus-visible {
    border-color: rgba(142, 203, 255, 0.64);
    background: rgba(98, 199, 184, 0.14);
    box-shadow: 0 0 18px rgba(142, 203, 255, 0.18);
  }

  .skills-grid article {
    position: relative;
    display: grid;
    gap: var(--space-3);
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .skills-grid ul {
    display: grid;
    gap: var(--space-2);
    padding-left: 1.2rem;
  }

  .timeline-list > li {
    position: relative;
    display: grid;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-4) var(--space-4) 4.5rem;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .experience-bullets {
    display: grid;
    gap: var(--space-2);
    padding-left: 1.1rem;
  }

  .experience-bullets li {
    padding-left: 0.15rem;
  }

  .timeline-list > li:hover,
  .skills-grid article:hover,
  .credential-grid article:hover {
    transform: translateY(-2px);
    border-color: rgba(170, 114, 255, 0.78);
    box-shadow:
      0 0 22px rgba(149, 91, 222, 0.22),
      0 0 52px rgba(98, 199, 184, 0.1),
      0 20px 44px rgba(0, 0, 0, 0.3);
  }

  .timeline-list > li::before {
    counter-increment: timeline;
    content: counter(timeline);
    position: absolute;
    left: var(--space-4);
    top: var(--space-4);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--color-ink), var(--color-accent-strong));
    color: #ffffff;
    font-weight: 800;
  }

  .credential-grid article {
    position: relative;
    display: grid;
    gap: var(--space-2);
    overflow: hidden;
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .contact__content {
    max-width: 48rem;
  }

  .contact__content h2 + p {
    margin-top: var(--space-3);
  }

  .contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    margin-top: var(--space-4);
    list-style: none;
    color: var(--color-muted);
  }

  .contact-list li {
    min-height: 2.1rem;
    padding: 0.32rem 0.6rem;
    border: 1px solid rgba(149, 91, 222, 0.34);
    border-radius: var(--radius);
    background: rgba(15, 16, 24, 0.84);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  .contact-list a {
    color: var(--color-accent-strong);
    font-weight: 800;
    text-decoration: none;
  }

  .site-footer a {
    color: var(--color-accent-strong);
    font-weight: 800;
    text-decoration: none;
  }
}

@layer utilities {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 420ms ease, transform 420ms ease;
  }

  .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

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

    .reveal {
      opacity: 1;
      transform: none;
    }
  }

  @media (max-width: 920px) {
    :root {
      --section-column-gap: var(--space-5);
    }

    .site-header {
      grid-template-columns: 1fr auto;
    }

    .site-nav {
      grid-column: 1 / -1;
      justify-self: stretch;
      overflow-x: auto;
      padding-bottom: 0.2rem;
    }

    .site-nav a {
      flex: 1 0 auto;
      text-align: center;
    }

    h1 {
      font-size: 3rem;
    }

    .presentation h1 {
      font-size: 3.6rem;
    }

    .presentation__inner {
      grid-template-columns: 1fr;
      gap: var(--space-5);
    }

    .presentation::after {
      width: 100%;
      height: 14rem;
      top: auto;
      clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
      opacity: 0.32;
    }

    .presentation__summary {
      font-size: 1.2rem;
    }

    h2 {
      font-size: 2rem;
    }

    .about,
    .section-heading--split,
    .contact {
      grid-template-columns: 1fr;
    }

    .credential-grid,
    .project-grid,
    .skills-grid {
      grid-template-columns: 1fr;
    }

    .contact__actions {
      margin-top: 0;
    }
  }

  @media (max-width: 620px) {
    :root {
      --section-space: 3rem;
      --section-heading-gap: 1.5rem;
      --section-column-gap: 1.75rem;
    }

    .page-shell {
      width: min(100% - 1rem, var(--shell));
    }

    .site-header {
      padding-inline: 0.5rem;
    }

    .brand__text {
      display: none;
    }

    h1 {
      font-size: 2.35rem;
    }

    .presentation {
      min-height: 0;
      padding-block: var(--space-6);
    }

    .presentation__photo-frame {
      width: 10.5rem;
    }

    .presentation h1 {
      font-size: 2.85rem;
    }

    .presentation__summary {
      font-size: 1.04rem;
    }

    .presentation__stack,
    .presentation__actions {
      justify-content: flex-start;
    }

    .presentation__portrait {
      justify-items: start;
    }

    .presentation__portrait::before {
      display: none;
    }

    .icon-link {
      width: 3.35rem;
      height: 3.35rem;
    }

    .icon-link svg {
      width: 1.5rem;
      height: 1.5rem;
    }

    h2 {
      font-size: 1.65rem;
    }

    .about__copy {
      font-size: 1rem;
    }

    .site-footer {
      flex-direction: column;
    }
  }
}
