:root {
    --black: #0a0a0a;
    --deep: #111111;
    --surface: #161616;
    --edge: #242424;
    --rule: #333333;
    --muted: #555555;
    --mid: #888888;
    --light: #cccccc;
    --white: #f0ede8;
    --ivory: #e8e4dc;
    --gold: #c9a84c;
    --gold-dim: #7a6330;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Fluid type scale: 16px @ ≤1280px → 18px @ 1440px → 24px @ 1920px → 26px @ 2560px+ */
    font-size: clamp(16px, 1.25vw, 26px);
}

body {
    background: var(--black);
    color: var(--white);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
    cursor: default;
}

/* ── Grain overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1000;
    opacity: 0.4;
}

/* ── Nav ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 3rem;
    background: rgba(10,10,10,0.68);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.nav-mark {
    font-family: 'Cormorant SC', serif;
    font-size: 0.8rem;
    letter-spacing: 0.35em;
    color: var(--mid);
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    /* letter-spacing adds trailing space after last glyph — shift text right by half that to recentre */
    text-indent: 0.175em;
    gap: 0.08em;
}
.nav-mark::before,
.nav-mark::after {
    content: '';
    display: block;
    height: 5px;
}
/* ::before: outer thin line (80% width) at top, inner thick line (100%) at bottom */
.nav-mark::before {
    background:
            linear-gradient(currentColor, currentColor) center top    / 80% 1px no-repeat,
            linear-gradient(currentColor, currentColor) center bottom / 100% 2px no-repeat;
}
/* ::after: inner thick line (100%) at top, outer thin line (80%) at bottom */
.nav-mark::after {
    background:
            linear-gradient(currentColor, currentColor) center top    / 100% 2px no-repeat,
            linear-gradient(currentColor, currentColor) center bottom / 80%  1px no-repeat;
}
@media (hover: hover) {
    .nav-mark:hover { color: var(--white); }
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}
.nav-links a {
    font-family: 'Cormorant SC', serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--mid);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s;
}
@media (hover: hover) {
    .nav-links a:hover { color: var(--ivory); }
}

/* Active link text colour */
.nav-links a.is-active { color: var(--ivory); }

/* ── Nav indicator ── */
/* Sits inside nav-links as a positioned li, absolutely placed over the active link */
.nav-links {
    position: relative; /* anchor for the indicator */
}

.nav-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-46%);
    pointer-events: none;
    /* width/left driven by ViewModel via CSS custom properties */
    left: var(--ind-left, 0px);
    width: var(--ind-width, 0px);
    height: 1.6em;
    /* Start hidden until ViewModel sets opacity */
    opacity: 0;
    transition:
            left    0.5s cubic-bezier(0.34, 1.35, 0.64, 1),
            width   0.4s cubic-bezier(0.34, 1.35, 0.64, 1),
            opacity 0.3s ease;
}

/* The two double-rule decorations — top (::before) and bottom (::after) */
.nav-indicator::before,
.nav-indicator::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 5px;
}
/* ::before: outer thin (80%) top, inner thick (100%) bottom */
.nav-indicator::before {
    top: 0;
    background:
            linear-gradient(currentColor, currentColor) center top    / 80%  1px no-repeat,
            linear-gradient(currentColor, currentColor) center bottom / 100% 2px no-repeat;
    color: var(--ivory);
}
/* ::after: inner thick (100%) top, outer thin (80%) bottom */
.nav-indicator::after {
    bottom: 0;
    background:
            linear-gradient(currentColor, currentColor) center top    / 100% 2px no-repeat,
            linear-gradient(currentColor, currentColor) center bottom / 80%  1px no-repeat;
    color: var(--ivory);
}

/* ── Landing ── */
.landing {
    min-height: 100vh;
    min-height: 100svh;     /* small viewport height — stable, doesn't shift with browser chrome */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    /* bottom padding must clear: scroll indicator text + gap + line + chevron + breathing room */
    padding: 6rem 2rem 5.5rem;
    box-sizing: border-box;
}

/* Radial vignette */
.landing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 70% at 50% 50%, transparent 30%, rgba(10,10,10,0.7) 100%);
    pointer-events: none;
}

/* Background ghost watch layers — each rotates independently */
.landing-bg-layer {
    position: absolute;
    width: 110vmin;
    height: 110vmin;
    opacity: 0.03;
}

/* Parallax wrapper — translateY applied by JS, rotation stays on each child SVG */
.landing-bg-layers {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    overflow: hidden;
}

.landing-content {
    will-change: transform;
}

@keyframes rot-cw-slow   { to { transform: rotate( 360deg); } }
@keyframes rot-ccw-slow  { to { transform: rotate(-360deg); } }
@keyframes rot-cw-mid    { to { transform: rotate( 360deg); } }
@keyframes rot-ccw-mid   { to { transform: rotate(-360deg); } }

.landing-bg-outer   { animation: rot-cw-slow  240s linear infinite; transform-origin: 51.2% 50.8%; }
.landing-bg-inner   { animation: rot-ccw-slow 185s linear infinite; transform-origin: 49.6% 51.4%; }
.landing-bg-ticks   { animation: rot-cw-mid   120s steps(600) infinite; }
.landing-bg-cross   { animation: rot-ccw-mid  360s linear infinite; }

.landing-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    animation: fadeUp 1.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.landing-logo {
    width: min(300px, 55vw);
    height: auto;
    animation: fadeUp 1.6s ease both;
}

/* Real SVG mark */
.logo-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Real SVG wordmark */
.landing-wordmark {
    width: min(480px, 80vw);
    animation: fadeUp 1.8s ease both;
    opacity: 0.9;
}
.wordmark-svg {
    width: 100%;
    height: auto;
    display: block;
}

.landing-tagline {
    font-family: 'Cormorant SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.5em;
    color: var(--mid);
    text-transform: uppercase;
    text-align: center;
    animation: fadeUp 2s ease both;
}

.landing-cta-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    animation: fadeUp 2.2s ease both;
}

.btn {
    font-family: 'Cormorant SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.9rem 2rem;
    border: 1px solid;
    transition: all 0.4s;
    cursor: pointer;
    background: none;
}

.btn-primary {
    border-color: var(--white);
    color: var(--black);
    background: var(--white);
}
.btn-primary:hover {
    background: transparent;
    color: var(--white);
}

.btn-ghost {
    border-color: var(--rule);
    color: var(--mid);
}
.btn-ghost:hover {
    border-color: var(--mid);
    color: var(--white);
}

.scroll-indicator {
    position: absolute;
    bottom: max(1.5rem, 2.5vh);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    animation: fadeUp 2.5s ease both;
}
.scroll-indicator span {
    font-family: 'Cormorant SC', serif;
    font-size: 0.55rem;
    letter-spacing: 0.4em;
    /* compensate for trailing letter-spacing gap */
    text-indent: 0.4em;
    color: var(--muted);
    text-transform: uppercase;
}
.scroll-line {
    position: relative;
    width: 1px;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--muted));
    animation: scrollPulse 2s ease infinite;
}
/* Chevron arrowhead at the bottom of the line */
.scroll-line::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-right: 1px solid var(--muted);
    border-bottom: 1px solid var(--muted);
    transform: translateX(-50%) rotate(45deg);
}
@keyframes scrollPulse {
    0%   { opacity: 0; transform: translateY(-8px); }
    40%  { opacity: 1; }
    100% { opacity: 0; transform: translateY(4px); }
}

/* ── Section base ── */
section {
    padding: 7rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.full-width {
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.section-rule {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.section-rule::before, .section-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--rule);
}
.section-label {
    font-family: 'Cormorant SC', serif;
    font-size: 0.6rem;
    letter-spacing: 0.5em;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
    color: var(--ivory);
    margin-bottom: 1.5rem;
}

h2 em {
    font-style: normal;
    font-weight: 600;
    color: #d4b896;
}

/* ── Services ── */
.services-bg {
    background: var(--deep);
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
}

.services-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: 4rem;
    border: 1px solid var(--edge);
}

.service-card {
    padding: 3rem 2.5rem;
    border-right: 1px solid var(--edge);
    position: relative;
    transition: background 0.4s;
}
.service-card:last-child { border-right: none; }
.service-card:hover { background: var(--surface); }

.service-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    margin-bottom: 2rem;
}

.service-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.service-title {
    font-family: 'Cormorant SC', serif;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: var(--ivory);
    margin-bottom: 1rem;
    font-weight: 400;
}

.service-desc {
    font-size: 0.9rem;
    color: var(--mid);
    line-height: 1.8;
    font-weight: 300;
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-family: 'Cormorant SC', serif;
    font-size: 0.6rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.3s;
}
.service-link:hover { color: var(--white); }
.service-link::after { content: '→'; font-size: 0.9rem; }

/* ── About ── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.about-text p {
    font-size: 1.05rem;
    color: var(--light);
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.9;
}

.about-text p:first-of-type::first-letter {
    font-size: 3.5rem;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.1em;
    font-family: 'IM Fell English', serif;
    color: var(--ivory);
}

.about-visual {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--edge);
}

.stat-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--deep);
    transition: background 0.3s;
}
.stat-row:hover { background: var(--surface); }

.stat-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--ivory);
    letter-spacing: -0.02em;
    line-height: 1;
}

.stat-label {
    font-family: 'Cormorant SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    text-transform: uppercase;
    line-height: 1.5;
}

.stat-note {
    position: relative;
    color: #d4b896;
    cursor: help;
    margin-left: 0.2em;
    font-size: 1.2em;
}

.stat-note::after {
    content: attr(data-note);
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--deep);
    border: 1px solid var(--edge);
    color: var(--mid);
    font-family: 'Georgia', serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.5;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    width: max-content;
    max-width: 260px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.stat-note:hover::after {
    opacity: 1;
}

/* ── Process ── */
.process-bg {
    background: var(--surface);
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
}

.process-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 3rem;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3rem;
    margin-top: 4rem;
    position: relative;
}

.process-connector {
    position: absolute;
    background: var(--rule);
    transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

.process-step {
    position: relative;
    z-index: 1;
}

/* Node dot — sized as a proper circle, line passes behind it */
.step-dot {
    width: 13px;
    height: 13px;
    border: 1px solid var(--mid);
    background: var(--surface);
    border-radius: 50%;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.step-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.step-title {
    font-family: 'Cormorant SC', serif;
    font-size: 1rem;
    color: var(--ivory);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.step-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.8;
    font-weight: 300;
}

/* ── Marquee ── */
.marquee-section {
    overflow: hidden;
    border-top: 1px solid var(--edge);
    border-bottom: 1px solid var(--edge);
    padding: 1.5rem 0;
    background: var(--deep);
}

.marquee-track {
    display: flex;
    gap: 4rem;
    padding-right: 4rem;
    animation: marquee 30s linear infinite;
    width: max-content;
}

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

.marquee-item {
    font-family: 'Cormorant SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    color: var(--muted);
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4rem;
}

.marquee-item::after {
    content: '◆';
    font-size: 0.4rem;
    color: var(--rule);
}

/* ── Contact ── */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

.contact-intro h2 { margin-bottom: 1rem; }

.contact-intro p {
    font-size: 1rem;
    color: var(--mid);
    font-weight: 300;
    line-height: 1.9;
    margin-bottom: 2rem;
}

.contact-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--edge);
}

.detail-label {
    font-family: 'Cormorant SC', serif;
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    color: var(--muted);
    text-transform: uppercase;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--light);
    font-weight: 300;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}


.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-family: 'Cormorant SC', serif;
    font-size: 0.6rem;
    letter-spacing: 0.4em;
    color: var(--muted);
    text-transform: uppercase;
}

input, textarea, select {
    background: var(--deep);
    border: 1px solid var(--edge);
    border-bottom-color: var(--rule);
    color: var(--white);
    padding: 0.85rem 1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 300;
    transition: border-color 0.3s;
    outline: none;
    -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--mid);
    background: var(--surface);
}

input::placeholder, textarea::placeholder {
    color: var(--muted);
    font-style: italic;
}

textarea { resize: vertical; min-height: 120px; }

select option { background: var(--deep); }

.field-error { border-color: #a04040; }

.validation-error {
    color: #c06060;
    font-size: 0.8rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--edge);
    padding: 2rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-mark {
    font-family: 'Cormorant SC', serif;
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    color: var(--muted);
}

.footer-copy {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    color: var(--muted);
    font-style: italic;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3rem; }

/* ── Hover gear spin ── */
.spin-hover { transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); }
.spin-hover:hover { transform: rotate(15deg); }
/* ── Mobile nav ── */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {

    nav {
        flex-direction: column;
        align-items: center;
        gap: 0.4rem;
        padding: 0.75rem 0 0.6rem;
        width: 100%;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    nav.nav--hidden {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }

    /* Centre the BMBS mark and scale it up slightly so it reads at nav size */
    .nav-mark {
        font-size: 0.9rem;
    }

    /* Full-width scrollable link row, centered when it fits, left-anchored when it overflows */
    .nav-links {
        width: 100%;
        justify-content: safe center;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 1.5rem;
        padding: 0 1.5rem 0.15rem;
        flex-wrap: nowrap;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    }
    .nav-links::-webkit-scrollbar { display: none; }

    /* Services — single column stack */
    .services-grid {
        grid-template-columns: 1fr;
    }
    .service-card {
        border-right: none;
        border-bottom: 1px solid var(--edge);
    }
    .service-card:last-child { border-bottom: none; }

    /* About — single column */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Process — vertical layout, connector on left */
    .process-steps {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 3rem;
        padding-left: 2rem;
    }

    /* Each step: dot floats left of text */
    .process-step {
        display: flex;
        gap: 1.5rem;
        padding-bottom: 2.5rem;
    }
    .process-step:last-child { padding-bottom: 0; }

    .step-dot {
        flex-shrink: 0;
        margin-bottom: 0;
        margin-top: 0.15rem;
        position: relative;
        left: -2.43rem; /* pull back to sit on the connector line */
    }

    .step-body { flex: 1; }

    /* Contact — single column */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Footer — stack centred */
    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem;
    }
    .nav-indicator { display: none; }
    .nav-links a.is-active { color: var(--ivory); }

    /* Push landing content clear of the taller two-row nav */
    .landing { padding-top: 8rem; }
}