/* ============================================================================
   DESIGNS — finishing layer for the four site designs
   ----------------------------------------------------------------------------
   Loaded after redesign.css. Colours come from the palette header.php prints
   for the active design (lib/designs.php); <html data-design="…"> selects the
   per-design details below.

   Goals: calmer, more professional surfaces (soft shadows instead of the hard
   offset "brutalist" shadows), readable button text on any main colour
   (--on-primary), and phone-first spacing and touch targets.
============================================================================ */

:root {
    --font-display: var(--design-display, 'Inter'), var(--font), system-ui, sans-serif;
    --vx-radius: var(--radius, 10px);
    --ds-shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --ds-shadow-md: 0 10px 30px -12px rgba(15, 23, 42, .22);
    --ds-shadow-lg: 0 24px 50px -24px rgba(15, 23, 42, .35);
}
[data-theme="dark"] {
    --ds-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --ds-shadow-md: 0 12px 32px -14px rgba(0, 0, 0, .7);
    --ds-shadow-lg: 0 28px 56px -26px rgba(0, 0, 0, .85);
    --vx-shadow: rgba(0, 0, 0, .6);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html, body { overflow-x: clip; }
body { line-height: 1.65; }
img, video, iframe, svg { max-width: 100%; }
img { height: auto; }
::selection { background: var(--primary); color: var(--on-primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
a { text-underline-offset: 3px; }

h1, h2, h3, h4,
.section-title, .hero-name, .project-title, .blog-title, .service-title {
    font-family: var(--font-display);
    color: var(--text);
}

/* The blueprint grid suits only the Modern design. */
html:not([data-design="modern"]) body::before { display: none; }

#scroll-progress { background: var(--primary); box-shadow: none; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav-link.active { color: var(--primary); background: var(--glow); }
.nav-link.active i { color: var(--primary); }
.nav-dot { background: var(--primary) !important; }
.nav-logo .accent { color: var(--primary); }
@media (min-width: 769px) {
    .navbar { box-shadow: var(--ds-shadow-sm); border-color: var(--border); background: color-mix(in srgb, var(--bg) 88%, transparent); }
    .navbar.scrolled { box-shadow: var(--ds-shadow-md); }
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn,
body .hero-glass-btn-primary {
    background: var(--primary);
    color: var(--on-primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--ds-shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, background .18s, color .18s, border-color .18s;
}
.btn:hover,
body .hero-glass-btn-primary:hover {
    background: var(--primary2);
    border-color: var(--primary2);
    color: var(--on-primary);
    transform: translateY(-1px);
    box-shadow: var(--ds-shadow-md);
    opacity: 1;
}
.btn:active, body .hero-glass-btn-primary:active { transform: none; box-shadow: var(--ds-shadow-sm); }

.btn.btn-outline,
.btn.btn-ghost,
body .hero-glass-btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.btn.btn-outline:hover,
.btn.btn-ghost:hover,
body .hero-glass-btn-ghost:hover {
    background: var(--glow);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: none;
}

/* ── Section headers ──────────────────────────────────────────────────────── */
.section-tag { color: var(--primary); font-weight: 600; }
.section-tag::before { background: var(--primary); box-shadow: 0 0 0 3px var(--glow); border-radius: 50%; width: 8px; height: 8px; }
.section-title { font-size: clamp(1.9rem, 4.6vw, 3.1rem); line-height: 1.12; letter-spacing: -.025em; }
.section-subtitle { color: var(--text2); }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.project-card, .blog-card, .service-card, .glass-card, .skill-chip,
.contact-info-item, .timeline-item {
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--ds-shadow-sm);
}
.project-card:hover, .blog-card:hover, .service-card:hover, .glass-card:hover {
    transform: translateY(-3px);
    border-color: var(--border3);
    box-shadow: var(--ds-shadow-lg);
}
.service-icon { background: var(--glow) !important; color: var(--primary) !important; }
.skill-chip:hover { border-color: var(--primary); }
.project-tag, .blog-category { color: var(--primary); }

/* ── Glass hero (Modern design) ───────────────────────────────────────────── */
body .hero-glass-img img { border: 1px solid var(--border); box-shadow: var(--ds-shadow-lg); }
@media (min-width: 900px) {
    body .hero-glass-img::after { border: 1px solid var(--border); box-shadow: var(--ds-shadow-md); }
}
body .hero-glass h1 { font-size: clamp(2.2rem, 6.4vw, 4.6rem); line-height: 1.04; }
body .hero-glass h1 .grad {
    background-image: none;
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}
body .hero-glass-badge { font-family: var(--font); }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control { background: var(--card); border: 1.5px solid var(--border); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--glow); }

/* ── Pagination, back-to-top, footer ──────────────────────────────────────── */
.page-btn.active, .pagination .active {
    background: var(--primary) !important; color: var(--on-primary) !important; border-color: var(--primary) !important;
}
#backToTop {
    background: var(--primary) !important;
    color: var(--on-primary) !important;
    border: 0 !important;
    border-radius: 50% !important;
    box-shadow: var(--ds-shadow-md) !important;
}
footer::before, .footer::before { height: 2px; background: var(--primary); opacity: .9; }

/* Footer surface: dark band (except Minimal), so footer text stays readable
   whatever the page background is. */
html:not([data-design="minimal"]) :is(footer, .footer, .site-footer) {
    --text: #e8edf5; --text2: #b3bdcc; --text3: #8b97a8;
    --primary: var(--footer-primary); --on-primary: var(--footer-on-primary);
    --card: rgba(255, 255, 255, .04); --bg3: rgba(255, 255, 255, .06); --glow: rgba(255, 255, 255, .06);
    --border: rgba(255, 255, 255, .1);
    background: var(--footer-bg) !important;
    color: var(--text);
}

/* ── Per-design details ───────────────────────────────────────────────────── */

/* Professional: crisp, corporate, generous whitespace. */
[data-design="professional"] h1, [data-design="professional"] h2,
[data-design="professional"] .section-title { font-weight: 800; letter-spacing: -.03em; }
[data-design="professional"] .section-tag { font-family: var(--font); letter-spacing: .08em; font-size: .75rem; }

/* Modern: keep the tech feel — mono eyebrows, glow on hover. */
[data-design="modern"] .project-card:hover,
[data-design="modern"] .blog-card:hover,
[data-design="modern"] .service-card:hover { box-shadow: 0 0 0 1px var(--border3), 0 20px 50px -24px color-mix(in srgb, var(--primary) 45%, transparent); }

/* Minimal: flat surfaces, hairlines, no lift. */
[data-design="minimal"] .project-card, [data-design="minimal"] .blog-card,
[data-design="minimal"] .service-card, [data-design="minimal"] .glass-card { box-shadow: none; }
[data-design="minimal"] .project-card:hover, [data-design="minimal"] .blog-card:hover,
[data-design="minimal"] .service-card:hover, [data-design="minimal"] .glass-card:hover { transform: none; box-shadow: none; border-color: var(--primary); }
[data-design="minimal"] .section-tag { font-family: var(--font); letter-spacing: .1em; }
[data-design="minimal"] .btn, [data-design="minimal"] .btn:hover { box-shadow: none; }

/* Editorial: serif headlines, square edges, rules between sections. */
[data-design="editorial"] h1, [data-design="editorial"] h2, [data-design="editorial"] h3,
[data-design="editorial"] .section-title { font-weight: 700; letter-spacing: -.01em; }
[data-design="editorial"] .section-tag { font-family: var(--font); letter-spacing: .14em; text-transform: uppercase; }
[data-design="editorial"] .section-tag::before { border-radius: 0; width: 18px; height: 3px; box-shadow: none; }
[data-design="editorial"] .project-card, [data-design="editorial"] .blog-card,
[data-design="editorial"] .service-card { box-shadow: none; }

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* 16px stops iOS zooming into form fields. */
    input, select, textarea, .form-control { font-size: 16px !important; }

    /* Comfortable touch targets. */
    .btn, .nav-link, .theme-toggle, .hamburger, .page-btn { min-height: 44px; }
    .nav-links .nav-link { display: flex; align-items: center; }
    .btn { padding-inline: 18px; }

    .section, section.section { padding-block: 56px; }
    .section-header { margin-bottom: 32px; }
    .section-title { font-size: clamp(1.7rem, 7vw, 2.3rem); }
    .container, .page { padding-inline: 16px; }

    /* Hero buttons stack full width so they are easy to tap. */
    .hero-glass-btns, .hero-corp-btns, .hero-minimal-row, .hero-mag-btns { flex-direction: column; align-items: stretch; }
    .hero-glass-btns > a, .hero-corp-btns > a, .hero-minimal-row > a.hero-minimal-btn, .hero-mag-btns > a { justify-content: center; width: 100%; }

    /* Article content: wide tables and long words never push the page sideways. */
    .blog-content table, .editorjs-content table, .legal-body table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .blog-content, .editorjs-content, .legal-body { overflow-wrap: anywhere; }
    pre { overflow-x: auto; max-width: 100%; }

}
@media (max-width: 380px) {
    body .hero-glass h1 { font-size: 2rem; }
    .nav-logo span { font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .btn, .project-card, .blog-card, .service-card, .glass-card { transition: none; transform: none !important; }
}

/* ── Mobile: hero height, footer columns, drawer ─────────────────────────── */
@media (max-width: 768px) {
    /* Heroes were 80–100vh tall, leaving big empty bands on phones. */
    .hero-corp, .hero-glass, .hero-minimal, .hero-mag { min-height: auto !important; }
    .hero-corp { padding: 28px 0 40px !important; }

    /* Footer columns: two per row, brand column full width. */
    .ft-grid { grid-template-columns: 1fr 1fr !important; gap: 28px 20px !important; padding-top: 40px !important; }
    .ft-grid > :first-child { grid-column: 1 / -1; }

    /* The closed drawer sits off-screen but its shadow leaked onto the page edge. */
    .nav-links:not(.open) { box-shadow: none; }
}
@media (max-width: 420px) {
    .ft-grid > :last-child { grid-column: 1 / -1; }
}

/* Editorial header is a full-width stacked masthead, not a floating bar. */
@media (min-width: 769px) {
    .navbar.navbar-magazine {
        position: sticky; top: 0; left: auto; right: auto; transform: none;
        width: 100%; height: auto; border: 0; border-radius: 0; box-shadow: var(--ds-shadow-sm);
        background: var(--card);
    }
}
/* The Editorial masthead is sticky (in the page flow) at every width, so the
   fixed-navbar body offset from style.css would leave an empty band. */
[data-design="editorial"] body { padding-top: 0 !important; }

/* ============================================================================
   HERO — shared markup (heroes/_hero.php), styled per design
============================================================================ */
.hx { position: relative; overflow: hidden; padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 7vw, 80px); }
.hx-inner {
    position: relative; z-index: 1;
    max-width: 1180px; margin: 0 auto; padding: 0 20px;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-items: center;
}
@media (min-width: 900px) {
    .hx-inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 64px; }
    .hx--solo .hx-inner { grid-template-columns: minmax(0, 1fr); max-width: 820px; text-align: center; }
    .hx--solo .hx-btns, .hx--solo .hx-tags, .hx--solo .hx-eyebrow { justify-content: center; }
    .hx--solo .hx-sub { margin-inline: auto; }
}
.hx-copy { min-width: 0; }

/* Phones get a small round portrait above the text, so the headline and the
   buttons stay on the first screen. Desktop shows the large photo instead. */
.hx-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 18px; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--primary); }
@media (min-width: 900px) { .hx-avatar { display: none; } }

.hx-eyebrow {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
    margin: 0 0 14px; font-size: .9rem; font-weight: 600; color: var(--text2);
}
.hx-eyebrow i { color: var(--primary); font-size: .85em; }
.hx-sep { color: var(--text3); margin-right: 4px; }
.hx-loc { white-space: nowrap; }

.hx h1 {
    font-family: var(--font-display);
    font-size: clamp(2.05rem, 6vw, 3.9rem);
    line-height: 1.08; letter-spacing: -.03em; font-weight: 800;
    margin: 0 0 16px; color: var(--text); text-wrap: balance;
}
.hx-name { color: var(--primary); white-space: nowrap; }
@media (max-width: 380px) { .hx-name { white-space: normal; } }

.hx-sub { font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.7; color: var(--text2); max-width: 56ch; margin: 0 0 20px; }

.hx-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; padding: 0; }
.hx-tags li {
    padding: 6px 12px; border-radius: 100px;
    background: var(--card); border: 1px solid var(--border);
    font-size: .8rem; font-weight: 600; color: var(--text2);
}

.hx-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 30px; }
.hx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 50px; padding: 0 24px; border-radius: var(--radius);
    font-size: .95rem; font-weight: 700; text-decoration: none;
    transition: background .18s, color .18s, border-color .18s, transform .18s, box-shadow .18s;
}
.hx-btn--primary { background: var(--primary); color: var(--on-primary); border: 1.5px solid var(--primary); box-shadow: var(--ds-shadow-sm); }
.hx-btn--primary:hover { background: var(--primary2); border-color: var(--primary2); color: var(--on-primary); transform: translateY(-1px); box-shadow: var(--ds-shadow-md); }
.hx-btn--primary i { transition: transform .18s; }
.hx-btn--primary:hover i { transform: translateX(3px); }
.hx-btn--ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--border); }
.hx-btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.hx-btn--link { min-height: 44px; padding: 0 6px; color: var(--text2); }
.hx-btn--link:hover { color: var(--primary); }

.hx-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
    margin: 0; padding-top: 22px; border-top: 1px solid var(--border); max-width: 520px;
}
.hx-stat { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 0; }
.hx-stat dd { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; color: var(--text); line-height: 1.1; letter-spacing: -.02em; }
.hx-stat dt { font-size: .78rem; color: var(--text3); font-weight: 500; line-height: 1.3; }

.hx-scroll { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; font-size: .8rem; font-weight: 600; color: var(--text3); text-decoration: none; }
.hx-scroll:hover { color: var(--primary); }
.hx-scroll i { animation: hx-bob 1.8s ease-in-out infinite; }
@keyframes hx-bob { 50% { transform: translateY(4px); } }

.hx-photo { display: none; margin: 0; position: relative; }
@media (min-width: 900px) {
    .hx-photo { display: block; justify-self: end; width: 100%; max-width: 420px; }
    .hx-photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: calc(var(--radius) + 6px); background: var(--bg3); }
}

/* Phones: full-width buttons, easy to tap. */
@media (max-width: 560px) {
    .hx-btn--primary, .hx-btn--ghost { flex: 1 1 100%; }
    .hx-btn--link { margin-inline: auto; }
}

/* ── Professional: soft panel behind the photo ── */
@media (min-width: 900px) {
    [data-design="professional"] .hx-photo::before {
        content: ''; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
        border-radius: calc(var(--radius) + 6px); background: var(--glow); border: 1px solid var(--border3);
    }
    [data-design="professional"] .hx-photo img { box-shadow: var(--ds-shadow-lg); }
}
[data-design="professional"] .hx { background: linear-gradient(180deg, var(--bg2), var(--bg) 70%); }

/* ── Modern: glow orbs, outlined chips, glowing photo ── */
.hx-orb { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.hx-orb--a { width: 420px; height: 420px; top: -120px; right: -80px; background: var(--primary); opacity: .16; }
.hx-orb--b { width: 360px; height: 360px; bottom: -160px; left: -120px; background: var(--accent); opacity: .12; }
[data-design="modern"] .hx-tags li { background: transparent; border-color: var(--border3); color: var(--text); font-family: var(--font-mono, monospace); font-size: .74rem; }
[data-design="modern"] .hx-photo img { border: 1px solid var(--border3); box-shadow: 0 0 0 6px var(--glow), 0 30px 60px -30px color-mix(in srgb, var(--primary) 50%, transparent); }
[data-design="modern"] .hx-btn--ghost { background: transparent; }

/* ── Minimal: flat, no chips background, quiet photo ── */
[data-design="minimal"] .hx-tags li { background: transparent; border: 0; padding: 0; color: var(--text3); }
[data-design="minimal"] .hx-tags li + li::before { content: '/'; margin-right: 8px; color: var(--border); }
[data-design="minimal"] .hx-btn--primary, [data-design="minimal"] .hx-btn--primary:hover { box-shadow: none; transform: none; }
[data-design="minimal"] .hx-stats { border-top-style: dashed; }

/* ── Editorial: serif headline, name in ink with an underline, captioned photo ── */
[data-design="editorial"] .hx h1 { font-weight: 700; letter-spacing: -.01em; }
[data-design="editorial"] .hx-name {
    color: var(--text);
    background: linear-gradient(transparent 82%, color-mix(in srgb, var(--primary) 30%, transparent) 82%);
}
[data-design="editorial"] .hx-eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; color: var(--primary); }
[data-design="editorial"] .hx-tags li { border-radius: 0; background: transparent; }
[data-design="editorial"] .hx-btn { border-radius: 0; text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; }
[data-design="editorial"] .hx-btn--primary { background: var(--text); border-color: var(--text); color: var(--bg); }
[data-design="editorial"] .hx-btn--primary:hover { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
[data-design="editorial"] .hx-photo figcaption { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; }
[data-design="editorial"] .hx-photo img { border-radius: 0; }
[data-design="editorial"] .hx-avatar { border-radius: 0; }

@media (prefers-reduced-motion: reduce) { .hx-scroll i { animation: none; } .hx-btn { transition: none; } }

/* ============================================================================
   HEADER — calmer, consistent across designs
============================================================================ */
.nav-link i { display: none; }
.navbar .nav-link { border: 0 !important; border-radius: 8px; }
.navbar .nav-link.active { background: var(--glow); color: var(--primary); }
.navbar-corporate .nav-link.active { box-shadow: none; }
.theme-toggle {
    width: 40px; height: 40px; border-radius: 50% !important;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border) !important; background: var(--card) !important; color: var(--text2) !important;
}
.theme-toggle:hover { color: var(--primary) !important; border-color: var(--primary) !important; }
.nav-logo img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.nav-logo span { font-weight: 800; letter-spacing: -.02em; }

@media (max-width: 768px) {
    .navbar { box-shadow: 0 1px 0 var(--border); }
    .nav-actions { gap: 8px !important; }
    .hamburger { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); }

    /* Drawer: clear list with large rows and a highlighted current page. */
    .nav-links { background: var(--card) !important; padding: 16px 12px !important; gap: 2px !important; border-left: 1px solid var(--border) !important; }
    .nav-links .nav-link { width: 100%; padding: 12px 14px !important; font-size: 1rem !important; color: var(--text) !important; border-radius: 10px; }
    .nav-links .nav-link.active { background: var(--glow) !important; color: var(--primary) !important; }
    .nav-links .nav-link i { display: inline-block; width: 22px; color: var(--primary); }
}
@media (max-width: 560px) {
    .hx-eyebrow { flex-direction: column; align-items: flex-start; gap: 2px; }
    .hx-eyebrow > i { display: none; }
    .hx-sep { display: none; }
}
@media (max-width: 768px) {
    .nav-links > li { width: 100%; }
}
