@layer fonts {

  /* orbitron-regular - latin */
  @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/orbitron-v31-latin-regular.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }

  /* orbitron-600 - latin */
  @font-face {
    font-display: swap;
    /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Orbitron';
    font-style: normal;
    font-weight: 600;
    src: url('/static/fonts/orbitron-v31-latin-600.woff2') format('woff2');
    /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }

  /* Inter (body text). The latin-ext files (needed for Hungarian ő/ű) only download on pages that use those characters. */
  @font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/inter-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
  }

  @font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    src: url('/static/fonts/inter-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
  }

  @font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('/static/fonts/inter-latin-ext-400.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
  }

  @font-face {
    font-display: swap;
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    src: url('/static/fonts/inter-latin-ext-700.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
  }
}

@layer colors {
  :root {
    --c-black: rgb(0, 0, 0);
    --c-white: rgb(255, 255, 255);
    --c-emissive-blue: rgb(28, 235, 255);
    --c-light-gray: rgb(108, 118, 130);
    --c-medium-gray: rgb(71, 78, 87);
    --c-dark-gray: rgb(40, 43, 47);
    --c-bg-dark-gray: rgb(24, 24, 24);
    --color-background-dark: var(--c-black);
    --color-white: var(--c-white);
    --color-emissive-blue: var(--c-emissive-blue);
    --color-light-gray: var(--c-light-gray);
    --color-medium-gray: var(--c-medium-gray);
    --color-dark-gray: var(--c-dark-gray);
  }
}

@layer typography {
  :root {
    --fs-48: calc(48 / 16 * 1rem);
    /*-- calculates what 48px is in rem, where 16px is 1rem --*/
    --fs-38: calc(38 / 16 * 1rem);
    --fs-28: calc(28 / 16 * 1rem);
    --fs-24: calc(24 / 16 * 1rem);
    --fs-22: calc(22 / 16 * 1rem);
    --fs-18: calc(18 / 16 * 1rem);
    --fs-16: calc(16 / 16 * 1rem);
    --fs-12: calc(12 / 16 * 1rem);
    --fs-14: calc(14 / 16 * 1rem);
    /*-- Orbitron has no ő/ű, so those letters fall back to Inter per-character --*/
    --font-heading: 'Orbitron', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    /*-- Mobile first --*/
    --font-size-h1: var(--fs-24);
    --font-size-h2: var(--fs-22);
    --font-size-h3: var(--fs-18);
    --font-size-p: var(--fs-16);
    --font-size-p-sm: var(--fs-16);
    --font-size-footer: var(--fs-14);

    /*-- Tablet media query --*/
    @media (width >=calc(700 / 16 * 1rem)) {
      --font-size-h1: var(--fs-38);
      --font-size-h2: var(--fs-28);
      --font-size-h3: var(--fs-22);
      --font-size-p: var(--fs-18);

    }

    /*-- Laptop media query --*/
    @media (width >=calc(1100 / 16 * 1rem)) {
      --font-size-h1: var(--fs-48);
      --font-size-h2: var(--fs-38);
      --font-size-h3: var(--fs-28);
    }

  }

  h1,
  h2,
  h3 {
    margin: 0;
    line-height: 1.2;
  }

  /*-- Orbitron is for personality (brand, h1, section headings); Inter is for reading --*/
  h1 {
    font-family: var(--font-heading);
    font-size: var(--font-size-h1);
    font-weight: 400;
  }

  h2 {
    font-family: var(--font-heading);
    font-size: var(--font-size-h2);
    font-weight: 600;
  }

  h3 {
    font-family: var(--font-body);
    font-size: var(--font-size-h3);
    font-weight: 700;
  }

  p {
    margin: 0;
    font-size: var(--font-size-p);
    font-weight: 400;
    line-height: 1.5;
  }

  a {
    text-decoration: none;
  }
}

@layer global {

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

  html {
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    background: var(--color-background-dark);
    color: var(--color-white);
    font-family: var(--font-body);
  }

  section {
    padding: 1rem;
  }

  footer {
    background-color: #222;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    color: #999; /* 5.6:1 on #222 (was #777 = 3.5:1, below WCAG AA) */
  }

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

  video {
    display: block;
    max-width: 100%;
    height: auto;
  }

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

  ul li {
    margin-bottom: 1rem;
    padding-left: 1rem;
    position: relative;
  }

}

@layer layout {
  .wrapper {
    /*-- Set up 3 column layout --*/
    display: grid;
    grid-template-columns: 12px 1fr 12px;

    /*
    > target children 
    * wildcard, or all children 
    */
    >* {
      grid-column: 2;
    }

    >.fullbleed {
      grid-column: 1 / -1;
      /* -1 is the last column, or counting right-to-left */
    }

    @media (width >=calc(700 / 16 * 1rem)) {
      grid-template-columns: 1fr min(100% - 80px, 1110px) 1fr;
    }
  }

  .divider {
    position: relative;
    width: 100%;
    height: 10px;
  }

  .div-transparent:before {
    content: "";
    position: absolute;
    top: 0;
    left: 5%;
    right: 5%;
    width: 90%;
    height: 3px;
    background-image: linear-gradient(to right, transparent, var(--color-medium-gray), transparent);
  }

  .div-dot:after {
    content: "";
    position: absolute;
    z-index: 1;
    top: -5px;
    left: calc(50% - 6px);
    width: 12px;
    height: 12px;
    background-color: var(--color-emissive-blue);
    border: 1px solid var(--color-dark-gray);
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--color-light-gray),
      0 0 0 2px var(--color-medium-gray);
  }
}

@layer header {
  header {
    padding: 1rem;
    text-align: center;
  }

  header h1 {
    margin: 0;
  }

  .nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-bar img {
    width: 64px;
    height: 64px;
  }

  .nav-menu-container {
    display: flex;
    align-items: center;
  }

  .nav-title {
    margin: 0;
    color: var(--c-emissive-blue);
    font-family: var(--font-heading);
    font-size: var(--font-size-h3);
    font-weight: 600;
  }

  nav a {
    margin: 0 1rem;
    color: rgb(28, 183, 255);
    text-decoration: none;
    transition: color 1.0s;
  }

  nav a:hover {
    text-decoration: underline;
    color: var(--c-emissive-blue);
  }

  .menu-toggle {
    display: none;
    font-size: 2rem;
    color: var(--c-emissive-blue);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
  }

  .logo {
    color: var(--c-emissive-blue);
  }

  /*-- Language --*/
  .language-switcher {
    padding: 0.5rem;
  }

  #language-select {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
  }


  /*-- Mobile Hamburger Menu --*/
  @media (max-width: 768px) {
    .menu-toggle {
      display: block;
    }

    .nav-bar nav {
      display: none;
      flex-direction: column;
      background-color: var(--c-bg-dark-gray);
      position: absolute;
      top: 70px;
      right: -300px;
      width: 150px;
      transition: right 0.3s ease;
      padding: 1rem;
      z-index: 10;
    }

    .nav-bar a {
      padding: 16px 0;
      ;
    }

    .nav-bar nav.show {
      display: flex;
      right: 20px;
    }

    .logo {
      display: none;
    }
  }

  /*-- fade-in logo animation --*/
  #splash {
    opacity: 0;
    animation: fadeIn 2s ease-in-out forwards;
  }

  @keyframes fadeIn {
    to {
      opacity: 1;
    }
  }

}

@layer icons {
  /* Inline SVG icons (replacing the Font Awesome CDN dependency). Sized in
     em units so they scale with the surrounding text, same as the old
     icon-font glyphs did. */
  .icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    flex-shrink: 0;
  }

  .icon-lg {
    width: 2em;
    height: 2em;
  }
}

@layer button {
  .button {
    display: inline-block;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--color-background-dark);
    background-color: var(--c-emissive-blue);
    border: 2px solid var(--c-emissive-blue);
    border-radius: 6px;
    width: fit-content;
    padding: 14px 32px;
    text-decoration: none;
    transition: background-color 200ms ease-in-out, color 200ms ease-in-out, box-shadow 200ms ease-in-out;

    &:hover {
      background-color: transparent;
      color: var(--c-emissive-blue);
      box-shadow: 0 0 15px var(--c-emissive-blue);
    }

    &:focus-visible {
      outline: 2px solid var(--c-emissive-blue);
      outline-offset: 4px;
    }
  }
}

@layer hero {
  .hero {
    border: none;

    /* Caps the poster/video height so the headline and button appear on the first
       screen. Raise it to show more of the animation, lower it to show less. */
    --hero-max-height: 80vh;

    .hero-media {
      position: relative;
      overflow: hidden;
      /* Definite width: with width:auto, the height cap below would be passed through the
         aspect ratio and shrink the box's WIDTH (left-aligned), instead of just cropping it */
      width: 100%;
      aspect-ratio: 16 / 9;
      max-height: var(--hero-max-height);

      /* Phones: portrait 4:5 frame (matches the 720x900 mobile video) */
      @media (width < calc(700 / 16 * 1rem)) {
        --hero-max-height: 62svh;
        aspect-ratio: 4 / 5;
        /* explicit width: with auto margins a grid item shrink-wraps its content, and
           everything inside is absolutely positioned, so it would collapse to 0 */
        width: min(100%, 420px);
        justify-self: center;
      }
    }

    /* Poster and video occupy the same box; the video fades in once it is playing */
    .hero-poster,
    .bg-video {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center 60%;
    }

    .bg-video {
      opacity: 0;
      transition: opacity 600ms ease;
    }

    .bg-video.is-playing {
      opacity: 1;
    }

    .content {
      margin-block-end: 48px;
    }

    .title {
      padding: 20px 0;
    }

    .description {
      padding-block-end: 24px;
    }
  }
}

@layer about {
  #about p,
  #about .about-list {
    max-width: 70ch; /* ~60-75 characters per line reads best */
  }

  #about {
    background-color: var(--color-background-dark);
    border: none;
    padding-top: 32px;

    h2 {
      margin-bottom: 1rem;
    }

    p {
      margin: 16px 0;
    }

    ul {
      list-style: disc;
      list-style-position: inside;
      padding: 0;
    }


  }

  .about-list {
    margin-top: 24px;
    margin-bottom: 24px;
    background-color: rgb(24, 24, 24);
    border-radius: 6px;
    padding: 12px;
  }
}

@layer code-typing {

  /* Add this to your CSS */
  .code-typing {
    background-color: var(--color-background-dark);
    padding: 3rem 2rem;
    color: #0ff;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-align: left;
    margin-bottom: 3rem;
  }

  .glass-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 2rem;
    max-width: 700px;
    min-height: 150px;
    margin: auto;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    animation: neonPulse 3s ease-in-out infinite;
  }

  .glass-panel.show {
    opacity: 1;
    transform: translateY(0);
  }

  @keyframes neonPulse {

    0%,
    100% {
      box-shadow: 0 0 10px rgba(0, 255, 255, 0.2), 0 0 30px rgba(0, 255, 255, 0.3);
    }

    50% {
      box-shadow: 0 0 20px rgba(0, 255, 255, 0.4), 0 0 50px rgba(0, 255, 255, 0.6);
    }
  }

  .terminal {
    display: block;
    font-size: 1.2rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;

    @media (max-width: 480px) {
      font-size: 1rem;
    }
  }

  .cursor {
    display: inline-block;
    animation: blink 0.7s steps(2, start) infinite;
  }

  @keyframes blink {

    0%,
    100% {
      opacity: 1;
    }

    50% {
      opacity: 0;
    }
  }

}

@layer services {
  .services {
    padding: 4rem 2rem;
    background-color: rgb(24, 24, 24);
    text-align: center;
  }

  .services h2 {
    margin-bottom: 2rem;
  }

  .service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
  }

  .service-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
  }

  .service-card:hover {
    box-shadow: 0 0 15px var(--c-emissive-blue), 0 0 25px #00bcd4;
    transform: translateY(-5px);
  }

  .service-card h3 {
    color: var(--c-emissive-blue);
    font-size: var(--fs-18);
    margin-bottom: 1rem;
  }

  .service-card p {
    font-size: var(--fs-16);
  }

  .service-card svg.icon-lg {
    color: #00bcd4;
    margin-bottom: 1rem;
  }

  .service-details {
    text-align: left;
    margin-top: 1rem;
    list-style: disc;
    list-style-position: inside;
  }

  .service-details li {
    font-size: var(--fs-16);
    margin-bottom: 0.5rem;
    padding-left: 0;
  }

}

@layer projects {
  .showcase {
    padding: 4rem 2rem;
    /*background-color: rgb(24, 24, 24);*/
    text-align: center;

      @media (width < calc(700 / 16 * 1rem)) {
        padding: 2rem 0;
      }
  }

  .showcase h2 {
    margin-bottom: 2rem;
  }

  .showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 2rem;
    align-items: start; /* an expanded card doesn't stretch its neighbours */
  }

  .showcase-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: white;
    text-decoration: none;
  }

  .showcase-card:hover {
    /* box-shadow: 0 0 15px #00ffff, 0 0 25px #00bcd4; */
    box-shadow: 0 0 15px var(--c-emissive-blue), 0 0 25px #00bcd4;
    transform: translateY(-5px);
  }

  .showcase-card h3 {
    color: var(--c-emissive-blue);
    font-size: var(--fs-18);
    padding: 25px 0;
    text-align: left;

  }

  .showcase-card p {
    font-size: var(--fs-16);
    text-align: left;
    padding: 16px 0px;
  }

  .showcase-image {
    display: block;
    margin: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3; /* matches the source photos, so nothing is cropped */
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  }

  /*-- "Read more" expander (native <details>, no JS) --*/
  .showcase-details {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
  }

  .showcase-details summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 0;
    color: var(--c-emissive-blue);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    text-align: left;
  }

  .showcase-details summary::-webkit-details-marker {
    display: none;
  }

  .showcase-details summary::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 200ms ease;
  }

  .showcase-details[open] summary::before {
    transform: rotate(45deg);
  }

  .showcase-details summary:focus-visible {
    outline: 2px solid var(--c-emissive-blue);
    outline-offset: 2px;
  }

  ul li {
    text-align: start;
  }

}

@layer contact {
  .contact {
    margin: 2rem 0;
  }

  .contact h2 {
    margin-bottom: 24px;
  }

  .contact-content {
    max-width: 70ch;
    margin-bottom: 24px;
  }

  .email-link {
    margin-bottom: 72px;
  }
}

@layer footer {
  .footer {
    p {
      font-size: var(--font-size-footer);
    }
  }
}