/* ==========================================================================
   Tarantian Systems — shared stylesheet
   Used by: index.html, /blog/*, policy pages
   ========================================================================== */

:root {
    /* Warm cream neutrals, not cool grey-white.
       The old tokens sat at lightness 94 / 88 / 100 — only a 1.06 contrast
       ratio between page and card, so every surface read as one flat sheet.
       These four tiers are spaced far enough apart to actually be seen:
       surface 97.6 > surface-2 91.7 > bg 85.9 > bg-alt 74.5. */
    --bg: #f4eee3;
    --bg-alt: #e9dfcd;
    --surface: #fffcf7;
    --surface-2: #faf5ec;
    --text: #1a1410;
    --text-body: #3d342c;
    --text-muted: #665b4e;
    /* 1.53 against a card — the old #ece7e3 was 1.23 and invisible */
    --border: #dbcdb6;
    /* --accent is used for TEXT and links, so it must clear 4.5:1 on the
       DARKEST surface it sits on (--bg-alt). #c2410c only reached 4.49 there
       once the neutrals warmed up; this holds 4.82 on alt, 6.22 on a card.
       --accent-vivid is the decorative orange for fills and gradients. */
    --accent: #ab3808;
    --accent-soft: #fdeee1;
    --accent-vivid: #f97316;
    --accent-2: #e11d48;
    /* Third stop lets gradients travel warm → cool instead of orange → orange */
    --accent-3: #7c3aed;
    --accent-3-soft: #f2ecff;
    --btn-primary-fg: #ffffff;
    /* Warm-brown shadows. Cool navy shadows on a cream page read as grey
       smudge and were part of why the old surfaces looked washed out. */
    --shadow-sm: 0 1px 2px rgba(67, 45, 22, 0.05), 0 2px 6px rgba(67, 45, 22, 0.05);
    --shadow-md: 0 8px 24px rgba(67, 45, 22, 0.11);
    --shadow-lg: 0 18px 50px rgba(67, 45, 22, 0.16);
    --shadow-glow: 0 18px 44px -12px rgba(171, 56, 8, 0.38);
    --radius: 16px;
    --radius-lg: 24px;
    --maxw: 1180px;
    --header-h: 68px;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    /* Warm-neutral dark to match the cream light theme — the old navy
       (#0b0f19) fought the orange accent the same way the cool white did. */
    --bg: #100c08;
    --bg-alt: #1a130c;
    --surface: #241c13;
    --surface-2: #2b2219;
    --text: #f2ebe1;
    --text-body: #d8ccbc;
    --text-muted: #a5967f;
    --border: #433524;
    /* Inverted for dark: the accent must get lighter, not darker (7.68:1 here) */
    --accent: #fdad6d;
    --accent-soft: #33230f;
    --accent-vivid: #fb923c;
    --accent-2: #fb7185;
    --accent-3: #a78bfa;
    --accent-3-soft: #1e1833;
    /* White on light orange is only 2.26:1 — dark text on the fill is 7.73:1 */
    --btn-primary-fg: #1c1917;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 18px 44px -12px rgba(251, 146, 60, 0.28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

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

/* Long unbroken strings — email addresses, URLs — must be allowed to wrap.
   naguletiraviteja@tarantiansystems.com is 324px wide and pushed narrow
   phones into horizontal scroll on every page that prints it. */
a[href^="mailto:"], a[href^="http"] { overflow-wrap: break-word; word-break: break-word; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }

.section { padding: 88px 0; }
.section-tight { padding: 56px 0; }

.eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.section-head { text-align: center; max-width: 660px; margin: 0 auto 52px; }

.section-head h2 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.section-head p { color: var(--text-muted); font-size: 1.06rem; margin-top: 0.75rem; }

.head-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.head-row h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.head-row p { color: var(--text-muted); margin-top: 0.4rem; }

.link-more {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

.link-more:hover { text-decoration: underline; }

/* ---------- Header ----------
   Scoped to #header (the site nav) only. A bare `header` selector also
   matches <header class="article-head">, which pinned article titles. */
#header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#header.scrolled {
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border-bottom-color: var(--border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-h);
    gap: 1rem;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

/* Full logo lockup (icon + wordmark). assets/logo.webp is a 1254x391 canvas
   whose artwork measures 1226x338 at y=26..363 — it fills 97.8% of the width
   and 86.5% of the height, so only thin transparent bands are cropped away.
   Artwork aspect is 3.6272:1; vertical centre sits at 49.74% (near enough to
   centred that no nudge is needed). */
.logo-lockup {
    /* 52px keeps the small "SYSTEMS LLP" line legible; much below this and
       the tagline degrades into a smudge. The 68px header leaves 8px of
       breathing room above and below at this size. */
    height: 52px;
    width: 189px; /* 52 * 3.627 */
    overflow: hidden;
    position: relative;
    gap: 0;
}

.logo-lockup img {
    position: absolute;
    left: 50%;
    /* Canvas is 391/338 = 1.157x taller than the artwork band, so scaling the
       image height to 115.7% of the box lands the artwork at exactly box
       height; the leftover bands are cropped by overflow:hidden. */
    height: 115.7%;
    width: auto;
    max-width: none;
    /* Artwork centre is 49.74% of the image — 0.26% above the midpoint. */
    top: 50%;
    transform: translate(-50%, -50%) translateY(0.26%);
    display: block;
}

/* The wordmark is navy and disappears on the near-black dark background.
   Invert-then-rotate keeps the orange icon orange while lifting the navy
   text to a light tint.
   NOTE: this requires assets/logo.webp to have a TRANSPARENT background. If
   the file ships with a white canvas, the invert turns that canvas into a
   black rectangle. See the note in index.html. */
[data-theme="dark"] .logo-lockup img {
    filter: invert(1) hue-rotate(180deg);
}

/* In the footer the lockup is a block above the blurb, so it needs the
   spacing the text wordmark used to get from its line box. */
footer .logo-lockup { margin-bottom: 1rem; }

@media (max-width: 480px) {
    .logo-lockup { height: 36px; width: 131px; }
}

/* Logo mark. Currently unused — superseded by .logo-lockup above. Kept for
   any page that still wants a compact square mark beside a text wordmark. */
.logo .mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent-vivid), var(--accent-2));
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    object-fit: contain;
}

.nav-links { display: flex; list-style: none; gap: 1.75rem; align-items: center; }

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.94rem;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); }

.nav-cta {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg) !important;
    font-weight: 600;
}

.nav-cta:hover { background: var(--accent); color: #fff !important; }

.nav-right { display: flex; align-items: center; gap: 0.6rem; }

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
    transition: border-color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--accent); transform: rotate(-15deg); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text);
    padding: 0.2rem 0.3rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.55rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.96rem;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--btn-primary-fg);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(171, 56, 8, 0.45); }

.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.88rem; }

.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none !important; }

/* Inline form error message */
.form-error {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.92rem;
}

[data-theme="dark"] .form-error {
    background: #2a1416;
    border-color: #5c2327;
    color: #fca5a5;
}

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.5rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.9rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.icon-tile {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    background: var(--accent-soft);
    margin-bottom: 1.1rem;
}

.card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.card p { color: var(--text-body); font-size: 0.96rem; }

.price-tag {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

/* ---------- Blog: category pills ---------- */
.cat-bar {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.cat-pill:hover { border-color: var(--accent); color: var(--accent); }

.cat-pill.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

/* ---------- Blog: post cards ---------- */
.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.post-thumb {
    height: 168px;
    display: grid;
    place-items: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, var(--surface)));
    border-bottom: 1px solid var(--border);
}

.post-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
}

.tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.post-card h3 {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 0.55rem;
}

.post-card h3 a:hover { color: var(--accent); }

.post-card p { color: var(--text-body); font-size: 0.94rem; flex: 1; }

.post-foot {
    margin-top: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
}

.read-link { color: var(--accent); font-weight: 600; }
.read-link:hover { text-decoration: underline; }

/* ---------- Featured post ---------- */
.featured {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 2.5rem;
}

.featured-art {
    min-height: 300px;
    display: grid;
    place-items: center;
    font-size: 5.5rem;
    background: linear-gradient(135deg, var(--accent-vivid), var(--accent-2));
}

.featured-body { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }

.featured-body h3 {
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0.7rem 0 0.8rem;
}

.featured-body h3 a:hover { color: var(--accent); }
.featured-body > p { color: var(--text-body); margin-bottom: 1.5rem; }

/* ---------- Ad slots ---------- */
/* ---------- Ad placeholders: HIDDEN until AdSense approval ----------
   The AdSense loader and every <ins> unit are already commented out in the
   HTML, so nothing is served. This hides the empty reserved boxes too, so
   visitors don't see "Advertisement" labels on blank slots.

   TO RE-ENABLE AFTER APPROVAL: delete this one rule, then uncomment the
   loader <script> in each page's <head> and the <ins> blocks marked
   "ADSENSE". */
.ad-slot { display: none !important; }

.ad-slot {
    margin: 2.5rem auto;
    max-width: 100%;
    min-height: 100px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
    overflow: hidden;
}

.ad-slot .ad-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.65;
}

.ad-slot ins { display: block; width: 100%; }

/* Placeholder shown where post listings sit while no articles are published. */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

/* Sidebar sticky ad */
.ad-sticky { position: sticky; top: calc(var(--header-h) + 24px); }

/* ---------- Article layout ---------- */
.article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; align-items: start; }

.article-head { padding: 48px 0 8px; }
.article-head h1 {
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0.8rem 0 1rem;
}
.article-head .lede { font-size: 1.15rem; color: var(--text-body); font-weight: 450; }

.byline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.byline .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--btn-primary-fg);
    font-weight: 800;
    font-size: 0.9rem;
}

.byline strong { color: var(--text); font-weight: 600; }

/* 450 sits between regular and medium — needs the variable font (wght@100..900)
   loaded in each page's <head>, otherwise it snaps back to 400. */
.prose { font-size: 1.07rem; line-height: 1.75; font-weight: 450; }
.prose > * + * { margin-top: 1.3rem; }
.prose h2 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-top: 2.6rem;
    padding-top: 0.4rem;
}
.prose h3 { font-size: 1.22rem; font-weight: 700; margin-top: 2rem; letter-spacing: -0.01em; }
.prose p { color: var(--text-body); }
.prose strong { color: var(--text); font-weight: 650; }
.prose a { color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: 1.3rem; color: var(--text-body); }
.prose li { margin-top: 0.6rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.3rem 0 0.3rem 1.3rem;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text);
}

.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.15em 0.42em;
    border-radius: 6px;
}

.prose pre {
    /* Warm-neutral rather than navy, so it sits with the orange palette */
    background: #1c1917;
    color: #e7e2dd;
    padding: 1.2rem 1.3rem;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
}

.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.callout {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
}

.callout p { color: var(--text); margin: 0; }
.callout p + p { margin-top: 0.6rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 480px; }
.prose th, .prose td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 700; background: var(--surface-2); }
.prose td { color: var(--text-body); }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.side-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
}

.side-box h4 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.side-list { list-style: none; display: grid; gap: 0.9rem; }
.side-list a { font-size: 0.94rem; font-weight: 500; line-height: 1.45; }
.side-list a:hover { color: var(--accent); }
.side-list .side-meta { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.toc { list-style: none; display: grid; gap: 0.6rem; font-size: 0.92rem; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--accent); }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 0.85rem; color: var(--text-muted); padding-top: 28px; }
.crumb a:hover { color: var(--accent); }
.crumb span { margin: 0 0.4rem; opacity: 0.5; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); background: var(--surface); padding: 56px 0 32px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-grid p { color: var(--text-muted); font-size: 0.93rem; margin-top: 0.9rem; max-width: 300px; }

.footer-grid h5 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.footer-grid ul { list-style: none; display: grid; gap: 0.65rem; }
.footer-grid ul a { color: var(--text-muted); font-size: 0.93rem; }
.footer-grid ul a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-bottom nav { height: auto; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-bottom nav a:hover { color: var(--accent); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    #header { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .article-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
    .ad-sticky { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 860px) {
    .featured { grid-template-columns: 1fr; }
    .featured-art { min-height: 200px; font-size: 4rem; }
    .featured-body { padding: 1.9rem; }
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 1rem 24px 1.4rem;
        gap: 1rem;
        display: none;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-links li { width: 100%; }
    .menu-toggle { display: block; }
    .section { padding: 64px 0; }
    .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .container, .container-narrow { padding: 0 18px; }
    .card { padding: 1.5rem; }
}

/* ==========================================================================
   ENHANCEMENT LAYER
   Everything below refines the base above (motion, depth, colour, polish).
   It is appended so its rules win on specificity ties.
   ========================================================================== */

/* ---------- Keyframes ---------- */
@keyframes ts-float {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(0, -26px, 0) scale(1.06); }
}

@keyframes ts-drift {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%  { transform: translate3d(30px, 18px, 0) rotate(8deg); }
    100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes ts-gradient-pan {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ts-shine {
    0%   { transform: translateX(-130%) skewX(-18deg); }
    100% { transform: translateX(320%) skewX(-18deg); }
}

@keyframes ts-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes ts-pulse-ring {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-vivid) 45%, transparent); }
    70%  { box-shadow: 0 0 0 12px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes ts-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Global polish ---------- */
::selection { background: color-mix(in srgb, var(--accent-vivid) 28%, transparent); color: var(--text); }

/* Visible keyboard focus everywhere, without a ring on mouse clicks */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

/* Warmer, brand-tinted scrollbar on supporting browsers */
html { scrollbar-color: color-mix(in srgb, var(--accent-vivid) 55%, var(--border)) transparent; }

body::-webkit-scrollbar { width: 11px; }
body::-webkit-scrollbar-track { background: var(--bg); }
body::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent-vivid) 45%, var(--border));
    border-radius: 999px;
    border: 3px solid var(--bg);
}
body::-webkit-scrollbar-thumb:hover { background: var(--accent-vivid); }

/* ---------- Section bands ----------
   The tokens above give each tier a visible tone; these add a warm wash and
   soft accent glows so a long scroll has rhythm instead of one flat field.
   Sections opt in with style="background:var(--bg-alt)" as before — this just
   makes that background richer than a solid fill. */
.section, .section-tight { position: relative; }

.section > .container,
.section-tight > .container { position: relative; z-index: 1; }

/* Any section carrying the alt background gets the tinted treatment */
[style*="--bg-alt"] {
    background:
        radial-gradient(900px circle at 12% 0%, color-mix(in srgb, var(--accent-vivid) 9%, transparent), transparent 60%),
        radial-gradient(700px circle at 88% 100%, color-mix(in srgb, var(--accent-3) 8%, transparent), transparent 60%),
        linear-gradient(180deg, var(--bg-alt), color-mix(in srgb, var(--bg-alt) 82%, var(--bg))) !important;
}

/* Hairline separators so bands read as deliberate blocks */
[style*="--bg-alt"] {
    border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

/* Default-background sections get a much fainter warm lift, alternating side */
.section:not([style]) {
    background:
        radial-gradient(800px circle at 85% 8%, color-mix(in srgb, var(--accent-vivid) 5%, transparent), transparent 62%);
}

/* Cards need a touch more presence now that they sit on tinted bands */
.card, .post-card, .step, .contact-item, .side-box {
    background: linear-gradient(160deg, var(--surface), var(--surface-2));
}

/* ---------- Scroll progress bar (top of viewport) ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: 0 50%;
    transform: scaleX(0);
    background: linear-gradient(90deg, var(--accent-vivid), var(--accent-2), var(--accent-3));
    z-index: 1200;
    pointer-events: none;
}

/* ---------- Header ---------- */
#header { transition: border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease; }
#header.scrolled { box-shadow: 0 6px 24px -18px rgba(67, 45, 22, 0.55); }

.logo { position: relative; transition: transform 0.3s var(--ease-spring); }
.logo:hover { transform: translateY(-1px); }

/* Animated underline on nav links */
.nav-links > li > a:not(.nav-cta) { position: relative; padding-bottom: 2px; }

.nav-links > li > a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-vivid), var(--accent-2));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.32s var(--ease-out);
}

.nav-links > li > a:not(.nav-cta):hover::after,
.nav-links > li > a.active:not(.nav-cta)::after { transform: scaleX(1); transform-origin: left; }

.nav-cta { transition: background 0.25s ease, color 0.25s ease, transform 0.25s var(--ease-spring), box-shadow 0.25s ease; }
.nav-cta:hover {
    background: linear-gradient(135deg, var(--accent-vivid), var(--accent-2));
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.theme-toggle:hover { transform: rotate(-18deg) scale(1.08); }
.theme-toggle:active { transform: scale(0.94); }

/* Hamburger → X */
.menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: none;
    place-items: center;
    font-size: 0;
    transition: background 0.2s ease;
}

.menu-toggle .bars { position: relative; display: block; width: 20px; height: 2px; }

.menu-toggle .bars,
.menu-toggle .bars::before,
.menu-toggle .bars::after {
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s var(--ease-out), opacity 0.2s ease, background 0.3s ease;
}

.menu-toggle .bars::before,
.menu-toggle .bars::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
}

.menu-toggle .bars::before { top: -6px; }
.menu-toggle .bars::after  { top: 6px; }

.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after  { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; isolation: isolate; }

.btn-primary {
    background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
    background-size: 200% 100%;
    box-shadow: var(--shadow-glow);
    transition: transform 0.28s var(--ease-spring), box-shadow 0.28s ease, background-position 0.6s var(--ease-out);
}

.btn-primary:hover { background-position: 100% 50%; transform: translateY(-3px); }
.btn-primary:active { transform: translateY(-1px) scale(0.985); }

/* Light sweep across primary buttons on hover */
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
    transform: translateX(-130%) skewX(-18deg);
    z-index: -1;
}

.btn-primary:hover::after { animation: ts-shine 0.85s var(--ease-out); }

.btn-ghost { transition: transform 0.28s var(--ease-spring), border-color 0.25s ease, color 0.25s ease, background 0.25s ease; }
.btn-ghost:hover { transform: translateY(-3px); background: var(--accent-soft); }

.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.02rem; }

/* ---------- Cards: spotlight + lift ---------- */
.card, .post-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}

/* Cursor-following highlight; --mx/--my are set by site.js */
.card::before, .post-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%),
                color-mix(in srgb, var(--accent-vivid) 13%, transparent), transparent 62%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.card:hover::before, .post-card:hover::before { opacity: 1; }

.card:hover, .post-card:hover {
    transform: translateY(-7px);
    box-shadow: var(--shadow-lg);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.card > *, .post-card > * { position: relative; z-index: 1; }

/* Gradient icon tiles that react to the card hover */
.icon-tile {
    background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-3) 12%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
    transition: transform 0.4s var(--ease-spring), box-shadow 0.35s ease;
}

.card:hover .icon-tile {
    transform: translateY(-3px) rotate(-6deg) scale(1.06);
    box-shadow: var(--shadow-glow);
}

.price-tag { transition: transform 0.3s var(--ease-out), background 0.3s ease, color 0.3s ease; }
.card:hover .price-tag {
    transform: translateX(4px);
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--btn-primary-fg);
}

/* Section headings pick up the tri-colour gradient */
.grad-text {
    background: linear-gradient(115deg, var(--accent-vivid), var(--accent-2) 45%, var(--accent-3));
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: ts-gradient-pan 9s ease-in-out infinite;
}

.eyebrow {
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--accent-3) 10%, var(--surface)));
}

/* ---------- Reveal: richer variants + stagger ---------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
    transition-delay: var(--d, 0ms);
    will-change: opacity, transform;
}

.reveal.in { opacity: 1; transform: none; }

.reveal-left  { transform: translateX(-34px); }
.reveal-right { transform: translateX(34px); }
.reveal-zoom  { transform: scale(0.94); }

/* ---------- Trust / logo marquee ---------- */
.marquee {
    position: relative;
    /* clip:both is needed as well as overflow:hidden — the duplicated track is
       ~3000px wide and escaped the container at narrow widths, giving the whole
       page a horizontal scrollbar at 320px. */
    overflow: hidden;
    max-width: 100%;
    contain: paint;
    padding: 0.4rem 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 0.85rem;
    animation: ts-marquee 34s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-spring);
}

/* Inline SVG icons in the marquee pills. Each icon sets its own brand colour
   in --mq-c (inline on the element); this rule consumes it, falling back to
   the pill's currentColor if an icon ships without one.
   flex-shrink:0 stops them squashing inside the nowrap pill. */
.mq-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    fill: none;
    stroke: var(--mq-c, currentColor);
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Solid-shape marks (JS bolt, Play triangle, Firebase flame) fill instead
   of stroke — outlining them leaves a hollow, weak silhouette. */
.mq-fill { fill: var(--mq-c, currentColor); stroke: none; }

/* Python: the two interlocking snakes are blue over yellow. */
.mq-py-a { stroke: #3b82f6; }
.mq-py-b { stroke: #eab308; }

/* Google Play: the real mark is a four-colour gradient triangle. A flat
   green reads as the wrong brand, so approximate the sweep with a gradient
   that runs the Play palette (blue → green → yellow → red).
   Declared fallback-first: if url() resolves, it wins as the later value;
   if the def is ever removed, the flat colour still paints. */
.mq-play path {
    fill: #34a853;
    fill: url(#mqPlayGrad);
}

/* Firebase: dark-amber back face, mid-amber fold, bright-yellow front. */
.mq-fb-a { fill: #f59e0b; }
.mq-fb-b { fill: #f8b517; }
.mq-fb-c { fill: #fbbf24; }

/* The brand colours are tuned for the cream light theme. On the warm-dark
   background the deeper ones (Python blue, SEO green, JS amber) lose
   contrast, so lift the whole set slightly rather than restating each hex. */
[data-theme="dark"] .mq-icon { filter: brightness(1.18) saturate(1.05); }

.marquee-item:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* The label turns accent-orange on hover; the icons keep their brand colour
   and just lift slightly, so the row still reads as a set of real marks. */
.marquee-item:hover .mq-icon { transform: scale(1.08); }

.mq-icon { transition: transform 0.25s var(--ease-spring); }

/* ---------- Numbered process steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 1.5rem; counter-reset: step; }

.step {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.4rem 1.6rem 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}

.step:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); }

.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: -14px;
    left: 1.6rem;
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 30px;
    padding: 0 0.6rem;
    border-radius: 999px;
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    color: var(--btn-primary-fg);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-glow);
}

.step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; }
.step p { color: var(--text-muted); font-size: 0.94rem; }

/* ---------- CTA band ---------- */
.cta-band {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: clamp(2.4rem, 5vw, 3.6rem);
    text-align: center;
    color: #fff;
    background: linear-gradient(125deg, #7c2d12, #9f1239 48%, #4c1d95);
    background-size: 220% 220%;
    animation: ts-gradient-pan 14s ease-in-out infinite;
    box-shadow: var(--shadow-lg);
}

.cta-band::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent 70%);
    background-position: 20% 20%;
    background-repeat: no-repeat;
    animation: ts-drift 16s ease-in-out infinite;
    pointer-events: none;
}

.cta-band > * { position: relative; z-index: 1; }

.cta-band h2 {
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.18;
    margin-bottom: 0.85rem;
}

.cta-band p { color: rgba(255, 255, 255, 0.86); max-width: 560px; margin: 0 auto 1.9rem; font-size: 1.04rem; }

.cta-band .btn-primary {
    background: #fff;
    color: #7c2d12;
    box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.5);
}

.cta-band .btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.cta-band .btn-ghost:hover { background: rgba(255, 255, 255, 0.18); border-color: #fff; color: #fff; }

.cta-actions { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Back to top ---------- */
.to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--btn-primary-fg);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--shadow-glow);
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(16px) scale(0.85);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.35s var(--ease-spring);
    z-index: 1100;
}

.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px) scale(1.06); }

/* ---------- Footer ---------- */
footer { position: relative; }

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-vivid), var(--accent-2), var(--accent-3), var(--accent-vivid));
    background-size: 300% 100%;
    animation: ts-gradient-pan 12s linear infinite;
}

/* Phone line under the footer blurb */
.footer-contact { margin-top: 0.7rem !important; }

.footer-contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
}

.footer-contact a:hover { transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.footer-grid ul a { position: relative; transition: color 0.22s ease, padding-left 0.28s var(--ease-out); }
.footer-grid ul a:hover { padding-left: 0.5rem; }

.footer-grid ul a::before {
    content: '→';
    position: absolute;
    left: -0.5rem;
    opacity: 0;
    transition: opacity 0.25s ease, left 0.28s var(--ease-out);
    color: var(--accent);
}

.footer-grid ul a:hover::before { opacity: 1; left: -0.15rem; }

/* ---------- Responsive refinements ---------- */
@media (max-width: 768px) {
    .nav-links {
        transform: translateY(-10px);
        opacity: 0;
        transition: opacity 0.28s ease, transform 0.32s var(--ease-out);
        border-radius: 0 0 20px 20px;
    }
    .nav-links.open { transform: none; opacity: 1; animation: ts-fade-up 0.32s var(--ease-out); }
    .nav-links li { border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); padding-bottom: 0.65rem; }
    .nav-links li:last-child { border-bottom: none; padding-bottom: 0; }
    .nav-cta { display: inline-flex; margin-top: 0.3rem; }
    .menu-toggle { display: grid; }
    /* Hover lift is meaningless on touch and can feel sticky */
    .card:hover, .post-card:hover, .step:hover { transform: none; }
    .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

@media (hover: none) {
    .card::before, .post-card::before { display: none; }
}

/* ---------- Product cards ----------
   Shared by the homepage #products grid and the About page's "Our products"
   section. These lived in index.html's inline <style> until About needed the
   same cards; keep them here so the two pages cannot drift apart. */
.product-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.product-card .product-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    transition: transform 0.45s var(--ease-spring), box-shadow 0.35s ease;
}
.product-card h3 { margin-bottom: 0.35rem; }
.product-card p { flex: 1; margin-bottom: 1.25rem; }
.product-card:hover .product-icon {
    transform: translateY(-5px) scale(1.07) rotate(-3deg);
    box-shadow: var(--shadow-glow);
}

.chip-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { font-size: 0.73rem; font-weight: 700; padding: 0.25rem 0.7rem; border-radius: 999px; }
.chip-type { background: var(--text); color: var(--bg); }
/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-left, .reveal-right, .reveal-zoom { opacity: 1; transform: none; transition: none; }
    .marquee-track,
    .grad-text,
    .cta-band,
    .cta-band::before,
    footer::before { animation: none !important; }
    .btn-primary:hover::after { animation: none; }
    .scroll-progress { display: none; }
}

/* ---------- Floating contact dock (call + WhatsApp) ----------
   Used on the home page and the offers landing page. Sits on the right
   rail, centred on the same axis as .to-top so the buttons form one
   column. Pages with their own bottom-fixed UI (e.g. the offers page
   sticky bar) raise .contact-dock themselves. */
/* ==================== Floating contact dock ====================
   Right-hand rail, stacked above the .to-top button that site.js
   injects at right:20px/bottom:20px (46px, 42px under 760px).
   Widths here match it exactly so all three align in one column. */
.contact-dock {
    position: fixed;
    /* .to-top is 46px at right:20px, so its centre sits 43px from the
       edge. Centring the wider dock on that same axis keeps all three
       buttons in one column without touching the shared site.css. */
    right: 43px;
    transform: translateX(50%);
    bottom: 78px; /* 20px offset + 46px .to-top + 12px gap */
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.dock-btn {
    position: relative;
    /* Deliberately larger than the 46px .to-top: these are the primary
       contact actions, and .to-top is shared by every page's CSS. */
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s ease, filter 0.28s ease;
}

.dock-btn svg { width: 30px; height: 30px; fill: currentColor; }

/* WhatsApp brand green, deepened toward its official dark teal so the
   icon keeps clear contrast against the button face */
.dock-whatsapp { background: linear-gradient(135deg, #1da851, #075e54); color: #fff; }
/* The accent lightens in dark mode, so track the theme's button fg token */
.dock-call {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: var(--btn-primary-fg);
}

/* Label is announced by aria-label; keep the text for assistive tech only */
.dock-label {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.dock-btn:hover,
.dock-btn:focus-visible {
    transform: translateY(-3px) scale(1.06);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.06);
    text-decoration: none;
}

.dock-whatsapp:hover, .dock-whatsapp:focus-visible { color: #fff; }
.dock-call:hover, .dock-call:focus-visible { color: var(--btn-primary-fg); }

.dock-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Gentle pulse on WhatsApp to draw the eye */
.dock-whatsapp::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366; /* bright brand green reads best as a ring */
    animation: dock-pulse 2.6s var(--ease-out) infinite;
    pointer-events: none;
}

@keyframes dock-pulse {
    0%   { opacity: 0.65; transform: scale(1); }
    70%  { opacity: 0; transform: scale(1.28); }
    100% { opacity: 0; transform: scale(1.28); }
}

@media (max-width: 760px) {
    /* Track .to-top's smaller mobile footprint: 14px offset + 42px + 10px */
    /* mobile .to-top: 42px at right:14px -> centre 35px from the edge */
    .contact-dock { right: 35px; bottom: 66px; gap: 0.75rem; }
    .dock-btn { width: 56px; height: 56px; }
    .dock-btn svg { width: 27px; height: 27px; }
}

/* Very narrow phones: ease off so the rail doesn't crowd content */
@media (max-width: 380px) {
    .dock-btn { width: 52px; height: 52px; }
    .dock-btn svg { width: 25px; height: 25px; }
}

@media (prefers-reduced-motion: reduce) {
    .dock-whatsapp::before { animation: none; }
    .dock-btn { transition: none; }
    .dock-btn:hover, .dock-btn:focus-visible { transform: none; }
}
