/* ===================================================================
   Etusivu (F1): hero, pikatesti, kolme palvelua, asiakkaat, Aija, varaus.
   Vain etusivulla (body.page-home). Otsikot Sora, leipäteksti Zalando Sans.
   =================================================================== */

.page-home, .page-f1 {
  --hf-ink: #121218;
  --hf-paper: #fafaf7;
  --hf-paper-2: #f3f1ed;
  --hf-line: #ddd6ca;
  --hf-muted: #3a3a42;
  --hf-orange: #ff6a2b;
  --hf-orange-text: #ff5912;
  --hf-orange-soft: #fff1ea;
  --hf-line-soft: #efebe4;
  --hf-head: var(--font-heading);
  --hf-body: "Zalando Sans", system-ui, sans-serif;
  /* Tekstikoot: kaikki F1-sivujen otsikot ja leipätekstit tulevat näistä.
     Tietokoneella maksimi, puhelimella clampin minimi. */
  --hf-fs-hero: clamp(34px, 4.2vw, 48px);
  --hf-fs-h1: var(--h1-size);
  --hf-fs-h2: var(--h2-size);
  --hf-fs-h3: var(--h3-size);
  --hf-fs-h4: var(--h4-size);
  --hf-fs-cta: clamp(22px, 2vw, 26px);
  --hf-fs-lead: var(--fs-lead);
  --hf-fs-body: var(--fs-card);
  --hf-fs-small: var(--fs-small);
}

.hf-wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.hf-h2 { margin: 0; font-family: var(--hf-head); font-weight: 700; font-size: var(--hf-fs-h2); line-height: 1.1; letter-spacing: -0.04em; }
.hf-h3 { margin: 0; font-family: var(--hf-head); font-weight: 700; font-size: var(--hf-fs-h3); line-height: 1.1; letter-spacing: -0.035em; }
.hf-p { margin: 0; font-family: var(--hf-body); font-size: var(--hf-fs-lead); line-height: 1.6; color: var(--hf-muted); }

.hf-btn { display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; font-family: var(--hf-head); font-weight: 600; font-size: 16px; padding: 14px 24px; color: #fff; background: var(--hf-ink); text-decoration: none; transition: transform 180ms ease, background-color 180ms ease; }
.hf-btn:hover, .hf-btn:focus-visible { transform: translateY(-1px); background: #2c2c34; }
.hf-btn--o { background: var(--hf-orange); }
.hf-btn--o:hover, .hf-btn--o:focus-visible { background: #ff7d45; }

/* ---------- Hero ---------- */
.hf-hero { background: var(--hf-ink); color: #fdfffc; padding: calc(var(--header-height, 104px) + 72px) 0 96px; text-align: center; }
.hf-hero__title { margin: 0 auto; max-width: 980px; font-family: var(--hf-head); font-weight: 700; font-size: var(--hf-fs-hero); line-height: 1.1; letter-spacing: -0.035em; }
.hf-hero__title .hf-grey { color: #b9bcc2; }
.hf-hero__title .hf-or { color: var(--hf-orange); }
.hf-hero__sub { margin: 32px auto 0; max-width: 580px; font-family: var(--hf-body); font-size: var(--hf-fs-lead); line-height: 1.6; color: #cccccc; }
.hf-hero__quotes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 940px; margin: 48px auto 0; text-align: left; }
.hf-hero__quote { margin: 0; padding: 22px 24px; border: 1px solid #2c2c34; border-radius: 12px; background: #1a1a22; display: flex; gap: 14px; font-family: var(--hf-body); font-size: 16px; line-height: 1.5; color: #cdd1cd; }
.hf-hero__quote::before { content: "\201C"; font-family: var(--hf-head); font-weight: 700; font-size: 40px; line-height: 0.8; color: var(--hf-orange); }

/* Tietokoneella hero kahteen palstaan kuten tuotesivuilla: otsikko ja teksti vasemmalla, lainaukset oikealla. */
@media (min-width: 1025px) {
  .page-home .hf-hero { text-align: left; padding-top: calc(var(--header-height, 104px) + 120px); padding-bottom: 160px; }
  .page-home .hf-hero .hf-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 400px; column-gap: 80px; align-items: center; }
  .page-home .hf-hero__title { grid-column: 1; margin: 0; max-width: none; }
  .page-home .hf-hero__sub { grid-column: 1; margin: 28px 0 0; max-width: 560px; }
  .page-home .hf-hero__pills { grid-column: 1; justify-content: flex-start; }
  .page-home .hf-hero__quotes { grid-column: 2; grid-row: 1 / span 3; grid-template-columns: minmax(0, 1fr); margin: 0; max-width: none; }
}
/* ---------- Pikatesti ---------- */
.hf-test { background: var(--hf-ink); color: #fdfffc; padding: 100px 0 110px; border-top: 1px solid #2c2c34; }
.hf-test__grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 72px; align-items: start; }
.hf-test__lead { margin: 12px 0 20px; font-family: var(--hf-body); font-size: var(--hf-fs-body); line-height: 1.5; color: #cdd1cd; }
.hf-test__list { list-style: none; margin: 0; padding: 0; }
.hf-check { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; margin: 0 -12px; border-radius: 8px; font-family: var(--hf-body); font-size: 16px; line-height: 1.4; color: #cdd1cd; }
.hf-check:hover { background: #1f1f27; }
.hf-check:focus-visible { outline: 2px solid var(--hf-orange); outline-offset: 2px; }
.hf-check__box { flex: none; width: 20px; height: 20px; border-radius: 5px; border: 2px solid #cdd1cd; display: flex; align-items: center; justify-content: center; color: var(--hf-ink); font-size: 13px; font-weight: 700; box-sizing: border-box; }
.hf-check[aria-pressed="true"] { color: #fff; }
.hf-check[aria-pressed="true"] .hf-check__box { background: var(--hf-orange); border-color: var(--hf-orange); }
.hf-check[aria-pressed="true"] .hf-check__box::after { content: "\2713"; }
.hf-result { background: var(--hf-paper); color: var(--hf-ink); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 140px; }
.hf-result__state { display: none; flex-direction: column; gap: 14px; }
.hf-result__state.is-active { display: flex; }
.hf-result__label { font-family: var(--hf-body); font-size: 13px; font-weight: 600; letter-spacing: 0.12em; color: #55555f; }
.hf-result__name { margin: 0; font-family: var(--hf-head); font-weight: 700; font-size: var(--hf-fs-h4); line-height: 1.15; letter-spacing: -0.03em; }
.hf-result__text { margin: 0; font-family: var(--hf-body); font-size: var(--hf-fs-body); line-height: 1.5; color: var(--hf-muted); }
.hf-result .hf-btn { align-self: flex-start; }
.hf-result__go.is-active { display: inline-flex; flex-direction: row; }
.hf-bars { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--hf-line); }
.hf-bar__row { display: flex; justify-content: space-between; font-family: var(--hf-body); font-size: 15px; }
.hf-bar__row.is-best { font-weight: 700; }
.hf-bar__track { height: 8px; border-radius: 4px; background: #e6e3dc; overflow: hidden; margin-top: 5px; }
.hf-bar__fill { display: block; height: 100%; width: 0; background: var(--hf-ink); transition: width 300ms ease; }
.hf-bar__row.is-best + .hf-bar__track .hf-bar__fill { background: var(--hf-orange); }

/* ---------- Palvelut ---------- */
.hf-services { background: var(--hf-paper); color: var(--hf-ink); }
.hf-services__head { padding-top: 110px; padding-bottom: 30px; }
.hf-service { padding: 70px 0; }
.hf-service--alt { background: var(--hf-paper-2); }
.hf-service__grid { display: grid; grid-template-columns: minmax(0, 1fr) 600px; gap: 72px; align-items: center; }
.hf-service__copy { display: flex; flex-direction: column; gap: 18px; }
.hf-service__copy .hf-btn { align-self: flex-start; margin-top: 8px; }
.hf-tag { align-self: flex-start; border-radius: 8px; padding: 6px 12px; font-family: var(--hf-head); font-size: 14px; font-weight: 600; border: 1px solid transparent; }
.hf-tag--orange { color: #ff5912; background: #fff1ea; border-color: rgba(255, 89, 18, 0.36); }
.hf-tag--purple { color: #5b21b6; background: rgba(237, 233, 254, 0.92); border-color: rgba(139, 92, 246, 0.36); }
.hf-tag--yellow { color: #854d0e; background: rgba(254, 240, 138, 0.92); border-color: rgba(234, 179, 8, 0.4); }
.hf-hero__pills { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }
.hf-hero__pills .hf-tag { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease; }
.hf-hero__pills .hf-tag::after { content: "→"; display: inline-block; width: 0; opacity: 0; overflow: hidden; transform: translateX(-4px); transition: width 180ms ease, opacity 180ms ease, transform 180ms ease; }
.hf-hero__pills .hf-tag:hover, .hf-hero__pills .hf-tag:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); filter: brightness(1.06); }
.hf-hero__pills .hf-tag:hover::after, .hf-hero__pills .hf-tag:focus-visible::after { width: 12px; opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .hf-hero__pills .hf-tag, .hf-hero__pills .hf-tag::after { transition: none; } }

/* Kuvakehys: ohut reuna, hento pisteruudukko ja oranssi kulma */
.hf-viz { position: relative; width: 600px; border: 1px solid var(--hf-line); border-radius: 6px; background: #fbfaf7 radial-gradient(rgba(18, 18, 24, 0.08) 0.7px, transparent 1px) 0 0 / 12px 12px; box-sizing: border-box; }
.hf-viz::before { content: ""; position: absolute; left: -2px; top: -2px; width: 56px; height: 56px; border-top: 4px solid var(--hf-orange); border-left: 4px solid var(--hf-orange); border-top-left-radius: 8px; box-sizing: border-box; pointer-events: none; }
.hf-viz--pos, .hf-viz--gtm { overflow: hidden; }
.hf-viz--pos { height: 420px; }
.hf-viz--gtm { height: 490px; background-color: #ffffff; }
.hf-viz--audit { padding: 30px 32px; }
.hf-chip { position: absolute; border: 1px solid var(--hf-line); border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(18, 18, 24, 0.06); font-family: var(--hf-head); font-weight: 600; font-size: 15px; padding: 10px 14px; text-align: center; box-sizing: border-box; color: var(--hf-ink); }
.hf-chip small { display: block; font-family: var(--hf-body); font-weight: 400; font-size: 12px; color: #55555f; margin-top: 2px; }
.hf-chip--sm { font-size: 13px; padding: 10px 6px; }
.hf-rep { height: 74px; display: flex; flex-direction: column; justify-content: center; }
.hf-line { position: absolute; background: var(--hf-ink); }

/* Positiointi: lähtötiedot yhdistyvät positioksi */
@keyframes hfPopIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes hfDraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes hfPos { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.hf-p-in, .hf-p-pos, .hf-p-out { opacity: 0; }
.hf-p-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.is-in .hf-p-in { animation: hfPopIn 0.6s ease-out forwards; }
.is-in .hf-p-in.d2 { animation-delay: 0.15s; }
.is-in .hf-p-in.d3 { animation-delay: 0.3s; }
.is-in .hf-p-line { animation: hfDraw 0.7s ease-out 0.6s forwards; }
.is-in .hf-p-pos { animation: hfPos 0.6s ease-out 1.2s forwards; }
.is-in .hf-p-line.d2 { animation-delay: 1.6s; }
.is-in .hf-p-out { animation: hfPopIn 0.6s ease-out 2.1s forwards; }
.is-in .hf-p-out.d2 { animation-delay: 2.25s; }
.hf-p-pos { position: absolute; left: 200px; top: 196px; width: 200px; height: 60px; border-radius: 14px; background: var(--hf-ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--hf-head); font-weight: 700; font-size: 22px; }
.hf-p-out { background: #ffe3d6; }

/* GTM-sprintti: data kulkee Clauden kautta raporttiin ja toimenpiteisiin */
@keyframes hfGrowV { from { transform: scaleY(0); } to { transform: none; } }
@keyframes hfGrowH { from { transform: scaleX(0); } to { transform: none; } }
.hf-viz--gtm > * { opacity: 0; }
.hf-viz--gtm.is-in > * { animation: hfPopIn 0.5s ease-out both; opacity: 1; }
.hf-viz--gtm.is-in > .hf-line--v { animation-name: hfGrowV; transform-origin: top; }
.hf-viz--gtm.is-in > .hf-line--h { animation-name: hfGrowH; transform-origin: center; }
@keyframes hfFlow { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 88% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes hfGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 43, 0); } 50% { box-shadow: 0 0 0 10px rgba(255, 106, 43, 0.22); } }
@keyframes hfLight { 0%, 30% { background: #fff; } 40%, 80% { background: #ffe3d6; } 90%, 100% { background: #fff; } }
.hf-dot { position: absolute; left: 0; top: 0; offset-rotate: 0deg; box-sizing: border-box; width: 12px; height: 12px; border-radius: 50%; background: var(--hf-orange); border: 2px solid var(--hf-ink); animation: hfFlow 2.8s ease-in-out infinite; }
.hf-claude { position: absolute; left: 190px; top: 196px; width: 220px; height: 64px; border-radius: 14px; background: var(--hf-orange); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--hf-head); font-weight: 700; font-size: 22px; }
.hf-claude small { font-family: var(--hf-body); font-weight: 500; font-size: 12px; }

/* GTM-audit: scorecard */
@keyframes hfBar { 0%, 6% { width: 0; } 30%, 88% { width: var(--w); } 100% { width: 0; } }
@keyframes hfRank { 0%, 40% { opacity: 0; transform: scale(0.4); } 48%, 88% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
@keyframes hfRowHi { 0%, 40% { background: transparent; } 48%, 88% { background: #ffe3d6; } 100% { background: transparent; } }
.hf-sc__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-family: var(--hf-head); font-weight: 700; font-size: 20px; }
.hf-sc__head span { font-family: var(--hf-body); font-weight: 400; font-size: 13px; color: #55555f; }
.hf-sc__row { display: grid; grid-template-columns: 30px 130px minmax(0, 1fr) 46px; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; font-family: var(--hf-body); font-size: 15px; }
.hf-sc__row > span:last-child { font-size: 14px; text-align: right; }
.hf-sc__row.low { font-weight: 600; animation: hfRowHi 7s infinite both; }
.hf-sc__bar { display: block; height: 10px; border-radius: 5px; background: var(--hf-ink); animation: hfBar 7s infinite both; }
.hf-sc__row.low .hf-sc__bar { background: var(--hf-orange); }
.hf-sc__rank { width: 24px; height: 24px; border-radius: 50%; background: var(--hf-ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; opacity: 0; animation: hfRank 7s infinite both; }

/* ---------- Asiakkaat ---------- */
.hf-quotes { background: var(--hf-paper-2); padding: 110px 0; color: var(--hf-ink); overflow: hidden; }
.hf-quotes__cols { display: flex; flex-direction: column; gap: 20px; margin-top: 48px; }
.hf-quotes__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; will-change: transform; }
.hf-quote { margin: 0; padding: 26px 26px 22px; background: var(--hf-ink); color: #e7e8e4; border-radius: 14px; display: flex; flex-direction: column; gap: 14px; font-family: var(--hf-body); font-size: var(--hf-fs-body); line-height: 1.55; }
.hf-quote::before { content: "\201C"; font-family: var(--hf-head); font-weight: 700; font-size: 44px; line-height: 0.6; color: var(--hf-orange); }
.hf-quote p { margin: 0; }
.hf-quote footer { font-size: 14px; color: #a9adb3; padding-top: 12px; border-top: 1px solid #2c2c34; }

/* ---------- Aija ---------- */
.hf-about { background: var(--hf-paper); padding: 110px 0; color: var(--hf-ink); }
.hf-blog { background: var(--hf-paper); padding: 110px 0 0; color: var(--hf-ink); }
.hf-blog__grid { margin-top: 40px; max-width: none; }
.hf-blog__grid .blog-card-image { aspect-ratio: 16 / 9; }
.hf-blog__more { margin-top: 32px; }
.hf-about__grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 80px; align-items: center; }
.hf-about__img { width: 100%; height: 540px; object-fit: cover; border-radius: 16px; display: block; }
.hf-about__copy { display: flex; flex-direction: column; gap: 22px; }
.hf-about__copy .hf-p { font-size: var(--hf-fs-lead); max-width: 640px; }
.hf-about__copy .hf-btn { align-self: flex-start; }

/* ---------- Varaus ---------- */
.page-home .hf-booking, .page-f1 .hf-booking { background: var(--hf-ink); color: #fdfffc; padding: 110px 0 60px; }
.hf-booking__grid { display: flex; flex-direction: column; align-items: center; gap: 44px; text-align: center; }
.hf-booking h2 { font-size: var(--hf-fs-cta); max-width: 640px; margin-left: auto; margin-right: auto; text-wrap: balance; }
.hf-booking__text { margin: 18px 0 0; font-family: var(--hf-body); font-size: var(--hf-fs-lead); line-height: 1.6; color: #cdd1cd; max-width: 520px; margin-left: auto; margin-right: auto; }
.hf-booking__cal { width: 100%; max-width: 1060px; min-height: 700px; margin-top: -24px; }
.hf-booking__cal .calendly-inline-widget { min-width: 320px; height: 700px; }

/* ---------- Mobiili ---------- */
@media (max-width: 1100px) {
  .hf-service__grid { grid-template-columns: minmax(0, 1fr); }
  .hf-viz-wrap { max-width: 600px; }
}
@media (max-width: 960px) {
  .hf-test__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hf-result { position: static; }
  .hf-about__grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hf-about__img { height: 420px; max-width: 440px; }
}
@media (max-width: 680px) {
  .hf-hero { text-align: left; }
  .hf-hero__title { margin: 0; }
  .hf-hero__sub { margin: 24px 0 0; }
  .hf-hero__pills { justify-content: flex-start; }
  .hf-booking__cal { margin-top: 0; }
  .hf-hero { padding-top: calc(var(--header-height, 88px) + 40px); padding-bottom: 72px; }
  .hf-hero__quotes { grid-template-columns: minmax(0, 1fr); }
  .hf-test, .hf-quotes, .hf-about, .page-home .hf-booking, .page-f1 .hf-booking { padding: 72px 0; }
  .hf-blog { padding-top: 72px; }
  .hf-blog__grid { max-width: none; }
  .hf-services__head { padding-top: 72px; }
  .hf-service { padding: 48px 0; }
  .hf-quotes__row { grid-template-columns: 1fr; }
  /* Animaatiot skaalataan puhelimen leveyteen */
  .hf-viz-wrap { width: 100%; overflow: hidden; }
  .hf-viz-wrap .hf-viz { transform-origin: top left; transform: scale(var(--hf-scale, 0.55)); }
  .hf-viz-wrap--pos { height: calc(420px * var(--hf-scale, 0.55)); }
  .hf-viz-wrap--gtm { height: calc(490px * var(--hf-scale, 0.55)); }
  .hf-viz-wrap--audit { height: calc(440px * var(--hf-scale, 0.55)); }
}
@media (prefers-reduced-motion: reduce) {
  .hf-viz--gtm > *, .hf-p-in, .hf-p-line, .hf-p-pos, .hf-p-out, .hf-dot, .hf-claude, .hf-rep, .hf-act, .hf-sc__bar, .hf-sc__rank, .hf-sc__row.low { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .hf-sc__bar { width: var(--w); }
  .hf-dot { display: none; }
}
