/* ==========================================================================
   Habrix design system (shared by every page), in two themes.
   Light: cool-white surfaces, graphite ink. Dark: near-black surfaces, silver ink.
   One accent in both: cyan flowing into violet. The theme is the data-theme
   attribute on <html> (set before first paint, toggled by site.js). Tokens
   first; every component draws from them. The 3D gallery mirrors the light
   colours in assets/js/works/palette.js.
   ========================================================================== */

/* .theme-light pins a region to the light palette in either theme (the 3D venue is always daylight) */
:root,
.theme-light {
    /* Surfaces */
    --bg: #F5F7FA;
    --bg-deep: #E9EEF3;
    --surface: #FFFFFF;
    --surface-2: #EEF2F6;
    --surface-3: #E2EBF4;

    /* Ink */
    --ink: #0F1720;
    --ink-2: #3A4756;
    --ink-3: #56657A;
    --line: rgba(15, 23, 32, 0.08);
    --line-strong: rgba(15, 23, 32, 0.14);

    /* Accent. The "-ink" tones are the text-safe versions (4.5:1 on white). */
    --cyan: #00BFD0;
    --cyan-hi: #5EEAF5;
    --cyan-ink: #006B76;
    --violet: #7B6CFF;
    --violet-ink: #5F54E8;
    --grad: linear-gradient(135deg, #00808F 0%, #5F54E8 100%);
    --grad-bright: linear-gradient(135deg, #00D4E6 0%, #7B6CFF 100%);
    --error: #C0463A;
    --ok: #1C7A5A;
    --grad-a: #00808F;
    --grad-b: #5F54E8;
    --on-grad: #FFFFFF;

    /* Theme-dependent surfaces and states */
    color-scheme: light;
    --nav-bg: rgba(255, 255, 255, 0.76);
    --nav-bg-top: rgba(255, 255, 255, 0.4);
    --nav-shadow: 0 8px 30px -22px rgba(15, 23, 32, 0.35);
    --menu-bg: rgba(255, 255, 255, 0.97);
    --hover-tint: rgba(15, 23, 32, 0.06);
    --btn-hover-bg: #F2FBFC;
    --btn-hover-line: rgba(0, 122, 136, 0.5);
    --line-hover: rgba(15, 23, 32, 0.24);
    --panel-bg: #0F1720;
    --panel-line: transparent;
    --wm-top: #0F1720;
    --wm-bottom: #2B3745;
    --dot-glow: transparent;
    --intro-ink: 15, 23, 32;
    --intro-accent: 0, 150, 165;
    --field-dot: 15, 23, 32;
    --field-hot: 0, 150, 165;
    --field-boost: 0.7;

    /* Glass */
    --glass: rgba(255, 255, 255, 0.8);
    --glass-strong: rgba(255, 255, 255, 0.92);
    --glass-blur: blur(18px) saturate(1.4);

    /* Depth: cool, soft, never black */
    --shadow-1: 0 1px 2px rgba(15, 23, 32, 0.06), 0 6px 16px -10px rgba(15, 23, 32, 0.25);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 18px 40px -22px rgba(15, 23, 32, 0.38);
    --shadow-3: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 28px 64px -28px rgba(15, 23, 32, 0.5);
    --shadow-accent: 0 12px 26px -12px rgba(0, 128, 143, 0.7);
    --shadow-accent-hi: 0 16px 30px -12px rgba(0, 128, 143, 0.8);

    /* Shape */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-pill: 999px;

    /* Motion */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --nav-h: 72px;
    --gutter: clamp(20px, 4.4vw, 64px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);

    /* Type: Manrope for identity, Inter for reading, mono for labels */
    --font-head: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Dark theme: the original Habrix look, refined. Same tokens, different values. */
:root[data-theme='dark'] {
    color-scheme: dark;
    --bg: #090A0C;
    --bg-deep: #06070A;
    --surface: #101216;
    --surface-2: #0D0F12;
    --surface-3: #171A1F;

    --ink: #F3F4F6;
    --ink-2: #C2C8D0;
    --ink-3: #8D95A0;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.15);

    --cyan: #5BE7F2;
    --cyan-hi: #8FF3FA;
    --cyan-ink: #5BE7F2;
    --violet: #9A8DFF;
    --violet-ink: #A79CFF;
    --grad: linear-gradient(135deg, #5BE7F2 0%, #9A8DFF 100%);
    --grad-bright: linear-gradient(135deg, #5BE7F2 0%, #A79CFF 100%);
    --grad-a: #5BE7F2;
    --grad-b: #A79CFF;
    --on-grad: #04202A;
    --error: #FF9C8F;
    --ok: #7EE2B8;

    --glass: rgba(16, 18, 22, 0.8);
    --glass-strong: rgba(16, 18, 22, 0.92);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 16px -10px rgba(0, 0, 0, 0.7);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 18px 40px -22px rgba(0, 0, 0, 0.8);
    --shadow-3: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 28px 64px -28px rgba(0, 0, 0, 0.9);
    --shadow-accent: 0 10px 28px -12px rgba(91, 231, 242, 0.45);
    --shadow-accent-hi: 0 16px 36px -12px rgba(91, 231, 242, 0.6);

    --nav-bg: rgba(9, 10, 12, 0.88);
    --nav-bg-top: rgba(9, 10, 12, 0.3);
    --nav-shadow: none;
    --menu-bg: rgba(12, 13, 16, 0.98);
    --hover-tint: rgba(255, 255, 255, 0.07);
    --btn-hover-bg: rgba(91, 231, 242, 0.08);
    --btn-hover-line: rgba(91, 231, 242, 0.55);
    --line-hover: rgba(255, 255, 255, 0.3);
    --panel-bg: #0E1115;
    --panel-line: rgba(255, 255, 255, 0.1);
    --wm-top: #FFFFFF;
    --wm-bottom: #9AA7B4;
    --dot-glow: rgba(91, 231, 242, 0.85);
    --intro-ink: 236, 241, 246;
    --intro-accent: 91, 231, 242;
    --field-dot: 210, 222, 232;
    --field-hot: 91, 231, 242;
    --field-boost: 1;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

html {
    background-color: var(--bg-deep);
    scrollbar-width: none;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--nav-h);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--ink-2);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
.wordmark,
.g-btn,
.nav-link,
.nav-cta,
.text-link,
.footer-cta,
.footer-mark-word,
.mobile-menu a {
    font-family: var(--font-head);
}

h1,
h2,
h3,
p,
dl,
dd,
figure,
ul {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

a {
    -webkit-tap-highlight-color: transparent;
}

img {
    display: block;
    max-width: 100%;
}

input,
textarea,
select {
    font: inherit;
    color: inherit;
}

::selection {
    background: rgba(0, 191, 208, 0.28);
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--cyan-ink);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: -64px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--bg);
    font-size: 14px;
    font-weight: 700;
    transition: top 0.25s var(--ease-out);
}

.skip-link:focus {
    top: 16px;
}

.material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    font-variation-settings: 'wght' 400, 'FILL' 0;
    user-select: none;
}

/* Eyebrow: hairline, index word, label (the same device the home page uses) */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-3);
    font-family: var(--font-mono);
    font-size: clamp(13px, 1.1vw, 14px);
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.eyebrow::before {
    content: '';
    flex: none;
    width: 30px;
    height: 1px;
    background: linear-gradient(to right, var(--cyan-ink), transparent);
}

.eyebrow .idx {
    color: var(--cyan-ink);
    font-weight: 500;
}

.g-eyebrow {
    color: var(--cyan-ink);
    font-family: var(--font-mono);
    font-size: clamp(13px, 1.1vw, 14px);
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--nav-shadow);
}

.nav-inner {
    display: flex;
    align-items: center;
    height: var(--nav-h);
    transition: height 0.4s var(--ease-out);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 max(20px, var(--safe-r)) 0 max(20px, var(--safe-l));
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    border-radius: var(--r-sm);
}

.nav-inner > .nav-brand {
    margin-right: auto;
}

.nav-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.6s var(--ease-out);
}

.nav-brand:hover img {
    transform: rotate(-8deg) scale(1.06);
}

.wordmark {
    position: relative;
    display: inline-block;
    /* Brushed-metal lettering, as on the logo: bright at the top, cooler at the base */
    background: linear-gradient(180deg, var(--wm-top) 10%, var(--wm-bottom) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--ink);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.wordmark .i-wrap {
    position: relative;
    display: inline-block;
    background: var(--grad-bright);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wordmark .dot {
    position: absolute;
    top: -0.02em;
    left: 50%;
    width: 0.15em;
    height: 0.15em;
    border-radius: 2px;
    background: var(--grad-bright);
    box-shadow: 0 0 0.5em var(--dot-glow);
    transform: translateX(-50%);
}

.nav-links {
    position: relative;
    display: none;
    gap: 36px;
}

/* One indicator glides between links (site.js); without JS each link keeps its own underline */
.nav-indicator {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    border-radius: 2px;
    background: var(--grad-bright);
    opacity: 0;
    transition: transform 0.55s var(--ease-out), width 0.55s var(--ease-out), opacity 0.3s var(--ease);
    pointer-events: none;
}

.js .nav-link::after {
    display: none;
}

.nav-link {
    position: relative;
    padding: 8px 2px;
    color: var(--ink-3);
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s var(--ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--grad-bright);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s var(--ease-out);
}

.nav-link:hover,
.nav-link[aria-current='page'] {
    color: var(--ink);
}

.nav-link:hover::after,
.nav-link[aria-current='page']::after {
    transform: scaleX(1);
}

.nav-end {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.nav-inner > .nav-brand,
.nav-end {
    flex: 1 1 0;
}

.nav-cta {
    position: relative;
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: var(--r-pill);
    overflow: hidden;
    background: var(--grad);
    color: var(--on-grad);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.005em;
    box-shadow: var(--shadow-accent);
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.nav-cta .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.3s var(--ease-out);
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent-hi);
}

.nav-cta:hover .material-symbols-outlined {
    transform: translateX(3px);
}

.nav-cta:active {
    transform: translateY(0) scale(0.98);
}

.nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--ink);
    transition: background 0.2s var(--ease);
}

.nav-toggle:hover,
.nav-toggle[aria-expanded='true'] {
    background: var(--hover-tint);
}

.nav-toggle .material-symbols-outlined {
    font-size: 24px;
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: grid;
    padding: 4px max(20px, var(--safe-r)) 24px max(20px, var(--safe-l));
    background: var(--menu-bg);
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    box-shadow: 0 28px 44px -28px rgba(0, 0, 0, 0.45);
    transform-origin: top;
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0.3s;
}

.mobile-menu.hidden-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

.mobile-menu a:not(.nav-cta) {
    display: flex;
    align-items: center;
    min-height: 50px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-2);
    font-size: 17px;
    font-weight: 600;
}

.mobile-menu a[aria-current='page'] {
    color: var(--cyan-ink);
}

.mobile-menu .nav-cta {
    display: inline-flex;
    justify-content: center;
    justify-self: start;
    min-height: 46px;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .nav-inner {
        padding: 0 40px;
    }
}

/* The full link row and the call to action need room: below 1080px the menu folds into the hamburger */
@media (min-width: 1080px) {
    .nav-links {
        display: flex;
    }

    .nav-cta {
        display: inline-flex;
    }

    .nav-toggle,
    .mobile-menu {
        display: none;
    }
}

.wordmark,
.nav-cta {
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.g-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.25s var(--ease-out), background 0.2s var(--ease), border-color 0.2s var(--ease),
        box-shadow 0.25s var(--ease-out), color 0.2s var(--ease);
}

.g-btn .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.3s var(--ease-out);
}

.g-btn:hover {
    border-color: var(--btn-hover-line);
    background: var(--btn-hover-bg);
    transform: translateY(-1px);
    box-shadow: var(--shadow-1);
}

.g-btn:active {
    transform: translateY(0) scale(0.98);
}

.g-btn:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.g-btn-primary {
    overflow: hidden;
    border-color: transparent;
    background: var(--grad);
    color: var(--on-grad);
    box-shadow: var(--shadow-accent);
}

/* A band of light crosses the primary button on hover */
.g-btn-primary::before,
.nav-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease-out);
    pointer-events: none;
}

.g-btn-primary:hover::before,
.nav-cta:hover::before {
    transform: translateX(120%);
}

.g-btn-primary:hover {
    border-color: transparent;
    background: var(--grad);
    color: var(--on-grad);
    box-shadow: var(--shadow-accent-hi);
}

.g-btn:hover .material-symbols-outlined {
    transform: translate(2px, -2px);
}

.g-btn:hover .material-symbols-outlined:first-child {
    transform: translateX(-3px);
}

.g-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    cursor: pointer;
    transition: transform 0.25s var(--ease-out), color 0.2s var(--ease), border-color 0.2s var(--ease),
        background 0.2s var(--ease);
}

.g-icon-btn:hover {
    border-color: var(--btn-hover-line);
    background: var(--btn-hover-bg);
    color: var(--cyan-ink);
}

.g-icon-btn:active {
    transform: scale(0.94);
}

.g-icon-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

kbd {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-bottom-width: 3px;
    border-radius: var(--r-xs);
    background: var(--surface);
    color: var(--ink);
    font: 500 12px/1 var(--font-mono);
    letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: clamp(48px, 7vw, 84px) var(--gutter) calc(36px + var(--safe-b));
}

.footer-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 36px;
    padding-bottom: clamp(36px, 5vw, 64px);
}

.footer-brand p {
    max-width: 42ch;
    margin-top: 18px;
    color: var(--ink-3);
    font-size: 16px;
    line-height: 1.65;
}

.footer-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    color: var(--ink);
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.footer-cta span:first-child {
    background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 50%, var(--grad-a) 50%, var(--grad-b) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.6s var(--ease-out);
}

.footer-cta:hover span:first-child {
    background-position: -100% 0;
}

.footer-cta .material-symbols-outlined {
    color: var(--cyan-ink);
    font-size: 0.8em;
    transition: transform 0.4s var(--ease-out);
}

.footer-cta:hover .material-symbols-outlined {
    transform: translate(5px, -5px);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 500;
}

.footer-copy {
    letter-spacing: 0.02em;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-links a {
    transition: color 0.2s var(--ease);
}

.footer-links a:hover {
    color: var(--ink);
}

@media (max-width: 820px) {
    .footer-top {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* A little more compact once you have started reading (set by site.js) */
.topnav.is-compact .nav-inner {
    height: 60px;
}

/* Header gains a little more presence once the page scrolls under it (set by site.js) */
.topnav {
    transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
}

.topnav.is-top {
    background: var(--nav-bg-top);
    border-bottom-color: transparent;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Page layout and editorial type
   -------------------------------------------------------------------------- */

.wrap {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: max(var(--gutter), var(--safe-l));
    padding-right: max(var(--gutter), var(--safe-r));
}

.section {
    position: relative;
    padding: clamp(88px, 12vw, 168px) 0;
}

.section + .section {
    border-top: 1px solid var(--line);
}

.display {
    color: var(--ink);
    font-size: clamp(40px, 6vw, 88px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.h-section {
    color: var(--ink);
    font-size: clamp(30px, 3.8vw, 52px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-wrap: balance;
}

.h-section .soft {
    color: var(--ink-3);
}

.lede {
    color: var(--ink-2);
    font-size: clamp(18px, 1.4vw, 21px);
    line-height: 1.6;
    max-width: 52ch;
    text-wrap: pretty;
}

.body {
    color: var(--ink-2);
    font-size: 17px;
    line-height: 1.65;
    text-wrap: pretty;
}

/* The one place colour fills type: a single key word per page */
.accent-text {
    background: var(--grad-bright);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Room for descenders, so the gradient never clips a "g" or "y" */
    padding-bottom: 0.08em;
    margin-bottom: -0.08em;
}

.sec-head {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(28px, 5vw, 96px);
    align-items: end;
    margin-bottom: clamp(48px, 7vw, 96px);
}

.sec-head .h-section {
    margin-top: 22px;
}

.sec-head .body,
.sec-head .lede {
    max-width: 56ch;
}

@media (max-width: 860px) {
    body {
        font-size: 16px;
    }

    .display {
        font-size: clamp(34px, 9.5vw, 52px);
    }

    .body {
        font-size: 16px;
    }

    .sec-head {
        grid-template-columns: 1fr;
    }
}

/* Underlined text link with an arrow that steps forward */
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 700;
    background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    padding-bottom: 4px;
    transition: color 0.2s var(--ease), background-size 0.4s var(--ease-out);
}

.text-link .material-symbols-outlined {
    font-size: 18px;
    transition: transform 0.35s var(--ease-out);
}

.text-link:hover {
    color: var(--cyan-ink);
}

.text-link:hover .material-symbols-outlined {
    transform: translate(3px, -3px);
}

/* Scroll reveal (site.js adds .is-in). Without JS, or with reduced motion, content is simply visible. */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 90ms);
}

.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */

.field {
    display: grid;
    gap: 8px;
    color: var(--ink-3);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.input {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease-out);
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder {
    color: var(--ink-3);
    opacity: 0.75;
}

.input:hover {
    border-color: var(--line-hover);
}

.input:focus {
    outline: none;
    border-color: var(--cyan-ink);
    box-shadow: 0 0 0 4px rgba(0, 191, 208, 0.16);
}

textarea.input {
    min-height: 148px;
    resize: vertical;
    line-height: 1.6;
}

select.input {
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2356657A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: right 16px center;
    background-repeat: no-repeat;
    cursor: pointer;
}

input[type='file'].input {
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
}

input[type='file'].input::file-selector-button {
    margin-right: 12px;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--bg);
    color: var(--ink);
    font: 600 13px/1 var(--font-head);
    cursor: pointer;
}

.status {
    min-height: 1.4em;
    color: var(--ink-3);
    font-size: 15px;
    font-weight: 500;
}

.status.is-ok {
    color: var(--ok);
}

.status.is-error {
    color: var(--error);
}

/* Theme toggle: one round button, the sun shows in dark, the moon in light */
.theme-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink-2);
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease),
        transform 0.4s var(--ease-out);
}

.theme-toggle:hover {
    color: var(--ink);
    border-color: var(--btn-hover-line);
    background: var(--btn-hover-bg);
}

.theme-toggle:active {
    transform: scale(0.92);
}

.theme-toggle svg {
    grid-area: 1 / 1;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.3s var(--ease), transform 0.5s var(--ease-out);
}

.theme-toggle .i-sun {
    opacity: 0;
    transform: rotate(-70deg) scale(0.6);
}

:root[data-theme='dark'] .theme-toggle .i-sun {
    opacity: 1;
    transform: none;
}

:root[data-theme='dark'] .theme-toggle .i-moon {
    opacity: 0;
    transform: rotate(70deg) scale(0.6);
}

/* Theme reveal (site.js): the browser's own crossfade is switched off and the new page is revealed through a
   growing circle with a feathered edge. --reveal is registered so it can be animated. */
@property --reveal {
    syntax: '<length>';
    inherits: true;
    initial-value: 0px;
}

:root.theme-switching::view-transition-old(root),
:root.theme-switching::view-transition-new(root) {
    animation: none;
    mix-blend-mode: normal;
}

:root.theme-switching::view-transition-old(root) {
    z-index: 1;
}

:root.theme-switching::view-transition-new(root) {
    z-index: 2;
    -webkit-mask-image: radial-gradient(circle at var(--reveal-x) var(--reveal-y), #000 calc(var(--reveal) - var(--reveal-soft)), transparent var(--reveal));
    mask-image: radial-gradient(circle at var(--reveal-x) var(--reveal-y), #000 calc(var(--reveal) - var(--reveal-soft)), transparent var(--reveal));
}

/* While the theme switches, the header is part of the page being revealed, not a separate layer */
:root.theme-switching .topnav {
    view-transition-name: none;
}

/* Moving between pages: the header stays put while the page underneath lifts away and the next one settles in */
@view-transition {
    navigation: auto;
}

.topnav {
    view-transition-name: topnav;
}

::view-transition-old(root) {
    animation: page-out 0.32s var(--ease) both;
}

::view-transition-new(root) {
    animation: page-in 0.55s var(--ease-out) 0.08s both;
}

@keyframes page-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* The toggle answers the click with a ring of light */
.theme-toggle::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 1px solid var(--cyan-ink);
    opacity: 0;
    pointer-events: none;
}

.theme-toggle.is-pulse::after {
    animation: toggle-pulse 0.9s var(--ease-out);
}

@keyframes toggle-pulse {
    from {
        opacity: 0.9;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1.9);
    }
}

/* Buttons that lean toward the pointer ease back when it leaves */
.g-btn {
    transition: transform 0.25s var(--ease-out), background 0.2s var(--ease), border-color 0.2s var(--ease),
        box-shadow 0.25s var(--ease-out), color 0.2s var(--ease), translate 0.45s var(--ease-out);
}

.nav-cta {
    transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), translate 0.45s var(--ease-out);
}

.footer-cta {
    transition: translate 0.45s var(--ease-out);
}

/* Footer signature: the wordmark, huge and quiet, rising out of the foot of the page.
   It is lit by a soft spotlight that follows the pointer. */
.footer-mark {
    --fx: 50%;
    --fy: 30%;
    position: relative;
    overflow: hidden;
    padding: 0.12em var(--gutter) 0;
    text-align: center;
    user-select: none;
}

.footer-mark-word {
    display: inline-block;
    position: relative;
    font-size: clamp(88px, 22vw, 360px);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 0.92;
    background:
        radial-gradient(28% 60% at var(--fx) var(--fy), color-mix(in srgb, var(--cyan) 55%, transparent), transparent 70%),
        linear-gradient(180deg, color-mix(in srgb, var(--ink) 16%, transparent) 0%, color-mix(in srgb, var(--ink) 2%, transparent) 88%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateY(42%);
    opacity: 0;
    transition: transform 1.6s var(--ease-out), opacity 1.2s var(--ease-out);
}

.footer-mark.is-in .footer-mark-word {
    transform: translateY(14%);
    opacity: 1;
}

.footer-mark-word .i-wrap {
    position: relative;
    display: inline-block;
    /* Own fill so the ı stem stays visible; parent text-fill is transparent */
    background: var(--grad-bright);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-mark-word .dot {
    position: absolute;
    top: -0.02em;
    left: 50%;
    width: 0.15em;
    height: 0.15em;
    border-radius: 0.03em;
    background: var(--grad-bright);
    box-shadow: 0 0 0.4em var(--dot-glow);
    transform: translateX(-50%);
    opacity: 0.85;
}

/* Header tucks away while reading down the page and returns on the way up (pages opt in with data-nav-hide) */
.topnav.is-hidden {
    transform: translateY(-100%);
}

.topnav {
    transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease),
        transform 0.5s var(--ease-out), opacity 0.8s var(--ease-out);
}

/* --------------------------------------------------------------------------
   Header as a floating pill: a detached glass capsule that floats over the page.
   (Overrides the full-width bar above; the markup is unchanged.)
   -------------------------------------------------------------------------- */

.topnav {
    top: 14px;
    left: 0;
    right: 0;
    width: max-content;
    max-width: calc(100% - 24px);
    margin: 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    background: var(--nav-bg);
    box-shadow: 0 18px 50px -26px rgba(0, 0, 0, 0.6);
    transition: top 0.5s var(--ease-out), background 0.4s var(--ease), box-shadow 0.4s var(--ease),
        transform 0.5s var(--ease-out), opacity 0.8s var(--ease-out);
}

/* It never goes see-through at the very top: the capsule is always a surface */
.topnav.is-top {
    background: var(--nav-bg);
    border-color: var(--line-strong);
    box-shadow: 0 18px 50px -26px rgba(0, 0, 0, 0.6);
}

/* Once you are reading it tightens, rises a little and firms up */
.topnav.is-compact {
    top: 8px;
    background: var(--menu-bg);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(var(--field-hot), 0.1);
}

.topnav.is-hidden {
    transform: translateY(-170%);
}

.nav-inner {
    height: 56px;
    max-width: none;
    margin: 0;
    padding: 0 8px 0 18px;
    gap: 6px;
}

.topnav.is-compact .nav-inner {
    height: 50px;
}

.nav-inner > .nav-brand,
.nav-end {
    flex: 0 0 auto;
}

.nav-inner > .nav-brand {
    margin-right: 14px;
}

.nav-brand img {
    width: 30px;
    height: 30px;
}

.wordmark {
    font-size: 21px;
}

.nav-links {
    gap: 2px;
}

.nav-link {
    padding: 9px 14px;
    border-radius: var(--r-pill);
}

/* The indicator is now a soft capsule that glides behind the link you point at */
.nav-indicator {
    top: 50%;
    bottom: auto;
    height: 34px;
    margin-top: -17px;
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--hover-tint);
}

.nav-end {
    gap: 8px;
}

.nav-cta {
    min-height: 40px;
    padding: 0 18px;
}

.theme-toggle {
    width: 38px;
    height: 38px;
}

.nav-toggle {
    width: 40px;
    height: 40px;
}

@media (min-width: 768px) {
    .nav-inner {
        padding: 0 8px 0 20px;
    }
}

/* Below 1080px the pill spans the screen (minus a margin) and the links fold into a floating panel */
@media (max-width: 1079px) {
    .topnav {
        width: calc(100% - 24px);
    }

    .nav-inner > .nav-brand {
        margin-right: auto;
    }

    .mobile-menu {
        top: calc(100% + 10px);
        padding: 6px 20px 22px;
        border: 1px solid var(--line-strong);
        border-radius: 24px;
        box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.6);
    }
}

/* --------------------------------------------------------------------------
   The Habrix arrow: one diagonal arrow, drawn twice. On hover (the parent decides) the first slides out toward
   the corner while the second slides in behind it. Used by the header button and the services list.
   -------------------------------------------------------------------------- */

.arr {
    position: relative;
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    overflow: hidden;
}

.arr svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.55s var(--ease-out);
}

.arr svg:last-child {
    transform: translate(-130%, 130%);
}

.nav-cta:hover .arr svg:first-child,
.cap:hover .arr svg:first-child,
.cap a:focus-visible .arr svg:first-child {
    transform: translate(130%, -130%);
}

.nav-cta:hover .arr svg:last-child,
.cap:hover .arr svg:last-child,
.cap a:focus-visible .arr svg:last-child {
    transform: none;
}

/* Heading halves that were plain grey now carry a quiet metal sheen, echoing the wordmark */
.h-section .soft,
.manifesto .soft {
    background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.06em;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}
