/* ==========================================================================
   Guardians of Blockchain · base stylesheet
   Shared by every page: tokens, reset, typography, layout and components.
   Page-specific rules live in their own file (home.css, product.css, …)
   inside the `pages` layer.

   Source of truth: Figma "GoB", page "Funnel (#23)",
   variable collection "GoB web (#23)" and text styles "GoB/*".
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Fonts (self-hosted variable fonts, no third-party requests)
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.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-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Exo 2";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/exo-2-latin.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-family: "Exo 2";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/exo-2-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Colour (Figma: barva/*) */
  --color-night: #121523; /* page background */
  --color-deep: #0f172b; /* cards and panels */
  --color-slate: #1d293d; /* raised surfaces */
  --color-teal: #00e5cf; /* brand, primary accent */
  --color-gold: #ffbf00; /* secondary accent */
  --color-white: #f8fafc; /* headings and primary text */
  --color-mist: #90a1b9; /* secondary text */
  --color-ink: #020617; /* text on teal and gold */
  --color-error: #f87171;
  --color-line: rgb(255 255 255 / 0.1); /* decorative hairlines */
  --color-line-hover: rgb(255 255 255 / 0.24); /* the same hairlines on a hovered control */
  --color-control: #62748e; /* form control outlines, 3:1 on night */
  --color-glass: rgb(18 21 35 / 0.72); /* sticky header over content */

  /* Case colours of the miners (Figma: Barvy). The names match the values of
     the colour picker and of the data-color attribute (see "Case colour"). */
  --case-orange-bitcoin: #f7931a;
  --case-royal-purple: #412269;
  --case-neon-green: #00e5cf;
  --case-white: #fff;
  --case-black: #000;

  --gradient-brand: linear-gradient(
    90deg,
    var(--color-teal) 0% 20%,
    var(--color-gold) 100%
  );

  /* Space (Figma: mezera/*) */
  --space-4: 0.25rem;
  --space-8: 0.5rem;
  --space-12: 0.75rem;
  --space-16: 1rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-40: 2.5rem;
  --space-48: 3rem;
  --space-64: 4rem;
  --space-80: 5rem;
  --space-96: 6rem;

  /* Radius (Figma: radius/*) */
  --radius-button: 0.5rem;
  --radius-card: 0.75rem;
  --radius-card-lg: 1rem;
  --radius-pill: 999px;

  /* Type families */
  --font-display: "Exo 2", ui-sans-serif, system-ui, sans-serif;
  --font-text: "Inter", ui-sans-serif, system-ui, sans-serif;

  /* Type scale. Headings scale fluidly between the phone (390) and the
     desktop (1440) artboards and land exactly on the Figma text styles. */
  --text-display: clamp(3rem, 2.443rem + 2.286vw, 4.5rem); /* 48 → 72 */
  --text-h2: clamp(2.25rem, 1.971rem + 1.143vw, 3rem); /* 36 → 48 */
  --text-h3: clamp(1.5rem, 1.361rem + 0.571vw, 1.875rem); /* 24 → 30 */
  --text-h4: clamp(1.25rem, 1.157rem + 0.381vw, 1.5rem); /* 20 → 24 */
  --leading-h2: clamp(2.5rem, 2.314rem + 0.762vw, 3rem); /* 40 → 48 */
  --leading-h3: clamp(2rem, 1.907rem + 0.381vw, 2.25rem); /* 32 → 36 */
  --leading-h4: clamp(1.75rem, 1.657rem + 0.381vw, 2rem); /* 28 → 32 */

  /* Layout */
  --container: 75rem; /* 1200 */
  --gutter: clamp(1rem, 4vw, 7.5rem); /* 16 on phones; the 1200 container takes over on desktop */
  --header-height: 4.25rem; /* 68 phone */
  --section-space: clamp(4rem, 3.257rem + 3.048vw, 6rem); /* 64 → 96 */

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 150ms;
  --duration: 250ms;
}

@media (min-width: 48rem) {
  :root {
    --header-height: 4.5rem; /* 72 desktop */
  }
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

  * {
    margin: 0;
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Anchors and focus targets never hide under the sticky header. */
    scroll-padding-top: calc(var(--header-height) + var(--space-16));
  }

  body {
    min-height: 100svh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  img,
  picture,
  svg,
  video {
    display: block;
    max-width: 100%;
  }

  img,
  video {
    height: auto;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
  }

  button {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  ul[class],
  ol[class] {
    padding: 0;
    list-style: none;
  }

  h1,
  h2,
  h3,
  h4,
  p {
    overflow-wrap: break-word;
  }

  summary {
    cursor: pointer;
    list-style: none;
  }

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

  fieldset {
    min-width: 0;
    padding: 0;
    border: 0;
  }

  [hidden] {
    display: none !important;
  }

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

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* --------------------------------------------------------------------------
   Base: document and typography
   -------------------------------------------------------------------------- */

@layer base {
  body {
    background-color: var(--color-night);
    color: var(--color-white);
    font: 400 1rem/1.5 var(--font-text);
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display);
    text-wrap: balance;
  }

  p {
    text-wrap: pretty;
  }

  :focus-visible {
    outline: 2px solid var(--color-teal);
    outline-offset: 2px;
  }

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

  /* Text styles (Figma: GoB/Desktop/*, GoB/Mobil/*, GoB/Text/*) */

  .text-display {
    font: 600 var(--text-display) / 1 var(--font-display);
    letter-spacing: -0.021em;
  }

  .text-h2 {
    font: 700 var(--text-h2) / var(--leading-h2) var(--font-display);
    letter-spacing: -0.02em;
  }

  .text-h3 {
    font: 600 var(--text-h3) / var(--leading-h3) var(--font-display);
    letter-spacing: -0.01em;
  }

  .text-h4 {
    font: 600 var(--text-h4) / var(--leading-h4) var(--font-display);
  }

  /* Lead is Body 16 on phones and Lead 20 from the tablet up. */
  .text-lead {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  @media (min-width: 48rem) {
    .text-lead {
      font-size: 1.25rem;
      line-height: 1.75rem;
    }
  }

  .text-body {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .text-small {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .text-caption {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
  }

  .text-medium {
    font-weight: 500;
  }

  .text-muted {
    color: var(--color-mist);
  }

  .text-accent {
    color: var(--color-teal);
  }

  .text-gold {
    color: var(--color-gold);
  }

  /* Gradient text: the element brings its own background-image.
     Without background-clip the words are plain teal. */
  .text-gradient {
    color: var(--color-teal);
  }

  @supports (background-clip: text) or (-webkit-background-clip: text) {
    .text-gradient {
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
  }

  /* Link inside running text */
  .text-link {
    color: var(--color-white);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  .text-link:hover {
    text-decoration-color: var(--color-teal);
  }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

@layer layout {
  /* The page wrapper creates the stacking context for the backdrop. */
  .page {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    overflow-x: clip;
  }

  .page > main {
    flex: 1;
  }

  .container {
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
  }

  .section {
    padding-block: var(--section-space);
  }

  .section__head {
    display: grid;
    gap: var(--space-16);
    justify-items: center;
    max-width: 50rem;
    margin: 0 auto var(--space-32);
    text-align: center;
  }

  @media (min-width: 48rem) {
    .section__head {
      margin-bottom: var(--space-48);
    }
  }
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

@layer components {
  /* Icon ------------------------------------------------------------------
     <svg class="icon" aria-hidden="true"><use href="assets/icons/sprite.svg#name"/></svg> */

  .icon {
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
  }

  .icon--14 {
    width: 0.875rem;
    height: 0.875rem;
  }

  .icon--16 {
    width: 1rem;
    height: 1rem;
  }

  .icon--18 {
    width: 1.125rem;
    height: 1.125rem;
  }

  .icon--20 {
    width: 1.25rem;
    height: 1.25rem;
  }

  .icon--40 {
    width: 2.5rem;
    height: 2.5rem;
  }

  /* Button ----------------------------------------------------------------
     Figma: Tlačítko (typ Primární | Sekundární, velikost M | L) */

  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    min-height: 2.75rem;
    padding: 0 var(--space-24); /* height is min-height, with or without a border */
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    white-space: nowrap;
    transition:
      filter var(--duration-fast) ease,
      background-color var(--duration-fast) ease,
      border-color var(--duration-fast) ease,
      transform var(--duration-fast) ease;
  }

  .button--lg {
    min-height: 3.25rem;
    padding-inline: var(--space-32);
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .button--block {
    display: flex;
    width: 100%;
  }

  .button--primary {
    border: 0;
    background: var(--gradient-brand);
    color: var(--color-ink);
  }

  .button--primary:hover {
    filter: brightness(1.08);
  }

  .button--secondary {
    border-color: var(--color-line);
    background-color: var(--color-night);
    color: var(--color-white);
  }

  .button--secondary:hover {
    border-color: var(--color-line-hover);
    background-color: var(--color-slate);
  }

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

  .button:disabled,
  .button[aria-disabled="true"] {
    filter: none;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
  }

  /* Icon button (44 × 44 square): menu toggle, social links, remove item */

  .icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-button);
    background-color: var(--color-night);
    color: var(--color-white);
    transition:
      background-color var(--duration-fast) ease,
      border-color var(--duration-fast) ease;
  }

  .icon-button:hover {
    border-color: var(--color-line-hover);
    background-color: var(--color-slate);
  }

  /* Text link with a trailing arrow ("Get the free guide →") */

  .link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    min-height: 2.75rem;
    font-weight: 500;
    line-height: 1.5rem;
    color: var(--color-white);
  }

  .link-arrow__label {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
  }

  .link-arrow .icon {
    transition: transform var(--duration) var(--ease-out);
  }

  .link-arrow:hover .icon {
    transform: translateX(0.25rem);
  }

  .link-arrow:hover .link-arrow__label {
    text-decoration-color: var(--color-teal);
  }

  /* Actions: one primary button with a quieter text link next to it.
     Stacked and full width on phones, one centred row from the tablet up. */

  .actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
  }

  .actions .link-arrow {
    justify-content: center;
    padding-inline: var(--space-16);
  }

  @media (min-width: 48rem) {
    .actions {
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: var(--space-16);
    }
  }

  /* Card ------------------------------------------------------------------ */

  .card {
    border: 1px solid var(--color-line);
    border-radius: var(--radius-card);
    background-color: var(--color-deep);
  }

  .card--lg {
    border-radius: var(--radius-card-lg);
  }

  /* Pill: small rounded label ("Today", "01", "-20 %") */

  .pill {
    display: inline-flex;
    align-items: center;
    padding: var(--space-4) var(--space-12);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    background-color: var(--color-deep);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  /* Icon with a short text: assurances and notes ("Pay in Bitcoin").
     The icon is centred on the first line, so a longer text can wrap. */

  .icon-text {
    display: flex;
    align-items: flex-start;
    gap: var(--space-8);
    color: var(--color-mist);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .icon-text__icon {
    margin-top: 0.125rem; /* (20 px line - 16 px icon) / 2 */
    color: var(--color-white);
  }

  .icon-text__icon--accent {
    color: var(--color-teal);
  }

  /* Spec list: a <dl> of rows, the name on the left and its value on the
     right (model cards on the homepage and on the product pages) */

  .spec-list {
    display: grid;
    gap: var(--space-12);
  }

  .spec-list__row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-16);
  }

  .spec-list dt {
    color: var(--color-mist);
  }

  .spec-list dd {
    font-weight: 500;
    text-align: right;
  }

  /* Case colour: data-color="orange-bitcoin" (royal-purple, neon-green,
     white, black) hands the colour to the element as --swatch. Used by the
     colour picker, the name of the chosen colour and the dot in the cart. */

  [data-color="orange-bitcoin"] {
    --swatch: var(--case-orange-bitcoin);
  }

  [data-color="royal-purple"] {
    --swatch: var(--case-royal-purple);
  }

  [data-color="neon-green"] {
    --swatch: var(--case-neon-green);
  }

  [data-color="white"] {
    --swatch: var(--case-white);
  }

  [data-color="black"] {
    --swatch: var(--case-black);
  }

  /* Form field --------------------------------------------------------------
     Figma: Pole formuláře (stav Výchozí | Fokus | Chyba) */

  .field {
    display: grid;
    gap: var(--space-8);
  }

  .field__label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  .field__control {
    width: 100%;
    min-height: 3rem;
    padding: 0.6875rem var(--space-16);
    border: 1px solid var(--color-control);
    border-radius: var(--radius-button);
    background-color: var(--color-night);
    color: var(--color-white);
    font-size: 1rem; /* 16px keeps iOS from zooming on focus */
    line-height: 1.5rem;
    transition:
      border-color var(--duration-fast) ease,
      box-shadow var(--duration-fast) ease;
  }

  .field__control::placeholder {
    color: var(--color-mist);
    opacity: 1;
  }

  .field__control:hover {
    border-color: var(--color-mist);
  }

  /* The second pixel of the 2px state outline is an inset shadow, so the
     field never changes size between states. */
  .field__control:focus-visible {
    /* Transparent, not none: forced colours (Windows contrast themes) draw
       it in their own colour, while border and shadow are dropped there. */
    outline: 2px solid transparent;
    border-color: var(--color-teal);
    box-shadow: inset 0 0 0 1px var(--color-teal);
  }

  .field__control[aria-invalid="true"] {
    border-color: var(--color-error);
    box-shadow: inset 0 0 0 1px var(--color-error);
  }

  select.field__control {
    appearance: none;
    padding-right: var(--space-48);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390a1b9' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m19 9-7 6-7-6'/%3E%3C/svg%3E");
    background-position: right var(--space-16) center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
  }

  .field__hint,
  .field__error {
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .field__hint {
    color: var(--color-mist);
  }

  .field__error {
    color: var(--color-error);
  }

  /* Quantity stepper --------------------------------------------------------
     Figma: Počet kusů */

  .quantity {
    display: inline-flex;
    align-items: center;
    gap: var(--space-4);
    border: 1px solid var(--color-control);
    border-radius: var(--radius-button);
    background-color: var(--color-night);
  }

  .quantity__button {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: calc(var(--radius-button) - 1px);
    color: var(--color-white);
    transition: color var(--duration-fast) ease;
  }

  .quantity__button:hover {
    color: var(--color-teal);
  }

  .quantity__button:disabled,
  .quantity__button[aria-disabled="true"] {
    color: var(--color-mist);
    opacity: 0.5;
    cursor: not-allowed;
  }

  .quantity__value {
    width: 1.75rem;
    padding: 0;
    border: 0;
    background: none;
    line-height: 1.5rem;
    text-align: center;
    appearance: textfield;
    -moz-appearance: textfield;
  }

  .quantity__value::-webkit-inner-spin-button,
  .quantity__value::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
  }

  /* Order steps -------------------------------------------------------------
     Figma: Kroky objednávky (krok Cart | Details | Payment | Confirmation)
     <li> states: .is-done, [aria-current="step"], default = upcoming */

  .steps {
    display: flex;
    align-items: center;
    gap: var(--space-12);
    color: var(--color-mist);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  .steps__item {
    display: flex;
    align-items: center;
    gap: var(--space-8);
  }

  /* Connector between two steps */
  .steps__item + .steps__item::before {
    content: "";
    width: 2rem;
    height: 1px;
    margin-right: var(--space-4);
    background-color: var(--color-line);
  }

  .steps__marker {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    border: 1px solid var(--color-line);
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1rem;
  }

  .steps__item[aria-current="step"] {
    color: var(--color-white);
  }

  .steps__item[aria-current="step"] .steps__marker {
    border-color: var(--color-teal);
    background-color: var(--color-teal);
    color: var(--color-ink);
  }

  /* A finished step shows the check-circle icon instead of its number. */
  .steps__item.is-done > .icon {
    color: var(--color-teal);
  }

  /* The words "Step 2 of 4" live inside the current marker. Wide screens
     show only the number; screen readers get the whole phrase everywhere. */
  .steps__count {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* Phones (Figma: Krok (telefon) + Průběh): the row of markers becomes
     "Step 2 of 4 Details" above a progress bar. Same markup. */
  @media (width < 36rem) {
    .steps {
      display: grid;
      justify-items: center;
      gap: 0.625rem;
      width: 100%;
      font-weight: 400;
    }

    .steps__item:not([aria-current="step"]) {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .steps__item[aria-current="step"] {
      color: var(--color-mist);
    }

    .steps__item + .steps__item::before {
      content: none;
    }

    .steps__item[aria-current="step"] .steps__marker {
      display: inline;
      width: auto;
      height: auto;
      border: 0;
      border-radius: 0;
      background: none;
      color: var(--color-teal);
      font-size: inherit;
      font-weight: 500;
      line-height: inherit;
    }

    .steps__count {
      position: static;
      width: auto;
      height: auto;
      overflow: visible;
      clip-path: none;
      white-space: normal;
    }

    /* Track and fill of the progress bar share the second grid row. */
    .steps::before,
    .steps::after {
      content: "";
      grid-area: 2 / 1;
      height: 0.25rem;
      border-radius: 0.125rem;
    }

    .steps::before {
      width: 100%;
      background-color: var(--color-line);
    }

    .steps::after {
      justify-self: start;
      width: var(--steps-progress, 25%);
      background: linear-gradient(90deg, var(--color-teal), var(--color-gold));
    }

    .steps:has(.steps__item:nth-child(2)[aria-current="step"]) {
      --steps-progress: 50%;
    }

    .steps:has(.steps__item:nth-child(3)[aria-current="step"]) {
      --steps-progress: 75%;
    }

    .steps:has(.steps__item:nth-child(4)[aria-current="step"]) {
      --steps-progress: 100%;
    }
  }

  /* Reviews -----------------------------------------------------------------
     Figma: What Miners Are Saying, on the homepage and the product pages.
     <ul class="reviews__list"> of <li class="review card">: a strip that
     scrolls sideways up to 1024, three columns above. */

  .reviews__list {
    display: grid;
    grid-auto-flow: column;
    /* 300 px cards on a 390 px phone; narrower phones still show the next one */
    grid-auto-columns: min(18.75rem, 84%);
    gap: var(--space-12);
    /* The strip runs to both screen edges; the first card starts on the grid. */
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x mandatory;
  }

  /* The strip takes keyboard focus (tabindex="0"), so arrows scroll it in
     every browser. Its edges touch the screen, so the ring sits inside. */
  .reviews__list:focus-visible {
    outline-offset: -2px;
  }

  .review {
    padding: var(--space-24) var(--space-16);
    scroll-snap-align: start;
  }

  .review__figure {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-24);
    height: 100%;
  }

  /* Hanging opening quotation mark */
  .review__quote {
    text-indent: -0.45em;
  }

  .review__author {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.125rem var(--space-12);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .review__source {
    grid-row: span 2;
  }

  .review__name {
    font-weight: 500;
  }

  .review__place {
    color: var(--color-mist);
  }

  @media (min-width: 64rem) {
    .reviews__list {
      grid-auto-flow: row;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--space-24);
      margin-inline: 0;
      padding-inline: 0;
      overflow-x: visible;
      scroll-snap-type: none;
    }

    .review {
      padding: var(--space-32);
    }
  }

  /* FAQ ---------------------------------------------------------------------
     Figma: Questions Before You Order (#faq), on the homepage and the
     product pages. One <details name="faq"> per question, so opening one
     closes the others. Source order: title, questions, contact. From 1024
     the grid puts the contact links under the title, left of the questions. */

  .faq__layout {
    display: grid;
    gap: var(--space-32);
  }

  .faq__title {
    text-align: center;
  }

  .faq__list {
    display: grid;
    align-content: start;
    gap: var(--space-12);
  }

  /* The whole row opens the answer. */
  .faq__question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-16);
    padding: var(--space-24) var(--space-16);
    border-radius: calc(var(--radius-card) - 1px);
    transition: padding-bottom var(--duration) var(--ease-out);
  }

  .faq__item[open] > .faq__question {
    padding-bottom: var(--space-12);
  }

  .faq__question-text {
    font: 500 1rem/1.5rem var(--font-text);
  }

  .faq__chevron {
    transition:
      rotate var(--duration) var(--ease-out),
      color var(--duration-fast) ease;
  }

  .faq__question:hover .faq__chevron {
    color: var(--color-teal);
  }

  .faq__item[open] .faq__chevron {
    rotate: 180deg;
  }

  /* 16 px on phones too: the answers do the selling a shop assistant would. */
  .faq__answer {
    padding: 0 var(--space-16) var(--space-24);
    color: var(--color-mist);
    font-size: 1rem;
    line-height: 1.5rem;
  }

  /* The answer slides open where the browser can animate to height: auto. */
  @supports (interpolate-size: allow-keywords) {
    .faq__item {
      interpolate-size: allow-keywords;
    }

    .faq__item::details-content {
      height: 0;
      overflow: clip;
      transition:
        height var(--duration) var(--ease-out),
        content-visibility var(--duration) allow-discrete;
    }

    .faq__item[open]::details-content {
      height: auto;
    }
  }

  .faq__contact {
    display: grid;
    justify-items: center;
    gap: var(--space-8);
    text-align: center;
  }

  @media (min-width: 48rem) {
    .faq__question {
      padding-inline: var(--space-24);
    }

    .faq__answer {
      padding-inline: var(--space-24);
    }
  }

  @media (min-width: 64rem) {
    .faq__layout {
      grid-template-columns: minmax(0, 400fr) minmax(0, 736fr);
      grid-template-rows: auto 1fr;
      grid-template-areas:
        "title list"
        "contact list";
      gap: var(--space-16) var(--space-64);
    }

    .faq__title {
      grid-area: title;
      text-align: left;
      text-wrap: wrap; /* two full lines as in the frame, not a balanced pair */
    }

    .faq__list {
      grid-area: list;
    }

    .faq__contact {
      grid-area: contact;
      align-content: start;
      justify-items: start;
      gap: var(--space-16);
      text-align: left;
    }

    .faq__contact .link-arrow {
      min-height: 3.25rem;
    }
  }

  /* Site header -------------------------------------------------------------
     Figma: Hlavička/Desktop, Hlavička/Telefon and their "přilepená" variants.
     Sticky on every page. Transparent over the hero; a glass panel with a
     hairline fades in between 24 and 120 px of scroll. */

  .site-header {
    position: sticky;
    z-index: 100;
    top: 0;
    /* Without scroll-driven animations the glass is simply always on. */
    border-bottom: 1px solid var(--color-line);
    background-color: var(--color-glass);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
  }

  .site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-24);
    min-height: var(--header-height);
  }

  .site-header__logo {
    flex: none;
    border-radius: var(--radius-button);
  }

  .site-header__logo img {
    width: auto;
    height: 2.25rem; /* 36 phone */
  }

  .site-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-8);
  }

  .site-header__secure {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    color: var(--color-mist);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
  }

  @supports (animation-timeline: scroll()) {
    .site-header {
      animation: site-header-glass linear both;
      animation-timeline: scroll(root block);
      animation-range: 24px 120px;
    }

    @keyframes site-header-glass {
      from {
        border-bottom-color: transparent;
        background-color: rgb(18 21 35 / 0);
        -webkit-backdrop-filter: blur(0) saturate(1);
        backdrop-filter: blur(0) saturate(1);
      }
    }
  }

  /* Main navigation: one list, inline on desktop, a popover panel on phones. */

  .site-nav {
    /* Popover reset */
    margin: 0;
    padding: 0;
    border: 0;
    color: inherit;
  }

  .site-nav__link {
    color: var(--color-mist);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    transition: color var(--duration-fast) ease;
  }

  .site-nav__link:hover,
  .site-nav__link[aria-current="page"] {
    color: var(--color-white);
  }

  @media (width < 48rem) {
    .site-nav {
      inset: var(--header-height) 0 auto;
      width: 100%;
      max-width: none;
      padding: var(--space-8) var(--gutter) var(--space-24);
      border-bottom: 1px solid var(--color-line);
      background-color: var(--color-night);
    }

    /* While the menu is open its button shows a cross. */
    .site-header__close-icon,
    .site-header:has(.site-nav:popover-open) .site-header__menu-icon {
      display: none;
    }

    .site-header:has(.site-nav:popover-open) .site-header__close-icon {
      display: block;
    }

    /* The page dims below the header; the header itself stays usable. */
    .site-nav::backdrop {
      top: var(--header-height);
      background-color: rgb(2 6 23 / 0.6);
    }

    .site-nav__list {
      display: grid;
    }

    .site-nav__link {
      display: flex;
      align-items: center;
      min-height: 3.25rem;
      border-bottom: 1px solid var(--color-line);
      color: var(--color-white);
      font-size: 1rem;
      line-height: 1.5rem;
    }

    .site-nav__list > li:last-child .site-nav__link {
      border-bottom: 0;
    }

    /* Panel slides down when the popover opens. */
    .site-nav:popover-open {
      animation: site-nav-in var(--duration) var(--ease-out);
    }

    @keyframes site-nav-in {
      from {
        opacity: 0;
        translate: 0 -0.5rem;
      }
    }
  }

  @media (min-width: 48rem) {
    .site-header__logo img {
      height: 2.75rem; /* 44 desktop */
    }

    /* The popover is a plain inline list here, open or not. */
    .site-nav {
      position: static;
      display: block;
      width: auto;
      height: auto;
      overflow: visible;
      background: none;
    }

    .site-nav__list {
      display: flex;
      align-items: center;
      gap: var(--space-32);
    }

    .site-nav__link {
      display: inline-flex;
      align-items: center;
      min-height: 2.75rem;
    }

    .site-header__menu-toggle {
      display: none;
    }
  }

  /* Cart button in the header (count badge is optional) */

  .cart-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    height: 2.75rem;
    padding-inline: var(--space-12);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-button);
    background-color: var(--color-night);
    color: var(--color-white);
    transition:
      background-color var(--duration-fast) ease,
      border-color var(--duration-fast) ease;
  }

  .cart-button:hover {
    border-color: var(--color-line-hover);
    background-color: var(--color-slate);
  }

  .cart-button__count {
    min-width: 1.125rem;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-pill);
    background-color: var(--color-teal);
    color: var(--color-ink);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    text-align: center;
  }

  /* Site footer -------------------------------------------------------------
     Figma: Patička/Desktop, Patička/Telefon */

  .site-footer {
    padding-block: var(--space-64) var(--space-40);
    color: var(--color-mist);
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .site-footer__top {
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
    padding-bottom: var(--space-32);
    border-bottom: 1px solid var(--color-line);
  }

  .site-footer__logo {
    align-self: flex-start;
    border-radius: var(--radius-button);
  }

  .site-footer__logo img {
    width: auto;
    height: 2.5rem;
  }

  .site-footer__social {
    display: flex;
    gap: var(--space-8);
  }

  .site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
    padding-top: var(--space-32);
  }

  .site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4) var(--space-24);
  }

  .site-footer__links a,
  .site-footer__credit a {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    transition: color var(--duration-fast) ease;
  }

  .site-footer__links a:hover,
  .site-footer__credit a:hover {
    color: var(--color-white);
  }

  .site-footer__credit {
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }

  /* GoB: a button that looks like the footer links (opens the cookie settings). */
  .site-footer__link-button {
    min-height: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: color var(--duration-fast) ease;
  }

  .site-footer__link-button:hover {
    color: var(--color-white);
  }

  /* GoB: copyright and the seller's legal details, a quiet last row. */
  .site-footer__legal {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-24);
    color: var(--color-mist);
    font-size: 0.75rem;
    line-height: 1.125rem;
    opacity: 0.8;
  }

  @media (min-width: 64rem) {
    .site-footer__top,
    .site-footer__bottom,
    .site-footer__legal {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }

    .site-footer__links,
    .site-footer__credit {
      white-space: nowrap;
    }
  }

  /* Grid backdrop -----------------------------------------------------------
     Figma: Pozadí/Mřížka. A 110 px grid with a few lit cells and a soft glow
     behind the page title; fades out to the sides and to the bottom.
     Place it as the first child of .page. */

  .grid-backdrop {
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 61.875rem; /* 990 */
    max-height: 100%; /* short pages: no empty scroll below the footer */
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(
        closest-side,
        rgb(89 191 204 / 0.1),
        transparent
      )
      50% -7.5rem / 68.75rem 32.5rem no-repeat;
  }

  .grid-backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    --grid-line: rgb(255 255 255 / 0.05);
    --grid-lit: rgb(140 217 217 / 0.07);
    --lit: linear-gradient(var(--grid-lit), var(--grid-lit));
    background:
      var(--lit) calc(50% - 54.5px) 0 / 109px 109px no-repeat,
      var(--lit) calc(50% + 385.5px) 0 / 109px 109px no-repeat,
      var(--lit) calc(50% - 494.5px) 220px / 109px 109px no-repeat,
      var(--lit) calc(50% + 495.5px) 330px / 109px 109px no-repeat,
      var(--lit) calc(50% - 164.5px) 440px / 109px 109px no-repeat,
      var(--lit) calc(50% + 165.5px) 440px / 109px 109px no-repeat,
      var(--lit) calc(50% - 384.5px) 550px / 109px 109px no-repeat,
      var(--lit) calc(50% + 605.5px) 660px / 109px 109px no-repeat,
      linear-gradient(to right, var(--grid-line) 1px, transparent 1px)
        calc(50% + 55px) 0 / 110px 110px,
      linear-gradient(to top, var(--grid-line) 1px, transparent 1px) 0 0 / 110px
        110px;
    -webkit-mask-image: radial-gradient(
      ellipse 70% 60% at 50% 45%,
      #000 0%,
      rgb(0 0 0 / 0.85) 55%,
      transparent 100%
    );
    mask-image: radial-gradient(
      ellipse 70% 60% at 50% 45%,
      #000 0%,
      rgb(0 0 0 / 0.85) 55%,
      transparent 100%
    );
  }

  /* Skip link --------------------------------------------------------------- */

  .skip-link {
    position: absolute;
    z-index: 200;
    top: var(--space-8);
    left: var(--space-8);
    padding: var(--space-12) var(--space-16);
    border-radius: var(--radius-button);
    background-color: var(--color-teal);
    color: var(--color-ink);
    font-weight: 600;
    transform: translateY(-200%);
  }

  .skip-link:focus-visible {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

@layer utilities {
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* The same below 48rem or below 64rem only: words and titles that the
     narrow layouts drop from the screen stay in the accessibility tree. */
  @media (width < 48rem) {
    .visually-hidden-below-48 {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  @media (width < 64rem) {
    .visually-hidden-below-64 {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  .nowrap {
    white-space: nowrap;
  }
}
