/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

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

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* END OF BOILERPLATE */

:root {
  --main-blue-light: #00C8FF;
  --main-blue-dark: #0067B6;
  --main-blue-navy: #183870;


  --bg-white: #F2F2F2;
  --bg-grey: #F2F2F2;

  --text-black: #333;
  --text-white: #eee;
}

* {
  box-sizing: border-box;
  /*outline: 1px solid green;*/
}

@font-face {
  font-family: 'WF Visual Sans';
  src: url('https://dhygzobemt712.cloudfront.net/Fonts/VF/WFVisualSansVF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@keyframes arrow-bounce {
  0%, 100%  { transform: translateY(0); }
  50% { transform: translateY(12px); }
}

@keyframes infiniteScroll {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0%);
  }
}

html,body { height: 100%; margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'WF Visual Sans', sans-serif; }

a {
  text-decoration: none;
  color: var(--text-white);
}

.underline {
  font-weight: bold;
}

.underline, a:hover {
  text-decoration: underline;
  text-underline-offset: 8px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--main-blue-light);
}

p {
  font-weight: 200;
}

.blue-light-text {
  color: var(--main-blue-light);
}

.text-semibold {
  font-weight: 400;
}

#hero {
  height: 100dvh;
  min-height: 100vh;
  width: 100%;

  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Puts flex items at the start of the container */
  align-items: center;

  position: relative;
  padding: 1rem 0;

  color: var(--text-white);
  overflow: hidden;
  background: linear-gradient(90deg, var(--main-blue-navy) 0%, #00050D 100%);

  .circuit {
    position: absolute;
    top: 10%; /* Sit at the top of the hero background */
    pointer-events: none; /* Don't interfere with clicks */
    opacity: 0.7; /* Subtle by default */
    max-height: 80%;
    max-width: 50%;
    z-index: 1; /* Behind header and landing text */
  }

  .circuit-left {
    left: 0;
    transform: translateY(0) rotate(90deg);
  }

  .circuit-right {
    right: 0;
    transform: translateY(0) rotate(-90deg);
  }

  header {
    margin: 0;
    width: 70vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative; z-index: 8;

    img {
      max-width: 15%;
    }

    nav {
      display: flex;
      gap: 4vw;
      align-items: center; /* Vertically centers the <a> elements */
      justify-content: center; /* Optional: Horizontally centers them if you want */
    }

    #eshop-button {
      padding: 0.5vw 1.7vw;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      text-decoration: none;
      color: var(--main-blue-navy);
      background: white 0 0 no-repeat padding-box;
      border-radius: 4px;
      transition:
        background 0.1s ease,
        outline 0.1s ease,
        color 0.1s ease;

      svg {
        fill: var(--main-blue-navy);
        width: 24px;
        height: 24px;
        transition: fill 0.2s ease;
      }

      &:hover {
        background: none;
        outline: 1px solid var(--main-blue-light);
        color: var(--text-white);

        svg {
          fill: var(--text-white);
        }
      }
    }
  }

  #landing-text {
    margin: auto;
    text-align: center;
    position: relative; z-index: 7;
    width: clamp(15vw, 30vw, 40vw);

    h1 {
      padding-bottom: 1rem;
      font-size: 4vw;
      font-weight: 500;
      line-height: 4vw;
    }

    .scroll-down {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-decoration: none;
      animation: arrow-bounce 3s infinite ease-in-out;

      &:hover {
        opacity: 0.8;
      }

      .label {
        font-size: 0.9rem;
        letter-spacing: 0.02em;
        opacity: 0.95;
        user-select: none;
      }
    }

    .arrow {
      width: 36px;
      height: 36px;
      display: inline-block;
      -webkit-tap-highlight-color: transparent;
      cursor: pointer;
      transform-origin: center;

      svg { display:block; width:100%; height:100%; }
    }
  }

  .references {
    position: absolute; /* Take out of flex flow to prevent centering issues */
    bottom: 2rem;       /* Position it at the bottom */
    left: 0;            /* Align it to the very left edge of the hero section */
    width: fit-content; /* Allow the container to be as wide as its content */

    display: flex;
    flex-wrap: nowrap; /* Ensure logos stay in a single line */
    align-items: center;
    gap: 6vw;
    padding: 0 2vw; /* Use padding instead of margin for internal spacing */
    z-index: 6;

    /* Add the animation */
    animation: infiniteScroll 60s linear infinite;

    /* Pause animation on hover for better user experience */
    &:hover {
      animation-play-state: paused;
    }

    /* make anchor wrappers inline-block so the img hit area is clickable */
    .reference-link {
      display: inline-block;
      text-decoration: none;
      line-height: 0; /* remove extra descender space around images */
    }

    img {
      height: 2.2vw; /* Set height directly here instead of max-height on parent */
      max-height: 35px; /* Add a max-height for very large screens */
      width: auto;
      max-width: none;
      object-fit: contain;
      /*filter: brightness(0) saturate(100%) invert(1);*/
      filter: brightness(0.7);
      transition: filter 300ms ease, transform 200ms ease;
      will-change: transform, filter;
      cursor: pointer;             /* show pointer because it's clickable */
      transform-origin: center;    /* scale from center */
    }

    /* hover / focus: slightly larger and remove dim filter */
    .reference-link:focus-visible,
    img:hover,
    img:focus {
      transform: scale(1.3);
      filter: none;
    }

    /* keyboard-accessible focus ring on the link wrapper */
    .reference-link:focus-visible {
      outline: 2px solid var(--main-blue-light);
      outline-offset: 4px;
      border-radius: 4px;
    }
  }
}

section {
  margin: 0 auto;
  padding: 3vw 0;
  text-align: center;

  &:nth-child(odd) {
    background: var(--bg-grey);
  }

  .prefix {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--main-blue-dark);
  }

  h1 {
    font-size: 2.2rem;
    font-weight: 600;

    padding: 0;
    margin-top: 0.1vw;

    text-decoration: underline;
    text-underline-offset: 8px;
    text-decoration-thickness: 3px;
    text-decoration-color: var(--main-blue-dark);
  }
}

footer {
  background: var(--main-blue-navy);
  color: var(--text-white);

  p, li {
    font-size: 0.9rem;
    font-weight: 400;
  }

  li {
    margin: 0.5rem 0;
  }

  h4 {
    margin: 0 0 1vw;
    text-transform: uppercase;
  }

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

  a {
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--text-white);

    &:hover {
      text-underline-offset: 3px;
      text-decoration-color: var(--main-blue-light);
    }
  }

  #footer-content {
    width: 60vw;
    padding: 2rem 0;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  #footer-brand {
    max-width: 30%;
    display: flex; /* 1. Make it a flex container */
    flex-direction: column; /* 2. Stack children vertically (main axis is now vertical) */
    justify-content: space-between;

    img {
      max-width: 75%;
      margin: 0 auto 1rem;
      display: block;
    }

    p {
      margin: 0;
      text-align: center;
    }
  }

  #footer-contact {
    li {
      display: flex;
      gap: 0.75rem;
    }

    .icon {
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}
