*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: none;
}
body { overscroll-behavior-y: none; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Accessibility — skip to content */
.skip-link {
    position: absolute; top: -100px; left: 12px;
    background: var(--accent, #7C6653); color: #fff;
    padding: 10px 18px; border-radius: 8px;
    font-weight: 600; font-size: 14px;
    z-index: 99999; text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; outline: 2px solid #fff; outline-offset: 2px; }

/* Visible focus ring for keyboard users */
:focus-visible {
    outline: 3px solid var(--accent2, #C4A887);
    outline-offset: 3px;
    border-radius: 4px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }


:root {
    --bg:       #222425;
    --bg2:      #2A2C2D;
    --bg3:      #343738;
    --bg-rgb:   34, 36, 37;
    --bg2-rgb:  42, 44, 45;
    --border:   rgba(255,255,255,0.12);
    --accent:   #7C6653;
    --accent2:  #C4A887;
    --accent2-rgb: 196, 168, 135;
    --accent-pressed: #695343;
    --white:    #F1F0EC;
    --grey:     #C2C1BC;
    --muted:    #AAA9A3;
    --footer-bg: #1C1E1F;
    --footer-bg-rgb: 28, 30, 31;
    --nav-height: 80px;
}

html { scroll-behavior: smooth; }
main, section[id] { scroll-margin-top: calc(var(--nav-height) + 16px); }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
body.dialog-open { overflow: hidden; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ─── NAV ─── */
nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 999;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; height: var(--nav-height);
    background: rgba(var(--bg-rgb),0.98);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    transition: box-shadow 0.3s;
}

.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--white);
}
.logo-mark {
    height: 42px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-mark img { height: 42px; width: auto; }
nav > .logo {
    position: relative;
    align-self: stretch;
    min-width: 235px;
}
nav > .logo::before {
    content: '';
    position: absolute; inset: 0 -28px 0 -40px;
    background: rgba(var(--accent2-rgb),0.045);
    border-right: 1px solid var(--border);
    border-bottom: 3px solid var(--accent);
    pointer-events: none;
}
nav > .logo .logo-mark { position: relative; z-index: 1; }

.nav-links {
    display: flex; align-self: stretch; gap: 0; list-style: none;
    border-left: 1px solid var(--border);
}
.nav-links li {
    display: flex;
    border-right: 1px solid var(--border);
}
.nav-links a {
    display: flex; align-items: center;
    padding: 0 24px;
    color: var(--grey); text-decoration: none;
    font-size: 13px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.035);
}

.nav-right {
    display: flex; align-items: center; gap: 20px;
}
.nav-email {
    display: flex; align-items: center; gap: 7px;
    color: var(--grey); text-decoration: none;
    font-size: 13px; font-weight: 500; letter-spacing: 0.03em;
    transition: color 0.2s;
}
.nav-email svg { opacity: 0.6; flex-shrink: 0; }
.nav-email:hover { color: var(--accent2); }
.nav-email:hover svg { opacity: 1; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; border: none; cursor: pointer;
    font-family: 'Outfit', sans-serif; font-weight: 600;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn-gold {
    background: var(--accent);
    color: #fff;
    padding: 10px 22px; font-size: 14px;
    border: 1px solid var(--accent);
}
@media (hover: hover) {
    .btn-gold:hover { background: var(--accent2); border-color: var(--accent2); color: var(--bg); }
}
.btn-gold:active { background: var(--accent-pressed); }
.btn-gold-lg {
    background: var(--accent);
    color: #fff;
    padding: 15px 34px; font-size: 16px;
    border: 1px solid var(--accent);
}
@media (hover: hover) {
    .btn-gold-lg:hover { background: var(--accent2); border-color: var(--accent2); color: var(--bg); }
}
.btn-gold-lg:active { background: var(--accent-pressed); }
.btn-outline {
    background: transparent; color: var(--white);
    padding: 14px 32px; font-size: 15px;
    border: 1px solid rgba(255,255,255,0.2);
}
.btn-outline:hover {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.05);
}

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 5px;
    align-items: center; justify-content: center;
    width: 44px; height: 44px; margin-right: -10px;
    background: none; border: none; cursor: pointer; padding: 0;
}
.hamburger span {
    display: block; width: 24px; height: 2px;
    background: var(--white); border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-menu {
    display: none;
    position: fixed; top: var(--nav-height); right: 24px; z-index: 998;
    width: 280px; max-width: calc(100% - 32px);
    background: rgba(var(--bg2-rgb),0.98);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    flex-direction: column; gap: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
@media (max-width: 600px) {
    .mobile-menu {
        right: 0; left: 0; width: auto; max-width: none;
        border-radius: 0; border-left: none; border-right: none;
        padding: 24px 32px; gap: 20px;
    }
}
.mobile-menu.open { display: flex; }
@media (min-width: 901px) {
    .mobile-menu { display: none !important; }
}
.mobile-menu a {
    color: var(--grey); text-decoration: none;
    font-size: 18px; font-weight: 500;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    transition: color 0.2s;
}
.mobile-menu a:hover { color: var(--white); }

/* ─── HERO ─── */
#hero {
    position: relative;
    min-height: 760px;
    display: flex; align-items: center;
    padding: var(--nav-height) 56px 0;
    background: var(--bg);
    overflow: hidden;
}
.hero-content {
    max-width: 1180px; margin: 0 auto; width: 100%;
    position: relative; z-index: 2;
}
.hero-copy {
    width: min(560px, 50vw); max-width: none;
    padding: 0;
}
.hero-media {
    position: absolute; inset: var(--nav-height) 0 0;
    overflow: hidden;
    background: var(--bg2);
}
.hero-media::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(var(--footer-bg-rgb),0.94) 0%, rgba(var(--footer-bg-rgb),0.78) 31%, rgba(var(--footer-bg-rgb),0.48) 62%, transparent 84%);
    pointer-events: none;
}
.hero-media img {
    display: block; width: 100%; height: 100%;
    object-fit: cover;
    object-position: 72% 48%;
}
.hero-h1 {
    font-size: clamp(38px, 3.2vw, 50px);
    font-weight: 600; line-height: 1.08;
    letter-spacing: -0.025em;
    margin-bottom: 22px; max-width: 600px;
    font-family: 'Outfit', sans-serif;
    text-wrap: balance;
}
.hero-sub {
    font-size: 17px; color: var(--grey);
    max-width: 500px; line-height: 1.65;
    margin-bottom: 34px;
}
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-btns .btn { border-radius: 2px; }

/* ─── ABOUT ─── */
#firmast {
    position: relative;
    overflow: hidden;
    padding: 96px 56px;
    background: var(--bg);
    border-top: 4px solid var(--accent);
}
#firmast::before {
    content: '';
    position: absolute; inset: 0 48% 0 0;
    background: url('/logo-mark.svg') 0 16px / 152px 152px repeat;
    opacity: 0.04;
    -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,0.72) 58%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,0.72) 58%, transparent 100%);
    pointer-events: none;
}
#firmast .section-max { position: relative; z-index: 1; }
.section-max { max-width: 1180px; margin: 0 auto; }
.section-h {
    font-size: clamp(32px, 3.2vw, 46px);
    font-weight: 600; letter-spacing: -0.025em;
    line-height: 1.08; margin-bottom: 0;
    font-family: 'Outfit', sans-serif;
}
.section-h::before,
.contact-left h2::before {
    content: '';
    display: block;
    width: 38px; height: 2px;
    margin-bottom: 16px;
    background: var(--accent2);
}

.about-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 80px; align-items: center;
}
.about-text p {
    color: var(--grey); font-size: 16px;
    line-height: 1.8; margin-top: 24px;
}
.company-facts {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 40px;
    border-bottom: 1px solid var(--border);
}
.company-fact {
    position: relative;
    min-height: 86px;
    padding: 18px 16px 18px 17px;
    border-top: 1px solid var(--border);
    color: inherit; text-decoration: none;
}
.company-fact::before {
    content: '';
    position: absolute; left: 0; top: 27px;
    width: 5px; height: 5px;
    background: var(--accent);
}
.company-fact:nth-child(odd) { margin-right: 20px; }
.company-fact strong {
    display: block; color: var(--white);
    font-size: 16px; font-weight: 600;
    letter-spacing: -0.01em;
}
.company-fact span {
    display: block; color: var(--muted);
    font-size: 13px; line-height: 1.45;
    margin-top: 4px;
}
a.company-fact:hover strong { color: var(--accent2); }
a.company-fact:focus-visible { border-radius: 0; }

.about-img-wrap {
    position: relative; height: 540px;
    border-radius: 4px; overflow: hidden;
    border: 1px solid var(--border);
}
.about-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: center center;
}

/* ─── SERVICES ─── */
#teenused { padding: 96px 56px; background: var(--bg2); }
.services-head { margin-bottom: 42px; }
.services-lead {
    max-width: 720px; margin: 20px 0 0;
    color: var(--grey); font-size: 16px; line-height: 1.7;
}

.services-grid {
    display: grid; grid-template-columns: repeat(2,1fr);
    column-gap: 56px;
}
.scard,
.step {
    transition: border-color 0.2s, background-color 0.2s;
}
.scard:hover,
.step:hover {
    border-top-color: var(--accent2);
    background: rgba(255,255,255,0.015);
}
.scard {
    border-top: 1px solid var(--border);
    padding: 30px 18px 34px;
    display: flex; flex-direction: column; gap: 14px;
}
.scard h3 {
    font-size: 21px; font-weight: 600;
    letter-spacing: -0.015em;
}
.scard p { color: var(--grey); font-size: 15px; line-height: 1.7; }

/* ─── PROCESS ─── */
#protsess { padding: 96px 56px; background: var(--bg); }
.steps-grid {
    margin-top: 8px;
    border-bottom: 1px solid var(--border);
}
.step {
    display: grid;
    grid-template-columns: 72px minmax(190px, 0.65fr) minmax(0, 1.35fr);
    gap: 28px;
    padding: 26px 0;
    border-top: 1px solid var(--border);
    align-items: center;
}
.step-num {
    font-size: 13px; font-weight: 600;
    color: var(--accent2); letter-spacing: 0.06em;
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(var(--accent2-rgb),0.55);
    border-radius: 2px;
}
.step h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.step p { color: var(--grey); font-size: 15px; line-height: 1.7; }

/* ─── PORTFOLIO ─── */
#portfolio { padding: 96px 56px; background: var(--bg2); }
.proj-grid {
    display: grid; grid-template-columns: repeat(2,1fr);
    column-gap: 28px; row-gap: 46px; margin-bottom: 72px;
}
.pcard {
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.pcard-img {
    aspect-ratio: 16 / 10;
    overflow: hidden; border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--bg3);
}
.pcard-img img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    filter: saturate(0.94) brightness(0.96);
    transition: filter 0.25s ease;
}
.pcard:hover .pcard-img img { filter: saturate(1) brightness(1); }
.pcard-body { padding: 18px 0 0; }
.pcard-tag {
    font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
    color: var(--accent2);
    margin-bottom: 8px;
    padding-left: 9px;
    border-left: 2px solid var(--accent);
}
.pcard-body h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 6px; }
.pcard-body p { color: var(--grey); font-size: 14px; line-height: 1.6; }
.gallery-sub {
    font-size: 15px; font-weight: 500; letter-spacing: 0;
    color: var(--grey);
    margin-bottom: 20px;
}
.portfolio-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 48px;
}

.pgrid-slider { position: relative; }
.pgrid-viewport { overflow: hidden; border-radius: 4px; }
.pgrid-track {
    display: flex;
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}
.pgrid-page {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(4,1fr);
    grid-template-rows: 240px 240px;
    gap: 12px;
    padding: 2px;
    box-sizing: border-box;
}
.pgrid-page .pitem:first-child { grid-column: 1; grid-row: 1 / 3; }
.pgrid-page .pitem:nth-child(4) { grid-column: 4; grid-row: 1 / 3; }
.pgrid-page-wide-two {
    justify-content: center;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 360px;
}
.pgrid-page-wide-two .pitem:first-child { grid-column: auto; grid-row: auto; }
.pgrid-page-photos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 480px;
}
.pgrid-page-photos .pitem:first-child,
.pgrid-page-photos .pitem:nth-child(4) { grid-column: auto; grid-row: auto; }
.pgrid-page-photos .pitem,
.pslide.photo-with-caption { display: flex; flex-direction: column; }
.pgrid-page-photos .pitem img,
.pslide.photo-with-caption img { object-fit: contain; flex: 1; min-height: 0; height: 0; }
.photo-label {
    flex: 0 0 auto; padding: 12px;
    color: var(--white); font-size: 14px; line-height: 1.5;
}
.pitem {
    border-radius: 4px; overflow: hidden;
    position: relative;
}
.pitem img {
    width: 100%; height: 100%; object-fit: cover;
    transition: filter 0.25s ease;
    filter: brightness(0.84);
}
.pitem:hover img { filter: brightness(0.94); }

.pgrid-arrow {
    position: absolute; top: calc(50% - 16px);
    transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(var(--bg2-rgb),0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--white); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: background 0.25s ease, opacity 0.25s ease;
}
.pgrid-arrow:hover { background: var(--accent); }
.pgrid-arrow:active { background: var(--accent-pressed); }
.pgrid-arrow-prev { left: -22px; }
.pgrid-arrow-next { right: -22px; }
.pgrid-arrow:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

.pgrid-dots {
    display: flex; justify-content: center; gap: 0;
    margin-top: 8px;
}
/* 44×44 hit area; the visible bar is drawn by ::before */
.pgrid-dots button {
    position: relative;
    width: 44px; height: 44px; border: none; padding: 0;
    background: transparent; cursor: pointer;
    transition: width 0.4s ease;
}
.pgrid-dots button::before {
    content: '';
    position: absolute; left: 50%; top: 50%;
    width: 26px; height: 4px; border-radius: 2px;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.18);
    transition: background 0.4s ease, width 0.4s ease;
}
.pgrid-dots button:hover::before { background: rgba(255,255,255,0.35); }
.pgrid-dots button.active { width: 62px; }
.pgrid-dots button.active::before { background: var(--accent); width: 44px; }

/* ─── CONTACT ─── */
#kontakt { padding: 96px 56px; background: var(--bg); }
.contact-grid {
    display: grid; grid-template-columns: 1fr 1.6fr;
    gap: 80px; align-items: start;
}
.contact-left h2 {
    font-size: clamp(32px, 3.2vw, 46px);
    font-weight: 600; letter-spacing: -0.025em;
    line-height: 1.1; margin: 0 0 18px;
    font-family: 'Outfit', sans-serif;
}
.contact-left p { color: var(--grey); font-size: 16px; line-height: 1.7; margin-bottom: 40px; }

.cdetails { display: flex; flex-direction: column; gap: 22px; }
.cdetail { display: flex; align-items: center; gap: 16px; }
.cdetail-icon {
    width: 46px; height: 46px; min-width: 46px;
    background: rgba(var(--accent2-rgb),0.13);
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent2);
}
.cdetail-lbl {
    font-size: 13px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.1em;
    font-weight: 600; margin-bottom: 2px;
}
.cdetail-val {
    font-size: 15px; color: var(--white);
    font-weight: 500; text-decoration: none;
    transition: color 0.2s;
}
.cdetail-val:hover { color: var(--accent2); }

.cform {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-top-color: rgba(var(--accent2-rgb),0.65);
    border-radius: 5px; padding: 46px;
    position: relative; overflow: hidden;
}
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fgroup { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.fgroup label {
    font-size: 13px; font-weight: 600;
    color: var(--grey); letter-spacing: 0.06em; text-transform: uppercase;
}
.fgroup input,
.fgroup textarea {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 4px; padding: 14px 16px;
    color: var(--white); font-size: 15px;
    font-family: 'Outfit', sans-serif;
    transition: border-color 0.2s;
    width: 100%;
}
.fgroup input:focus, .fgroup textarea:focus { border-color: var(--accent2); }
.fgroup textarea { resize: vertical; min-height: 130px; }
.fgroup input::placeholder, .fgroup textarea::placeholder { color: #B5B4AE; opacity: 1; }
.btn-submit { width: 100%; padding: 16px; font-size: 16px; }
.form-privacy, .form-status {
    color: var(--muted); font-size: 13px; line-height: 1.55;
}
.form-privacy { margin: -2px 0 16px; }
.form-privacy a { color: var(--grey); text-underline-offset: 3px; }
.form-privacy a:hover { color: var(--white); }
.form-status { min-height: 20px; margin-top: 10px; text-align: center; }
/* ─── FOOTER ─── */
footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 60px 56px 36px;
}
footer::before {
    content: '';
    position: absolute;
    z-index: 0;
    inset: 0 0 0 38%;
    background: url('/logo-mark.svg') 0 18px / 144px 144px repeat;
    opacity: 0.035;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.72) 34%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.72) 34%, #000 100%);
    pointer-events: none;
}
.footer-inner {
    position: relative;
    z-index: 1;
    max-width: 1160px; margin: 0 auto;
}
.footer-top {
    display: grid; grid-template-columns: 2fr 1fr 1fr;
    gap: 64px; margin-bottom: 48px;
}
.fbrand p {
    color: var(--muted); font-size: 14px;
    line-height: 1.7; margin-top: 16px; max-width: 360px;
}
.fbrand .company-meta {
    margin-top: 18px;
    display: flex; flex-direction: column; gap: 4px;
    max-width: 360px;
}
.fbrand .reg-info {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.55;
}
.fbrand .reg-info span {
    color: var(--grey); font-weight: 500;
    letter-spacing: 0.2px;
}
.fbrand .reg-info strong {
    color: var(--grey); font-weight: 600;
    letter-spacing: 0.5px;
}
.fcol h3 {
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 20px;
}
.fcol ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.fcol ul a {
    color: var(--grey); text-decoration: none;
    font-size: 14px; transition: color 0.2s;
}
.fcol ul a:hover { color: var(--white); }

.footer-bot {
    border-top: 1px solid var(--border);
    padding-top: 28px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 24px;
}
.footer-bot p { color: var(--muted); font-size: 13px; }

/* ─── FORM POLISH ─── */
.fgroup { position: relative; }
.fgroup input, .fgroup textarea {
    transition: border-color 0.25s, box-shadow 0.25s;
}
.fgroup input:focus, .fgroup textarea:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 3px rgba(var(--accent2-rgb),0.28);
}
.btn-submit { position: relative; overflow: hidden; }
.btn-submit .spinner {
    display: none; width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%;
    animation: spin 0.7s linear infinite;
    position: absolute;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-txt { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Honeypot — robotid täidavad, inimesed ei näe */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ─── SUCCESS OVERLAY ─── */
.success-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(10px);
    align-items: center; justify-content: center;
}
.success-overlay.show { display: flex; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.success-card {
    background: var(--bg3);
    border: 1px solid rgba(var(--accent2-rgb),0.38);
    border-radius: 8px; padding: 52px 44px;
    text-align: center; max-width: 420px; width: 90%;
    animation: popIn 0.25s ease;
    position: relative;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.98) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.success-icon {
    width: 72px; height: 72px; margin: 0 auto 24px;
    background: rgba(var(--accent2-rgb),0.16);
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.success-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s ease 0.2s forwards;
}
@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}
.success-card h3 {
    font-size: 24px; font-weight: 700;
    margin-bottom: 12px; color: var(--white);
}
.success-card p {
    color: var(--grey); font-size: 15px; line-height: 1.7;
    margin-bottom: 28px;
}
.success-close {
    background: var(--accent); color: #fff;
    border: none; border-radius: 5px;
    padding: 12px 32px; font-size: 15px;
    font-family: 'Outfit', sans-serif; font-weight: 600;
    cursor: pointer; transition: background 0.2s;
}
.success-close:hover { background: var(--accent2); color: var(--bg); }
#captchaInput:focus-visible { border-color: var(--accent2) !important; }

/* ─── SLIDER (mobile portfolio) ─── */
.pslider-wrap { display: none; position: relative; }
.pslider {
    position: relative;
    border-radius: 16px; overflow: hidden;
    height: 72vw; max-height: 420px; min-height: 240px;
    touch-action: pan-y;
    background: var(--bg3);
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
.pslider-track { display: contents; }
.pslide {
    position: absolute; inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
    transform: scale(1.04);
}
.pslide.active {
    opacity: 1;
    transform: scale(1);
}
.pslide.prev {
    opacity: 0;
    transform: scale(0.97);
}
.pslide.active.prev { opacity: 1; transform: scale(1); }
.pslide img {
    width: 100%; height: 100%; object-fit: cover;
    pointer-events: none; user-select: none;
}
.slider-controls {
    display: flex; justify-content: center; align-items: center; gap: 12px;
    margin-top: 16px;
}
.slider-count {
    color: var(--grey); font-size: 14px; font-variant-numeric: tabular-nums;
}
.slider-toggle {
    min-height: 40px; padding: 8px 14px; border: 1px solid var(--border);
    border-radius: 999px; background: transparent; color: var(--grey);
    font: 600 13px/1 'Outfit', sans-serif; cursor: pointer;
}
.slider-toggle:hover { border-color: var(--accent2); color: var(--white); }
.slider-arrows {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 100%; display: flex; justify-content: space-between;
    pointer-events: none; padding: 0 10px;
    margin-top: -18px;
    z-index: 2;
}
.sarr {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(var(--bg2-rgb),0.88);
    border: 1px solid var(--border);
    color: var(--white); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    pointer-events: all; transition: background 0.2s;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.sarr:hover { background: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
    nav > .logo { min-width: 205px; }
    .nav-email { display: none; }
    .hero-copy { width: min(520px, 55vw); }
    .hero-h1 { font-size: clamp(36px, 4.2vw, 46px); line-height: 1.09; }
}

@media (max-width: 900px) {
    :root { --nav-height: 72px; }
    nav { padding: 0 20px; }
    nav > .logo::before { display: none; }
    .nav-links, .nav-email { display: none; }
    .hamburger { display: flex; }

    #hero {
        min-height: 0;
        display: flex; flex-direction: column; align-items: stretch;
        padding: var(--nav-height) 0 0;
    }
    .hero-content {
        order: 2;
        max-width: none;
        padding: 0 20px;
        background: var(--footer-bg);
    }
    .hero-copy {
        width: 100%; max-width: 620px;
        margin: 0 auto;
        padding: 38px 0 48px;
    }
    .hero-media {
        position: relative; inset: auto;
        order: 1; width: 100%;
        aspect-ratio: 16 / 10;
    }
    .hero-media::after { display: none; }
    .hero-media img { object-position: 62% 48%; }
    .hero-h1 { font-size: clamp(30px, 6.4vw, 42px); line-height: 1.08; margin-bottom: 20px; max-width: 620px; }
    .hero-sub { display: block; font-size: 16px; line-height: 1.6; margin-bottom: 28px; max-width: 620px; }
    .hero-btns .btn { min-height: 50px; text-align: center; padding: 14px 24px; font-size: 15px; }

    #firmast, #teenused, #protsess, #portfolio, #kontakt { padding: 64px 20px; }
    #firmast::before {
        inset: 0;
        background-size: 128px 128px;
        opacity: 0.028;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.45) 54%, transparent 88%);
        mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.45) 54%, transparent 88%);
    }
    footer { padding: 48px 20px 28px; }
    footer::before {
        inset: 0;
        background-position: 12px 20px;
        background-size: 124px 124px;
        opacity: 0.022;
        -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.66) 30%, #000 100%);
        mask-image: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.66) 30%, #000 100%);
    }

    .step { grid-template-columns: 44px 1fr; gap: 8px 16px; padding: 22px 0; }
    .step p { grid-column: 2; }
    .proj-grid { grid-template-columns: 1fr; row-gap: 40px; margin-bottom: 54px; }

    .about-grid { grid-template-columns: 1fr; gap: 36px; }
    .about-img-wrap { height: clamp(360px, 65vw, 560px); }

    .services-grid { grid-template-columns: 1fr; }
    .scard { padding: 26px 0 30px; }

    /* Hide desktop grid, show slider */
    .pgrid-slider { display: none; }
    .pslider-wrap { display: block; }

    .portfolio-head { flex-direction: column; align-items: flex-start; gap: 16px; }
    .portfolio-head .btn-outline { width: 100%; text-align: center; }

    .contact-grid { grid-template-columns: 1fr; gap: 32px; }
    .frow { grid-template-columns: 1fr; }
    .fgroup input, .fgroup textarea { font-size: 16px; }
    .cform { padding: 28px 22px; }
    /* Hide duplicate contact cards on mobile — footer already has them */
    .contact-left .cdetails { display: none; }
    .contact-left h2 { margin-bottom: 12px; }
    .contact-left p { margin-bottom: 0; }

    .footer-top { grid-template-columns: 1fr; gap: 32px; }
    .footer-bot { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 480px) {
    .hero-media { aspect-ratio: 4 / 3; }
    .hero-copy { padding: 34px 0 44px; }
    .hero-h1 { line-height: 1.1; }
    .section-h { font-size: clamp(28px, 8vw, 40px); }
    .company-facts { grid-template-columns: 1fr; }
    .company-fact:nth-child(odd) { margin-right: 0; }
    .about-img-wrap { height: 300px; }
}

@media (max-width: 900px) and (max-height: 700px) {
    .hero-media {
        height: clamp(190px, 42vh, 300px);
        aspect-ratio: auto;
    }
}

@media (max-width: 600px) {
    .hero-btns { flex-direction: column; gap: 10px; }
    .hero-btns .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Former inline style attributes (moved here so the CSP needs no 'unsafe-inline'). ID selectors keep their old precedence. */
.pcard-img img.op-40 { object-position: center 40%; }
.pitem img.op-35 { object-position: 35% center; }
#captchaOverlay .success-card { max-width: 360px; }
#captchaOverlay .success-icon { background: rgba(var(--accent2-rgb),0.12); }
#captchaTitle { font-size: 20px; margin-bottom: 8px; }
#captchaDescription { margin-bottom: 20px; }
#captchaOverlay .captcha-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
#captchaQ { font-size: 26px; font-weight: 700; color: var(--white); }
#captchaOverlay .captcha-eq { font-size: 22px; color: var(--muted); }
#captchaInput { width: 72px; padding: 10px; text-align: center; font-size: 22px; font-weight: 700; background: var(--bg3); border: 2px solid var(--border); border-radius: 5px; color: var(--white); font-family: 'Outfit', sans-serif; transition: border-color 0.2s; }
#captchaError { color: #FF9A9A; font-size: 13px; min-height: 20px; margin-bottom: 12px; }
#captchaOverlay .captcha-actions { display: flex; gap: 10px; justify-content: center; }
#captchaCancel { background: transparent; border: 1px solid var(--border); color: var(--grey); border-radius: 5px; padding: 11px 24px; font-size: 14px; font-family: 'Outfit', sans-serif; cursor: pointer; }
#captchaSubmit { padding: 11px 28px; }
