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

/*
  Base CSS reset adapted from:
  Chris Coyier, “The Coyier CSS Starter”
  Frontend Masters
  https://frontendmasters.com/blog/the-coyier-css-starter/

  Used under fair use as a starting point and modified for this project.
*/
@layer reset {
  html {
    color-scheme: light dark;
    font:
      clamp(1rem, 1rem + 0.5vw, 2rem) / 1.4 system-ui,
      sans-serif;
    tab-size: 2;
    hanging-punctuation: first allow-end last;
    word-break: break-word;
  }

  body {
    margin: 0;
    padding: 2rem;

    @media (width < 500px) {
      padding: 1rem;
    }
  }

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

  h1,
  h2 {
    font-weight: 900;
    letter-spacing: -0.02rem;
  }

  h1,
  h2,
  h3 {
    line-height: 1.1;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6

  /* FUTURE :heading */
    {
    text-wrap: balance;
    margin-block-start: 0;
  }

  p,
  li,
  dd {
    text-wrap: pretty;
    max-inline-size: 88ch;
  }

  a {
    color: oklch(0.68 0.17 228);
    text-underline-offset: 2px;

    &:not(:is(:hover, :focus)) {
      text-decoration-color: color-mix(in srgb, currentColor, transparent 50%);
    }
  }

  sub,
  sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }

  sub {
    inset-block-end: -0.25em;
  }

  sup {
    inset-block-start: -0.5em;
  }

  ul,
  ol,
  dl {
    margin: 0;
    padding: 0;
    list-style-position: inside;

    ul,
    ol,
    dl {
      padding-inline-start: 2ch;
    }
  }

  img,
  video,
  iframe {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
    border-style: none;
  }

  figure {
    inline-size: fit-content;
    margin-inline: auto;
  }

  figcaption {
    contain: inline-size;
    font-size: 90%;
  }

  input,
  select,
  textarea,
  button {
    font: inherit;
    /* FUTURE: appearance: base; */
  }

  label {
    display: block;
  }

  input:not( :where([type="submit"],
      [type="checkbox"],
      [type="radio"],
      [type="button"],
      [type="reset"])) {
    inline-size: 100%;
  }

  button,
  input:where([type="submit"],
    [type="reset"],
    [type="button"]) {
    background: CanvasText;
    color: Canvas;
    border: 1px solid transparent;
  }

  textarea {
    field-sizing: content;
    min-block-size: 5lh;
    inline-size: 100%;
    max-inline-size: 100%;
  }

  pre,
  code,
  kbd,
  samp {
    font-family: ui-monospace, SFMono-Regular, monospace;
  }

  svg {
    fill: currentColor;
  }

  [aria-disabled="true" i],
  [disabled] {
    cursor: not-allowed;
  }

  [hidden] {
    display: none !important;
  }

  [disabled],
  label:has(input[disabled]) {
    opacity: 0.5;

    [disabled] {
      opacity: 1;
    }
  }

  pre {
    white-space: pre-wrap;
    background: CanvasText;
    color: Canvas;
    padding: 1.5rem;
  }

  hr {
    border-style: solid;
    border-width: 1px 0 0;
    color: inherit;
    height: 0;
    overflow: visible;
    margin-block: 2.5rem;
  }

  :target {
    scroll-margin: 3rlh;
  }

  table {
    caption-side: bottom;
    border-collapse: collapse;

    td {
      font-size: 90%;
    }

    td,
    th {
      word-break: normal;
      border: 1px solid gray;
      padding: 0.5rem;
    }
  }

  [role="region"][aria-labelledby][tabindex] {
    overflow: auto;
  }

  caption {
    font-size: 90%;
  }

  .screenreader-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  :focus-visible {
    outline-offset: 2px;
  }

  @media (prefers-reduced-motion: no-preference) {
    @view-transition {
      navigation: auto;
    }

    html {
      interpolate-size: allow-keywords;

      &:focus-within {
        scroll-behavior: smooth;
      }
    }
  }

}

@layer base {
  html {
    font-size: 100%;
    scroll-behavior: smooth;
  }

  body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #E6E6E6;
    background-color: #181614;;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.75rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
  }

  h3 {
    font-size: 1.125rem;
    margin-top: 1.5rem;
  }

  h4 {
    font-size: 1rem;
    margin-top: 1.25rem;
  }

  p {
    margin: 0 0 1rem;
  }

  code,
  pre,
  .mono {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular,
      Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.95em;
  }

  a {
    color: #F2F2F2
  }
 
  a:visited {
    color: inherit;
  }

  a:hover {
    color: #A6907C;
  }

  .skip-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.75rem 1rem;
    background: #FFB30D;
    color: #001542;
    font-weight: 600;
    text-decoration: none;
    transform: translateY(-120%);
    transition: transform 150ms ease;
    z-index: 100;
  }

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

  #page-header,
  #main-content,
  section#about,
  section#skills,
  section#experience,
  section#github,
  section#contact {
    scroll-margin-top: 74px;
  }

}

@layer layout {
  .ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
  }

}

@layer components {
 .page-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    z-index: 50;
    flex-wrap: nowrap;

    /* Initial state, alters on scroll */
    background-color: rgb(20 20 20 / 1); 
    border-bottom: 1px solid rgb(2 103 115 / 0.2);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition:
      background-color 200ms ease,
      border-color 200ms ease;
  }

  /* Scrolled state */
  .page-nav.is-scrolled {
    background-color: rgb(20 20 20 / 0.6);
    border-bottom: 1px solid rgb(2 103 115 / 0.9);
  }

  .home-link {
    display: block;
    position: relative;
    font-size: 1.5rem;
    line-height: 2rem;
    color: #F2F2F2;
    margin-right: 1rem;
    flex-shrink: 0;
    text-decoration: none;
  }

  .home-link::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background:  #3CA6A6;
    transition: width 0.3s ease;
  }

  .home-link:hover::before {
    width: 50%;
  }

  .home-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    right: 0;
    width: 0;
    height: 2px;
    background:  #FFB30D;
    transition: width 0.3s ease;
  }

  .home-link:hover::after {
    width: 50%;
  }


  .home-link__bracket {
    color: #3CA6A6
  }

  .home-link__bracket--alt {
    color: #FFB30D;
  }

  .main-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0 3px;
    list-style-type: none;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav__item {
    list-style-type: none;
    padding: 2px 0;
  }

  .main-nav__link {
    display: block;
    position: relative;
    text-decoration: none;
    text-transform: lowercase;
    margin: 2px 0;
    max-inline-size: none;
    text-wrap: nowrap;
    white-space: nowrap;
  }

  .main-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 0;
    width: 0;
    height: 2px;
    background:  #A6907C;
    transition: width 0.3s ease;
  }

  .main-nav__link:hover::after {
    width: 100%;
  }

  .main-nav__text::after {
    content: "()";
  }

  #page-header {
    padding-top: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hello-world {
    color: #FFB30D;
    margin: 0 0 0.5rem 0;
    padding: 0;
  }

  .page-header__heading {
    font-family: "Syne", "Inter", system-ui, sans-serif;
    font-weight: 700;
    font-size: 3.75rem;
    line-height: 1;
    letter-spacing: -0.01em;
    text-align: center;
    color: #FFFFFF;
  }

  .page-header__sub-heading {
    font-family: "Syne", "Inter", system-ui, sans-serif;
    color: #001542;
    font-weight: 500;
    font-size: 1.6rem;
  }

  .page-header__tagline {
    font-family: "Syne", "Inter", system-ui, sans-serif;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.4rem;
    font-weight: 300;
  }

  .section {
    margin-top: 3rem;
  }

  .section__title {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular,
      Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 1em;
    font-weight: normal;
    color: #FFB30D;
    margin: 0 0 0.5rem 0;
  }

  .section__title::before {
    content: "// ";
    font-family: '';
  }

  .section__tagline {
    font-family: "Syne", "Inter", system-ui, sans-serif;
    font-size: 2rem;
    line-height: 2rem;
    font-weight: 400;
    margin-bottom: 1rem;
  }

  .glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.25;
    animation: float 40s ease-in-out infinite;
  }

  .glow--one {
    width: 280px;
    height: 280px;
    top: 10%;
    left: 8%;
    background: rgb(60 166 166 / 0.35);
  }

  .glow--two {
    width: 360px;
    height: 360px;
    bottom: 15%;
    right: 10%;
    background: rgb(255 179 13 / 0.25);
    animation-delay: -20s;
  }

  .page-header {
    opacity: 1;
    transform: none;
  }

  .page-header.animate,
  .page-header.animate > * {
    animation: header-enter 600ms ease-out both;
  }

  .page-header > *:nth-child(1) { animation-delay: 0ms; }
  .page-header > *:nth-child(2) { animation-delay: 80ms; }
  .page-header > *:nth-child(3) { animation-delay: 160ms; }
  .page-header > *:nth-child(4) { animation-delay: 220ms; }
  
  .site-footer {
    margin-top: 4rem;
    padding: 3rem 1.5rem 2.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.08);
    text-align: center;
  }

  .site-footer__top {
    margin-top: 1rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .page-header,
    .page-header > *,
    .page-header.animate,
    .page-header.animate > *{
      animation: none;
      opacity: 1;
      transform: none;
    }
  }

  @media (min-width: 480px) {
    .main-nav {
      gap: 1rem;
    }
  }

  @keyframes float {
    0% {
      transform: translate3d(0, 0, 0) scale(1);
    }
    33% {
      transform: translate3d(60px, -80px, 0) scale(1.08);
    }
    66% {
      transform: translate3d(-80px, 50px, 0) scale(0.96);
    }
    100% {
      transform: translate3d(0, 0, 0) scale(1);
    }
  }

  @keyframes header-enter {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

}

@layer utilities {
  .gradiant-text {
    background: linear-gradient(
      150deg,
      #3CA6A6 0%,
      #3CA6A6 30%,
      #FFB30D 70%,
      #FFB30D 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .muted {
    color: #BAB7B3;
  }

}

@layer overrides {}

