/* ==========================================================================
   HS Digi alle 30-vuotiaille — campaign landing page
   Skeleton: design tokens -> viewport scaffold -> sections.
   Token values inlined from the SNDP design system (HS brand, light mode)
   so the page is standalone-safe on kampanjat.hs.fi.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* colour — semantic */
  --nof-semantic-color-foreground-primary: #191919;
  --nof-semantic-color-foreground-secondary: #555558;
  --nof-semantic-color-foreground-tertiary: #88888b;
  --nof-semantic-color-foreground-negative: #ffffff;
  --nof-semantic-color-background-content-default: #ffffff;
  --nof-semantic-color-background-content-highlight: #efeff2;
  --nof-semantic-color-background-content-tint: #f0ebe8;
  --nof-semantic-color-brand-primary: #004F9D;
  --nof-semantic-color-brand-secondary: #004F9D;
  --nof-semantic-color-sales-default: #3860ff;

  /* colour — core HS */
  --nof-core-color-hs-yellow: #fffd43;
  --nof-core-color-hs-gray-70: #e9eaed;

  /* typography */
  /* ALME brands ship only Metric on kampanjat.*; available weights are 400/600
     (al-fonts.css) and 700/900 (al-fonts-extra.css). */
  --font-display: Metric, Helvetica, Arial, sans-serif;
  --font-content: Metric, Helvetica, Arial, sans-serif;
  --font-body: Metric, Helvetica, Arial, sans-serif;
  --font-subtitle: Metric, Helvetica, Arial, sans-serif;

  /* spacing — 4pt base */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-s: 12px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  --radius-card: 8px;   /* /tilaa/ product card: #combo .hss-col-third */
  --radius-pill: 30px;  /* /tilaa/ .button */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-l: 16px;
  --radius-full: 9999px;

  /* --------------------------------------------------------------------
     2. VIEWPORT SCAFFOLD
     Breakpoints live here as the single source of truth. Note that
     @container / @media cannot read custom properties, so the literal
     values are repeated in the query conditions below — change both.
     -------------------------------------------------------------------- */
  --bp-sm: 640px;   /* small phone -> large phone   */
  --bp-md: 768px;   /* phone -> tablet              */
  --bp-lg: 1024px;  /* tablet -> small desktop      */
  --bp-xl: 1280px;  /* desktop                      */

  --page-max: 100%;        /* full-bleed page width              */
  --content-max: 920px;    /* reading measure for text sections  */
  --gutter: var(--space-l);
  --section-space: var(--space-2xl);
}

/* --------------------------------------------------------------------------
   3. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-content);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.45;
  color: var(--nof-semantic-color-foreground-primary);
  background: var(--nof-core-color-hs-gray-70);
  text-wrap: pretty;
}

img, svg { display: block; max-width: 100%; }
p { margin: 0; }

a { color: var(--nof-semantic-color-brand-secondary); text-decoration: underline; }
a:hover { color: color-mix(in srgb, var(--nof-semantic-color-brand-secondary) 88%, #000); }

/* --------------------------------------------------------------------------
   4. PAGE SHELL
   Every section is a container, so the layout responds to the width it is
   actually given — not the browser window. That makes the review switcher
   below behave exactly like a real device width.
   -------------------------------------------------------------------------- */
.page {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  /* No background here: it would sit above the hero-bg in the stacking
     order (see .hero-bg) and hide it. Each section supplies its own bg instead. */
}

.page > * {
  container-type: inline-size;
  container-name: section;
}

/* Review switcher: html[data-viewport="375"] etc. Set by the inline script
   from ?viewport= in the URL. Remove with the script before publishing. */
html[data-viewport] .page { box-shadow: 0 0 0 1px var(--nof-core-color-hs-gray-70); }
html[data-viewport="375"]  .page { max-width: 375px; }
html[data-viewport="414"]  .page { max-width: 414px; }
html[data-viewport="768"]  .page { max-width: 768px; }
html[data-viewport="1024"] .page { max-width: 1024px; }
html[data-viewport="1440"] .page { max-width: 1440px; }

/* --------------------------------------------------------------------------
   5. SHARED
   -------------------------------------------------------------------------- */
.section-title {
  margin: 0 0 var(--space-l);
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
}

.lede {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-align: left;
}

.lede--inverse { color: var(--nof-semantic-color-foreground-negative); }

.benefit-list {
  display: grid;
  gap: var(--space-l);
  margin: 0;
  padding: 0;
  font-size: 1.375rem;
  line-height: 1.35;
  list-style: none;
}

.benefit-list li::before { content: "- "; }


.body { font-size: 1.0625rem; color: var(--nof-semantic-color-foreground-secondary); }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-xl);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}

.btn:focus-visible { outline: 2px solid var(--nof-semantic-color-brand-secondary); outline-offset: 2px; }

.btn--dark { background: var(--nof-semantic-color-brand-primary); color: var(--nof-semantic-color-foreground-negative); }
.btn--dark:hover { background: #2b2b2b; color: var(--nof-semantic-color-foreground-negative); }

.btn--light { background: var(--nof-core-color-hs-yellow); color: var(--nof-semantic-color-brand-primary); }
.btn--light:hover { background: color-mix(in srgb, var(--nof-core-color-hs-yellow) 88%, #000); color: var(--nof-semantic-color-brand-primary); }

/* --------------------------------------------------------------------------
   6. HEADER
   -------------------------------------------------------------------------- */
/* In the hero's flex flow (not absolute) so the title always starts below the logo. */
.site-header {
  position: relative;
  z-index: 1;
  flex: none;
  padding: var(--space-l) var(--gutter);
}

.site-header__logo,
.site-header__logo:hover { text-decoration: none; }

.site-header__logo {
  display: block;
  width: min(332px, 70vw);
  margin-inline: auto;
}

.site-header__logo img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   7. HERO
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  /* Always exactly one fold. The spacer/content split below absorbs any extra
     space a very tall title would otherwise need, so this never has to grow. */
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f2eeef;
}

.hero-bg { position: absolute; bottom: 0; z-index: 1; width: 100%; height: 100vh; }

.hero-bg__img {
  width: 100%;
  height: 100%;
  /* contain, not cover: the rat/brain artwork must never be cropped off. */
  object-fit: contain;
  object-position: 50% 100%;
}

.hero__inner {
  /* Fills the fold below the header; the spacer is the logo-to-title gap. */
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 var(--gutter) var(--space-2xl);
}

.hero__spacer { flex: 0 1 50%; }

.hero__content {
  /* Grows to absorb any leftover space below the spacer (basis 50%), but
     never shrinks below its own content — the spacer gives way first. */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 0 auto;
  min-height: 0;
}

.hero__title {
  margin: 0;
  width: min(100%, 8.8ch);
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(11vw, 17vw, 12rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  font-variant-numeric: lining-nums;
  color: var(--nof-core-color-hs-yellow);
  text-wrap: pretty;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.24);
}

@media (min-width: 1028px) {
  .hero__title { font-size: clamp(11vw, 13vw, 15rem); }
}

.hero__cta {
  /* Fills the remaining space in the fold below the title, centered per fix request. */
  align-self: center;
  margin-top: 2em;
  font-family: var(--font-subtitle);
}

/* --------------------------------------------------------------------------
   8. TEXT BLOCKS
   -------------------------------------------------------------------------- */
.text-block {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  background: #f7f7f5;
}

.text-block__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
  /* Wider than --content-max on purpose: on laptop widths this reads almost
     full-bleed, ~40px from the edge combined with .text-block's own gutter
     padding — no extra padding added, just a wider cap. */
  max-width: min(calc(100% - 32px), 1600px);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   9. OFFER / PRODUCT CARD
   -------------------------------------------------------------------------- */
.offer {
  /* Bigger mobile padding + smaller tile shows more of the "4,90" artwork around the card. */
  padding: clamp(231px, 10vw, 129px) var(--gutter);
  background-color: var(--nof-semantic-color-brand-primary);
  background-image: url("../images/alme-4.90-taustakuva.svg");
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: top;
}

.offer__inner {
  max-width: 420px;
  margin-inline: auto;
}

.product {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Generous block padding on mobile so the card doesn't feel cramped edge to edge. */
  padding: 48px var(--space-l) 36px;
  background: var(--nof-semantic-color-brand-primary);
  color: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.product__name {
  margin: 0;
  font-family: var(--font-content);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
}

.product__image { width: 78%; height: auto; }

.product__feature,
.product__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-body);
  line-height: 1.2;
}

.product__feature { font-size: 1.0625rem; margin-bottom: 16px; }

.product__price {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  line-height: 1.1;
  margin-bottom: 8px;
}

.product__price strong { font-size: 2.25rem; font-weight: 700; }

.product__price-normal {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.2;
  color: #fff;
  text-decoration: line-through;
  margin-bottom: 24px;
}

.product__cta { align-self: stretch; margin-bottom: 16px; }

.product__cta,
.product__cta:hover { background: #fff; color: var(--nof-semantic-color-brand-primary); }

.product__cta:hover { background: #e7f3ff; }

.product__note { font-size: 0.875rem; }

.product__note .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------------------------
   10. FAQ
   -------------------------------------------------------------------------- */
.faq {
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  background: #f7f7f5;
}

.faq__inner { max-width: var(--content-max); margin-inline: auto; }

.faq .section-title {
  text-align: left;
  /* inline-block, not inline: with this custom font's metrics, an inline
     box's background can miss the half-leading strip below the text. */
  display: inline-block;
  padding: 8px 16px 0;
  background: var(--nof-semantic-color-brand-primary);
  color: #fff;
}

.faq__list { display: flex; flex-direction: column; }

.faq__item { border-top: 1px solid var(--nof-semantic-color-background-content-highlight); }
.faq__item:last-child { border-bottom: 1px solid var(--nof-semantic-color-background-content-highlight); }

.faq__q {
  padding: var(--space-m) var(--space-xl) var(--space-m) 0;
  font-family: var(--font-content);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq__q::-webkit-details-marker { display: none; }

.faq__q::after {
  content: "";
  position: absolute;
  right: var(--space-xs);
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease-out;
}

.faq__item[open] .faq__q::after { transform: translateY(-30%) rotate(225deg); }

.faq__a {
  padding: 0 var(--space-xl) var(--space-m) 0;
  font-family: var(--font-content);
  font-size: 1.125rem;
  line-height: 1.3;
}

.faq__a ul {
    padding: 0;
    padding-left: 1em;
    font-size: 16px;
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   11. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
  padding: var(--space-xl) var(--gutter);
  background: #000;
  color: var(--nof-semantic-color-foreground-negative);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: center;
  max-width: var(--page-max);
  margin-inline: auto;
}

.site-footer__logo {
  display: block;
  width: min(180px, 45vw);
}

.site-footer__logo img { width: 100%; height: auto; }

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-m);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1;
}

.site-footer__links a { color: var(--nof-semantic-color-foreground-negative); }
.site-footer__links a:hover { color: var(--nof-core-color-hs-yellow); }

/* --------------------------------------------------------------------------
   12. CONTAINER QUERIES
   Each section reacts to its own width. Values mirror --bp-* above.
   -------------------------------------------------------------------------- */
@container section (min-width: 640px) {
  .lede { font-size: 2rem; }
  .section-title { font-size: 2rem; }
}

@container section (min-width: 768px) {
  .site-footer__inner { flex-direction: row; justify-content: space-between; }
}

/* @media, not @container: .text-block/.faq establish their own container,
   so they can't query their own width (same reason as .offer below). */
@media (min-width: 768px) {
  .text-block { padding-block: var(--space-3xl); }
  .faq { padding-block: var(--space-3xl); }
}
@container section (min-width: 1024px) {
  .hero__title { max-width: 12ch; }
  .lede { font-size: 2.25rem; }
  .section-title { font-size: 2.25rem; }
  .offer__inner { max-width: 460px; }
  .product { padding: var(--space-xl) var(--space-l) var(--space-l); }
}

/* @media, not @container: .offer establishes its own container, so it can't
   query its own width — a container query here would never match. */
@media (min-width: 768px) {
  /* Section is roughly as wide as the 16:9 artwork here, so cover barely crops.
     Below 768px it would be zoomed far in, hence the repeat-y tiling in the base rule. */
  .offer {
    padding-block: 96px;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: top;
  }
}

/* Aamulehti Brainrot hero, following the supplied desktop and mobile layout. */
.hero__title,
.hero__subtitle {
  position: relative;
  z-index: 2;
  font-family: Metric, sans-serif;
  color: #004F9D;
  text-shadow: none;
}

.hero__title {
  width: auto;
  max-width: none;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
}

/* Mobile: logo, headline and subtitle centred in the empty top area of the artwork. */
@media (max-width: 767px) {
  .site-header { padding: 4vh var(--gutter) 0; }
  .site-header__logo { width: min(290px, 35vw); margin-inline: auto; }
  .hero__inner { padding: 0 var(--gutter) var(--space-2xl); padding-top: 8px; }
  .hero__spacer { flex: 0 0 clamp(16px, 5.8vw, 32px); }
  .hero__content { align-items: center; text-align: center; }
  /* vw+vh mix, not plain vw: grows further on taller viewports where there's extra room below the header. */
  .hero__title { width: 100%; max-width: 100%; font-size: clamp(10vw, calc(9vw + 2.7vh), 20vw); line-height: 0.807; }
  .hero__subtitle { margin-top: 0.42em; font-size: 5.8vw; }
  /* The new hero image is much wider than its box on purpose: only the rat is
     meant to stay on screen, the diagonal "AI generoitu" ribbon crops off. */
  .hero-bg { top: auto; bottom: 0; height: 60vh; }
  .hero-bg__img { object-fit: cover; object-position: 50% 30%; }
}

/* Desktop: logo, headline and subtitle left-aligned in a column beside the rat. */
@media (min-width: 768px) {
  .site-header { padding: 17.7vh 0 0 clamp(40px, 11vw, 200px); }
  .site-header__logo { width: clamp(200px, 24.2vw, 390px); margin-inline: 0; }
  .hero__inner { padding: 0 var(--gutter) var(--space-2xl) clamp(40px, 11vw, 200px); padding-top: 16px; }
  .hero__spacer { flex: 0 0 clamp(24px, 3.3vw, 64px); }
  .hero__content { align-items: flex-start; text-align: left; }
  /* Text column width: clears the right-anchored .hero-bg box's left edge (44vw)
     minus the text's own left offset and a breathing margin. Font-size is tied
     to this same width so it shrinks automatically instead of over-wrapping. */
  .hero__content { --text-col: calc(44vw - clamp(40px, 11vw, 200px) - 24px); }
  .hero__title { max-width: var(--text-col); font-size: calc(var(--text-col) / 6); line-height: 0.846; hyphens: manual; }
  .hero__subtitle { margin-top: 0.5em; font-size: calc(var(--text-col) / 16); max-width: var(--text-col); }
  /* Narrower, right-anchored box (not the full-width base rule): keeps the
     rat clear of the text column and lets cover crop the legs off the bottom
     instead of shrinking the whole image to fit. */
  .hero-bg { bottom: 0; height: 44.2vh; left: auto; right: 0; width: 56vw; }
  .hero-bg__img { object-fit: cover; object-position: 50% 14.5%; }
}

/* Tablet portrait (e.g. iPad mini): a right-anchored side-by-side column is too
   narrow here and the artwork covers the text. Use the mobile stacked layout
   instead, scaled up for the extra width. */
@media (min-width: 768px) and (orientation: portrait) {
  .site-header { padding: 3.2vh var(--gutter) 0; }
  .site-header__logo { width: min(420px, 28vw); margin-inline: auto; }
  .hero__inner { padding: 0 var(--gutter) var(--space-2xl); padding-top: 8px; }
  .hero__spacer { flex: 0 0 clamp(24px, 4vw, 48px); }
  .hero__content { align-items: center; text-align: center; }
  .hero__title { width: 100%; max-width: 100%; font-size: clamp(6vw, 5vw + 2vh, 10vw); line-height: 0.85; hyphens: none; }
  .hero__subtitle { margin-top: 0.5em; font-size: clamp(2vw, 1.6vw + 1vh, 3.2vw); }
  /* The new hero image is much wider than its box on purpose: only the rat is
     meant to stay on screen, the diagonal "AI generoitu" ribbon crops off. */
  .hero-bg { top: auto; bottom: 0; left: 0; right: auto; width: 100%; height: 68vh; }
  .hero-bg__img { object-fit: cover; object-position: 50% 30%; }
}
