/* ==========================================================================
   Kloena Digital — Products index & product detail pages
   Builds on the tokens and header/footer styles in styles.css
   ========================================================================== */

/* Shared page shell — mirrors the header's content box. */
.page-products main.products,
.page-product main.product {
  display: block;
  /* main is a flex item in the page column: allow it to shrink below the
     min-content width of its children instead of overflowing the viewport. */
  min-width: 0;
  width: min(1400px, 100%);
  margin-inline: auto;
  padding: clamp(6px, 1.4vw, 18px) clamp(20px, 3vw, 44px) 0;
}

.page-products main.products > section,
.page-product main.product > section {
  width: 100%;
  margin-inline: auto;
}

/* 1. Shared primitives (eyebrow, buttons)
   ========================================================================== */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.eyebrow__rule {
  display: block;
  flex: none;
  width: 36px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.35s var(--ease), background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--accent);
  color: #0b0c0e;
}

.btn--primary:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: var(--ink);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  border-color: rgba(255, 203, 0, 0.5);
  color: var(--accent-2);
  transform: translateY(-1px);
}

/* 2. Products index — intro
   ========================================================================== */
.products-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(14px, 2.4vw, 32px);
  margin-bottom: clamp(22px, 3vw, 38px);
}

.products-intro__copy {
  max-width: 720px;
}

.products-intro .eyebrow {
  margin-bottom: 14px;
}

.products-intro__title {
  margin: 0 0 clamp(10px, 1.4vw, 16px);
  font-family: var(--font-display);
  font-size: clamp(34px, 5.4vw, 68px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

.products-intro__title em {
  font-style: normal;
  font-weight: 300;
  color: var(--accent-2);
}

.products-intro__lead {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 300;
  line-height: 1.72;
  color: var(--ink-dim);
  text-wrap: pretty;
}

/* 3. Products index — hero banners
   ========================================================================== */
.product-list {
  display: grid;
  /* 100% keeps the row edge-to-edge on the page shell even when the shell is
     a centred grid; 1fr tracks then split that width between the cards. */
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
}

.product-banner {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(380px, 31vw, 470px);
  padding: clamp(20px, 2.6vw, 38px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  animation: product-in 0.9s var(--ease-soft) both;
  transition: border-color 0.6s ease, box-shadow 0.6s var(--ease);
}

.product-list .product-banner:nth-child(2) { animation-delay: 0.08s; }
.product-list .product-banner:nth-child(3) { animation-delay: 0.16s; }
.product-list .product-banner:nth-child(4) { animation-delay: 0.24s; }

.product-banner:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: 0 44px 90px -60px color-mix(in srgb, var(--accent) 70%, transparent);
}

.product-banner__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-image: linear-gradient(150deg, var(--accent) 0%, var(--accent-2) 55%, #14161c 100%);
}

.product-banner__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0.65) brightness(0.5) saturate(0.95);
  transform: scale(1.05);
  transition: filter 0.9s var(--ease), transform 1.4s var(--ease);
}

/* Software screenshots sit on a flat desktop background; dim them harder
   so the headline stays readable. */
.product-banner[data-tone="ui"] .product-banner__media img {
  filter: grayscale(0.75) brightness(0.36) saturate(0.85);
}

.product-banner:hover .product-banner__media img {
  filter: grayscale(0) brightness(0.64) saturate(1.05);
  transform: scale(1);
}

.product-banner[data-tone="ui"]:hover .product-banner__media img {
  filter: grayscale(0.4) brightness(0.48) saturate(1);
}

.product-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(7, 8, 10, 0.3) 0%, rgba(7, 8, 10, 0.12) 24%, rgba(7, 8, 10, 0.78) 62%, rgba(7, 8, 10, 0.97) 100%),
    linear-gradient(100deg, rgba(7, 8, 10, 0.72) 0%, rgba(7, 8, 10, 0.24) 52%, transparent 100%),
    radial-gradient(70% 80% at 0% 100%, rgba(255, 203, 0, 0.16), transparent 70%);
}

.product-banner__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.1vw, 14px);
  width: 100%;
  max-width: none;
}

.product-banner__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.9vw, 42px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

.product-banner__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-banner__title a:hover,
.product-banner__title a:focus-visible {
  color: var(--accent-2);
}

.product-banner__title a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 6px;
  border-radius: 4px;
}

.product-banner__desc {
  max-width: 52ch;
  margin: 0;
  font-size: clamp(13px, 1vw, 15px);
  font-weight: 300;
  line-height: 1.68;
  color: var(--ink-dim);
  text-wrap: pretty;
}

.product-banner__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-banner__tags li {
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 246, 248, 0.76);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.product-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(4px, 0.8vw, 10px);
}

/* 4. Product detail — hero
   ========================================================================== */
.product-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(340px, 40vw, 470px);
  padding: clamp(22px, 4vw, 56px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  animation: product-in 0.9s var(--ease-soft) both;
}

.product-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.product-hero__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(0.65) brightness(0.46) saturate(0.95);
  transform: scale(1.04);
}

.product-hero[data-tone="ui"] .product-hero__media img {
  filter: grayscale(0.75) brightness(0.34) saturate(0.85);
  object-position: center;
}

.product-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(95deg, rgba(7, 8, 10, 0.92) 0%, rgba(7, 8, 10, 0.66) 46%, rgba(7, 8, 10, 0.16) 82%),
    linear-gradient(180deg, rgba(7, 8, 10, 0.5) 0%, transparent 30%, rgba(7, 8, 10, 0.78) 82%, rgba(7, 8, 10, 0.96) 100%),
    radial-gradient(60% 90% at 4% 100%, rgba(255, 203, 0, 0.15), transparent 70%);
}

.product-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(10px, 1.2vw, 16px);
  max-width: 680px;
}

.product-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(2px, 0.8vw, 8px);
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-dim);
  transition: color 0.25s ease, transform 0.35s var(--ease);
}

.product-back::before {
  content: "\2190";
  font-size: 12px;
  line-height: 1;
}

.product-back:hover {
  color: var(--accent-2);
  transform: translateX(-3px);
}

.product-back:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 4px;
  border-radius: 3px;
}

.product-hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 5.2vw, 68px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

.product-hero__title em {
  font-style: normal;
  font-weight: 300;
  color: var(--accent-2);
}

.product-hero__lead {
  max-width: 58ch;
  margin: 0;
  font-size: clamp(14px, 1.1vw, 17px);
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-dim);
  text-wrap: pretty;
}

.product-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(4px, 0.8vw, 10px);
}

/* 5. Product detail — sections
   ========================================================================== */
.product-section {
  margin-top: clamp(44px, 6.4vw, 88px);
  scroll-margin-top: 24px;
}

.section-head {
  max-width: 680px;
  margin-bottom: clamp(22px, 3vw, 38px);
}

.section-head .eyebrow {
  margin-bottom: 12px;
}

.section-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-wrap: balance;
}

.section-head__title em {
  font-style: normal;
  font-weight: 300;
  color: color-mix(in srgb, var(--accent-2) 80%, #ffffff);
}

.product-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.product-copy p {
  max-width: 66ch;
  margin: 0;
  font-size: clamp(14px, 1.05vw, 16px);
  font-weight: 300;
  line-height: 1.78;
  color: var(--ink-dim);
  text-wrap: pretty;
}

.product-copy p + p {
  margin-top: 1.15em;
}

.product-copy p:first-child {
  font-size: clamp(15px, 1.15vw, 18px);
  color: rgba(244, 246, 248, 0.84);
}

.product-copy a {
  color: var(--accent-2);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 203, 0, 0.4);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.product-copy a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.product-copy a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 2px;
}

/* At-a-glance fact list */
.product-facts {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
}

.product-facts__title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.product-facts__list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.product-facts__row {
  display: grid;
  grid-template-columns: minmax(84px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.product-facts__row dt {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.product-facts__row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink-dim);
}

.product-facts__row dd a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 203, 0, 0.35);
  padding-bottom: 1px;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.product-facts__row dd a:hover {
  color: var(--accent-2);
  border-color: var(--accent-2);
}

.product-facts__row dd a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Screenshot gallery */
.product-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}

.product-gallery--single {
  grid-template-columns: minmax(0, 1fr);
}

.product-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.product-figure__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(0.35) brightness(0.82) saturate(0.96);
  transition: filter 0.8s var(--ease), transform 1.1s var(--ease);
}

.product-figure--contain .product-figure__image {
  object-fit: contain;
  padding: 14px;
  background: #0b0d10;
}

.product-figure:hover .product-figure__image {
  filter: grayscale(0) brightness(0.94) saturate(1.03);
  transform: scale(1.012);
}

.product-figure figcaption {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* 6. Closing call to action
   ========================================================================== */
.product-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 36px);
  margin-top: clamp(44px, 6.4vw, 88px);
  margin-bottom: clamp(24px, 4vw, 48px);
  padding: clamp(24px, 4vw, 52px);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 190% at 0% 0%, rgba(255, 203, 0, 0.13), transparent 56%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  box-shadow: 0 40px 90px -62px rgba(255, 203, 0, 0.55);
}

.product-cta .eyebrow {
  margin-bottom: 8px;
}

.product-cta__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  color: var(--ink);
}

@keyframes product-in {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 7. Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .product-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Two banners per row no longer fit comfortably — stack them. */
  .product-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-banner {
    min-height: clamp(320px, 48vw, 430px);
    padding: clamp(20px, 3.4vw, 40px);
  }
}

@media (max-width: 720px) {
  .product-gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-banner,
  .product-hero {
    padding: 22px 20px;
    border-radius: 18px;
  }

  .product-banner {
    min-height: 380px;
  }

  .product-banner::after {
    background-image:
      linear-gradient(180deg, rgba(7, 8, 10, 0.35) 0%, rgba(7, 8, 10, 0.15) 26%, rgba(7, 8, 10, 0.82) 66%, rgba(7, 8, 10, 0.97) 100%),
      radial-gradient(80% 70% at 0% 100%, rgba(255, 203, 0, 0.16), transparent 70%);
  }

  .product-hero {
    min-height: 400px;
  }

  .product-hero::after {
    background-image:
      linear-gradient(180deg, rgba(7, 8, 10, 0.55) 0%, rgba(7, 8, 10, 0.2) 26%, rgba(7, 8, 10, 0.84) 68%, rgba(7, 8, 10, 0.97) 100%),
      radial-gradient(80% 70% at 0% 100%, rgba(255, 203, 0, 0.14), transparent 70%);
  }

  .product-banner__actions,
  .product-hero__actions {
    width: 100%;
  }

  .product-banner__actions .btn,
  .product-hero__actions .btn {
    flex: 1 1 auto;
  }

  .product-cta {
    align-items: flex-start;
    border-radius: 18px;
  }

  .product-cta .btn {
    width: 100%;
  }
}

/* On narrow phones the pair of buttons can't sit side by side any more. */
@media (max-width: 560px) {
  .product-banner__actions .btn,
  .product-hero__actions .btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-banner,
  .product-hero {
    animation: none;
  }
}
