/* ============================================================
   JAMES - PORTFOLIO V4 SHARED STYLESHEET
   Dark navy + sky accent | Archivo (headings) + Space Grotesk (body)
   Fonts are linked in each page's HTML (Google Fonts). No @import,
   no external URLs here. Icons are inline SVG in the HTML.
   ============================================================ */

/* ------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------ */
:root {
    /* Surfaces */
    --bg: #0D1117;
    --surface: #161B22;
    --surface-2: #1B222C;           /* hover / elevated */
    --border: #21262D;
    --border-strong: #30363D;

    /* Text (all pairs AA-checked against --bg and --surface) */
    --text: #E6EDF3;
    --text-muted: #9DA7B1;          /* 7.75:1 on bg, 7.08:1 on surface (rule 10) */

    /* Accent */
    --accent: #38BDF8;
    --accent-hover: #7DD3FC;        /* lightened for hover fills on dark */
    --accent-soft: rgba(56, 189, 248, 0.10);
    --accent-border: rgba(56, 189, 248, 0.22);

    /* Status */
    --success: #4ADE80;

    /* Type */
    --font-heading: 'Archivo', 'Segoe UI', sans-serif;
    --font-body: 'Space Grotesk', 'Segoe UI', sans-serif;

    /* Layout */
    --container: 1100px;
    --section-pad: 5.5rem;
    --header-h: 64px;

    /* Radii: inner radius = outer minus its padding */
    --radius-lg: 12px;              /* cards, panels, form box */
    --radius-md: 8px;               /* buttons, inputs (12 - 4 inset) */
    --radius-sm: 4px;               /* chips, badges (12 - 8 inset) */

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;

    /* Motion: ease-out entrances, ease-in-out moves, no bounce */
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast: 150ms;              /* hover color/border */
    --dur-ui: 200ms;                /* dropdowns, accordions (150-250ms band) */
    --dur-exit: 160ms;              /* exits 20% shorter than entrances */
    --dur-reveal: 500ms;            /* scroll reveals */
}

/* ------------------------------------------------------------
   2. RESET + BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Keyboard focus must land where the user can see it: a smooth scroll leaves the
   focused control off-screen for hundreds of ms, so keyboard scrolling jumps
   straight there while mouse-initiated anchor scrolling stays smooth. */
html:has(:focus-visible) {
    scroll-behavior: auto;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

img,
video,
iframe {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
}

/* Focus: one consistent accent ring on everything interactive */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background: rgba(56, 189, 248, 0.28);
    color: var(--text);
}

/* Cheap scrollbar styling (WebKit only, best effort) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3D444D;
}

/* ------------------------------------------------------------
   3. LAYOUT PRIMITIVES
   ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

.section {
    padding-block: var(--section-pad);
}

.section-eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-3);
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3.5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--text);
    text-wrap: balance;
}

/* Section header wrapper: eyebrow + title, spaced off the section body */
.section-header {
    margin-bottom: var(--space-6);
}

/* Scroll reveal (IntersectionObserver toggles .visible).
   The hidden state lives under .js, which the page sets with an inline script:
   without JS the copy stays visible instead of being stuck at opacity 0. */
.js .fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity var(--dur-reveal) var(--ease-out),
        transform var(--dur-reveal) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* A keyboard user tabbing into a card must see the focus ring at once, so a
   focused reveal block shows immediately instead of waiting for the observer. */
.js .fade-up:focus-within {
    opacity: 1;
    transform: none;
    transition: none;
}

/* Stagger children by 30ms (rule 25); pages opt in with .stagger */
.stagger > .fade-up:nth-child(2) { transition-delay: 30ms; }
.stagger > .fade-up:nth-child(3) { transition-delay: 60ms; }
.stagger > .fade-up:nth-child(4) { transition-delay: 90ms; }
.stagger > .fade-up:nth-child(5) { transition-delay: 120ms; }
.stagger > .fade-up:nth-child(6) { transition-delay: 150ms; }
.stagger > .fade-up:nth-child(7) { transition-delay: 180ms; }
.stagger > .fade-up:nth-child(8) { transition-delay: 210ms; }

/* ------------------------------------------------------------
   4. BUTTONS (CTA is the strongest visual: rule 18)
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.btn:active {
    transform: scale(0.97);         /* press feedback, rule 27 */
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);               /* 8.83:1 on the accent fill */
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 18px rgba(56, 189, 248, 0.28);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-strong);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ------------------------------------------------------------
   5. HEADER / NAV
   ------------------------------------------------------------ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid transparent;
    transition:
        background-color var(--dur-ui) var(--ease-out),
        border-color var(--dur-ui) var(--ease-out);
}

.header.scrolled {
    background: rgba(13, 17, 23, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--border);
}

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

.logo {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}

.logo-dot {
    color: var(--accent);
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.nav-menu a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);       /* 6.17:1 on bg */
    transition: color var(--dur-fast) var(--ease-out);
}

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

.nav-cta {
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--bg);
    font-size: 0.82rem;
    font-weight: 700;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.nav-cta:hover {
    background: var(--accent-hover);
}

.nav-cta:active {
    transform: scale(0.97);
}

/* Hamburger */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;                    /* touch target */
    height: 44px;
    padding: 10px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--text);
    transition: transform var(--dur-ui) var(--ease-in-out), opacity var(--dur-fast) var(--ease-out);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ------------------------------------------------------------
   6. HERO (home)
   ------------------------------------------------------------ */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 88vh;
    padding: calc(var(--header-h) + var(--space-8)) 0 var(--space-7);
    overflow: hidden;
}

/* Static grid texture: cheap, no animation */
.hero-grid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 75% 55% at 50% 40%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 40%, black 20%, transparent 100%);
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--accent-border);
    border-radius: 100px;
    background: var(--accent-soft);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: var(--space-5);
}

.avail-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    animation: avail-pulse 2.4s var(--ease-in-out) infinite;
}

@keyframes avail-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
    50%      { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.12); }
}

.hero-headline {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -0.04em;
    color: var(--text);
    max-width: 700px;
    margin-bottom: var(--space-4);
    text-wrap: balance;
}

.hero-accent {
    color: var(--accent);
}

.hero-sub {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: var(--space-6);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-7);
}

.hero-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-5);
    width: fit-content;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.stat-num {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    font-variant-numeric: tabular-nums;   /* rule 17 */
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ------------------------------------------------------------
   7. MARQUEE
   ------------------------------------------------------------ */
.marquee-section {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.marquee-label {
    flex-shrink: 0;
    padding-left: var(--space-4);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.marquee-track {
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 6%, black 94%, transparent);
}

/* Track content is duplicated in the HTML; translate -50% loops it seamlessly */
.marquee-inner {
    display: flex;
    gap: var(--space-4);
    width: max-content;
    animation: marquee-scroll 36s linear infinite;
}

.marquee-inner span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

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

/* ------------------------------------------------------------
   8. WORK / VIDEO CARDS
   ------------------------------------------------------------ */
.work-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition:
        border-color var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.work-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.work-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;           /* default */
    background: var(--bg);
    overflow: hidden;
}

/* Optional ratios via data-ratio on the card or the media itself.
   Vertical caps belong on the CARD so poster and card narrow together. */
[data-ratio="9-16"] .work-media,
.work-media[data-ratio="9-16"] {
    aspect-ratio: 9 / 16;
}

/* Cap the whole card, never the media area inside it */
.work-card[data-ratio="9-16"] {
    max-width: 480px;
    margin-inline: auto;
}

[data-ratio="1-1"] .work-media,
.work-media[data-ratio="1-1"] {
    aspect-ratio: 1 / 1;
}

[data-ratio="4-5"] .work-media,
.work-media[data-ratio="4-5"] {
    aspect-ratio: 4 / 5;
}

.work-media img,
.work-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur-reveal) var(--ease-out);
}

.work-card:hover .work-media img,
.work-card:hover .work-media video {
    transform: scale(1.03);
}

/* Poster loading state: cheap shimmer, no spinner element needed */
.work-media.video-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        var(--surface) 40%,
        var(--surface-2) 50%,
        var(--surface) 60%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    pointer-events: none;   /* the shimmer must not swallow the play/cancel click */
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* Play: a real button so keyboard users can reach it */
.play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.35);
    transition: background-color var(--dur-fast) var(--ease-out);
}

.play-btn .play-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(13, 17, 23, 0.65);
    border: 1px solid rgba(230, 237, 243, 0.25);
    color: #FFFFFF;
    transition:
        transform var(--dur-fast) var(--ease-out),
        background-color var(--dur-fast) var(--ease-out);
}

.play-btn:hover {
    background: rgba(13, 17, 23, 0.2);
}

.play-btn:hover .play-btn-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
    transform: scale(1.05);
}

.play-btn:active .play-btn-icon {
    transform: scale(0.97);
}

/* Keyboard focus ring stays visible over video (never outline:none) */
.play-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* Playing state: icon swaps to pause, scrim drops so playback isn't dimmed.
   Icon spans live in the HTML: <span class="play-btn-icon icon-play"> and
   <span class="play-btn-icon icon-pause">. */
.play-btn .icon-pause { display: none; }
.play-btn.playing .icon-play { display: none; }
.play-btn.playing .icon-pause { display: flex; }
.play-btn.playing { background: transparent; }
.play-btn.playing:hover { background: rgba(13, 17, 23, 0.25); }

.work-tag-badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(6px);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);             /* needs AA over video: bright on dark scrim */
}

.work-info {
    padding: var(--space-4) var(--space-5) var(--space-5);
}

.work-info h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.work-info p {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}

.work-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.work-tools span {
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
}

/* ------------------------------------------------------------
   9. ACCORDIONS (process + FAQ)
   grid-template-rows transition: no max-height clipping caps
   ------------------------------------------------------------ */
.process-item,
.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--dur-fast) var(--ease-out);
}

.process-item.active,
.faq-item.open,
.process-item:hover,
.faq-item:hover {
    border-color: var(--border-strong);
}

.process-item.active,
.faq-item.open {
    border-color: var(--accent-border);
}

.process-trigger,
.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    text-align: left;
    transition: color var(--dur-fast) var(--ease-out);
}

.process-step-num {
    flex-shrink: 0;
    width: 1.6rem;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    transition: color var(--dur-fast) var(--ease-out);
}

.process-item.active .process-step-num {
    color: var(--accent);
}

.process-trigger h3,
.faq-q h3 {
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.process-chevron,
.faq-icon {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: transform var(--dur-ui) var(--ease-in-out), color var(--dur-fast) var(--ease-out);
}

.process-item.active .process-chevron,
.faq-item.open .faq-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

/* Collapsible body: 0fr -> 1fr grid transition, 200ms.
   Markup contract: <div class="process-body"><div>content</div></div>
   and <div class="faq-a"><div>content</div></div> - the inner div is
   required for the grid-rows transition to collapse. */
.process-body,
.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--dur-ui) var(--ease-out);
}

.process-item.active .process-body,
.faq-item.open .faq-a {
    grid-template-rows: 1fr;
}

/* Inner wrapper required: see markup contract above */
.process-body > div,
.faq-a > div {
    min-height: 0;
    overflow: hidden;
}

.process-body p,
.faq-a p {
    padding: 0 var(--space-5) var(--space-4);
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.process-body p {
    padding-left: calc(var(--space-5) + 1.6rem);   /* aligns under the title, past the step number */
}

/* Side panel (process section) */
.process-panel {
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
    padding: var(--space-6);
    background: var(--surface);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
}

.panel-eyebrow {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-3);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: var(--space-3);
}

.panel-desc {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

.panel-detail {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.panel-detail svg {
    flex-shrink: 0;
    margin-top: 0.15rem;            /* optical alignment with first text line */
    color: var(--accent);
}

/* ------------------------------------------------------------
   10. FORMS
   ------------------------------------------------------------ */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group label {
    display: block;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text);
    resize: none;
    transition:
        border-color var(--dur-fast) var(--ease-out),
        box-shadow var(--dur-fast) var(--ease-out);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Keyboard focus: accent border + soft ring (never outline:none) */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

/* Dark-friendly autofill (Chrome fills with white unless overridden) */
.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group textarea:-webkit-autofill,
.form-group textarea:-webkit-autofill:hover,
.form-group textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
    caret-color: var(--text);
    transition: background-color 9999s ease-out;
}

.form-group select option {
    background: var(--surface);
    color: var(--text);
}

.form-group textarea {
    min-height: 120px;
}

.form-submit {
    width: 100%;
    padding: 0.8rem;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--bg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        background-color var(--dur-fast) var(--ease-out),
        opacity var(--dur-fast) var(--ease-out),
        transform var(--dur-fast) var(--ease-out);
}

.form-submit:hover {
    background: var(--accent-hover);
}

.form-submit:active {
    transform: scale(0.97);
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-submit.loading {
    color: transparent;             /* label hidden while the spinner shows */
    position: relative;
}

.form-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(13, 17, 23, 0.35);
    border-top-color: var(--bg);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.form-success {
    display: none;
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: var(--radius-md);
    background: rgba(74, 222, 128, 0.08);
    color: var(--success);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: center;
}

.form-success.show {
    display: block;
    animation: success-pulse 0.6s var(--ease-out);   /* rule 35: pulse to confirm success */
}

@keyframes success-pulse {
    0%  { transform: scale(0.98); }
    55% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* ------------------------------------------------------------
   11. CAL.COM EMBED
   ------------------------------------------------------------ */
.book-call-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0.75rem 0.9rem;
    margin-top: var(--space-2);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 600;
    transition:
        border-color var(--dur-fast) var(--ease-out),
        color var(--dur-fast) var(--ease-out);
}

.book-call-toggle:hover,
.book-call-toggle.open {
    border-color: var(--accent);
    color: var(--accent);
}

.book-call-toggle svg {
    flex-shrink: 0;
    transition: transform var(--dur-ui) var(--ease-in-out);
}

.book-call-toggle.open svg {
    transform: rotate(180deg);
}

/* Cal embed: 0fr -> 1fr grid transition, 200ms.
   Markup contract: <div class="cal-embed-wrap"><div><iframe ...></iframe></div></div>
   the inner div is required for the grid-rows transition to collapse. */
.cal-embed-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--dur-ui) var(--ease-out);
}

.cal-embed-wrap.open {
    grid-template-rows: 1fr;
}

/* Inner wrapper required: see markup contract above */
.cal-embed-wrap > div {
    min-height: 0;
    overflow: hidden;
}

.cal-embed-wrap iframe {
    width: 100%;
    height: 700px;
    margin-top: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color-scheme: light;
}

/* ------------------------------------------------------------
   12. CONTACT PAGE
   ------------------------------------------------------------ */
.contact-page-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
    padding-block: calc(var(--header-h) + var(--space-7)) var(--section-pad);
}

.contact-left h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.9rem, 3.5vw, 2.6rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: var(--space-3);
}

.contact-left > p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: var(--space-2);
}

.contact-detail svg {
    flex-shrink: 0;
    color: var(--accent);
}

.contact-detail a {
    color: var(--text);
    transition: color var(--dur-fast) var(--ease-out);
}

.contact-detail a:hover {
    color: var(--accent);
}

.contact-socials {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.contact-socials a,
.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;                    /* touch-sized */
    height: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-muted);
    transition:
        color var(--dur-fast) var(--ease-out),
        border-color var(--dur-fast) var(--ease-out);
}

.contact-socials a:hover,
.footer-social a:hover {
    color: var(--accent);
    border-color: var(--accent-border);
}

.contact-right {
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* ------------------------------------------------------------
   13. PAGE HERO (works, contact, 404)
   ------------------------------------------------------------ */
.page-hero {
    padding-block: calc(var(--header-h) + var(--space-7)) var(--space-5);
    text-align: center;
}

.page-hero .section-eyebrow {
    margin-bottom: var(--space-2);
}

.page-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: var(--space-3);
    text-wrap: balance;
}

.page-hero p {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 460px;
    margin-inline: auto;
}

/* ------------------------------------------------------------
   14. WORKS PAGE
   ------------------------------------------------------------ */
.works-grid-page {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    padding-bottom: var(--section-pad);
}

.works-cta-strip {
    padding: var(--space-6) 0;
    border-top: 1px solid var(--border);
}

.works-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-5);
}

.works-cta-inner h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: var(--space-1);
}

.works-cta-inner p {
    font-size: 0.84rem;
    color: var(--text-muted);
    max-width: 440px;
}

/* ------------------------------------------------------------
   15. ABOUT STRIP
   ------------------------------------------------------------ */
.about-strip {
    padding-block: var(--space-7);
    border-top: 1px solid var(--border);
}

.about-strip-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-6);
    align-items: center;
}

.about-strip img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius-lg);   /* outer 12 + 0 padding: media fills the frame */
}

.about-strip p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 560px;
}

.about-strip p strong {
    color: var(--text);
    font-weight: 600;
}

/* ------------------------------------------------------------
   16. FOOTER
   ------------------------------------------------------------ */
.footer {
    padding: var(--space-6) 0 var(--space-5);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-5);
    margin-bottom: var(--space-5);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    display: block;
    margin-bottom: var(--space-1);
}

.footer-left p {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-nav a {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: color var(--dur-fast) var(--ease-out);
}

.footer-nav a:hover {
    color: var(--text);
}

.footer-social {
    display: flex;
    gap: var(--space-2);
}

/* screen-reader/aria-label helper: icon-only links keep an accessible name */
.footer-social a[aria-label],
.contact-socials a[aria-label] {
    -webkit-tap-highlight-color: transparent;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.footer-bottom p {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.footer-cta {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    transition: color var(--dur-fast) var(--ease-out);
}

.footer-cta:hover {
    color: var(--accent-hover);
}

/* ------------------------------------------------------------
   17. REDUCED MOTION (kill all non-essential movement)
   ------------------------------------------------------------ */
@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;
    }

    .js .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .marquee-inner {
        animation: none;
    }

    .avail-dot {
        animation: none;
    }

    .nav-menu.closing {
        animation: none;
        opacity: 0;          /* the panel leaves at once, no 160ms wait */
        visibility: hidden;
    }
}

/* ------------------------------------------------------------
   18. RESPONSIVE (880px nav collapse, 580px compact)
   ------------------------------------------------------------ */
@media (max-width: 880px) {
    :root {
        --section-pad: 4rem;
    }

    /* Nav collapses to the hamburger */
    .nav-menu,
    .nav-cta {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Open state doubles as the dropdown panel; 200ms in, 160ms out */
    .nav-menu.active {
        display: block;
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        padding: var(--space-4) var(--space-5) var(--space-5);
        background: rgba(13, 17, 23, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        transform-origin: top;
        animation: nav-open var(--dur-ui) var(--ease-out);
    }

    @keyframes nav-open {
        from {
            opacity: 0;
            transform: scaleY(0.95);
        }
        to {
            opacity: 1;
            transform: scaleY(1);
        }
    }

    .nav-menu.active ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-menu.active li a {
        display: block;
        padding: 0.85rem 0;
        font-size: 0.95rem;
        color: var(--text);
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active li:last-child a {
        border-bottom: none;
    }

    /* Menu close: exit animation, then the panel is removed by JS after 160ms
       (--dur-exit; keep the JS timeout in sync with it) */
    .nav-menu.closing { animation: nav-close var(--dur-exit) var(--ease-out) forwards; }
    @keyframes nav-close {
        from { opacity: 1; transform: scaleY(1); }
        to   { opacity: 0; transform: scaleY(0.95); }
    }

    .mobile-menu-btn.active span {
        transition-duration: var(--dur-exit);
    }

    /* Stacked layouts */
    .works-grid-page,
    .contact-page-wrap,
    .about-strip-inner {
        grid-template-columns: 1fr;
    }

    .contact-page-wrap {
        gap: var(--space-6);
        padding-block: calc(var(--header-h) + var(--space-6)) var(--space-6);
    }

    .process-panel {
        position: static;
        min-height: 0;
    }

    .hero {
        min-height: auto;
        padding-block: calc(var(--header-h) + var(--space-7)) var(--space-6);
    }
}

@media (max-width: 580px) {
    :root {
        --section-pad: 3.25rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats {
        gap: var(--space-4);
    }

    .marquee-section {
        gap: var(--space-3);
    }

    .marquee-label {
        padding-left: var(--space-5);   /* sits on the page margin (.container padding) */
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .works-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .contact-right {
        padding: var(--space-4);
    }
}
