/* =========================================================
   BASE THEME
   Tämä vastaa siitä, miltä sivu NÄYTTÄÄ.
   ========================================================= */
:root {
   /* body */
  --fs-body: clamp(14px, 0.9vw + 10px, 18px);
  --lh-body: 1.55;

  /* headings */
  --fs-h1: clamp(40px, 5.2vw, 64px);
  --fs-h2: clamp(22px, 3.0vw, 40px);
  --fs-h3: clamp(18px, 2.1vw, 26px);

  --fw-h1: 600;
  --fw-h2: 600;
  --fw-h3: 700;

  --lh-h1: 1.05;
  --lh-h2: 1.12;
  --lh-h3: 1.18;
   
   /* Editor UI panel (ThemePicker) */
  --ui-panel-bg: #0b1020;
  --ui-panel-border: rgba(255,255,255,0.10);

  /* Legacy contract defaults (so base.css doesn’t fall apart) */
  --color-bg: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #334155;
  --color-text-muted: #64748b;

  --color-border: rgba(15, 23, 42, 0.12);

  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-primary-contrast: #ffffff;

  --font-family-base: var(--font-body);
  --line-height-base: var(--line-body);
   
  /* Spacing / radius / shadow used by your preview hooks */
  --space-section: 4rem;
  --space-card: 1.5rem;

  /* legacy names you already use in hero/features hooks */
  --space-lg: 1.5rem;
  --space-xl: 4rem;

  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-md: 0 10px 30px rgba(0,0,0,0.10);
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-heading: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --text-base: 16px;
  --line-body: 1.6;
   
  --fs-h2: clamp(22px, 3.0vw, 40px);
  --fw-h2: 600;
  --fst-h2: normal;

  --fs-h3: clamp(18px, 3.0vw, 40px);
  --fw-h3: 600;
  --fst-h3: normal;  

  --fs-section-title: var(--fs-h2);
  --fw-section-title: var(--fw-h2);
  --lh-section-title: 1.12;
  --fst-section-title: normal;

  --fs-subtitle: var(--fs-h3);
  --fw-subtitle: var(--fw-h3);
  --lh-subtitle: 1.15;
  --fst-subtitle: normal;

  --fs-card-title: var(--fs-h3);
  --fw-card-title: var(--fw-h3);
  --lh-card-title: 1.15;

  --fs-small: clamp(12px, 0.4vw + 10px, 14px);

  /* HERO title role */
  --fs-hero-title: clamp(50px, 5.2vw, 64px);
  --lh-hero-title: 1.05;
  --fw-hero-title: 600;
  --fst-hero-title: normal;
  --ls-hero-title: -0.02em;

  /* HERO subtitle role */
  --fs-hero-subtitle: clamp(30px, 3.0vw, 36px);
  --lh-hero-subtitle: 1.05;
  --fw-hero-subtitle: 600;
  --fst-hero-subtitle: normal;
  --ls-hero-subtitle: -0.02em;


  --page-pad-x: clamp(16px, 4vw, 48px);
  --page-pad-y: clamp(20px, 5vw, 64px);
  --page-max: 1100px;
   
}   

body{ font-size: var(--fs-body); line-height: var(--lh-body); }

h1{ font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-h1); }
h2{ font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2); }
h3{ font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3); }



.page-section {
  padding-block: var(--space-xl);
  background: var(--color-bg);
  color: var(--color-text-primary);
}

.section-title{ font-size: var(--fs-section-title); line-height: var(--lh-h2); font-weight: var(--fw-section-title); }
.subtitle{ font-size: var(--fs-subtitle); line-height: var(--lh-subtitle); font-weight: var(--fw-subtitle); }
.small{ font-size: var(--fs-small); }

a, .btn-primary {
  color: var(--color-primary-contrast);
  background: var(--color-primary);
}

a, .btn {
  color: var(--color-primary-contrast);
  background: var(--color-primary);
}

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

.card {
  padding: var(--space-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}


/* ---------- Hero ---------- */


/* ---------- Hero ---------- */
//Legacy Hero
.hero h1 {
  font-size: var(--font-size-h1);
  margin-bottom: var(--space-sm);
}

.hero p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.hero .cta-button {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.hero .cta-button:hover {
  background: var(--color-accent-hover);
}

// Preview inherited
.hero {
  padding-block: var(--space-xl);
}

.hero-container {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);

  background: var(--color-accent);
  color: var(--color-primary-contrast);
}


.hero-title {
  font-family: var(--font-heading);
  font-size: var(--fs-hero-title);
  line-height: var(--lh-hero-title);
  font-weight: var(--fw-hero-title);
  font-style: var(--fst-hero-title);
  letter-spacing: var(--ls-hero-title);
}

.hero-subtitle {
  color: var(--color-primary-contrast);
  opacity: 0.9;
}

.hero-cta {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);

  background: var(--color-primary-contrast);
  color: var(--color-accent);
}


// Improved Hero
.hero-title{
  font-family: var(--font-heading);
  font-size: var(--fs-hero-title);
  font-weight: var(--fw-hero-title);
  font-style: var(--fst-hero-title);
}

.hero-subtitle{
  font-family: var(--font-heading);
  font-size: var(--fs-hero-subtitle);
  font-weight: var(--fw-hero-subtitle);
  font-style: var(--fst-hero-subtitle);
}

/* HERO WOW (A): Aurora background + glass */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(48px, 8vw, 96px) 0;
}

/* pehmeä “aurora” tausta */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -2;
  background: radial-gradient(closest-side,
      color-mix(in oklab, var(--color-primary) 55%, transparent),
      transparent 70%);
  filter: blur(40px);
  opacity: 0.55;
  transform: translate3d(0,0,0);
  animation: hero-aurora 12s ease-in-out infinite;
}

/* toinen väriläiskä, eri liike */
.hero::after {
  z-index: -3;
  opacity: 0.35;
  background: radial-gradient(closest-side,
      color-mix(in oklab, var(--color-muted) 45%, transparent),
      transparent 70%);
  animation-duration: 18s;
  animation-direction: reverse;
}

@keyframes hero-aurora {
  0%   { transform: translate(-6%, -4%) scale(1.05); }
  50%  { transform: translate(6%, 4%)  scale(1.15); }
  100% { transform: translate(-6%, -4%) scale(1.05); }
}

/* kevyt “glass card” sisältöblokille jos sellainen on */
.hero .hero-inner,
.hero .hero-content {
  position: relative;
  border-radius: 24px;
  padding: clamp(20px, 3vw, 28px);
  background: color-mix(in oklab, var(--color-bg) 75%, transparent);
  border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  backdrop-filter: blur(10px);
}

/* otsikko gradient-tekstinä */
.hero .hero-title {
  line-height: 1.06;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg,
      var(--color-text),
      color-mix(in oklab, var(--color-primary) 70%, var(--color-text)),
      var(--color-text));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* reduce motion -kunnioitus */
@media (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after {
    animation: none;
  }
}

@container preview (prefers-reduced-motion: reduce) {
  .hero::before,
  .hero::after {
    animation: none;
  }
}



/* ---------- CTA ---------- */

.cta {
  text-align: center;
  padding-block: var(--space-xl); 
}

.cta .section-title {
  margin-bottom: var(--space-sm);
}

.cta .cta-error {
  color: var(--color-danger);
  font-size: var(--font-size-small);
  margin-top: var(--space-xs);
}

.cta-button {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);

  background: var(--color-accent);
  color: var(--color-primary-contrast);
  text-decoration: none;
}



/* ===== Testimonials ===== */
/* == scale proofed ==*/



.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.testimonial-item {
  background: var(--color-bg);
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  color: var(--color-text-primary, var(--color-text, #0f172a));
}

.testimonial-quote {
  font-size: var(--font-size-body, 1rem);
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary, var(--color-text, #0f172a));
}

.testimonial-author {
  font-weight: 600;
  color: var(--color-text-primary, var(--color-text, #0f172a));
}


@media (max-width: 900px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}
@container preview (max-width: 900px) {
  .testimonials-grid { grid-template-columns: 1fr; }
}



/* ===== Gallery ===== */
/* == scale proofed ==*/
.gallery-grid{
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.gallery-item{
  padding: var(--space-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  min-width: 0;
  overflow: hidden;
}

.gallery-img{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-caption{ margin-top: 0.5rem; }

/* Hugo / oikea mobiili */
@media (max-width: 900px){
  .gallery-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px){
  .gallery-grid{ grid-template-columns: 1fr; }
}

/* Editor preview (container queries) */
@supports (container-type: inline-size){
  @container preview (max-width: 900px){
    .gallery-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @container preview (max-width: 600px){
    .gallery-grid{ grid-template-columns: 1fr; }
  }
}



/* ===== Storybook ===== */
/* == scale proofed ==*/

.storybook,
.hugo-site .storybook {
  padding-block: var(--space-xl, 4rem);
}

.storybook h2,
.hugo-site .storybook h2 {
  margin: 0 0 0.75rem 0;
  font-family: var(--font-heading, var(--font-heading, system-ui, sans-serif));
  color: var(--color-text-primary, var(--color-text, #0f172a));
}

.storybook .muted,
.hugo-site .storybook .muted {
  color: var(--color-text-muted, var(--color-muted, #64748b));
}

.storybook-list,
.hugo-site .storybook-list {
  margin: 1.25rem 0 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1rem;
}

/* Card-ish item */
.storybook-item,
.storybook-list > li,
.hugo-site .storybook-item,
.hugo-site .storybook-list > li {
  padding: var(--space-card, 1.5rem);
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card, 0 10px 30px rgba(0,0,0,0.08));
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, rgba(15, 23, 42, 0.08));
}

.storybook-item h3,
.storybook-list > li h3,
.hugo-site .storybook-item h3,
.hugo-site .storybook-list > li h3 {
  margin: 0 0 0.5rem 0;
  font-family: var(--font-heading, var(--font-heading, system-ui, sans-serif));
  font-size: 1.05rem;
  color: var(--color-text-primary, var(--color-text, #0f172a));
}

.storybook-item p,
.storybook-list > li p,
.hugo-site .storybook-item p,
.hugo-site .storybook-list > li p {
  margin: 0;
  line-height: var(--line-height-base, 1.55);
}


/* ===== Footer ===== */

/* =========================
   Footer (clean + robust)
   ========================= */

.site-footer,
.page-section.footer,
footer.footer {
  position: relative;
  margin-top: 48px;
  padding: 28px 0 34px;
  overflow: hidden;

  background:
    radial-gradient(1200px 220px at 20% -20%,
      color-mix(in oklab, var(--color-primary) 18%, transparent),
      transparent 60%),
    linear-gradient(180deg,
      color-mix(in oklab, var(--color-bg) 96%, black 4%),
      var(--color-bg));

  border-top: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
}

/* “sheen”-viiva */
.site-footer::before,
.page-section.footer::before,
footer.footer::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in oklab, var(--color-primary) 35%, transparent),
    transparent);
  opacity: 0.7;
}

/* Inner layout: yksi malli (GRID), kestää pitkät tekstit */
.site-footer .footer-inner,
.page-section.footer .footer-inner,
footer.footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;

  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(180px, 1fr);
  gap: 16px;
  align-items: center;
}

/* Brand */
.site-footer .footer-brand,
.page-section.footer .footer-brand,
footer.footer .footer-brand {
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
  min-width: 0;
}

/* Nav: linkit rivissä, wrap sallittu */
.site-footer .footer-nav,
.page-section.footer .footer-nav,
footer.footer .footer-nav,
.site-footer nav,
.page-section.footer nav,
footer.footer nav {
  justify-self: center;
}

.site-footer .footer-nav,
.page-section.footer .footer-nav,
footer.footer .footer-nav,
.site-footer nav ul,
.page-section.footer nav ul,
footer.footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer nav li,
.page-section.footer nav li,
footer.footer nav li { margin: 0; }

/* Link style (pill) */
.site-footer a,
.page-section.footer a,
footer.footer a {
  color: color-mix(in oklab, var(--color-primary) 85%, var(--color-text));
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  background: color-mix(in oklab, var(--color-bg) 80%, transparent);
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.site-footer a:hover,
.page-section.footer a:hover,
footer.footer a:hover {
  background: color-mix(in oklab, var(--color-primary) 14%, var(--color-bg));
  border-color: color-mix(in oklab, var(--color-primary) 28%, transparent);
  transform: translateY(-1px);
}

.site-footer a:focus-visible,
.page-section.footer a:focus-visible,
footer.footer a:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--color-primary) 55%, transparent);
  outline-offset: 2px;
}

/* Copy/right area: ei purista linkkejä, katkoo pitkät sanat */
.site-footer .footer-copy,
.page-section.footer .footer-copy,
footer.footer .footer-copy,
.site-footer .footer-right,
.page-section.footer .footer-right,
footer.footer .footer-right,
.site-footer small,
.page-section.footer small,
footer.footer small {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
  color: color-mix(in oklab, var(--color-muted) 85%, var(--color-text));
}

/* Mobile: kaikki pinoon */
@media (max-width: 800px) {
  .site-footer .footer-inner,
  .page-section.footer .footer-inner,
  footer.footer .footer-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }

  .site-footer .footer-copy,
  .page-section.footer .footer-copy,
  footer.footer .footer-copy,
  .site-footer .footer-right,
  .page-section.footer .footer-right,
  footer.footer .footer-right {
    text-align: left;
  }

  .site-footer nav,
  .page-section.footer nav,
  footer.footer nav,
  .site-footer .footer-nav,
  .page-section.footer .footer-nav,
  footer.footer .footer-nav {
    justify-self: start;
  }

  .site-footer nav ul,
  .page-section.footer nav ul,
  footer.footer nav ul {
    justify-content: flex-start;
  }
}


/* ===== Welcome ===== */
/* == scale proofed == */

.welcome { position: relative; overflow: hidden; isolation: isolate; padding: clamp(56px, 9vw, 120px) 0; }
.welcome-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: start; }

.welcome-eyebrow {
  display:inline-flex; padding:6px 10px; border-radius:999px;
  border:1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  background: color-mix(in oklab, var(--color-bg) 85%, transparent);
  font-weight:800; font-size:12px;
}

/* Eyebrow: lisää kontrasti kun taustalla on kuva / tumma */
.welcome.has-bg .welcome-eyebrow {
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.28);              /* tumma lasi */
  border-color: rgba(255,255,255,0.22);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* pieni “glow” jos haluat lisää blingiä (optional) */
.welcome.has-bg .welcome-eyebrow {
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

.welcome-title { margin: 10px 0 8px; line-height: 1.06; letter-spacing: -0.02em; }
.welcome-bullets { margin: 16px 0 18px; padding: 0; list-style:none; display:grid; gap:12px; }
.welcome-bullet-title { font-weight: 800; }
.welcome-ctas { display:flex; gap:12px; flex-wrap:wrap; }

.welcome-cta { display:inline-flex; align-items:center; justify-content:center; border-radius:999px; padding:12px 16px; font-weight:800; text-decoration:none; border:1px solid color-mix(in oklab, var(--color-text) 12%, transparent); }
.welcome-cta.primary { background: var(--color-primary); color: var(--color-primary-contrast); }
.welcome-cta.secondary { background: transparent; color: var(--color-text); }

.welcome-proof.card { border-radius: 20px; padding: 18px; border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent); background: color-mix(in oklab, var(--color-bg) 78%, transparent); backdrop-filter: blur(10px); }
.welcome-highlights { display:grid; grid-template-columns: 1fr 1fr; gap:12px; }
.welcome-highlight-value { font-weight: 900; font-size: 18px; }

/* Photo background */
.welcome.has-bg::before {
  content:""; position:absolute; inset:0; z-index:-3;
  background-image: var(--welcome-bg);
  background-size: cover;
  background-position: var(--welcome-bg-pos, center);
  filter: saturate(0.95) contrast(1.05);
  transform: scale(1.02);
}
.welcome.has-bg::after{
  content:""; position:absolute; inset:0; z-index:-2;
  background: linear-gradient(90deg,
    rgba(0,0,0,var(--welcome-overlay, 0.62)) 0%,
    rgba(0,0,0,calc(var(--welcome-overlay, 0.62) - 0.18)) 55%,
    rgba(0,0,0,0.10) 100%);
}
.welcome.has-bg .welcome-title,
.welcome.has-bg .welcome-subtitle,
.welcome.has-bg .welcome-bullet-title,
.welcome.has-bg .welcome-bullet-body { color: #fff; }
.welcome.has-bg .muted { color: rgba(255,255,255,0.82); }

@media (max-width: 900px) { .welcome-inner { grid-template-columns: 1fr; } }
@container preview (max-width: 900px) { .welcome-inner { grid-template-columns: 1fr; } }


/* Force welcome title sizing (editor + hugo sama) */
.welcome-title {
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 10px 0 10px;
}
.welcome-subtitle {
  font-size: clamp(14px, 1.6vw, 18px);
  max-width: 58ch;
}

/* Edge-blur frame for the right-side image */
.welcome-media {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  box-shadow: 0 24px 70px color-mix(in oklab, black 35%, transparent);
  background: color-mix(in oklab, var(--color-bg) 85%, transparent);
}

.welcome-image {
  display: block;
  width: 100%;
  height: auto;
  transform: translateZ(0);
}

/* Blur only the edges of what's behind (the image) */
.welcome-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);

  /* Mask: center is transparent, edges get the blur */
  -webkit-mask-image: radial-gradient(closest-side, transparent 64%, black 100%);
  mask-image: radial-gradient(closest-side, transparent 64%, black 100%);

  /* subtle frosting tint */
  background: rgba(255,255,255,0.04);
}

/* Optional: extra “glass rim” */
.welcome-media::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* Default (light & normal): use theme text */
.welcome-proof.card {
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-bg) 88%, var(--color-text) 6%);
  border: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
}

/* Labels inside */
.welcome-highlight-label {
  color: color-mix(in oklab, var(--color-muted) 90%, var(--color-text));
}

  --fs-section-title: var(--fs-h2);
/* When photo background is active: switch to “glass on dark” */
.welcome.has-bg .welcome-proof.card {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.18);
}

.welcome.has-bg .welcome-highlight-label {
  color: rgba(255,255,255,0.78);
}

/* 1) Varmista että CTA:t on aina overlayn päällä */
.welcome-ctas {
  position: relative;
  z-index: 2;
}

/* 2) Secondary CTA: “glass pill” tummaan taustaan */
.welcome.has-bg .welcome-cta.secondary {
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.28);

  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);

  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

/* 3) Hover */
.welcome.has-bg .welcome-cta.secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.40);
}

.welcome-inner {
  padding-left: max(clamp(16px, 4vw, 48px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 4vw, 48px), env(safe-area-inset-right));
}

/* ===== Catalog ===== */

.catalog { padding: 44px 0; }
.catalog-head { margin-bottom: 18px; }

.catalog-subtitle { margin: 8px 0 0; max-width: 70ch; }

.catalog-list { display: grid; gap: 14px; }

.catalog-card {
  display: grid;
  grid-template-columns: 140px 1fr 180px;
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid color-mix(in oklab, var(--color-text) 10%, transparent);
  background: color-mix(in oklab, var(--color-bg) 86%, transparent);
  backdrop-filter: blur(10px);
}

.catalog-media { border-radius: 14px; overflow: hidden; }
.catalog-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.catalog-img.placeholder { width: 100%; height: 100%; background: color-mix(in oklab, var(--color-bg) 70%, var(--color-text) 8%); }

.catalog-id { font-size: 12px; }
.catalog-name { font-weight: 900; font-size: 18px; margin-top: 2px; }
.catalog-item-subtitle { margin-top: 2px; }
.catalog-desc { margin-top: 8px; line-height: 1.45; max-width: 75ch; }

.catalog-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 10px; }
.catalog-amount { font-weight: 900; font-size: 18px; }
.catalog-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
  background: color-mix(in oklab, var(--color-primary) 14%, var(--color-bg));
  color: var(--color-text);
}

@media (max-width: 900px) {
  .catalog-card { grid-template-columns: 120px 1fr; }
  .catalog-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}

@container preview (max-width: 900px){
  .catalog-card { grid-template-columns: 120px 1fr; }
  .catalog-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}


/* ==== Features ====  */
/* == scale proofed == */

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

.features .section-title{
  margin: 0 0 0.75rem 0;
  color: var(--color-text-primary, var(--color-text, #0f172a));
}


.features-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-item {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background: var(--color-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  min-width: 0;
}

.feature-item p {
  color: var(--color-text-muted);
}

.feature-item h3 {
  color: var(--color-text-primary, var(--color-text, #0f172a));
  font-family: var(--font-base);
  font-size: var(--fs-subtitle);
  line-height: var(--lh-subtitle);
  font-weight: var(--fw-subtitle);
  font-style: var(--fst-subtitle);
  line-height: 1.15;
  overflow-wrap: break-word;
  hyphens: auto;
}

.feature-item p {
  color: var(--color-text-secondary);
  font-size: var(--font-size-body);
}

.feature-empty {
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}


.features-grid{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.features-card{
  flex: 1 1 260px;     /* kortti saa kasvaa, mutta ei kutistu liian pieneksi */
  min-width: 240px;
}


/* Hugo / oikea mobiili */
@media (max-width: 900px){
  .features-list{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px){
  .features-list{ grid-template-columns: 1fr; }
}

@container preview (max-width: 900px){
  .features-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container preview (max-width: 600px){
  .features-list{
    grid-template-columns: 1fr;
  }
}

/* WildCard baseline */
.wc { padding: var(--space-section, 3rem) 0; }
.wc__inner { display: grid; gap: var(--space-card, 1.5rem); }

.wc__block{
  padding: 1rem;
  border-radius: var(--radius-card, 12px);
  box-shadow: var(--shadow-card, none);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.wc-tone--light .wc__block{
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.06);
}

.wc[data-align="center"]{ text-align: center; }

.wc__title{ margin: 0 0 .5rem 0; font-size: var(--fs-h2, 22px); }
.wc__eyebrow{ font-size: var(--fs-small, 12px); letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.wc__body{ margin: 0; font-size: var(--fs-body, 16px); }

/* Grid variants */
.wc--grid .wc__inner,
.wc--cards .wc__inner{
  grid-template-columns: repeat( auto-fit, minmax(260px, 1fr) );
}

/* Optional: obey data-cols when set */
.wc--grid[data-cols="1"] .wc__inner,
.wc--cards[data-cols="1"] .wc__inner{ grid-template-columns: 1fr; }
.wc--grid[data-cols="2"] .wc__inner,
.wc--cards[data-cols="2"] .wc__inner{ grid-template-columns: repeat(2, 1fr); }
.wc--grid[data-cols="3"] .wc__inner,
.wc--cards[data-cols="3"] .wc__inner{ grid-template-columns: repeat(3, 1fr); }
.wc--grid[data-cols="4"] .wc__inner,
.wc--cards[data-cols="4"] .wc__inner{ grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px){
  .wc--grid[data-cols="3"] .wc__inner,
  .wc--grid[data-cols="4"] .wc__inner,
  .wc--cards[data-cols="3"] .wc__inner,
  .wc--cards[data-cols="4"] .wc__inner{
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px){
  .wc--grid .wc__inner,
  .wc--cards .wc__inner{ grid-template-columns: 1fr; }
}

/* CTA buttons */
.wc__ctaButtons{ display: inline-flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.wc__btn{ display:inline-block; padding:.65rem 1rem; border-radius: var(--radius-button, 9999px); text-decoration:none; }
.wc__btn--primary{ background: var(--color-primary, #34d399); color: var(--color-primary-contrast, #0b1220); }
.wc__btn--secondary{ border: 1px solid rgba(255,255,255,0.2); color: var(--color-text, #ecfdf5); }
.wc-tone--light .wc__btn--secondary{ border-color: rgba(0,0,0,0.15); color: var(--color-text, #0b1220); }

/* Image */
.wc__img{ width: 100%; height: auto; display: block; border-radius: calc(var(--radius-card, 12px) - 4px); }
.wc__imagePlaceholder{ height: 220px; border-radius: calc(var(--radius-card, 12px) - 4px); background: rgba(127,127,127,0.15); }

/* Features / Stats */
.wc__grid{ display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.wc__cardTitle{ font-weight: 600; margin-bottom: .25rem; }
.wc__statValue{ font-weight: 700; font-size: var(--fs-h2, 22px); }


body {
  font-family: var(--font-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  font-style: var(--fst-body);
  margin: 0;
  padding: 0;
}

.preview-root {
  margin: 0;
  padding-inline: var(--page-pad-x);
  padding-block: var(--page-pad-y);
  padding-left: calc(var(--page-pad-x) + env(safe-area-inset-left));
  padding-right: calc(var(--page-pad-x) + env(safe-area-inset-right));
  border-radius: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  background: var(--color-bg);
}

@media (min-width: 1024px) {
  .preview-root {
    margin: 0 auto;
    border-radius: 5px;
    border: 1px solid color-mix(in oklab, var(--color-text) 12%, transparent);
    box-shadow: 0 20px 60px color-mix(in oklab, black 18%, transparent);
  }
}


body{ font-size: var(--fs-body); line-height: var(--lh-body); }

h1{ font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-h1); }
h2{ font-size: var(--fs-h2); line-height: var(--lh-h2); font-weight: var(--fw-h2); }
h3{ font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-h3); }


