/* Ancar International redesign */

:root {
    --bg: #293b42;
    --bg-alt: #22333a;
    --bg-deep: #1b292f;
    --surface: #324750;
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(95, 208, 238, 0.35);
    --text: #f2f5f6;
    --text-muted: #b7c4c9;
    --accent: #5fd0ee;
    --accent-ink: #0f2a33;
    --cta: #ff8a4c;
    --cta-ink: #2a1407;
    --radius: 6px;
    --container: 1140px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    /* --header-h is set from the real header height by main.js; the fallback covers no-JS */
    scroll-padding-top: calc(var(--header-h, 72px) + 16px);
}
[id] { scroll-margin-top: calc(var(--header-h, 72px) + 16px); }
#top { scroll-margin-top: 0; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #fff; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 0.6em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.mono { font-family: var(--mono); font-size: 0.9em; letter-spacing: 0.01em; }
.hl { color: var(--cta); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }

.skip {
    position: absolute; left: -999px; top: 0;
    background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; }

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    border: 1px solid var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: #fff; border-color: #fff; color: var(--accent-ink); }
.btn-primary { background: var(--cta); border-color: var(--cta); color: var(--cta-ink); }
.btn-primary:hover { background: #ffa273; border-color: #ffa273; color: var(--cta-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.btn-ghost:hover { background: var(--surface); border-color: var(--text-muted); color: #fff; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.95rem; }
.btn-block { display: block; text-align: center; margin-top: 1.25rem; }

/* Header */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; }
.logo-link { display: block; }
.logo { height: 44px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); }
.site-nav .nav-phone { color: var(--text-muted); }
.site-nav .btn { color: var(--accent-ink); }
.site-nav .btn:hover { color: var(--accent-ink); }

.nav-toggle {
    display: none;
    background: none; border: 0; padding: 0.5rem; cursor: pointer;
    flex-direction: column; gap: 5px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--text); }

/* Hero */
.hero {
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 4rem);
    border-bottom: 1px solid var(--line);
    background:
        linear-gradient(var(--bg) 0%, rgba(41, 59, 66, 0.6) 100%),
        repeating-linear-gradient(0deg, transparent 0 39px, rgba(95, 208, 238, 0.06) 39px 40px),
        repeating-linear-gradient(90deg, transparent 0 39px, rgba(95, 208, 238, 0.06) 39px 40px);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 3.5rem; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 500; text-transform: uppercase; margin-bottom: 1.25rem; }
.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 44ch; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.hero-proof {
    list-style: none; margin: 2.25rem 0 0; padding: 1rem 0 0;
    border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
    color: var(--text-muted); font-size: 0.85rem;
}
.hero-drawing { margin: 0; }
.hero-drawing img { width: 100%; height: auto; }
.hero-drawing figcaption { margin-top: 0.75rem; color: var(--text-muted); font-size: 0.8rem; text-align: center; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-tight { padding-top: clamp(2rem, 4vw, 3rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.intro { color: var(--text-muted); max-width: 60ch; margin-bottom: 2rem; font-size: 1.05rem; }
.group-title { margin-top: 2.5rem; color: var(--accent); font-size: 0.85rem; text-transform: uppercase; font-weight: 500; }

/* Persona paths */
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.path {
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.path:hover { border-color: var(--accent); color: var(--text); transform: translateY(-2px); }
.path-tag { color: var(--accent); text-transform: uppercase; font-size: 0.78rem; margin-bottom: 0.75rem; }
.path h3 { margin-bottom: 0.5rem; }
.path p { color: var(--text-muted); font-size: 0.98rem; flex: 1; }
.path-cta { color: var(--cta); font-weight: 600; }

/* Process steps */
.steps {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
    counter-reset: step;
}
.steps li { position: relative; padding-top: 1rem; border-top: 1px solid var(--line-strong); }
.step-num { display: block; color: var(--cta); font-size: 2rem; font-weight: 500; line-height: 1; margin-bottom: 0.75rem; }
.steps p { color: var(--text-muted); font-size: 0.98rem; margin: 0; }

/* Capabilities */
.caps-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.caps { width: 100%; border-collapse: collapse; font-size: 1rem; }
.caps th, .caps td { padding: 0.9rem 1.1rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.caps tr:first-child th, .caps tr:first-child td { border-top: 0; }
.caps th { width: 10rem; color: #fff; font-weight: 600; background: var(--bg-alt); white-space: nowrap; }
.caps td.mono { color: var(--accent); }

.checklist {
    background: var(--bg-deep);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 1.5rem;
    position: sticky; top: calc(var(--header-h, 72px) + 16px);
}
.checklist h3 { color: var(--accent); text-transform: uppercase; font-size: 0.85rem; margin-bottom: 0.5rem; }
.checklist p { color: var(--text-muted); font-size: 0.95rem; }
.checklist ul { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.4rem; font-size: 0.98rem; }
.checklist li::marker { color: var(--accent); }

/* Gallery */
.gallery {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem;
}
.gallery button {
    width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; text-align: left;
    transition: border-color 0.15s ease;
}
.gallery button:hover, .gallery button:focus-visible { border-color: var(--accent); outline: none; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }

/* About */
.about-grid, .quote-grid, .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.about-side h3 { color: var(--accent); text-transform: uppercase; font-size: 0.85rem; }
.chips { list-style: none; padding: 0; margin: 0 0 1.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips li { border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.9rem; color: var(--text-muted); }
.facts-list { margin: 0; display: grid; gap: 0.5rem; font-size: 0.85rem; }
.facts-list div { display: grid; grid-template-columns: 10rem 1fr; padding: 0.5rem 0; border-top: 1px solid var(--line); }
.facts-list dt { color: var(--text-muted); }
.facts-list dd { margin: 0; color: #fff; }

/* Form */
.quote-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
.quote-copy .eyebrow { margin-bottom: 0.75rem; }
.form {
    display: grid; gap: 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 500; font-size: 0.95rem; }
.muted { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.4rem; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field input, .field textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--bg-deep); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.65rem 0.8rem;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.captcha:empty { display: none; }
.field input.invalid, .field textarea.invalid { border-color: #ff9f7a; }
.hidden-field { display: none; }
.form-status { margin: 0; min-height: 1.5em; color: var(--accent); }
.form-status.error { color: #ff9f7a; }

/* Contact */
address { font-style: normal; line-height: 1.7; }
.contact-list { margin: 0; display: grid; gap: 1.25rem; }
.contact-list div { display: grid; grid-template-columns: 6rem 1fr; }
.contact-list dt { color: var(--text-muted); }
.contact-list dd { margin: 0; }

/* Footer */
.site-footer { background: var(--bg-deep); color: var(--text-muted); padding: 2rem 0; font-size: 0.9rem; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; }

/* Lightbox */
.lightbox { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); color: var(--text); padding: 1rem; max-width: min(90vw, 600px); }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.7); }
.lightbox form { display: flex; justify-content: flex-end; margin-bottom: 0.5rem; }
.lightbox-close { background: none; border: 0; color: var(--text); font-size: 1.75rem; line-height: 1; cursor: pointer; padding: 0 0.25rem; }
.lightbox img { width: 100%; max-width: 560px; height: auto; border-radius: var(--radius); }
.lightbox p { margin: 0.75rem 0 0; font-weight: 500; text-align: center; }

/* Scroll reveal, opt-in and motion-safe */
@media (prefers-reduced-motion: no-preference) {
    .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
    .reveal.visible { opacity: 1; transform: none; }
}

/* Responsive */
@media (max-width: 960px) {
    .paths, .steps { grid-template-columns: 1fr; }
    .caps-grid { grid-template-columns: 1fr; }
    .checklist { position: static; }
}

@media (max-width: 860px) {
    .hero-grid, .about-grid, .quote-grid, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .hero-drawing { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 1000px) {
    .site-nav .nav-phone { display: none; }
}

@media (max-width: 860px) {
    .site-nav .nav-phone { display: block; }
    .nav-toggle { display: flex; }
    .site-nav {
        display: none;
        position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--bg); border-bottom: 1px solid var(--line);
    }
    .site-nav.open { display: flex; }
    .site-nav a { padding: 0.9rem 1.25rem; border-top: 1px solid var(--line); }
    .site-nav .btn { margin: 0.75rem 1.25rem 1rem; text-align: center; border-top: 0; }
    .logo { height: 36px; }
    .two-up { grid-template-columns: 1fr; }
    .caps th { width: auto; white-space: normal; }
}

/* Product case cards */
.products-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.products-head .intro { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter {
    white-space: normal;
    font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    background: transparent; color: var(--text-muted);
    border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.filter:hover { color: var(--text); border-color: var(--text-muted); }
.filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.cards li.is-hidden { display: none; }
.cards button {
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    height: 100%;
    white-space: normal; text-align: left;
}
/* Chromium centers a button's inner box at fit-content width unless children are full width */
.cards button > * { width: 100%; }
.cards img { aspect-ratio: 1; object-fit: cover; background: #fff; }
.card-body {
    display: grid; gap: 0.35rem; padding: 0.9rem 1rem 1.1rem;
    text-align: left; min-width: 0;
}
.card-body > * { display: block; min-width: 0; overflow-wrap: anywhere; }
.card-tag { color: var(--accent); font-size: 0.72rem; text-transform: uppercase; }
.card-body strong { font-size: 1.02rem; line-height: 1.3; }
.card-desc { color: var(--text-muted); font-size: 0.88rem; line-height: 1.45; }
.gallery-foot { margin: 2rem 0 0; color: var(--text-muted); }

/* Lightbox detail layout */
.lightbox { max-width: min(92vw, 880px); width: 100%; padding: 1rem 1.25rem 1.5rem; }
.lightbox-bar { display: flex; justify-content: flex-end; margin-bottom: 0.25rem; }
.lightbox-grid { display: grid; grid-template-columns: minmax(0, 360px) 1fr; gap: 1.75rem; align-items: start; }
.lightbox-grid img { width: 100%; max-width: none; background: #fff; }
.lightbox-info { min-width: 0; }
.lightbox-info h3 { margin-bottom: 0.5rem; overflow-wrap: anywhere; }
.lightbox-info p { margin-bottom: 0.9rem; text-align: left; font-weight: 400; }
.lightbox-note { color: var(--text-muted); border-left: 2px solid var(--accent); padding-left: 0.9rem; font-size: 0.95rem; }
@media (max-width: 700px) {
    .lightbox-grid { grid-template-columns: 1fr; }
    .lightbox-grid img { max-width: 360px; }
}
