/* ═══════════════════════════════════════════════════
   TILIVERKKO OY — Master Stylesheet
   Based on home3 template, expanded for multi-page site
   ═══════════════════════════════════════════════════ */

/* ═══ 0. RESET & VARIABLES ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:        #F5EFE6;
    --bg-alt:    #EAE2D6;
    --bg-deep:   #DED5C6;
    --white:     #FFFFFF;
    --text:      #2E2822;
    --text-mid:  #6E645A;
    --text-soft: #7E756E;      /* darkened for WCAG AA contrast (was #A09890) */
    --amber:     #8F5A2B;      /* darkened for WCAG AA contrast (was #B07B4F) */
    --amber-lt:  #D4A878;
    --amber-dim: rgba(143,90,43,0.12);
    --lake:      #6A9BB0;
    --lake-lt:   #A5C8D8;
    --golden:    #D4B48C;
    --border:    #D8D0C4;
    --dark:      #1A1816;
    --dark-mid:  #252220;

    --serif:     'DM Serif Display', Georgia, serif;
    --sans:      'DM Sans', -apple-system, sans-serif;
    --ease:      cubic-bezier(0.16, 1, 0.3, 1);

    color-scheme: light only;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
html.lenis, html.lenis body { height: auto; }

/* Keyboard focus indicator */
*:focus { outline: none; }
*:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    /* Force-show animation-gated content so it isn't stuck invisible */
    .reveal,
    .hero__mask-brand,
    .hero__mask-tagline,
    .hero__mask-sub,
    .hero__info,
    .phil__author,
    .vis-break__heading,
    .glass-stat,
    .team__title,
    .tm,
    .testimonials .reveal,
    .hp-cta .reveal,
    .contact-split__heading,
    .contact-split__sub,
    .contact-split__info { opacity: 1 !important; transform: none !important; }
    .phil__text .char { opacity: 1 !important; }
    .svc-row__circle, .tm__circle { clip-path: circle(50% at 50% 50%) !important; }
}

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

::selection { background: var(--amber); color: #fff; }
img { display: block; max-width: 100%; }
/* Prevent iOS double-tap-zoom on tap targets while still allowing pinch-zoom
   for accessibility. Applied to anchors and buttons across the site. */
a, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ═══ 1. GRAIN OVERLAY ═══ */
body::after {
    content: '';
    position: fixed; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px;
    opacity: 0.018;
    pointer-events: none;
    z-index: 10000;
}

/* ═══ 2. SHARED UTILITIES ═══ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 56px; }
.container--narrow { max-width: 900px; margin: 0 auto; padding: 0 56px; }
.section-pad { padding: 140px 56px; }
.section-pad--sm { padding: 100px 56px; }
.reveal { opacity: 0; transform: translateY(24px); }

.section-label {
    font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 14px; display: block;
}
.section-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--text);
}

/* ═══ 3. INTRO (homepage only) ═══ */
.intro {
    position: fixed; inset: 0;
    z-index: 9000;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 24px;
}
.intro__text {
    font-family: var(--serif);
    font-style: italic; font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: 0.02em;
    background-image: url('../img/TiliverkkoOyValmis13.2.(144)Skarppi.webp');
    background-size: cover; background-position: center 40%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    opacity: 0; transform: translateY(20px);
}
.intro__line {
    width: 60px; height: 1px;
    background: var(--amber);
    transform: scaleX(0);
}

/* ═══ 4. NAVIGATION ═══ */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    padding: 30px 56px;
    padding-top: calc(30px + env(safe-area-inset-top, 0px));
    padding-left: calc(56px + env(safe-area-inset-left, 0px));
    padding-right: calc(56px + env(safe-area-inset-right, 0px));
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    transition: background 0.5s, padding 0.4s, backdrop-filter 0.5s;
}
.nav.scrolled {
    padding: 18px 56px;
    padding-top: calc(18px + env(safe-area-inset-top, 0px));
    padding-left: calc(56px + env(safe-area-inset-left, 0px));
    padding-right: calc(56px + env(safe-area-inset-right, 0px));
    background: rgba(245,239,230,0.92);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav__brand {
    font-family: var(--serif);
    font-style: italic; font-weight: 400;
    font-size: 1.3rem; color: var(--text);
    transition: color 0.5s;
}
.nav.on-dark .nav__brand { color: #fff; }

.nav__links { display: flex; gap: 36px; }
.nav__links a {
    font-size: 0.82rem; letter-spacing: 0.05em;
    color: var(--text-mid);
    padding-bottom: 3px; position: relative;
    transition: color 0.3s;
}
.nav.on-dark .nav__links a { color: rgba(255,255,255,0.6); }
.nav__links a:hover { color: var(--text); }
.nav.on-dark .nav__links a:hover { color: #fff; }
.nav__links a::after {
    content: ''; position: absolute;
    bottom: 0; left: 0; width: 100%; height: 1px;
    background: var(--amber);
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.4s var(--ease);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Active nav link */
.nav__links a.active { color: var(--text); }
.nav__links a.active::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle {
    display: none; background: none; border: none;
    font-size: 0.85rem; letter-spacing: 0.05em;
    color: var(--text-mid);
}
.nav.on-dark .nav__toggle { color: rgba(255,255,255,0.6); }

/* Mobile Nav */
.mob-nav {
    position: fixed; inset: 0; z-index: 190;
    background: var(--bg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 24px;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mob-nav.open { opacity: 1; pointer-events: auto; }
.mob-nav a {
    font-family: var(--serif);
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--text);
    padding: 6px 12px;
}

/* ═══ 5. WAVE DIVIDERS ═══ */
.wave {
    position: relative; overflow: hidden;
    line-height: 0; margin-top: -2px;
}
.wave svg { display: block; width: 100%; height: 80px; }
.wave svg path { fill: var(--bg); }
.wave--flip { transform: scaleY(-1); margin-top: 0; margin-bottom: -2px; }

/* ═══ 6. BUTTONS & FORMS ═══ */
.btn {
    display: inline-flex; align-items: center;
    padding: 16px 40px;
    font-size: 0.82rem; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    border: 1.5px solid var(--text);
    color: var(--text); background: transparent;
    overflow: hidden; position: relative;
    transition: color 0.5s;
    font-family: var(--sans);
}
.btn::before {
    content: ''; position: absolute; inset: 0;
    background: var(--text);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.5s var(--ease); z-index: 0;
}
.btn:hover::before { transform: scaleX(1); }
.btn:hover { color: var(--bg); }
.btn span { position: relative; z-index: 1; }

.btn--amber { border-color: var(--amber); color: var(--amber); }
.btn--amber::before { background: var(--amber); }
.btn--amber:hover { color: #fff; }

.btn--white { border-color: #fff; color: #fff; }
.btn--white::before { background: #fff; }
.btn--white:hover { color: var(--text); }

.fg { margin-bottom: 28px; }
.fg label {
    display: block; font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-soft); margin-bottom: 10px;
}
.fg input, .fg textarea {
    width: 100%; padding: 12px 0;
    font-size: 1rem; color: var(--text);
    background: transparent; border: none;
    border-bottom: 1px solid var(--border);
    outline: none; transition: border-color 0.4s;
    font-family: var(--sans);
}
.fg input:focus, .fg textarea:focus { border-bottom-color: var(--amber); }
.fg textarea { resize: vertical; min-height: 80px; }
.fg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ═══ 7. HOMEPAGE — Hero (Text Mask) ═══ */
.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 650px;
    overflow: hidden;
}
.hero__image {
    position: absolute; inset: 0; z-index: 1;
}
.hero__image img {
    width: 100%; height: 120%;
    object-fit: cover; object-position: center 35%;
}
.hero__image::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg,
        rgba(42,33,24,0.1) 0%, rgba(42,33,24,0) 40%, rgba(42,33,24,0.25) 100%);
}
.hero__mask-layer {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 2;
    background-color: #F5EFE6;
    opacity: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; padding: 0 24px;
    will-change: opacity;
}
.hero__mask-brand {
    opacity: 0;
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(4rem, 14vw, 13rem);
    line-height: 0.9; letter-spacing: -0.02em;
    background-image: url('../img/TiliverkkoOyValmis13.2.(144)Skarppi.webp');
    background-size: cover; background-position: center 35%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: maskDrift 25s ease-in-out infinite alternate;
    margin-bottom: 12px;
}
.hero__mask-tagline {
    opacity: 0;
    display: block;
    white-space: nowrap;
    font-family: var(--serif); font-weight: 400;
    font-size: clamp(1.4rem, 4.2vw, 3.4rem);
    line-height: 1.1; letter-spacing: -0.01em;
    background-image: url('../img/TiliverkkoOyValmis13.2.(144)Skarppi.webp');
    background-size: cover; background-position: center 40%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    animation: maskDrift 25s ease-in-out infinite alternate;
}
@keyframes maskDrift {
    0% { background-position: 35% 35%; }
    100% { background-position: 65% 45%; }
}
.hero__mask-sub {
    margin-top: 28px;
    font-size: 0.85rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--text-soft);
    opacity: 0;
}
.hero__lights {
    position: absolute; inset: 0; z-index: 3;
    pointer-events: none; overflow: hidden;
    contain: strict;
}
.light {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,180,140,0.1), transparent 70%);
}
.light:nth-child(1) { width: 400px; height: 400px; top: 10%; left: 60%; animation: lfloat1 14s ease-in-out infinite; }
.light:nth-child(2) { width: 300px; height: 300px; top: 50%; left: 20%; animation: lfloat2 18s ease-in-out infinite; }
.light:nth-child(3) { width: 250px; height: 250px; top: 70%; left: 70%; animation: lfloat3 12s ease-in-out infinite; }
@keyframes lfloat1 { 0%,100%{transform:translate(0,0)}50%{transform:translate(40px,-30px)} }
@keyframes lfloat2 { 0%,100%{transform:translate(0,0)}50%{transform:translate(-30px,25px)} }
@keyframes lfloat3 { 0%,100%{transform:translate(0,0)}50%{transform:translate(25px,-20px)} }
.hero__info {
    position: absolute; bottom: 40px; left: 0; right: 0;
    z-index: 4; text-align: center; opacity: 0;
}
.hero__info span {
    font-size: 0.78rem; letter-spacing: 0.18em;
    text-transform: uppercase; color: rgba(255,255,255,0.85);
}

/* ═══ 8. HOMEPAGE — Philosophy ═══ */
.phil { padding: 140px 56px; position: relative; overflow: hidden; }
.phil__inner {
    max-width: 860px; margin: 0 auto;
    position: relative; text-align: center;
}
.phil__quote-mark {
    font-family: var(--serif);
    font-size: clamp(8rem, 18vw, 16rem);
    line-height: 0.6; color: var(--amber-dim);
    position: absolute; top: -40px; left: -20px;
    user-select: none; pointer-events: none;
}
.phil__text {
    font-family: var(--serif); font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.55; color: var(--text);
    position: relative; z-index: 2;
}
.phil__text { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease, transform 0.8s ease; }
.phil__text.in-view { opacity: 1; transform: translateY(0); }
.phil__author {
    margin-top: 36px; font-size: 0.82rem;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--amber); opacity: 0;
}

/* ═══ 9. HOMEPAGE — Services ═══ */
.services { padding: 80px 56px 160px; }
.services__inner { max-width: 1200px; margin: 0 auto; }
.services__top { text-align: center; margin-bottom: 100px; }
.services__label {
    font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--amber); margin-bottom: 14px; display: block; opacity: 0;
}
.services__title {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    color: var(--text); opacity: 0; transform: translateY(20px);
}
.svc-row {
    position: relative; padding: 72px 0;
    border-top: 1px solid var(--border);
    overflow: hidden; opacity: 0;
}
.svc-row:last-child { border-bottom: 1px solid var(--border); }
.svc-row__bg-num {
    position: absolute; font-family: var(--serif);
    font-size: clamp(10rem, 22vw, 20rem);
    line-height: 0.8; color: rgba(176,123,79,0.04);
    pointer-events: none; user-select: none;
    top: 50%; transform: translateY(-50%);
}
.svc-row--left .svc-row__bg-num { right: -3%; }
.svc-row--right .svc-row__bg-num { left: -3%; }
.svc-row__content { position: relative; z-index: 2; max-width: 560px; }
.svc-row--left .svc-row__content { margin-right: auto; }
.svc-row--right .svc-row__content { margin-left: auto; }
.svc-row__num {
    font-family: var(--sans); font-weight: 300;
    font-size: 0.82rem; letter-spacing: 0.15em;
    color: var(--amber); margin-bottom: 16px; display: block;
}
.svc-row__name {
    font-family: var(--serif);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--text); margin-bottom: 16px;
}
.svc-row__desc {
    font-size: 0.95rem; line-height: 1.8; color: var(--text-mid);
}
.svc-row__circle {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: clamp(140px, 18vw, 220px); height: clamp(140px, 18vw, 220px);
    border-radius: 50%; overflow: hidden;
    clip-path: circle(0% at 50% 50%);
}
.svc-row--left .svc-row__circle { right: 0; }
.svc-row--right .svc-row__circle { left: 0; }
.svc-row__circle img { width: 100%; height: 100%; object-fit: cover; }

/* ═══ 10. HOMEPAGE — Visual Break (glassmorphism) ═══ */
.vis-break {
    position: relative; height: 80vh; min-height: 500px;
    overflow: hidden; display: flex;
    align-items: center; justify-content: center;
}
.vis-break__bg { position: absolute; inset: 0; }
.vis-break__bg img {
    width: 100%; height: 118%;
    object-fit: cover; object-position: center 55%;
}
.vis-break__bg::after {
    content: ''; position: absolute; inset: 0;
    background: rgba(26,24,22,0.4);
}
.vis-break__content { position: relative; z-index: 2; text-align: center; }
.vis-break__heading {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: #fff; margin-bottom: 48px;
    opacity: 0; transform: translateY(24px);
}
.vis-break__stats {
    display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
}
.glass-stat {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px; padding: 32px 40px;
    text-align: center; min-width: 160px;
    opacity: 0; transform: translateY(20px);
}
.glass-stat__num {
    font-family: var(--serif); font-size: 2.8rem;
    color: #fff; line-height: 1;
}
.glass-stat__label {
    font-size: 0.72rem; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(255,255,255,0.55);
    margin-top: 8px;
}

/* ═══ 11. TEAM — Circles ═══ */
.team { padding: 160px 56px; text-align: center; }
.team__inner { max-width: 1000px; margin: 0 auto; }
.team__title {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text); margin-bottom: 80px;
    opacity: 0; transform: translateY(20px);
}
.team__arrangement {
    display: flex; flex-direction: column;
    align-items: center; gap: 56px;
}
.team__row {
    display: flex; gap: clamp(40px, 8vw, 100px);
    justify-content: center;
}
.tm { text-align: center; opacity: 0; transform: translateY(30px); }
.tm__circle {
    width: clamp(180px, 20vw, 260px); height: clamp(180px, 20vw, 260px);
    border-radius: 50%; overflow: hidden;
    margin: 0 auto 24px;
    background: var(--bg-alt);
}
.tm__circle img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
}
.tm__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-deep);
    font-family: var(--serif); font-size: 2.5rem; color: var(--text-soft);
}
.tm__name {
    font-family: var(--serif); font-size: 1.4rem;
    color: var(--text); margin-bottom: 4px;
}
.tm__role { font-size: 0.82rem; color: var(--text-soft); margin-bottom: 12px; }
.tm__links a {
    display: block; font-size: 0.85rem;
    color: var(--text-mid); line-height: 1.8;
    transition: color 0.3s;
}
.tm__links a:hover { color: var(--amber); }

/* ═══ 12. VALUES — Pills ═══ */
.values { padding: 0 56px 160px; }
.values__inner {
    max-width: 1000px; margin: 0 auto;
    display: flex; justify-content: center;
    gap: 48px; flex-wrap: wrap;
}
.val-pill {
    padding: 20px 36px;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: var(--serif); font-size: 1.1rem;
    color: var(--text);
    transition: background 0.4s, border-color 0.4s, color 0.4s;
    opacity: 0; transform: translateY(16px);
}
.val-pill:hover {
    background: var(--amber); border-color: var(--amber); color: #fff;
}

/* ═══ 12a. HOMEPAGE — Full Bleed Break Image ═══ */
.hp-break {
    overflow: hidden;
    margin: 0 56px;
}
.hp-break img {
    width: 100%;
    aspect-ratio: 2.4 / 1;
    object-fit: cover;
    object-position: center 55%;
    border-radius: 8px;
    transform: scale(1.04);
    opacity: 0;
}

/* ═══ 12b. HOMEPAGE — About Intro ═══ */
.hp-intro {
    padding: 140px 56px;
    text-align: center;
}
.hp-intro__title { margin-bottom: 20px; }
.hp-intro__lead {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-mid);
    max-width: 640px;
    margin: 0 auto 28px;
}
.hp-intro__software {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.hp-intro__software-logo {
    height: 32px;
    width: auto;
    display: block;
}
.c-info__software-logo {
    height: 28px;
    width: auto;
    display: block;
    margin-top: 4px;
}

/* ═══ 12c. HOMEPAGE — CTA ═══ */
.hp-cta {
    position: relative;
    height: 85vh;
    min-height: 600px;
    max-height: 880px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hp-cta__bg { position: absolute; inset: 0; }
.hp-cta__bg img {
    width: 100%;
    height: 115%;
    object-fit: cover;
    object-position: center 38%;
}
.hp-cta__bg::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(26, 24, 22, 0.5);
}
.hp-cta__content {
    position: relative;
    z-index: 2;
    padding: 0 24px;
    max-width: 680px;
}
.hp-cta__title {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: #fff;
    margin-bottom: 24px;
    line-height: 1.15;
}
.hp-cta__sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 440px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* ═══ 12d. VALUES — Elegant Line (homepage) ═══ */
.values-line-section {
    padding: 120px 56px;
    text-align: center;
}
.values-line-section .section-label {
    margin-bottom: 32px;
}
.values-line {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.8vw, 2.1rem);
    line-height: 1.6;
    color: var(--text-mid);
    max-width: 860px;
    margin: 0 auto;
}
.values-line em {
    font-style: italic;
    color: var(--text);
    position: relative;
    transition: color 0.4s;
}
.values-line em::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -2px;
    height: 1px;
    background: var(--amber);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s var(--ease);
}
.values-line em:hover { color: var(--amber); }
.values-line em:hover::after { transform: scaleX(1); transform-origin: left; }

/* Section divider */
.section-divider {
    width: 60px;
    height: 1px;
    background: var(--amber);
    margin: 80px auto 0;
    opacity: 0.5;
}

/* ═══ 13. TESTIMONIALS (NEW) ═══ */
.testimonials { padding: 100px 56px 160px; }
.testimonials__inner { max-width: 1100px; margin: 0 auto; }
.testimonials__intro {
    text-align: center;
    font-family: var(--serif); font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--text); margin-bottom: 64px;
    max-width: 600px; margin-left: auto; margin-right: auto;
}
.testimonials__grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 32px;
}
.testimonial-card {
    background: var(--bg-alt);
    border-radius: 16px;
    padding: clamp(32px, 4vw, 48px);
    position: relative;
}
.testimonial-card__mark {
    font-family: var(--serif);
    font-size: 6rem; line-height: 0.5;
    color: var(--amber-dim);
    position: absolute; top: 24px; left: 32px;
    user-select: none; pointer-events: none;
}
.testimonial-card__quote {
    font-family: var(--sans);
    font-size: 0.92rem; line-height: 1.85;
    color: var(--text-mid);
    font-style: normal;
    position: relative; z-index: 2;
    margin: 0;
}
.testimonial-card__author {
    display: block; margin-top: 24px;
    font-family: var(--sans);
    font-size: 0.82rem; font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--amber);
    font-style: normal;
}

/* ═══ 14. CONTACT — Split Screen ═══ */
.contact-split {
    display: grid; grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}
.contact-split__image { position: relative; overflow: hidden; }
.contact-split__image img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center 50%;
    transition: transform 8s ease;
}
.contact-split__image.in-view img { transform: scale(1.05); }
.contact-split__form-side {
    padding: 80px 64px;
    display: flex; flex-direction: column; justify-content: center;
    background: var(--bg-alt);
}
.contact-split__heading {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    color: var(--text); margin-bottom: 12px;
    opacity: 0; transform: translateY(24px);
}
.contact-split__sub {
    font-size: 1rem; line-height: 1.7;
    color: var(--text-mid); margin-bottom: 48px;
    opacity: 0; transform: translateY(16px);
}
.contact-split__info {
    margin-top: 48px; padding-top: 36px;
    border-top: 1px solid var(--border);
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 24px; opacity: 0; transform: translateY(12px);
}
.c-info__label {
    font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--amber); margin-bottom: 4px;
}
.c-info__value { font-size: 0.9rem; line-height: 1.7; color: var(--text-mid); }
.c-info__value a { transition: color 0.3s; }
.c-info__value a:hover { color: var(--text); }

/* ═══ 15. FOOTER ═══ */
.footer {
    background: var(--dark);
    padding: 56px 56px;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(56px + env(safe-area-inset-left, 0px));
    padding-right: calc(56px + env(safe-area-inset-right, 0px));
}
.footer__inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
}
.footer__brand {
    font-family: var(--serif); font-style: italic;
    font-size: 1.3rem; color: rgba(234,226,214,0.85);
}
.footer__mid { font-size: 0.75rem; color: rgba(234,226,214,0.65); }
.footer__mid a { text-decoration: underline; text-underline-offset: 3px; color: rgba(234,226,214,0.85); }
.footer__up {
    background: none;
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(234,226,214,0.8);
    font-size: 0.7rem; letter-spacing: 0.1em;
    text-transform: uppercase; padding: 10px 20px;
    transition: border-color 0.3s, color 0.3s;
}
.footer__up:hover { border-color: rgba(255,255,255,0.5); color: rgba(234,226,214,1); }

/* ═══ 16. SUB-PAGE HERO ═══ */
.page-hero {
    position: relative; height: 75vh;
    min-height: 560px; max-height: 780px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
}
.page-hero__bg { position: absolute; inset: 0; }
.page-hero__bg img {
    width: 100%; height: 115%;
    object-fit: cover;
}
.page-hero__bg::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg,
        rgba(26,24,22,0.4) 0%, rgba(26,24,22,0.3) 100%);
}
.page-hero__content { position: relative; z-index: 2; padding: 0 24px; }
.page-hero__label {
    font-size: 0.7rem; font-weight: 500;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--amber-lt); margin-bottom: 16px; display: block;
}
.page-hero__title {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #fff; line-height: 1.1;
}

/* Minimal hero variant (for privacy policy) */
.page-hero--minimal {
    height: auto; min-height: auto; max-height: none;
    padding: 160px 56px 80px;
    background: var(--bg-alt);
}
.page-hero--minimal .page-hero__title { color: var(--text); }
.page-hero--minimal .page-hero__label { color: var(--amber); }

/* ═══ 17. SUB-PAGE — Service Detail ═══ */
.svc-detail { max-width: 1100px; margin: 0 auto; }
.svc-detail__item {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 56px; align-items: center;
    padding: 80px 0;
    border-bottom: 1px solid var(--border);
}
.svc-detail__item:last-child { border-bottom: none; }
.svc-detail__item--reverse { direction: rtl; }
.svc-detail__item--reverse > * { direction: ltr; }
.svc-detail__image {
    overflow: hidden; border-radius: 8px;
    aspect-ratio: 4/3;
}
.svc-detail__image img {
    width: 100%; height: 100%; object-fit: cover;
}
.svc-detail__num {
    font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.15em; color: var(--amber);
    margin-bottom: 12px; display: block;
}
.svc-detail__name {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: var(--text); margin-bottom: 16px;
}
.svc-detail__desc {
    font-size: 0.95rem; line-height: 1.8; color: var(--text-mid);
    margin-bottom: 20px;
}
.svc-detail__list {
    list-style: none; padding: 0;
}
.svc-detail__list li {
    font-size: 0.9rem; color: var(--text-mid);
    padding: 6px 0 6px 20px; position: relative;
}
.svc-detail__list li::before {
    content: ''; position: absolute; left: 0; top: 14px;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--amber);
}

/* ═══ 18. SUB-PAGE — About / Story ═══ */
.story {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 64px; align-items: center;
    max-width: 1100px; margin: 0 auto;
}
.story__image { overflow: hidden; border-radius: 8px; }
.story__image img { width: 100%; aspect-ratio: 4/3; object-fit: cover; object-position: 25% center; }
.story__text h2 {
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--text); margin-bottom: 20px;
}
.story__text p {
    font-size: 0.95rem; line-height: 1.85;
    color: var(--text-mid); margin-bottom: 16px;
}
.story__text strong { font-weight: 600; color: var(--text); }

/* ═══ 19. SUB-PAGE — Value Blocks ═══ */
.value-blocks {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 32px; max-width: 1100px; margin: 0 auto;
}
.value-block {
    padding: 40px; border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.3s;
}
.value-block:hover { border-color: var(--amber); }
.value-block__title {
    font-family: var(--serif);
    font-size: 1.4rem; color: var(--text);
    margin-bottom: 12px;
}
.value-block__desc {
    font-size: 0.92rem; line-height: 1.75; color: var(--text-mid);
}

/* ═══ 20. SUB-PAGE — Legal / Privacy ═══ */
.legal { max-width: 800px; margin: 0 auto; padding: 80px 56px 160px; }
.legal h2 {
    font-family: var(--serif);
    font-size: 1.6rem; color: var(--text);
    margin: 48px 0 16px;
}
.legal h2:first-child { margin-top: 0; }
.legal p {
    font-size: 0.95rem; line-height: 1.85;
    color: var(--text-mid); margin-bottom: 16px;
}
.legal ul {
    padding-left: 20px; margin-bottom: 16px;
}
.legal li {
    font-size: 0.92rem; line-height: 1.8;
    color: var(--text-mid); margin-bottom: 4px;
}
.legal strong { font-weight: 600; color: var(--text); }
.legal a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

/* ═══ 21. SUB-PAGE — Contact Full ═══ */
.contact-full { max-width: 1100px; margin: 0 auto; }
.contact-full__grid {
    display: grid; grid-template-columns: 1.2fr 1fr;
    gap: 80px; align-items: start;
}
.contact-full__heading {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text); margin-bottom: 12px;
}
.contact-full__sub {
    font-size: 0.95rem; line-height: 1.7;
    color: var(--text-mid); margin-bottom: 48px;
    max-width: 440px;
}

/* Contact info cards */
.contact-cards {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; max-width: 1100px; margin: 0 auto;
}
.contact-card {
    padding: 32px; border: 1px solid var(--border);
    border-radius: 8px; text-align: center;
}
.contact-card__icon {
    font-size: 1.5rem; margin-bottom: 12px; color: var(--amber);
}
.contact-card__label {
    font-size: 0.68rem; font-weight: 500;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--amber); margin-bottom: 8px;
}
.contact-card__value {
    font-size: 0.92rem; line-height: 1.6; color: var(--text-mid);
}
.contact-card__value a { transition: color 0.3s; }
.contact-card__value a:hover { color: var(--text); }

/* CTA Section (shared across sub-pages) */
.cta-section {
    text-align: center;
    padding: 100px 56px;
    border-top: 1px solid var(--border);
}
.cta-section__text {
    font-family: var(--serif);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--text); margin-bottom: 32px;
}

/* ═══ 21b. FORM FEEDBACK ═══ */
.form-msg {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    display: none;
}
.form-msg.visible { display: block; }
.form-msg--success {
    background: rgba(139, 160, 116, 0.15);
    border: 1px solid rgba(139, 160, 116, 0.35);
    color: #4a5d3a;
}
.form-msg--error {
    background: rgba(176, 80, 80, 0.1);
    border: 1px solid rgba(176, 80, 80, 0.3);
    color: #8a3838;
}
.form-msg--sending {
    background: rgba(176, 123, 79, 0.08);
    border: 1px solid rgba(176, 123, 79, 0.25);
    color: var(--text-mid);
}
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
button[disabled] { opacity: 0.6; cursor: not-allowed; }

.form-privacy {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-soft);
    line-height: 1.5;
}
.form-privacy a {
    color: var(--amber);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s;
}
.form-privacy a:hover { color: var(--text); }

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--text);
    color: var(--bg);
    padding: 10px 16px;
    z-index: 9999;
    text-decoration: none;
    font-size: 0.85rem;
}
.skip-link:focus { top: 0; }

/* ═══ 22. CONTACT PAGE — Redesigned ═══ */
.contact-page-intro {
    max-width: 640px;
    text-align: center;
    margin: 0 auto 80px;
}
.contact-page-intro p {
    font-size: 1.05rem; line-height: 1.8;
    color: var(--text-mid);
}

.contact-page-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 72px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

.contact-page-form .fg {
    opacity: 1; transform: none;
}

.contact-page-info {
    padding: 48px;
    background: var(--bg-alt);
    border-radius: 12px;
}
.contact-page-info__heading {
    font-family: var(--serif);
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 32px;
}
.contact-page-info__item {
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}
.contact-page-info__item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.contact-team-strip {
    display: flex;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 80px;
    border-top: 1px solid var(--border);
}
.contact-team-member {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}
.contact-team-member__photo {
    width: 56px; height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-alt);
}
.contact-team-member__photo img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: center top;
}
.contact-team-member__placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-deep);
    font-family: var(--serif);
    font-size: 1rem; color: var(--text-soft);
}
.contact-team-member__name {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
}
.contact-team-member__role {
    font-size: 0.72rem;
    color: var(--text-soft);
    margin-bottom: 4px;
}
.contact-team-member__link {
    font-size: 0.78rem;
    color: var(--text-mid);
    transition: color 0.3s;
}
.contact-team-member__link:hover { color: var(--amber); }

/* ═══ 23. RESPONSIVE ═══ */
@media (max-width: 1024px) {
    .contact-split { grid-template-columns: 1fr; }
    .contact-split__image { height: 50vh; min-height: 300px; }
    .svc-row__circle { display: none; }
    .svc-detail__item { grid-template-columns: 1fr; gap: 32px; }
    .svc-detail__item--reverse { direction: ltr; }
    .story { grid-template-columns: 1fr; gap: 40px; }
    .contact-full__grid { grid-template-columns: 1fr; gap: 48px; }
    .testimonials__grid { grid-template-columns: 1fr; }
    .contact-cards { grid-template-columns: 1fr; max-width: 400px; }
    .value-blocks { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav, .nav.scrolled {
        padding: 14px 16px !important;
        padding-top: calc(14px + env(safe-area-inset-top, 0px)) !important;
        /* No safe-area on left/right: Firefox Android computes these
           incorrectly in portrait and pushes content past the viewport edge,
           clipping the Menu button. Base 16px is enough for portrait phones. */
        flex-wrap: nowrap !important;
        box-sizing: border-box !important;
        gap: 12px !important;
        background: rgba(245, 239, 230, 0.94) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-bottom: 1px solid rgba(216, 208, 196, 0.45) !important;
    }
    /* When mobile menu is open, lock body scroll (Lenis's .stop() does not
       reliably block native touch scrolling on Android) */
    body:has(.mob-nav.open) {
        overflow: hidden !important;
    }
    .nav__brand {
        font-size: 0.95rem !important;
        min-width: 0 !important;
        flex: 0 1 auto !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    .nav__links { display: none !important; }
    .nav__toggle {
        display: inline-block !important;
        font-size: 0.85rem !important;
        letter-spacing: 0.05em !important;
        padding: 10px 4px !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        margin-left: auto !important;
        color: var(--text-mid) !important;
        background: none !important;
        border: none !important;
        line-height: 1 !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    .phil { padding: 100px 24px; }
    .phil__quote-mark { font-size: 8rem; top: -20px; left: -8px; }
    .services { padding: 60px 24px 100px; }
    .svc-row { padding: 48px 0; }
    .svc-row--left .svc-row__content,
    .svc-row--right .svc-row__content { margin: 0; max-width: 100%; }
    .vis-break { height: 60vh; min-height: 360px; }
    .glass-stat { padding: 24px 28px; min-width: 130px; }
    .glass-stat__num { font-size: 2rem; }
    .team { padding: 100px 24px; }
    .team__row { flex-direction: column; align-items: center; gap: 48px; }
    .values { padding: 0 24px 100px; }
    .values__inner { gap: 20px; }
    .val-pill { padding: 16px 28px; font-size: 1rem; }
    .contact-split__form-side { padding: 60px 24px; }
    .fg-row { grid-template-columns: 1fr; gap: 0; }
    .contact-split__info { grid-template-columns: 1fr; }
    .footer { padding: 40px 24px; }
    .footer__inner { flex-direction: column; gap: 20px; text-align: center; }
    .svc-row__bg-num { display: none; }
    .container, .container--narrow { padding: 0 24px; }
    .section-pad { padding: 100px 24px; }
    .section-pad--sm { padding: 72px 24px; }
    .page-hero { height: 68vh; min-height: 460px; max-height: 620px; }
    .page-hero--minimal { padding: 120px 24px 60px; }
    .legal { padding: 48px 24px 100px; }
    .testimonials { padding: 72px 24px 100px; }
    .svc-detail__item { padding: 48px 0; }
    .cta-section { padding: 72px 24px; }
    .contact-card { padding: 24px; }
    .value-block { padding: 28px 24px; }
    .contact-full__grid { gap: 24px; }
    .contact-page-grid { grid-template-columns: 1fr; gap: 48px; }
    .contact-team-strip { flex-direction: column; gap: 24px; }
    .contact-team-member { flex-direction: column; text-align: center; }

    /* Homepage-specific mobile */
    .hp-break { margin: 0 24px; }
    .hp-break img { aspect-ratio: 16 / 10; border-radius: 6px; }
    .hp-intro { padding: 80px 24px; }
    .hp-intro__lead { font-size: 0.98rem; line-height: 1.75; margin-bottom: 24px; }
    .hp-cta { height: auto; min-height: 360px; padding: 80px 24px; }
    .hp-cta__content { padding: 0; }
    .hp-cta__title { margin-bottom: 20px; }
    .hp-cta__sub { font-size: 0.95rem; margin-bottom: 28px; }

    .values-line-section { padding: 80px 24px; }
    .values-line { font-size: 1.2rem; line-height: 1.55; }

    .testimonials__grid { gap: 20px; }
    .testimonial-card { padding: 32px 24px; }
    .testimonial-card__mark { font-size: 4rem; top: 16px; left: 20px; }
    .testimonials__intro { font-size: 1.1rem; margin-bottom: 40px; }

    /* Hero mobile — bigger, more prominent */
    .hero { min-height: 640px; }
    .hero__mask-brand { font-size: clamp(3.8rem, 16vw, 13rem); margin-bottom: 8px; }
    .hero__mask-tagline { font-size: clamp(1.3rem, 6.8vw, 3rem); }
    .hero__mask-sub { font-size: 0.8rem; letter-spacing: 0.15em; padding: 0 16px; margin-top: 22px; }
    .hero__info { bottom: 24px; }
    .hero__info span { font-size: 0.7rem; letter-spacing: 0.12em; }

    /* Photos — remove parallax overflow so images display naturally */
    .hero__image img,
    .vis-break__bg img,
    .page-hero__bg img,
    .hp-cta__bg img { height: 100%; }

    /* Mobile photo framing — keep the subject centred when portrait viewport
       crops a landscape image */
    .hero__image img { object-position: 32% 55%; }
    .hp-break { margin: 0; }
    .hp-break img { aspect-ratio: 4 / 3; object-position: center 50%; border-radius: 0; }

    /* Section divider */
    .section-divider { margin-top: 56px; }
}

/* Extra small screens */
@media (max-width: 400px) {
    .hero__mask-brand { font-size: 3.2rem; }
    .hero__mask-tagline { font-size: 1.25rem; }
    .hp-break { margin: 0; }
    .container, .container--narrow { padding: 0 20px; }
    .hp-intro { padding: 64px 20px; }
}
