/* =========================================================
   HARVIA LABS — landing page
   Dark mode, techy, healthtech, grit & aura.
   ========================================================= */

/* ---------- Local fonts ---------- */
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Light/Gotham Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Book/Gotham Book.otf') format('opentype');
    font-weight: 350;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Regular/Gotham Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Medium/Gotham Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Bold/Gotham Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Gotham';
    src: url('fonts/Gotham/Gotham Black/Gotham Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Chevin Pro';
    src: url('fonts/Chevin Pro/fonnts.com-Chevin_Pro_Light.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Chevin Pro';
    src: url('fonts/Chevin Pro/fonnts.com-Chevin_Pro_Medium.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Chevin Pro';
    src: url('fonts/Chevin Pro/fonnts.com-Chevin_Pro_DemiBold.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Chevin Pro';
    src: url('fonts/Chevin Pro/fonnts.com-Chevin_Pro_Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}
@font-face {
    font-family: 'Chevin Pro';
    src: url('fonts/Chevin Pro/fonnts.com-Chevin_Pro_ExtraBold.otf') format('opentype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
    /* Normalized vertical metrics — forces every browser to use the same
       ascent/descent regardless of which font table it normally prefers,
       so Chevin Pro and Gotham render with the same baseline position on
       iOS Safari and desktop Chrome/Firefox. ~85/15/0 puts the cap-height
       roughly in the centre of the line box at line-height: 1. */
    ascent-override: 85%;
    descent-override: 15%;
    line-gap-override: 0%;
}

:root {
    /* Brand palette (from styleguide) */
    --harvia-red: #ED1C24;
    --deep-red: #C01718;
    --near-black: #1A0000;
    --dark-grey: #505045;
    --natural-white: #FEFCF3;
    --accent-blue: #3AAEE4;
    --harvia-orange: #FF6000;
    --harvia-yellow: #FFC000;

    /* Layered darks */
    --bg-0: #0a0405;
    --bg-1: #120608;
    --bg-2: #1a0a0c;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    --text: #FEFCF3;
    --text-muted: rgba(254, 252, 243, 0.65);
    --text-dim: rgba(254, 252, 243, 0.45);

    --font-display: 'Gotham', system-ui, -apple-system, sans-serif;
    --font-body: 'Chevin Pro', system-ui, -apple-system, sans-serif;

    --container: 1400px;
    --gutter: clamp(16px, 3vw, 32px);
    --section-pad: clamp(70px, 8vw, 120px);
    --grid-gap: 7.2px;
    --radius: 2px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

a, button, [role="button"], .btn, .hover-card-cta, .nav-toggle {
    touch-action: manipulation;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    /* A radial warmth zone tiled once per viewport-height down the page.
       Within each tile the warmth peaks at the tile's center (50%) and
       fades fully to transparent before the tile's edge, so tile-to-tile
       there is no visible seam — both sides of every boundary are pure
       transparent over bg-0. The first tile's warmth starts well below
       the navbar (around 28vh from the top of the page), so there's no
       edge against the solid-dark navbar when not scrolled. */
    background:
        radial-gradient(
            ellipse 90% 55% at 50% 50%,
            rgba(184, 24, 20, 0.78) 0%,
            rgba(158, 21, 18, 0.62) 14%,
            rgba(128, 18, 16, 0.46) 28%,
            rgba(98, 15, 13, 0.32) 44%,
            rgba(68, 11, 10, 0.20) 60%,
            rgba(42, 8, 7, 0.10) 78%,
            rgba(22, 5, 5, 0.03) 92%,
            transparent 100%
        ),
        var(--bg-0);
    background-size: 100% 100dvh, 100% 100%;
    background-repeat: repeat-y, no-repeat;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text);
}

p { margin: 0; }

::selection {
    background: var(--harvia-red);
    color: var(--text);
}

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--gutter);
    height: 72px;
    /* Always fully opaque dark, no transitions. Eliminates the previous
       transparent-to-opaque flash on scroll. */
    background: var(--bg-0);
    border-bottom: 0px solid var(--line);
    overflow: visible;
    transition-duration: 0.3s;
}

.site-header.is-scrolled {
    border-bottom: 1px solid var(--line);
}

.logo-link {
    display: inline-flex;
    align-items: flex-start;
    align-self: flex-start;       /* logo anchored to TOP of navbar */
    transition: opacity 0.2s ease;
    line-height: 0;
    height: auto;
}

.logo-link:hover { opacity: 0.85; }

.logo {
    padding-left: 0vw;
    height: 96px;                /* overflows the 72px navbar by 36px */
    width: auto;
    transition: height 0.35s ease;
}

.site-header.is-scrolled .logo {
    height: 72px;                 /* shrinks on scroll, just barely overflows */

}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.main-nav > a {
    position: relative;
    padding: 10px 16px;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-size: 1rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.main-nav > a::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 6px;
    height: 2px;
    background: var(--text);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.main-nav > a:hover::after { transform: scaleX(1); }

.main-nav .nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    /* Symmetric — the @font-face metric overrides handle the centering. */
    padding: 11px 20px;
    background: var(--harvia-red);
    border: 2px solid var(--harvia-red);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    text-transform: none;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.main-nav .nav-cta::after { display: none; }

.main-nav .nav-cta:hover {
    background: var(--deep-red);
    border-color: var(--deep-red);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: 0;
    padding: 14px 10px;
    cursor: pointer;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    position: relative;
    /* Tighter padding + no min-height floor so the first project cards
       land inside the initial viewport with no scroll required. */
    padding: 120px var(--gutter) 24px;
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

/* First section right after the hero hugs it tighter than other sections
   so the first cards sit fully inside the initial viewport. */
.hero + .section {
    padding-top: clamp(12px, 1.5vw, 20px);
}

.hero + .section .section-head {
    margin-bottom: 12px;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.hero-glow {
    /* Hidden — the page-wide vertical gradient now carries the warmth.
       A localized hero glow on top would create a visible boundary
       between hero and the next section. */
    display: none;
}

@keyframes glow-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
    50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.hero-embers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-embers span {
    position: absolute;
    bottom: -10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--harvia-orange);
    box-shadow: 0 0 12px var(--harvia-orange);
    opacity: 0;
    animation: ember 9s linear infinite;
}

.hero-embers span:nth-child(1)  { left: 8%;  animation-delay: 0s;   animation-duration: 11s; }
.hero-embers span:nth-child(2)  { left: 18%; animation-delay: 2s;   animation-duration: 9s;  background: var(--harvia-yellow); box-shadow: 0 0 12px var(--harvia-yellow); }
.hero-embers span:nth-child(3)  { left: 27%; animation-delay: 4s;   animation-duration: 13s; }
.hero-embers span:nth-child(4)  { left: 38%; animation-delay: 1.5s; animation-duration: 10s; }
.hero-embers span:nth-child(5)  { left: 52%; animation-delay: 3s;   animation-duration: 12s; background: var(--harvia-red); box-shadow: 0 0 12px var(--harvia-red); }
.hero-embers span:nth-child(6)  { left: 63%; animation-delay: 5s;   animation-duration: 9s; }
.hero-embers span:nth-child(7)  { left: 71%; animation-delay: 6s;   animation-duration: 14s; background: var(--harvia-yellow); box-shadow: 0 0 12px var(--harvia-yellow); }
.hero-embers span:nth-child(8)  { left: 81%; animation-delay: 2.5s; animation-duration: 11s; }
.hero-embers span:nth-child(9)  { left: 88%; animation-delay: 7s;   animation-duration: 10s; }
.hero-embers span:nth-child(10) { left: 95%; animation-delay: 4.5s; animation-duration: 12s; background: var(--harvia-orange); box-shadow: 0 0 12px var(--harvia-orange); }

@keyframes ember {
    0%   { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 0.9; }
    50%  { transform: translateY(-50dvh) translateX(20px); opacity: 0.6; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-100dvh) translateX(-10px); opacity: 0; }
}

.hero-inner {
    position: relative;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 8dvh 0 6dvh 0;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6.5vw, 5.4rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    max-width: 18ch;
    margin-bottom: 32px;
    text-transform: none;
    margin-top: 4dvh; /* optical adjustment to visually center the title better against the hero glow and the next section */
}

/* Word rotator — solid color, no gradient */
.rotator {
    position: relative;
    display: inline-block;
    height: 1.05em;
    overflow: hidden;
    vertical-align: bottom;
    line-height: 1.05;
}

.rotator-list {
    display: flex;
    flex-direction: column;
    width: max-content;
    will-change: transform;
}

.rotator-word {
    display: block;
    height: 1.05em;
    line-height: 1.05;
    white-space: nowrap;
    flex: 0 0 auto;
    color: var(--natural-white);
}

.hero-lead {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 60ch;
    margin-bottom: 20px;
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Buttons — harvia.fi style: mixed case, Chevin Pro, square corners,
   thin border. Tight line-height so glyphs sit perfectly centered. */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    /* Symmetric — the @font-face metric overrides (ascent-override /
       descent-override / line-gap-override) normalize Chevin Pro so it
       centres on its own at line-height: 1, no padding bias needed. */
    padding: 13px 26px;
    font-family: var(--font-body);
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--harvia-red);
    border-color: var(--harvia-red);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--deep-red);
    border-color: var(--deep-red);
}

.btn-primary svg { transition: transform 0.25s ease; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--text);
}

.btn-ghost:hover {
    background: var(--text);
    color: var(--bg-0);
    border-color: var(--text);
}


/* =========================================================
   SECTIONS — uniform layout
   ========================================================= */
.section {
    position: relative;
    padding: var(--section-pad) 0;
    max-width: none;
}

/* Contact section is the last section before the footer — tighten its
   vertical padding so there isn't a giant empty band on either side. */
#contact {
    padding-top: clamp(40px, 5vw, 70px);
    padding-bottom: clamp(40px, 5vw, 70px);
}

.section-head {
    max-width: var(--container);
    margin: 0 auto 40px;
    padding: 0 var(--gutter);
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 18px;
    max-width: 28ch;
}

.section-sub {
    font-size: 0.98rem;
    color: var(--text-muted);
    max-width: 64ch;
    line-height: 1.55;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* =========================================================
   CARD GRID — uniform across every section
   ========================================================= */
.card-grid {
    display: grid;
    gap: var(--grid-gap);
    padding: 0 var(--grid-gap);
    /* Cap the grid at the same container width as the section heads and
       centre it, so cards don't stretch edge-to-edge on 4K monitors. */
    max-width: var(--container);
    margin: 0 auto;
}

.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Card aspect ratios */
.hover-card { aspect-ratio: 4 / 3; }
.card-grid--tall .hover-card { aspect-ratio: 16 / 9; }
/* Team grid cards (incl. the Join card) are 5:4 landscape. */
.card-grid--3 .hover-card { aspect-ratio: 5 / 4; }

/* =========================================================
   HOVER CARDS (top-anchored overlay)
   ========================================================= */
.hover-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-2);
    cursor: default;   /* cards aren't clickable as a whole... */
    isolation: isolate;
}

/* ...only show the pointer where something is actually clickable: a
   whole-card link (e.g. the Join card) or the in-card CTA button. */
a.hover-card { cursor: pointer; }
.hover-card-cta { cursor: pointer; }

.hover-card-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
    /* No zoom/brighten on hover — the image stays still. */
}

/* Solid low-opacity black block (not a gradient) behind the title. The
   block hugs its content: title only by default, growing to fit the
   description on hover. */
.hover-card-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 22px 26px 24px;
    background: rgba(10, 4, 5, 0.62);
}

.hover-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin: 0;
}

.hover-card p {
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
}

/* Reveal wrapper — holds the description (+ optional CTA) and collapses to
   EXACTLY zero when not hovered. It has no padding/border/margin of its
   own, so every card's default block is just `padding + title`: identical
   whether the card has a CTA, a long description, or neither. This is what
   guarantees the flagship/product cards are the same height at rest. */
.hover-card-reveal {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    /* Even easing (not front-loaded) + a max-height close to the real
       content height means the *visible* reveal tracks the full duration
       instead of finishing in the first fraction of it. */
    transition: max-height 0.6s ease-in-out,
                opacity 0.4s ease 0.05s;
}

.hover-card:hover .hover-card-reveal {
    max-height: 280px;
    opacity: 1;
}

/* Spacing inside the reveal wrapper (only seen once revealed). */
.hover-card-reveal p {
    margin-top: 16px;
}

/* Large hero-project cards get slightly bigger title */
.card-grid--tall .hover-card h3 {
    font-size: 1.4rem;
}

.card-grid--tall .hover-card p {
    font-size: 0.98rem;
}

/* In-card CTA button (e.g. "Buy at harvia.com" / "Explore the project").
   Block-level so it stacks under the description; its visibility is
   handled entirely by the reveal wrapper above. */
.hover-card-cta {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 13px 22px;
    background: transparent;
    border: 2px solid var(--text);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.hover-card-cta:hover {
    background: var(--text);
    color: var(--bg-0);
}

/* Team card — name (Gotham) + role (Chevin Pro), both always visible in a
   flat solid block at the BOTTOM. No hover effect of any kind: the block
   is static and the image never moves. */
.hover-card--team {
    cursor: default;
}

/* Anchor team portraits to the TOP so the whole head/forehead stays in
   frame (the closer-cropped selfies would lose the forehead with a
   centred crop). background-size: cover still fills the 5:4 box; only the
   bottom of the photo is cropped. */
.hover-card--team .hover-card-media {
    background-position: center top;
}

.hover-card--team .hover-card-content {
    top: auto;
    bottom: 0;
    padding: 22px 26px 20px;
    background: rgba(10, 4, 5, 0.68);
}

.hover-card--team p {
    /* Always visible, sits right under the name */
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: none;
    margin-top: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.88);
    transition: none;
}

/* "Join Harvia Labs" CTA card — solid harvia red panel, matching the
   "HARVIA-FAKTOJA" block on harvia.fi. Content anchored at the bottom
   so it lines up with the team cards beside it. */
.hover-card--join {
    background: var(--harvia-red);
    text-decoration: none;
    transition: background 0.3s ease;
}

.hover-card--join:hover {
    background: var(--deep-red);
}

.hover-card--join .hover-card-media {
    /* Drop the radial-gradient media; the solid red bg carries the look. */
    background: none !important;
}

.hover-card--join .hover-card-content,
.hover-card--join:hover .hover-card-content {
    /* No dark gradient overlay; sit at the bottom like the team cards. */
    background: transparent;
    top: auto;
    bottom: 0;
    padding: 22px 26px 20px;
}

.hover-card--join h3,
.hover-card--join p {
    color: var(--text);
}

.hover-card--join p {
    /* Always visible — same treatment as the team-card role label. */
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: none;
    margin-top: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.92);
    transition: none;
}

/* =========================================================
   FOOTER — single compact row
   ========================================================= */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-1);
    padding: 24px var(--gutter);
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: var(--container);
    margin: 0 auto;
}

.footer-logo {
    height: 36px;
    width: auto;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.footer-meta a {
    color: var(--text-dim);
    transition: color 0.2s ease;
}

.footer-meta a:hover { color: var(--text); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
    .card-grid--3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-grid--2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    /* Full-width stacked menu like harvia.fi: edge-to-edge rows, a thin
       separator line under each item, large left-aligned text, solid
       dark panel dropping from under the navbar. */
    .main-nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        z-index: 99;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background: var(--bg-0);
        border-top: 1px solid var(--line);
        border-radius: 0;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
    }

    .main-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .main-nav > a {
        padding: 14px var(--gutter);
        font-size: 1.02rem;
        font-weight: 700;
        text-align: left;
        border-bottom: 1px solid var(--line);
    }

    /* No animated underline on the mobile rows. */
    .main-nav > a::after { display: none; }

    .main-nav .nav-cta {
        margin: 0;
        padding: 14px var(--gutter);
        background: var(--harvia-red);
        border: none;
        border-radius: 0;
        justify-content: flex-start;
        text-align: left;
        font-size: 1.02rem;
        font-weight: 500;
    }

    .nav-toggle { display: flex; }

    /* Logo flush in the top-left corner: fills the full navbar height and
       a negative left margin cancels the header's gutter padding so the
       red box touches the very corner. Never changes size on scroll. */
    .logo-link {
        align-self: center;
        margin-left: calc(-1 * var(--gutter));
    }
    .logo,
    .site-header.is-scrolled .logo {
        height: 72px;
        padding-left: 0;
    }

    .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
    .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .hero {
        padding-top: 120px;
        padding-bottom: 70px;
        min-height: auto;
    }

    .hero-title {
        font-size: clamp(2rem, 9vw, 3.2rem);
    }

    .card-grid--3,
    .card-grid--2 {
        grid-template-columns: 1fr;
    }

    :root { --grid-gap: 12px; }

    .footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .footer-meta {
        gap: 14px;
        font-size: 0.8rem;
    }

    .hero-embers span {
        animation: none;
    }

}

/* Touch devices have no hover, so the reveal-on-hover description/CTA
   would never show. Make them visible by default instead, so each card
   is a complete block rather than a bare title strip.
   On touch, the card switches to a flex column so the image sits on top
   and the content panel expands below it — no content gets clipped by
   the aspect-ratio anymore. Team and Join cards keep their own layout. */
@media (hover: none) {
    .hover-card-reveal {
        max-height: 500px;
        opacity: 1;
    }

    .hover-card:not(.hover-card--team):not(.hover-card--join) {
        aspect-ratio: unset;
        display: flex;
        flex-direction: column;
    }

    .hover-card:not(.hover-card--team):not(.hover-card--join) .hover-card-media {
        position: relative;
        inset: unset;
        flex: 0 0 200px;
    }

    .hover-card:not(.hover-card--team):not(.hover-card--join) .hover-card-content {
        position: relative;
        inset: unset;
        background: var(--bg-2);
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Only disable the purely-decorative rising embers. We intentionally
       do NOT kill all transitions here — the previous `* { transition-
       duration: 0.01ms !important }` rule was overriding the rotator's
       inline transition, which made the hero word snap (flash) instead
       of sliding on iOS devices that have Reduce Motion enabled. */
    .hero-embers span {
        animation: none;
    }
}
