/* Self-hosted Jost (SIL Open Font License), latin + latin-ext, variable weight */
@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('../themes/nonox-v2/assets/fonts/jost-normal-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('../themes/nonox-v2/assets/fonts/jost-normal-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Nonox 2 - compact, technical design
   Navy + clean-energy accent, hairlines, 4px grid, small radii.
   ========================================================================== */

:root {
    --navy:       #001236;
    --navy-800:   #0A1D45;
    --navy-700:   #16295A;
    --accent:     #14D1A0;
    --accent-ink: #007A5E;           /* accent for text on light backgrounds (AA) */
    --ink:        #0E1A33;
    --muted:      #5B6679;
    --line:       #DCE2EC;
    --bg:         #FFFFFF;
    --bg-alt:     #F3F5F9;

    --font: 'Jost', 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --wrap: 1160px;
    --gutter: 20px;
    --radius: 4px;
    --header-h: 56px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
    margin: 0; overflow-x: hidden;
    font: 400 1rem/1.55 var(--font);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 .9em; }
h1, h2, h3, h4 {
    font-family: var(--font); font-weight: 500; color: var(--navy);
    line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em;
}
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; z-index: 300; background: var(--accent); color: var(--navy); padding: .5rem .9rem; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow {
    font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
    color: var(--accent-ink); margin: 0 0 .75rem;
    display: flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ''; width: 18px; height: 2px; background: currentColor; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: 500 .85rem/1 var(--font); letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
    padding: .8rem 1.25rem; border: 1px solid var(--accent); border-radius: var(--radius);
    background: var(--accent); color: var(--navy); cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.btn:hover { background: #fff; border-color: #fff; color: var(--navy); }
.btn-block { display: flex; width: 100%; }
.text-link, .arrow-link { font-weight: 500; color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; }
.text-link:hover, .arrow-link:hover { color: var(--accent-ink); }
.arrow-link::after { content: '\2192'; margin-left: .4rem; display: inline-block; transition: transform .2s; }
a:hover > .arrow-link::after, .arrow-link:hover::after { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: saturate(160%) blur(8px); backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--line); transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 2px 14px rgba(0, 18, 54, .08); }
.header-main { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-name { font-weight: 500; letter-spacing: .08em; color: var(--navy); }

.menu-toggle { display: none; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; padding: 0; position: relative; }
.menu-toggle .bars, .menu-toggle .bars::before, .menu-toggle .bars::after {
    position: absolute; left: 10px; width: 20px; height: 2px; background: var(--navy); content: ''; transition: transform .2s, top .2s, opacity .2s;
}
.menu-toggle .bars { top: 19px; }
.menu-toggle .bars::before { top: -6px; left: 0; }
.menu-toggle .bars::after { top: 6px; left: 0; }
.menu-open .menu-toggle .bars { background: transparent; }
.menu-open .menu-toggle .bars::before { top: 0; transform: rotate(45deg); }
.menu-open .menu-toggle .bars::after { top: 0; transform: rotate(-45deg); }

.menu-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .25rem; }
.menu-list > li { position: relative; display: flex; align-items: center; }
.menu-list a {
    display: block; padding: .5rem .75rem; font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--ink);
    border-radius: var(--radius); position: relative; white-space: nowrap;
}
.menu-list > li > a::after {
    content: ''; position: absolute; left: .75rem; right: .75rem; bottom: .2rem; height: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: left; transition: transform .2s;
}
.menu-list > li > a:hover::after, .menu-list > li > a.is-active::after { transform: scaleX(1); }
.sub-toggle { display: none; }
.has-sub > a { padding-right: .35rem; }
.has-sub::after { content: ''; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); margin-right: .4rem; pointer-events: none; }
.sub-list {
    list-style: none; margin: 0; padding: .4rem; position: absolute; top: 100%; left: 0; min-width: 220px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 28px rgba(0, 18, 54, .12);
    opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.has-sub:hover > .sub-list, .has-sub:focus-within > .sub-list, .has-sub.is-open > .sub-list { opacity: 1; visibility: visible; transform: none; }
.sub-list a { font-weight: 400; font-size: .85rem; text-transform: none; white-space: normal; padding: .45rem .7rem; }
.sub-list a:hover, .sub-list a.is-active { background: var(--bg-alt); color: var(--accent-ink); }

/* ---------- Hero slider ---------- */
.hero { position: relative; background: var(--navy); color: #fff; overflow: hidden; }
.hero-slides { position: relative; min-height: clamp(400px, 56vh, 540px); display: grid; }
.slide { grid-area: 1 / 1; position: relative; display: flex; align-items: center; padding: 56px 0 72px; }
.slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.slide::before {
    content: ''; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, var(--navy) 0%, rgba(0, 18, 54, .78) 38%, rgba(0, 18, 54, .15) 100%);
}
.slide::after { /* technical grid overlay */
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.slide-copy { position: relative; z-index: 2; }
.slide-copy > * { max-width: 640px; }
.hero .eyebrow { color: var(--accent); }
.hero-title { color: #fff; font-size: clamp(1.9rem, 4.6vw, 3.2rem); font-weight: 500; margin: 0 0 .5rem; letter-spacing: -.015em; }
.hero-sub { font-size: 1.1rem; color: rgba(255, 255, 255, .8); margin-bottom: 1.25rem; }
.hero .btn:hover { background: #fff; border-color: #fff; }
.hero.is-js .slide { opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s; }
.hero.is-js .slide.is-active { opacity: 1; visibility: visible; z-index: 2; }
.hero-controls {
    position: absolute; left: 0; right: 0; bottom: 20px; z-index: 5;
    display: flex; align-items: center; justify-content: space-between; pointer-events: none;
    left: 50%; transform: translateX(-50%);
}
.hero-controls > * { pointer-events: auto; }
.hero-dots { display: flex; gap: 6px; }
.hero-dots button { width: 28px; height: 4px; border: 0; padding: 0; background: rgba(255, 255, 255, .3); cursor: pointer; border-radius: 2px; transition: background .2s, width .2s; }
.hero-dots button.is-active { background: var(--accent); width: 44px; }
.hero-arrows { display: flex; gap: 6px; }
.hero-arrows button {
    width: 36px; height: 36px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(0, 18, 54, .4); border-radius: var(--radius);
    cursor: pointer; position: relative; transition: background .2s, border-color .2s;
}
.hero-arrows button:hover { background: var(--accent); border-color: var(--accent); }
.hero-arrows button::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; border: solid #fff; border-width: 0 0 2px 2px;
}
.hero-arrows .prev::before { transform: translate(-30%, -50%) rotate(45deg); }
.hero-arrows .next::before { transform: translate(-70%, -50%) rotate(-135deg); }
.hero-arrows button:hover::before { border-color: var(--navy); }

/* ---------- Key figures ---------- */
.figures { background: var(--navy-800); color: #fff; border-top: 1px solid rgba(255, 255, 255, .08); }
.figures-grid ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figures-grid li { padding: 18px 20px; border-left: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; line-height: 1.35; color: rgba(255, 255, 255, .72); }
.figures-grid li:first-child { border-left: 0; padding-left: 0; }
.figures-grid li strong { display: block; font: 500 1.75rem/1.1 var(--font); color: var(--accent); letter-spacing: -.01em; margin-bottom: 2px; }
.figures-grid li a { color: inherit; }

/* ---------- Sections ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }

.about-grid { display: grid; grid-template-columns: 280px 1fr; gap: 40px; align-items: start; }
.about-head h2 { margin-bottom: 1rem; }
.about-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { position: relative; padding: 20px 18px 6px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-size: .95rem; }
.card::before { content: attr(data-n); display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; color: var(--accent-ink); margin-bottom: .75rem; }
.card::after { content: ''; position: absolute; left: -1px; top: -1px; width: 28px; height: 3px; background: var(--accent); border-radius: var(--radius) 0 0 0; }
.card p:last-child { margin-bottom: 14px; }
.card h3 { font-size: 1.05rem; }

/* ---------- Projects ---------- */
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-card {
    display: flex; flex-direction: column; text-decoration: none; background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.project-card:hover { border-color: var(--accent); box-shadow: 0 8px 22px rgba(0, 18, 54, .1); transform: translateY(-2px); }
.project-thumb { display: block; aspect-ratio: 8 / 5; background: var(--navy-800) linear-gradient(135deg, var(--navy-800), var(--navy-700)); overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.project-card:hover .project-thumb img { transform: scale(1.04); }
.project-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.project-body h3 { margin: 0; font-size: 1rem; letter-spacing: .02em; text-transform: uppercase; }
.project-body p { margin: 0; font-size: .9rem; color: var(--muted); }
.project-body .arrow-link { margin-top: auto; padding-top: 8px; font-size: .85rem; align-self: flex-start; border-bottom: 0; color: var(--accent-ink); }

/* ---------- Partners ---------- */
.partner-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.partner-grid li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); height: 76px; display: flex; align-items: center; justify-content: center; padding: 12px 16px; }
.partner-grid a { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; }
.partner-grid img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.partner-grid li:hover img { filter: none; opacity: 1; }

/* ---------- Call to action ---------- */
.cta { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.cta::before {
    content: ''; position: absolute; inset: 0; opacity: .6;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.cta-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 28px; padding-bottom: 28px; }
.cta h2 { color: #fff; margin: 0; }

/* ---------- Page header (inner pages) ---------- */
.page-header { position: relative; background: var(--navy); color: #fff; padding: 36px 0 32px; overflow: hidden; }
.page-header-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.page-header::after {
    content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
    background-size: 40px 40px;
}
.page-header .wrap { position: relative; z-index: 2; }
.page-header h1 { color: #fff; margin: 0; font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.crumbs { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; font: 400 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .65); }
.crumbs li + li::before { content: '/'; margin-right: .4rem; color: var(--accent); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: #fff; }

/* ---------- Prose (static pages, project content) ---------- */
.prose-wrap { max-width: 920px; }
.prose { font-size: 1.02rem; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose a { color: var(--accent-ink); text-underline-offset: 2px; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent-ink); }
.prose img { max-width: 100% !important; height: auto !important; border-radius: var(--radius); }
.prose p > img.fr-fic { margin: .5rem auto; }
.prose .fr-dib { display: block; margin-left: auto; margin-right: auto; }
/* tame the editor's inline font sizes */
.prose span[style*="font-size: 18px"] { font-size: 1.0625rem !important; }
.prose span[style*="font-size: 24px"] { font-size: 1.35rem !important; }
.prose span[style*="font-size: 30px"] { font-size: clamp(1.4rem, 3vw, 1.9rem) !important; line-height: 1.25; color: var(--navy); }
.prose iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: var(--navy); }
.prose table { width: 100% !important; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.prose td, .prose th { border: 1px solid var(--line); padding: 10px 12px; vertical-align: top; }
.prose th { background: var(--bg-alt); text-align: left; }
.prose blockquote { margin: 1.2em 0; padding: .4em 0 .4em 1em; border-left: 3px solid var(--accent); color: var(--navy); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.prose .lead, .lead { font-size: 1.15rem; color: var(--navy); }


/* ---------- Content pages (static pages) ---------- */

.page-static .prose h2 { position: relative; padding-left: 14px; font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 1.8em 0 .6em; }
.page-static .prose h2::before { content: ''; position: absolute; left: 0; top: .15em; bottom: .15em; width: 4px; background: var(--accent); border-radius: 2px; }
.page-static .prose h3.id-color { display: inline-block; font: 500 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .7rem; margin-bottom: 1rem; }



/* figures: framed like a technical drawing */
.prose .fig { margin: 1.6em 0 .6em; padding: 14px; text-align: center !important; border: 1px solid var(--line); border-radius: var(--radius); position: relative;
    background-color: var(--bg-alt);
    background-image: linear-gradient(rgba(0, 18, 54, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 18, 54, .045) 1px, transparent 1px); background-size: 24px 24px; }
.prose .fig img { margin: 0 auto; display: block; background: #fff; }
.prose .fig-caption { font: 400 .78rem/1.5 var(--mono); color: var(--muted); margin: 0 0 1.6em; padding-left: 10px; border-left: 2px solid var(--line); }

/* pull quote */
.prose .pull { margin: 0 0 1.4em; padding: 28px 24px; text-align: center !important; background: var(--navy); border-radius: var(--radius); position: relative; overflow: hidden;
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 32px 32px; }
.prose .pull::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--accent); }
.prose .pull strong, .prose .pull span { color: #fff !important; font-weight: 500; font-size: clamp(1.25rem, 2.6vw, 1.7rem) !important; line-height: 1.3; }

/* key points as numbered tiles */
.prose .tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 1.2em 0 1.6em; counter-reset: tile; }
.prose .tile { margin: 0; padding: 16px 16px 16px 16px; text-align: left !important; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; position: relative; counter-increment: tile; }
.prose .tile::before { content: '0' counter(tile); display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; color: var(--accent-ink); margin-bottom: .6rem; }
.prose .tile::after { content: ''; position: absolute; left: -1px; top: -1px; width: 28px; height: 3px; background: var(--accent); }
.prose .tile strong, .prose .tile span { font-size: 1.05rem !important; line-height: 1.35; color: var(--navy); font-weight: 500; }

/* centred statement lines (Benefits) */
.page-static .prose p[style*="center"] > span[style*="24px"] { color: var(--navy); }

/* lists as stacked spec rows */
.page-static .prose ul { list-style: none; padding: 0; border-top: 1px solid var(--line); margin: 1.2em 0 1.6em; }
.page-static .prose ul li { position: relative; padding: 11px 0 11px 26px; margin: 0; border-bottom: 1px solid var(--line); }
.page-static .prose ul li::before { content: ''; position: absolute; left: 2px; top: 1.05em; width: 10px; height: 10px; border: 2px solid var(--accent); border-radius: 2px; transform: rotate(45deg) scale(.8); }
.page-static .prose ul ul { margin: .6em 0 0; }
.page-static .prose ul li span { font-size: 1rem !important; }
.page-static .prose ol { counter-reset: n; list-style: none; padding: 0; }
.page-static .prose ol li { counter-increment: n; position: relative; padding: 8px 0 8px 36px; }
.page-static .prose ol li::before { content: counter(n); position: absolute; left: 0; top: 8px; width: 24px; height: 24px; border-radius: var(--radius); background: var(--navy); color: var(--accent); font: 500 .75rem/24px var(--mono); text-align: center; }

/* tables as spec sheets */
.page-static .prose table { border: 0; }
.page-static .prose td, .page-static .prose th { border: 1px solid var(--line); background: #fff; }
.page-static .prose tr:first-child td { background: var(--navy); color: #fff; border-color: var(--navy); border-top: 3px solid var(--accent); }
.page-static .prose tr:first-child td * { color: #fff !important; font-size: .95rem !important; }
.page-static .prose td img { margin: 8px auto; }

.page-static .prose a[target="_blank"] img { transition: opacity .2s; }
.page-static .prose a[target="_blank"]:hover img { opacity: .85; }


/* ---------- Project detail ---------- */
.project-layout { display: grid; grid-template-columns: 1fr 260px; gap: 40px; align-items: start; }
.project-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 12px; }
.project-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 6px 20px rgba(0, 18, 54, .05); }
.project-nav-title { margin: 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: #fff; border-top: 3px solid var(--accent); font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.project-nav-title span { color: var(--navy); background: var(--accent); border-radius: 10px; padding: 3px 7px; font-size: .68rem; letter-spacing: 0; }
.project-nav ul { list-style: none; margin: 0; padding: 6px; }
.pn-item { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); text-decoration: none; position: relative; transition: background .15s; }
.pn-item:hover { background: var(--bg-alt); }
.pn-thumb { flex: none; width: 48px; height: 36px; border-radius: 3px; overflow: hidden; background: var(--navy-800); }
.pn-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.6); opacity: .85; transition: filter .2s, opacity .2s; }
.pn-item:hover .pn-thumb img, .pn-item.is-active .pn-thumb img { filter: none; opacity: 1; }
.pn-title { font-size: .8rem; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; line-height: 1.25; color: var(--ink); }
.pn-item.is-active { background: var(--bg-alt); }
.pn-item.is-active::before { content: ''; position: absolute; left: -6px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--accent); }
.pn-item.is-active .pn-title { color: var(--navy); }
.pn-sub { margin-left: 22px; }
.pn-sub .pn-thumb { width: 36px; height: 28px; }
.pn-sub .pn-title { font-size: .74rem; color: var(--muted); }
.side-cta { padding: 16px; border-radius: var(--radius); background: var(--navy); color: #fff; position: relative; overflow: hidden; border-top: 3px solid var(--accent); }
.side-cta strong { display: block; font-weight: 500; font-size: 1rem; line-height: 1.3; margin-bottom: 12px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 24px; }
.gallery a { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--bg-alt); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; display: block; }
.gallery a:hover img { transform: scale(1.05); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: rgba(0, 12, 36, .88); }
.lightbox img { max-width: 94vw; max-height: 90vh; width: auto; height: auto; border-radius: var(--radius); display: block; }
.lightbox form { position: absolute; right: 0; top: -40px; margin: 0; }
.lb-close { background: none; border: 0; color: #fff; font-size: 2rem; line-height: 1; cursor: pointer; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.contact-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt); }
.contact-card h3 { margin-bottom: 1rem; }
.contact-card dl { margin: 0; }
.contact-card dt { font: 500 .7rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 14px 0 4px; }
.contact-card dt:first-child { margin-top: 0; }
.contact-card dd { margin: 0; font-size: .95rem; }
.contact-card a { text-decoration-color: var(--accent); text-underline-offset: 2px; }

.artisan-form .row { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 16px; }
.artisan-form .row > [class*="col-md-12"], .artisan-form .row > [class*="col-12"] { grid-column: 1 / -1; }
.artisan-form .form-group { margin-bottom: 14px; }
.artisan-form .form-label, .artisan-form label { display: block; font: 500 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.artisan-form .form-control, .artisan-form input[type=text], .artisan-form input[type=email], .artisan-form input[type=tel], .artisan-form textarea, .artisan-form select {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: .65rem .8rem; transition: border-color .2s, box-shadow .2s;
}
.artisan-form textarea { min-height: 150px; resize: vertical; }
.artisan-form .form-control:focus, .artisan-form textarea:focus, .artisan-form select:focus { outline: 0; border-color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(20, 209, 160, .25); }
.artisan-form .form-check { display: flex; gap: .5rem; align-items: flex-start; }
.artisan-form .form-check-label { text-transform: none; letter-spacing: 0; font: inherit; font-size: .9rem; color: var(--ink); margin: 0; }
.artisan-form .required .form-label::after { content: ' *'; color: var(--accent-ink); }
.artisan-form .btn-primary, .artisan-form button[type=submit] {
    font: 500 .85rem/1 var(--font); letter-spacing: .04em; text-transform: uppercase; padding: .85rem 1.5rem; border-radius: var(--radius);
    background: var(--navy); color: #fff; border: 1px solid var(--navy); cursor: pointer; transition: background .2s, color .2s;
}
.artisan-form .btn-primary:hover, .artisan-form button[type=submit]:hover { background: var(--accent); border-color: var(--accent); color: var(--navy); }
.artisan-message-container .alert { padding: .8rem 1rem; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-alt); }
.artisan-message-container .alert-danger { border-left-color: #D64545; background: #FDF1F1; }
.invalid-feedback, .field-error { color: #B03030; font-size: .85rem; }

/* ---------- Footer ---------- */
.site-footer { background: #000A24; color: rgba(255, 255, 255, .75); font-size: .92rem; position: relative; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-top: 40px; padding-bottom: 32px; }
.site-footer .brand-logo { height: 30px; filter: brightness(0) invert(1); margin-bottom: 14px; }
.site-footer h4 { color: var(--accent); margin-bottom: .8rem; font-family: var(--mono); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer address strong { color: #fff; font-weight: 500; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; color: rgba(255, 255, 255, .55); }
.footer-base a { color: rgba(255, 255, 255, .8); }
#back-to-top {
    position: fixed; right: 16px; bottom: 16px; width: 40px; height: 40px; border-radius: var(--radius); background: var(--accent);
    opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s, transform .2s; z-index: 90; box-shadow: 0 6px 16px rgba(0, 18, 54, .25);
}
#back-to-top::before { content: ''; position: absolute; top: 55%; left: 50%; width: 9px; height: 9px; border: solid var(--navy); border-width: 2px 0 0 2px; transform: translate(-50%, -50%) rotate(45deg); }
#back-to-top.is-visible { opacity: 1; visibility: visible; }
#back-to-top:hover { transform: translateY(-2px); }

/* ---------- Bare pages (404, error, under construction) ---------- */
.page-bare { background: var(--navy); }
.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 40px var(--gutter);
    background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 40px 40px; }
.bare-inner { max-width: 520px; }
.bare-logo { height: 44px; width: auto; filter: brightness(0) invert(1); margin: 0 auto 32px; display: block; }
.bare h1 { color: #fff; }
.bare .eyebrow { justify-content: center; color: var(--accent); }
.bare-social { display: flex; justify-content: center; gap: 1rem; margin-top: 28px; font-size: .85rem; }
.bare-social a { color: rgba(255, 255, 255, .7); }


/* ---------- Cookie notice (Matomo plugin) ---------- */
/* `html #matomo-opt-out` out-specifies the plugin CSS; display/opacity stay with the plugin. */
html #matomo-opt-out {
    left: 16px; bottom: 16px; transform: none;
    width: min(26rem, calc(100% - 32px)); max-width: none; padding: 18px 20px 16px;
    background: #000A24; color: #fff;
    border: 1px solid rgba(255, 255, 255, .14); border-top: 3px solid var(--accent); border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(0, 10, 36, .4);
    font-family: var(--font); letter-spacing: 0;
}
html #matomo-opt-out::before {
    content: 'Cookies'; display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem;
    font: 500 .72rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
html #matomo-opt-out::after { content: ''; display: block; clear: both; }
html #matomo-opt-out p { margin: 0 0 14px; padding: 0; font-size: .9rem; line-height: 1.5; color: rgba(255, 255, 255, .8); }
html #matomo-opt-out a { color: var(--accent); }
html #matomo-opt-out .matomo-buttons { display: flex; gap: 8px; justify-content: flex-start; text-align: left; }
html #matomo-opt-out button {
    font: 500 .8rem/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
    padding: .7rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--accent);
    background: var(--accent); color: var(--navy); transition: background .2s, color .2s;
}
html #matomo-opt-out button.cookie-consent-button { background: var(--accent); color: var(--navy); border-color: var(--accent); }
html #matomo-opt-out button:hover, html #matomo-opt-out button.cookie-consent-button:hover { background: #fff; border-color: #fff; color: var(--navy); }
html #matomo-opt-out button.cookie-no-content-button { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); }
html #matomo-opt-out button.cookie-no-content-button:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
@media (max-width: 480px) {
    html #matomo-opt-out { left: 8px; bottom: 8px; width: calc(100% - 16px); }
    html #matomo-opt-out .matomo-buttons button { flex: 1 1 0; }
}

/* ---------- Rendering performance ---------- */
.partners, .cta { content-visibility: auto; contain-intrinsic-size: auto 320px; }
.brand-logo { width: auto; }
.slide-bg { aspect-ratio: 1600 / 760; }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .about-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .about-cols { grid-template-columns: minmax(0, 1fr); }
    .project-grid { grid-template-columns: repeat(2, 1fr); }
    .figures-grid ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .figures-grid li:nth-child(3) { border-left: 0; padding-left: 0; }
    .figures-grid li:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .1); }
    .project-layout, .contact-grid { grid-template-columns: 1fr; gap: 24px; }
    .project-side { position: static; order: 2; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .menu-toggle { display: block; }
    .site-nav {
        position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
        max-height: 0; overflow: hidden; visibility: hidden; transition: max-height .3s ease, visibility .3s;
    }
    .menu-open .site-nav { max-height: calc(100vh - var(--header-h)); overflow-y: auto; visibility: visible; }
    .menu-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gutter) 16px; }
    .menu-list > li { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
    .menu-list > li:last-child { border-bottom: 0; }
    .menu-list > li > a { flex: 1; padding: .8rem 0; }
    .menu-list > li > a::after, .has-sub::after { display: none; }
    .sub-toggle { display: block; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; position: relative; }
    .sub-toggle::before { content: ''; position: absolute; top: 50%; left: 50%; width: 7px; height: 7px; border: solid var(--navy); border-width: 0 2px 2px 0; transform: translate(-50%, -70%) rotate(45deg); transition: transform .2s; }
    .is-open > .sub-toggle::before { transform: translate(-50%, -30%) rotate(-135deg); }
    .sub-list { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 8px 12px; display: none; min-width: 0; }
    .has-sub.is-open > .sub-list { display: block; }
    .has-sub:hover > .sub-list { display: none; }
    .has-sub.is-open:hover > .sub-list { display: block; }
}
@media (max-width: 640px) {
    :root { --gutter: 16px; }
    .section { padding: 36px 0; }
    .project-grid { grid-template-columns: minmax(0, 1fr); }
    .hero-slides { min-height: 440px; }
    .slide { padding: 40px 0 72px; }
    .slide::before { background: linear-gradient(180deg, rgba(0, 18, 54, .55), var(--navy) 95%); }
    .cta-inner, .section-head-row { flex-direction: column; align-items: flex-start; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .artisan-form .row { grid-template-columns: 1fr; }
    .prose table, .prose tbody, .prose tr, .prose td { display: block; width: 100% !important; }
    .prose td { border-width: 0 0 1px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .js .reveal { opacity: 1; transform: none; }
}
@media print {
    .site-header, .hero-controls, .cta, #back-to-top { display: none !important; }
}
