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

:root {
    --bg: #0c0c0c;
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, 0.82);
    --tertiary: rgba(235, 235, 245, 0.58);
    --separator: rgba(84, 84, 88, 0.65);
    --fill: rgba(255, 255, 255, 0.1);
    --fill-strong: rgba(255, 255, 255, 0.15);
    --stroke: rgba(255, 255, 255, 0.18);
    --accent: #ffffff;
    --accent-soft: rgba(255, 255, 255, 0.1);
    --cta: rgba(255, 255, 255, 0.95);
    --cta-label: #1a1a1a;
    --ink: #1a1a1a;
    --radius-l: 28px;
    --radius-m: 20px;
    --radius-s: 14px;
    --nav-safe: 7.5rem;
    --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
        "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    background-color: #0c0c0c;
    color-scheme: dark;
}

html.light-mode,
html:has(body.light-mode) {
    background-color: #e6e3dc;
    color-scheme: light;
}

html,
body {
    width: 100%;
    min-height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--label);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1;
}

body.is-phone::before,
body.is-phone::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    z-index: 4;
    pointer-events: none;
    background: var(--bg);
}

body.is-phone::before {
    top: 0;
    height: env(safe-area-inset-top, 0px);
}

body.is-phone::after {
    bottom: 0;
    height: env(safe-area-inset-bottom, 0px);
}

/* Wallpaper — clean night, no grid / moving lines */
.ios-wallpaper {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: -webkit-fill-available;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #0c0c0c;
}

.wall-base {
    position: absolute;
    inset: 0;
    background: #0c0c0c;
}

.wall-mesh,
.wall-sheen,
.wall-noise,
.blob,
.blob-1,
.blob-2,
.blob-3,
.blob-4 {
    display: none !important;
    visibility: hidden !important;
    animation: none !important;
    opacity: 0 !important;
    background: none !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
    content: none !important;
}

.nav-link::before,
.nav-link:hover::before,
body.light-mode .nav-link::before,
body.light-mode .nav-link:hover::before {
    content: none !important;
    display: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
    animation: none !important;
    transition: none !important;
}

.wall-stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.9;
    pointer-events: none;
    /* hard stops so each star is a tiny dot, not a soft light blob */
    background-image:
        radial-gradient(circle at 11% 8%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
        radial-gradient(circle at 39% 17%, rgba(255, 255, 255, 0.4) 0 0.7px, transparent 1.2px),
        radial-gradient(circle at 71% 6%, rgba(255, 255, 255, 0.7) 0 1.1px, transparent 1.6px),
        radial-gradient(circle at 91% 23%, rgba(255, 255, 255, 0.45) 0 0.8px, transparent 1.3px),
        radial-gradient(circle at 6% 41%, rgba(255, 255, 255, 0.35) 0 0.7px, transparent 1.2px),
        radial-gradient(circle at 28% 53%, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.5px),
        radial-gradient(circle at 58% 31%, rgba(255, 255, 255, 0.3) 0 0.6px, transparent 1.1px),
        radial-gradient(circle at 83% 48%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1.5px),
        radial-gradient(circle at 17% 74%, rgba(255, 255, 255, 0.4) 0 0.8px, transparent 1.3px),
        radial-gradient(circle at 47% 86%, rgba(255, 255, 255, 0.28) 0 0.6px, transparent 1.1px),
        radial-gradient(circle at 69% 67%, rgba(255, 255, 255, 0.5) 0 0.9px, transparent 1.4px),
        radial-gradient(circle at 94% 79%, rgba(255, 255, 255, 0.35) 0 0.7px, transparent 1.2px);
    animation: stars-twinkle 8s ease-in-out infinite;
}

@keyframes stars-twinkle {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.95; }
}

body.light-mode .wall-stars {
    opacity: 0.2;
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    .wall-stars {
        animation: none;
        opacity: 0.9;
    }
}

.wall-vignette {
    display: none;
}

.wall-nebula {
    position: absolute;
    top: 14%;
    right: -4%;
    width: min(48vw, 400px);
    height: min(42vw, 340px);
    z-index: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(196, 186, 168, 0.05) 0%, transparent 70%);
    filter: blur(48px);
}

.wall-horizon {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28%;
    z-index: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(12, 12, 12, 0.35) 100%);
}

body.light-mode .wall-nebula,
body.light-mode .wall-horizon {
    opacity: 0.12;
}

/* Same composition as before; group scales together on phone */
.moon-orbit {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.moon {
    position: absolute;
    display: grid;
    place-items: center;
    width: min(60vw, 580px);
    height: min(60vw, 580px);
    top: 18%;
    right: 4%;
    left: auto;
    transform: translate(18%, -8%);
    transform-origin: center center;
    z-index: 2;
    pointer-events: none;
    will-change: transform;
}

.moon-photo {
    position: relative;
    z-index: 1;
    width: calc(52% * 0.78);
    height: calc(52% * 0.78);
    object-fit: contain;
    display: block;
    border-radius: 50%;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 61.5%, transparent 62.2%);
    mask-image: radial-gradient(circle at 50% 50%, #000 61.5%, transparent 62.2%);
    filter: none;
    user-select: none;
    -webkit-user-drag: none;
}

body.light-mode .moon {
    opacity: 1;
    filter: none;
}

.wall-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: none;
    box-shadow: none;
    animation: none;
    z-index: 0;
}

.wall-ring--a {
    width: min(90vw, 900px);
    height: min(90vw, 900px);
    top: 18%;
    right: 4%;
    left: auto;
    transform: translate(10%, -20%);
}

.wall-ring--b {
    display: grid;
    place-items: center;
    width: min(60vw, 580px);
    height: min(60vw, 580px);
    top: 18%;
    right: 4%;
    left: auto;
    transform: translate(18%, -8%);
    border-color: rgba(255, 255, 255, 0.14);
}

body.light-mode .wall-ring {
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .wall-ring--b {
    border-color: rgba(0, 0, 0, 0.12);
}

/* Light mode */
body.light-mode .ios-wallpaper {
    background: #e6e3dc;
}

body.light-mode .wall-base {
    background:
        radial-gradient(ellipse 90% 70% at 80% 10%, rgba(0, 0, 0, 0.06), transparent 55%),
        radial-gradient(ellipse 70% 60% at 10% 90%, rgba(0, 0, 0, 0.05), transparent 50%),
        linear-gradient(165deg, #ebe8e2 0%, #e6e3dc 45%, #d9d5cd 100%);
}

body.light-mode .wall-vignette {
    background: radial-gradient(ellipse 85% 75% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.08) 100%);
}

main {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .wall-mesh,
    .wall-sheen,
    .wall-ring,
    .wall-stars,
    .blob {
        animation: none;
    }
}

/* Shared glass material = same recipe as the menu */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.corner-code {
    position: fixed;
    top: 2.15rem;
    left: 2rem;
    z-index: 1001;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    color: var(--tertiary);
    pointer-events: none;
}

/* —— Top controls + nav: EXACT copy from portfolio-personal —— */
.top-controls {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 1001;
}

.language-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.language-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.language-toggle:active {
    transform: scale(0.95);
}

.language-toggle .lang-text {
    position: absolute;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.05em;
}

.language-toggle .lang-text[data-lang="es"] {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.language-toggle .lang-text[data-lang="en"] {
    opacity: 0;
    transform: scale(0) rotate(90deg);
}

body[data-lang="en"] .language-toggle .lang-text[data-lang="es"] {
    opacity: 0;
    transform: scale(0) rotate(-90deg);
}

body[data-lang="en"] .language-toggle .lang-text[data-lang="en"] {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

body.light-mode .language-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .language-toggle .lang-text {
    color: #1a1a1a;
}

body.light-mode .language-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle svg {
    position: absolute;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #ffffff;
}

.theme-toggle .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

body.light-mode .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0);
}

body.light-mode .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .theme-toggle svg {
    color: #1a1a1a;
}

body.light-mode .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .nav-menu {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .nav-link {
    color: #4a4a4a;
}

body.light-mode .nav-link:hover {
    background: #ffffff;
    color: var(--ink);
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 20px rgba(255, 255, 255, 0.95),
        0 6px 28px rgba(255, 255, 255, 0.85);
}

body.light-mode .nav-link.active {
    background: #ffffff;
    color: var(--ink);
    font-weight: 500;
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 20px rgba(255, 255, 255, 0.95),
        0 6px 28px rgba(255, 255, 255, 0.85),
        0 10px 32px rgba(0, 0, 0, 0.06);
    border: 1px solid #ffffff;
}

body.light-mode .nav-link .nav-icon,
body.light-mode .nav-link svg {
    color: #4a4a4a;
    stroke: #4a4a4a;
}

body.light-mode .nav-link:hover .nav-icon,
body.light-mode .nav-link:hover svg {
    color: var(--ink);
    stroke: var(--ink);
}

body.light-mode .nav-link.active .nav-icon,
body.light-mode .nav-link.active svg {
    color: var(--ink);
    stroke: var(--ink);
}

.bottom-nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: center bottom;
    z-index: 1000;
    width: auto;
    display: flex;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 0.3s ease;
}

.bottom-nav.is-compact {
    transform: translateX(-50%) scale(0.9);
}

.bottom-nav .nav-menu {
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 0.75rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.nav-menu li {
    display: flex;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    letter-spacing: -0.011em;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    border-radius: 48px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

/* nav shimmer removed */

.nav-link:hover {
    background: #ffffff;
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 18px rgba(255, 255, 255, 0.75),
        0 4px 28px rgba(255, 255, 255, 0.55);
}

.nav-link.active {
    background: #ffffff;
    color: var(--ink);
    font-weight: 500;
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 18px rgba(255, 255, 255, 0.75),
        0 4px 28px rgba(255, 255, 255, 0.55),
        0 10px 40px rgba(255, 255, 255, 0.35);
    border: 1px solid #ffffff;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: var(--ink);
}

.nav-link:not(.active) .nav-icon {
    color: #ffffff;
}

.nav-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon--wa,
.cta-wa-icon {
    width: 22px;
    height: 22px;
    overflow: visible;
}

/* —— Light mode page (content only; nav chrome above is portfolio-exact) —— */
body.light-mode {
    --bg: #e6e3dc;
    --label: #1a1a1a;
    --secondary: #4a4a4a;
    --tertiary: rgba(60, 60, 67, 0.3);
    --separator: rgba(60, 60, 67, 0.18);
    --fill: rgba(255, 255, 255, 0.55);
    --fill-strong: rgba(255, 255, 255, 0.72);
    --stroke: rgba(255, 255, 255, 0.5);
    --cta: #1a1a1a;
    --cta-label: #ffffff;
    --accent: #1a1a1a;
    --accent-soft: rgba(0, 0, 0, 0.06);
}

body.light-mode .glass-group,
body.light-mode .glass-card,
body.light-mode .glass-panel {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* —— Hero (iOS large title) —— */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: flex-end;
    padding: 0 clamp(1.25rem, 4vw, 2.5rem) calc(var(--nav-safe) + 1rem);
}

.hero-content {
    width: min(100%, 720px);
    padding-bottom: 0.5rem;
}

.hero-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.hero-brand {
    font-family: var(--font);
    font-size: clamp(3.05rem, 9.2vw, 5.15rem);
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 0.96;
    margin-bottom: 1rem;
}

body.light-mode .hero-brand {
    color: #3d3d3b;
}

.hero-line {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--secondary);
    max-width: 42rem;
    margin-bottom: 1.75rem;
    line-height: 1.45;
}

.hero-line-night {
    display: block;
    margin-top: 0.35rem;
}

.hero-break {
    display: none;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (min-width: 769px) {
    .hero {
        align-items: center;
        padding: 0 clamp(3.5rem, 8vw, 7rem) 0;
    }

    .hero-content {
        width: min(100%, 640px);
        padding-bottom: 0;
    }

    .hero-eyebrow {
        margin-bottom: 1.15rem;
    }

    .hero-brand {
        margin-bottom: 1.35rem;
    }

    .hero-line {
        font-size: 1.2rem;
        max-width: 44rem;
        margin-bottom: 2.25rem;
        line-height: 1.55;
    }

    .hero-actions {
        gap: 0.75rem;
    }
}

.action-island {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

body.light-mode .action-island {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.8);
}

.action-island--tight {
    padding: 0.28rem;
    gap: 0;
}

.action-island--tight .cta-primary,
.action-island--tight .cta-ghost {
    min-height: 36px;
    padding: 0.3rem 0.95rem;
    font-size: 1rem;
}

.cta-primary,
.cta-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 50px;
    padding: 0.75rem 1.25rem;
    border-radius: 48px;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.cta-primary {
    background: #ffffff;
    color: var(--ink);
    border-color: #ffffff;
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 18px rgba(255, 255, 255, 0.75),
        0 4px 28px rgba(255, 255, 255, 0.55),
        0 10px 40px rgba(255, 255, 255, 0.35);
}

body.light-mode .cta-primary {
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 20px rgba(255, 255, 255, 0.95),
        0 6px 28px rgba(255, 255, 255, 0.85),
        0 10px 32px rgba(0, 0, 0, 0.06);
}

.cta-primary:hover {
    background: #ffffff;
    color: var(--ink);
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 22px rgba(255, 255, 255, 0.85),
        0 6px 32px rgba(255, 255, 255, 0.6);
}

.cta-ghost {
    color: #ffffff;
    background: transparent;
    box-shadow: none;
}

body.light-mode .cta-ghost {
    color: #4a4a4a;
    background: transparent;
    border-color: transparent;
}

.cta-wa-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #25d366;
}

.cta-ghost:hover {
    background: #ffffff;
    color: var(--ink);
    box-shadow:
        0 0 0 1px #ffffff,
        0 0 18px rgba(255, 255, 255, 0.75),
        0 4px 28px rgba(255, 255, 255, 0.55);
}

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

/* —— Sections —— */
.section {
    padding: 4.5rem clamp(1.25rem, 4vw, 2.5rem) calc(var(--nav-safe) + 1.25rem);
}

.section-inner {
    width: min(100%, 920px);
    margin: 0 auto;
}

.section-head {
    margin-bottom: 2rem;
}

.section-eyebrow {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--secondary);
    margin-bottom: 0.4rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.028em;
    line-height: 1.12;
    margin-bottom: 0.5rem;
}

.section-sub {
    font-size: 1rem;
    color: var(--secondary);
    line-height: 1.5;
    max-width: 34rem;
}

#build.section {
    position: relative;
    overflow: hidden;
}

body.has-portal #build.section {
    position: fixed;
}

.build-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.build-moon {
    position: absolute;
    left: 6%;
    top: 22%;
    width: min(22vw, 180px);
    height: auto;
    opacity: 0.88;
    border-radius: 50%;
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 61.5%, transparent 62.2%);
    mask-image: radial-gradient(circle at 50% 50%, #000 61.5%, transparent 62.2%);
    user-select: none;
    -webkit-user-drag: none;
}

body.light-mode .build-moon {
    opacity: 0.62;
}

.build-stage {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    margin: 0 auto;
}

.build-intro {
    position: relative;
    margin-bottom: 2.75rem;
}

.build-mark {
    position: absolute;
    left: -0.08em;
    top: -0.42em;
    font-size: clamp(8rem, 22vw, 16rem);
    font-weight: 500;
    letter-spacing: -0.07em;
    line-height: 0.78;
    color: var(--label);
    opacity: 0.12;
    pointer-events: none;
    user-select: none;
}

body.light-mode .build-mark {
    opacity: 0.1;
}

.build-intro .section-title {
    font-size: clamp(2.4rem, 7vw, 4.1rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.98;
    margin-bottom: 0.85rem;
}

.build-intro .section-sub {
    max-width: 26rem;
    font-size: 1.05rem;
    line-height: 1.5;
}

.build-index {
    border-top: none;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0.5px 0 rgba(255, 255, 255, 0.04);
    padding: 0.35rem 1.5rem 0.15rem;
}

body.light-mode .build-index {
    border-top-color: transparent;
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.build-row {
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
}

body.light-mode .build-row {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.build-toggle {
    display: grid;
    grid-template-columns: 2.6rem 1fr;
    gap: 0.85rem;
    width: 100%;
    margin: 0;
    padding: 1.15rem 0 1.05rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.build-toggle:focus-visible {
    outline: 2px solid var(--label);
    outline-offset: 4px;
    border-radius: 4px;
}

.build-idx {
    padding-top: 0.55rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--tertiary);
    font-variant-numeric: tabular-nums;
}

.build-toggle h3 {
    margin: 0;
    font-size: clamp(1.55rem, 4.6vw, 2.65rem);
    font-weight: 500;
    letter-spacing: -0.038em;
    line-height: 1.05;
    color: var(--label);
    opacity: 0.34;
    transition: opacity 0.28s ease;
}

.build-row.is-open .build-toggle h3,
.build-toggle:hover h3 {
    opacity: 1;
}

.build-row p {
    max-width: 32rem;
    margin: 0 0 0 3.45rem;
    padding: 0 0 1.35rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--secondary);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-8px);
    padding-bottom: 0;
    transition:
        max-height 0.35s ease,
        opacity 0.28s ease,
        transform 0.28s ease,
        padding-bottom 0.28s ease;
}

.build-row.is-open p {
    max-height: 8rem;
    opacity: 1;
    transform: none;
    padding-bottom: 1.45rem;
}

@media (min-width: 900px) {
    .build-stage {
        display: grid;
        grid-template-columns: minmax(15rem, 0.82fr) minmax(0, 1.18fr);
        gap: 4.5rem 5rem;
        align-items: start;
    }

    .build-intro {
        position: sticky;
        top: 5.5rem;
        margin-bottom: 0;
        padding-top: 0.35rem;
    }

    .build-toggle {
        padding: 1.35rem 0 1.15rem;
    }

    .build-toggle h3 {
        font-size: clamp(2rem, 3.4vw, 2.85rem);
    }
}

.work-stage {
    width: min(100%, 1120px);
    margin: 0 auto;
}

.work-intro {
    position: relative;
    margin-bottom: 2.4rem;
}

.work-mark {
    position: absolute;
    left: -0.08em;
    top: -0.55em;
    font-size: clamp(6.5rem, 16vw, 12rem);
    font-weight: 500;
    letter-spacing: -0.07em;
    line-height: 0.78;
    color: var(--label);
    opacity: 0.12;
    pointer-events: none;
    user-select: none;
}

body.light-mode .work-mark {
    opacity: 0.1;
}

.work-intro .section-title {
    font-size: clamp(2.4rem, 7vw, 4.1rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.98;
    margin-bottom: 0.7rem;
}

.work-intro .section-sub {
    max-width: 26rem;
    font-size: 1.05rem;
    line-height: 1.5;
}

.work-board {
    display: grid;
    gap: 1.25rem;
    align-items: stretch;
}

.work-preview-slot {
    width: 100%;
    min-height: min(34rem, 68vh);
    display: grid;
    justify-items: stretch;
    align-items: start;
}

.work-preview {
    margin: 0;
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 16rem;
    aspect-ratio: 16 / 10;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0.5px 0 rgba(255, 255, 255, 0.04);
}

body.light-mode .work-preview {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.work-preview img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.work-preview--phone {
    width: auto;
    max-width: min(280px, 100%);
    min-height: 0;
    height: min(34rem, 68vh);
    aspect-ratio: 923 / 2000;
    justify-self: center;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.08), transparent 58%),
        #111110;
}

.work-preview--phone img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    border-radius: 1.5rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 18px 40px rgba(0, 0, 0, 0.42);
}

body.light-mode .work-preview--phone {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.95), transparent 58%),
        #e7e5e0;
}

body.light-mode .work-preview--phone img {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 16px 36px rgba(0, 0, 0, 0.16);
}

.work-caption {
    display: none;
}

.work-index {
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0.5px 0 rgba(255, 255, 255, 0.04);
    padding: 0.2rem 1.15rem 0.1rem;
}

body.light-mode .work-index {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.work-row {
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.16);
}

.work-row:last-child {
    border-bottom: 0;
}

body.light-mode .work-row {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

.work-toggle {
    display: grid;
    grid-template-columns: 2.1rem minmax(0, 1fr) auto;
    gap: 0.55rem 0.7rem;
    align-items: baseline;
    width: 100%;
    margin: 0;
    padding: 0.85rem 0 0.75rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.work-toggle:focus-visible {
    outline: 2px solid var(--label);
    outline-offset: 4px;
    border-radius: 4px;
}

.work-idx {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--tertiary);
    font-variant-numeric: tabular-nums;
}

.work-toggle h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--label);
    opacity: 0.38;
    transition: opacity 0.28s ease;
}

.work-tag {
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--tertiary);
    opacity: 0.7;
}

.work-row.is-open .work-toggle h3,
.work-toggle:hover h3 {
    opacity: 1;
}

.work-row p {
    max-width: 28rem;
    margin: 0 0 0 2.8rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--secondary);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-6px);
    padding-bottom: 0;
    transition:
        max-height 0.35s ease,
        opacity 0.28s ease,
        transform 0.28s ease,
        padding-bottom 0.28s ease;
}

.work-row.is-open p {
    max-height: 6.5rem;
    opacity: 1;
    transform: none;
    padding-bottom: 0.95rem;
}

@media (min-width: 900px) {
    .work-board {
        grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 0.9fr);
        gap: 1.75rem;
    }

    .work-preview {
        min-height: 22rem;
    }
}

.topics {
    display: grid;
    gap: 1.75rem;
}

.topic {
    padding: 1.2rem 1.3rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.045);
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    border: 0.5px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 0.5px 0 rgba(255, 255, 255, 0.04);
}

body.light-mode .topic {
    background: rgba(255, 255, 255, 0.58);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 1px 2px rgba(0, 0, 0, 0.03);
}

.topic h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.028em;
    margin-bottom: 0.4rem;
}

.topic p {
    font-size: 0.98rem;
    color: var(--secondary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.topic-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--tertiary);
    margin-bottom: 0.45rem;
}

.topic:has(.topic-media),
.topic:has(.studio-media) {
    overflow: hidden;
    padding-top: 0;
}

.topic-media,
.studio-media {
    margin: 0 -1.3rem 0.95rem;
    aspect-ratio: 16 / 10;
    background: rgba(255, 255, 255, 0.04);
}

.studio-media {
    aspect-ratio: 3 / 2;
}

.studio-media img {
    object-position: center;
}

.topic-media img,
.studio-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.topic-media--phone {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.08), transparent 58%),
        #111110;
}

.topic-media--phone img {
    width: auto;
    height: 90%;
    max-height: 90%;
    object-fit: contain;
    object-position: center;
    border-radius: 1.55rem;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.14),
        0 18px 40px rgba(0, 0, 0, 0.42);
}

body.light-mode .topic-media--phone {
    background:
        radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.95), transparent 58%),
        #e7e5e0;
}

body.light-mode .topic-media--phone img {
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 16px 36px rgba(0, 0, 0, 0.16);
}

.topic--link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.topic--link:hover h3 {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.case {
    display: grid;
    gap: 1.75rem;
    align-items: center;
}

.case-copy h3 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.55rem;
}

.case-copy p {
    font-size: 1.02rem;
    color: var(--secondary);
    line-height: 1.55;
    max-width: 28rem;
}

.case-media {
    margin: 0;
    display: flex;
    justify-content: center;
}

.case-media img {
    width: min(100%, 280px);
    height: auto;
    border-radius: 28px;
    display: block;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

body.light-mode .case-media img {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.studio-copy {
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--label);
    max-width: 36rem;
    margin-bottom: 1rem;
}

.studio-path {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.15rem;
    color: var(--secondary);
    font-size: 0.95rem;
}

@media (min-width: 769px) {
    .section {
        padding: 6rem clamp(3.5rem, 8vw, 7rem) calc(var(--nav-safe) + 1.5rem);
    }

    .topics {
        grid-template-columns: 1fr 1fr;
        gap: 2.25rem 3.5rem;
    }

    .topics:has(.topic:only-child) {
        grid-template-columns: 1fr;
        max-width: 34rem;
    }

    .case {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 3.5rem;
    }
}

/* Grouped list — iOS Settings style + glass */
.glass-group {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-l);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.glass-row {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 1rem 1.1rem;
    position: relative;
}

.glass-row + .glass-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 3.6rem;
    right: 0;
    height: 1px;
    background: var(--separator);
}

.row-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

body.light-mode .row-icon {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    box-shadow: none;
}

.row-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.2rem;
}

.row-body p {
    font-size: 0.92rem;
    color: var(--secondary);
    line-height: 1.4;
}

/* Method cards */
.method-grid {
    display: grid;
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .method-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.glass-card,
.glass-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-m);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    padding: 1.2rem 1.15rem;
}

.card-index {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.55rem;
}

.glass-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.glass-card p {
    font-size: 0.92rem;
    color: var(--secondary);
}

.studio-panel {
    padding: 1.5rem 1.35rem;
}

.studio-quote {
    font-size: clamp(1.25rem, 3.5vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 1.25rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 0.85rem;
    border-radius: 980px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--label);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

body.light-mode .chip {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Contact form — inset grouped */
.contact-form {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.1rem;
    position: relative;
    min-height: 52px;
}

.form-row + .form-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.1rem;
    right: 0;
    height: 1px;
    background: var(--separator);
}

.form-row--stack {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.45rem;
    padding-top: 0.95rem;
    padding-bottom: 0.95rem;
}

.form-row label {
    font-size: 1rem;
    font-weight: 400;
    color: var(--label);
}

.form-row input,
.form-row textarea {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--label);
    font: inherit;
    font-size: 1rem;
    outline: none;
    resize: vertical;
    text-align: right;
}

.form-row--stack textarea {
    text-align: left;
    min-height: 96px;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
    color: transparent;
}

.contact-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: max-content;
    margin-inline: auto;
}

.contact-mail {
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.contact-mail:hover {
    color: var(--label);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.light-mode .contact-mail:hover {
    color: #1a1a1a;
}

.form-status {
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Reveal — visible by default so the page never looks empty if JS lags */
[data-reveal] {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.js-ready [data-reveal]:not(.is-in) {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
}

[data-reveal].is-in {
    opacity: 1;
    transform: none;
}

html.js-ready.has-portal [data-reveal],
html.js-ready.has-portal [data-reveal]:not(.is-in) {
    opacity: 1;
    transform: none;
}

html.has-portal {
    height: auto;
    overflow-x: hidden;
    overflow-y: scroll;
    scroll-behavior: auto;
}

body.has-portal {
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
}

.portal-spacer {
    display: none;
}

body.has-portal .portal-spacer {
    display: block;
    height: 540vh;
    min-height: 4200px;
    pointer-events: none;
}

body.has-portal .hero,
body.has-portal .section {
    pointer-events: none;
}

body.has-portal .hero a,
body.has-portal .hero button,
body.has-portal .section a,
body.has-portal .section button {
    pointer-events: auto;
}

body.has-portal .hero {
    position: fixed;
    inset: 0;
    z-index: 2;
    min-height: 100dvh;
}

body.has-portal .section {
    position: fixed;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    margin: 0;
    padding-top: 2.25rem;
    padding-bottom: calc(var(--nav-safe) + 1rem);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 18px, 0);
    will-change: opacity, transform;
}

body.has-portal .section.is-portal-on {
    visibility: visible;
}

body.has-portal .section-inner {
    width: min(100%, 880px);
}

body.has-portal .section-head {
    margin-bottom: 1.15rem;
}

body.has-portal .build-moon {
    display: none;
}

body.has-portal .build-mark {
    font-size: clamp(5.5rem, 12vw, 9rem);
    top: -0.28em;
}

body.has-portal #build .build-stage {
    width: min(100%, 980px);
    display: grid;
    grid-template-columns: minmax(12rem, 0.75fr) minmax(0, 1.25fr);
    gap: 2rem 3rem;
    align-items: start;
}

body.has-portal .build-intro {
    position: static;
    margin-bottom: 0;
    padding-top: 0;
}

body.has-portal .build-intro .section-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
}

body.has-portal .build-intro .section-sub {
    font-size: 0.92rem;
}

body.has-portal .build-toggle {
    padding: 0.7rem 0 0.55rem;
}

body.has-portal .build-toggle h3 {
    font-size: clamp(1.15rem, 2.4vw, 1.7rem);
}

body.has-portal .build-row p {
    font-size: 0.86rem;
    margin-left: 3.45rem;
}

body.has-portal .build-row.is-open p {
    padding-bottom: 0.85rem;
}

body.has-portal .topics {
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}

body.has-portal #work .work-stage {
    width: min(100%, 1040px);
}

body.has-portal .work-intro {
    margin-bottom: 1.45rem;
}

body.has-portal .work-mark {
    font-size: clamp(4rem, 8vw, 6.5rem);
    top: -0.5em;
}

body.has-portal .work-intro .section-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    margin-bottom: 0.35rem;
}

body.has-portal .work-intro .section-sub {
    font-size: 0.92rem;
}

body.has-portal .work-board {
    grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.75fr);
    gap: 1.35rem;
    max-height: min(62vh, 560px);
    align-items: start;
}

body.has-portal .work-preview-slot {
    min-height: min(32rem, 62vh);
}

body.has-portal .work-preview {
    height: auto;
    max-height: min(62vh, 560px);
    min-height: 0;
    aspect-ratio: 16 / 10;
}

body.has-portal .work-preview--phone {
    width: auto;
    height: min(32rem, 62vh);
    max-height: min(32rem, 62vh);
    max-width: 250px;
    aspect-ratio: 923 / 2000;
    justify-self: center;
}

body.has-portal .work-index {
    overflow-y: auto;
    pointer-events: auto;
    padding: 0.1rem 0.95rem 0.05rem;
}

body.has-portal .work-toggle {
    padding: 0.62rem 0 0.5rem;
}

body.has-portal .work-toggle h3 {
    font-size: 0.95rem;
}

body.has-portal .work-row p {
    font-size: 0.8rem;
    margin-left: 2.8rem;
}

body.has-portal .work-row.is-open p {
    padding-bottom: 0.7rem;
}

body.has-portal .topic {
    padding: 0.85rem 0.95rem;
}

body.has-portal .topic:has(.topic-media),
body.has-portal .topic:has(.studio-media) {
    padding-top: 0;
}

body.has-portal .topic-media,
body.has-portal .studio-media {
    margin: 0 -0.95rem 0.6rem;
    aspect-ratio: 16 / 9;
}

body.has-portal .topic-media--phone {
    aspect-ratio: 16 / 10;
}

body.has-portal .studio-media {
    aspect-ratio: 3 / 2;
}

body.has-portal .topic p {
    font-size: 0.88rem;
    line-height: 1.4;
}

@media (max-width: 768px), (hover: none) and (max-height: 540px) {
    body.has-portal .hero {
        align-items: flex-end;
        padding-top: 0;
        padding-left: max(1.35rem, env(safe-area-inset-left, 0px));
        padding-right: max(1.35rem, env(safe-area-inset-right, 0px));
        padding-bottom: calc(var(--nav-safe) + 1.15rem);
    }

    .bottom-nav {
        transform: translateX(-50%) scale(0.86);
    }

    .bottom-nav.is-compact {
        transform: translateX(-50%) scale(0.86);
    }

    .bottom-nav.is-away {
        transform: translateX(-50%) translateY(calc(100% + 1.5rem)) scale(0.86);
        opacity: 0;
        pointer-events: none;
    }

    body.has-portal .hero-content {
        max-width: 22rem;
    }

    body.has-portal .moon-orbit {
        transform: none;
    }

    body.has-portal .section {
        align-items: safe center;
        padding-top: 4.75rem;
        padding-left: max(1.35rem, env(safe-area-inset-left, 0px));
        padding-right: max(1.35rem, env(safe-area-inset-right, 0px));
        padding-bottom: calc(var(--nav-safe) + 0.65rem);
    }

    body.has-portal .section::before {
        display: none;
    }

    .wall-horizon {
        opacity: 0;
    }

    body.has-portal .section-inner,
    body.has-portal .build-stage,
    body.has-portal .work-stage {
        position: relative;
        z-index: 1;
        width: 100%;
        max-height: 100%;
    }

    body.has-portal .section-title {
        font-size: 1.7rem;
    }

    body.has-portal .section-sub {
        font-size: 1.02rem;
        line-height: 1.5;
    }

    body.has-portal .topic h3 {
        font-size: 1.05rem;
        margin-bottom: 0.3rem;
    }

    body.has-portal .topic p,
    body.has-portal .studio-copy {
        font-size: 0.98rem;
        line-height: 1.5;
    }

    body.has-portal .topic-media {
        aspect-ratio: 16 / 10;
    }

    body.has-portal .topic-media--phone {
        aspect-ratio: 16 / 10;
    }

    body.has-portal .topic:has(.studio-media) {
        background: none;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        padding: 0;
        overflow: visible;
    }

    body.has-portal #work.section {
        align-items: safe center;
        overflow: hidden;
        pointer-events: none;
    }

    body.has-portal #work .work-stage {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 0 1 auto;
        width: 100%;
        height: auto;
        max-height: 100%;
        min-height: 0;
        overflow: visible;
        gap: 0.7rem;
        pointer-events: none;
        text-align: center;
    }

    body.has-portal #work .work-stage .work-intro,
    body.has-portal #work .work-stage .work-preview,
    body.has-portal #work .work-stage .work-preview-slot,
    body.has-portal #work .work-stage .work-caption,
    body.has-portal #work .work-stage .work-index,
    body.has-portal #work .work-stage button {
        pointer-events: auto;
    }

    body.has-portal #work .work-intro .section-sub {
        display: none;
    }

    body.has-portal .work-caption {
        display: grid;
        justify-items: center;
        gap: 0.2rem;
        text-align: center;
        margin: 0 auto;
        padding: 0 0.2rem;
        width: 100%;
        max-width: 22rem;
    }

    body.has-portal .work-caption-title {
        font-size: 1.05rem;
        font-weight: 500;
        letter-spacing: -0.03em;
    }

    body.has-portal .work-caption-tag {
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--tertiary);
    }

    body.has-portal .work-caption-copy {
        font-size: 0.9rem;
        line-height: 1.4;
        color: var(--secondary);
    }

    body.has-portal .work-intro {
        margin-bottom: 0;
        flex-shrink: 0;
        width: 100%;
        text-align: center;
    }

    body.has-portal .work-intro .section-title,
    body.has-portal .build-intro .section-title {
        font-size: 1.7rem;
        margin-bottom: 0.35rem;
    }

    body.has-portal .build-mark,
    body.has-portal .work-mark {
        position: static;
        display: block;
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        line-height: 1;
        color: var(--secondary);
        opacity: 1;
        margin: 0 0 0.4rem;
        top: auto;
        left: auto;
    }

    body.light-mode.has-portal .build-mark,
    body.light-mode.has-portal .work-mark {
        opacity: 1;
        color: var(--secondary);
    }

    body.has-portal .work-board {
        display: flex;
        flex-direction: column;
        align-items: center;
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
        max-height: none;
        gap: 0.55rem;
        width: 100%;
    }

    body.has-portal .work-preview-slot {
        min-height: 0;
        height: auto;
        flex-shrink: 0;
        overflow: visible;
        justify-items: center;
    }

    body.has-portal .work-preview,
    body.has-portal .work-preview--phone,
    body.has-portal .studio-media {
        display: flex;
        align-items: center;
        justify-content: center;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: none;
        min-height: 0;
        aspect-ratio: unset;
        overflow: hidden;
        border-radius: 12px;
        margin: 0 auto;
        background: transparent;
        border: 0;
        box-shadow: none;
        filter: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    body.light-mode.has-portal .work-preview,
    body.light-mode.has-portal .work-preview--phone,
    body.light-mode.has-portal .studio-media {
        background: transparent;
        border: 0;
        box-shadow: none;
        filter: none;
    }

    body.has-portal .work-preview img,
    body.has-portal .work-preview--phone img,
    body.has-portal .studio-media img {
        display: block;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: min(36vh, 260px);
        min-width: 0;
        min-height: 0;
        object-fit: contain;
        object-position: center;
        border-radius: 12px;
        box-shadow: none;
        opacity: 1;
        filter: none;
        -webkit-filter: none;
        mix-blend-mode: normal;
        color-scheme: light;
    }

    body.has-portal .work-preview--phone {
        max-width: min(150px, 46vw);
        justify-self: center;
        margin-inline: auto;
        background: transparent;
    }

    body.has-portal .work-preview--phone img {
        max-width: min(150px, 46vw);
        max-height: min(42vh, 300px);
        border-radius: 12px;
        box-shadow: none;
        opacity: 1;
        filter: none;
    }

    body.has-portal .work-index {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        gap: 0.3rem;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
        padding: 0.15rem 0 0.2rem;
        background: none;
        border: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        pointer-events: auto;
        touch-action: manipulation;
    }

    body.has-portal .work-row {
        border: 0;
        flex: 0 0 auto;
    }

    body.has-portal .work-row p {
        display: none;
    }

    body.has-portal .work-toggle {
        display: grid;
        place-items: center;
        grid-template-columns: 1fr;
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        gap: 0;
        border-radius: 50%;
        background: transparent;
        transition:
            background-color 0.22s ease,
            box-shadow 0.22s ease,
            transform 0.22s ease;
    }

    body.has-portal .work-toggle:active {
        transform: scale(0.92);
    }

    body.has-portal .work-toggle h3,
    body.has-portal .work-tag {
        display: none;
    }

    body.has-portal .work-idx {
        padding: 0;
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        color: var(--tertiary);
    }

    body.has-portal .work-row.is-open .work-idx,
    body.light-mode.has-portal .work-row.is-open .work-idx {
        color: #000;
    }

    body.has-portal .work-row.is-open .work-toggle,
    body.light-mode.has-portal .work-row.is-open .work-toggle {
        background: #fff;
        box-shadow:
            0 0.5px 0 rgba(0, 0, 0, 0.04),
            0 1px 3px rgba(0, 0, 0, 0.16);
    }

    body.has-portal #build.section {
        overflow: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        align-items: safe center;
    }

    body.has-portal #build .build-stage {
        display: flex;
        flex-direction: column;
        flex: 0 1 auto;
        min-height: 0;
        width: 100%;
        gap: 0.85rem;
        overflow: visible;
    }

    body.has-portal .build-intro {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    body.has-portal .build-index {
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
        max-height: none;
        padding: 0.2rem 1.1rem 0.35rem;
    }

    body.has-portal .build-toggle {
        min-height: 46px;
        padding: 0.95rem 0 0.82rem;
    }

    body.has-portal .build-toggle h3 {
        font-size: 1.18rem;
        opacity: 0.72;
    }

    body.has-portal .build-row.is-open .build-toggle h3 {
        opacity: 1;
    }

    body.has-portal .build-row p {
        margin-left: 2.4rem;
        font-size: 0.98rem;
        line-height: 1.5;
    }

    body.has-portal .build-row.is-open p {
        max-height: 12rem;
    }
}

body.has-portal .hero,
body.has-portal .section,
body.has-portal .moon,
body.has-portal .wall-ring--a,
body.has-portal .wall-horizon,
html.has-portal [data-reveal] {
    transition: none;
}

body.has-portal .wall-ring--b {
    transform-origin: center center;
    will-change: transform;
}

body.has-portal .site-footer {
    position: relative;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.hero-brand { transition-delay: 0.05s; }
.hero-line { transition-delay: 0.12s; }
.hero-actions { transition-delay: 0.2s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .wall-mesh,
    .wall-sheen,
    .wall-ring,
    .blob { animation: none; }
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .bottom-nav {
        transition: none;
    }
}

@media (max-width: 1024px) {
    .bottom-nav {
        bottom: 1.5rem;
    }

    .nav-menu {
        gap: 0.5rem;
        padding: 0.625rem;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.625rem 1rem;
    }

    .nav-icon {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-safe: 6.25rem;
    }

    .corner-code {
        top: 1.45rem;
        left: 1.25rem;
        font-size: 0.7rem;
    }

    .top-controls {
        top: 1.25rem;
        right: 1.25rem;
        gap: 0.65rem;
    }

    .language-toggle,
    .theme-toggle {
        width: 44px;
        height: 44px;
    }

    .bottom-nav {
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%) scale(0.86);
        width: calc(100% - 1.5rem);
        max-width: 420px;
    }

    .bottom-nav.is-compact {
        transform: translateX(-50%) scale(0.86);
    }

    .bottom-nav.is-away {
        transform: translateX(-50%) translateY(calc(100% + 1.5rem)) scale(0.86);
        opacity: 0;
        pointer-events: none;
    }

    .nav-menu {
        gap: 0.2rem;
        padding: 0.4rem;
        border-radius: 32px;
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu li {
        flex: 1 1 0;
        display: flex;
        justify-content: center;
        min-width: 0;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0;
        gap: 0;
        border-radius: 24px;
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }

    .nav-link span:last-child {
        display: none;
    }

    .nav-icon {
        width: 22px;
        height: 22px;
    }

    .action-island {
        padding: 0.32rem;
        gap: 0.28rem;
        border-radius: 28px;
    }

    .cta-primary,
    .cta-ghost {
        min-height: 34px;
        padding: 0.35rem 0.85rem;
        font-size: 0.86rem;
        border-radius: 22px;
    }

    .action-island--tight {
        padding: 0.24rem;
    }

    .action-island--tight .cta-primary,
    .action-island--tight .cta-ghost {
        min-height: 36px;
        padding: 0.3rem 0.9rem;
        font-size: 1rem;
    }

    .hero {
        align-items: center;
        padding-top: 5rem;
    }

    .form-row {
        grid-template-columns: 5.25rem 1fr;
    }
}

@media (max-width: 480px) {
    .bottom-nav {
        bottom: 0.85rem;
        width: calc(100% - 1.25rem);
        transform: translateX(-50%) scale(0.86);
    }

    .bottom-nav.is-compact {
        transform: translateX(-50%) scale(0.86);
    }

    .bottom-nav.is-away {
        transform: translateX(-50%) translateY(calc(100% + 1.35rem)) scale(0.86);
        opacity: 0;
        pointer-events: none;
    }
}

.form-row input:focus,
.form-row textarea:focus {
    color: var(--label);
}

.form-row:focus-within {
    background: rgba(255, 255, 255, 0.06);
}

body.light-mode .form-row:focus-within {
    background: rgba(0, 0, 0, 0.04);
}

:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

body.light-mode :focus-visible {
    outline-color: rgba(0, 0, 0, 0.45);
}

/* —— Improvements: brand, work, contact, footer, legal —— */
.brand-mark {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-mark:hover {
    transform: scale(1.06);
}

.brand-mark:active {
    transform: scale(0.96);
}

body.light-mode .brand-mark {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

.work-list {
    display: grid;
    gap: 0.85rem;
}

.work-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
        border-color 0.25s ease,
        background 0.25s ease;
}

.work-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.35);
}

.work-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 0.7rem;
    border-radius: 980px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--label);
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 0.75rem;
}

body.light-mode .work-tag {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.06);
}

body.light-mode .work-card:hover {
    border-color: rgba(0, 0, 0, 0.18);
}

.work-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.work-card p {
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: 0.9rem;
}

.work-link {
    color: var(--label);
    font-size: 0.9rem;
    font-weight: 600;
}

body.light-mode .work-link {
    color: #1a1a1a;
}

.method-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    margin: 0 0 1.15rem;
    color: var(--secondary);
    font-size: 0.92rem;
    font-weight: 600;
}

.method-inline span[aria-hidden="true"] {
    color: var(--tertiary);
    font-weight: 400;
}

.contact-channels {
    margin-bottom: 1rem;
}

.channel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    text-decoration: none;
    color: var(--label);
    position: relative;
    min-height: 52px;
    transition: background 0.2s ease;
}

.channel-row + .channel-row::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.1rem;
    right: 0;
    height: 1px;
    background: var(--separator);
}

.channel-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

body.light-mode .channel-row:hover {
    background: rgba(0, 0, 0, 0.04);
}

.channel-row span {
    color: var(--secondary);
    font-size: 0.95rem;
}

.channel-row strong {
    font-weight: 600;
    color: var(--label);
    font-size: 0.95rem;
}

.site-footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem clamp(1.25rem, 4vw, 2.5rem) calc(var(--nav-safe) + 1.5rem);
    color: var(--secondary);
    font-size: 0.85rem;
    width: min(100%, 720px);
    margin: 0 auto;
}

.site-footer a {
    color: var(--secondary);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--label);
}

/* duplicate reveal block removed — see rules above */

.legal-page .legal-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.25rem 3rem;
}

.legal-card {
    width: min(100%, 640px);
}

.legal-card h1 {
    font-size: clamp(2rem, 5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0.35rem 0 0.5rem;
}

.legal-card h2 {
    font-size: 1.1rem;
    margin: 1.35rem 0 0.4rem;
}

.legal-card p {
    color: var(--secondary);
    margin-bottom: 0.75rem;
    line-height: 1.55;
}

.legal-card a {
    color: var(--label);
}

body.light-mode .legal-card a {
    color: #1a1a1a;
}

.legal-updated {
    font-size: 0.85rem !important;
    margin-bottom: 1.25rem !important;
}

.legal-card .cta-ghost {
    margin-top: 0.75rem;
    display: inline-flex;
}

@media (max-width: 768px) {
    .brand-mark {
        top: 1.25rem;
        left: 1.25rem;
        width: 40px;
        height: 40px;
        border-radius: 11px;
    }

    .moon-orbit {
        transform: scale(0.78);
        transform-origin: 86% 22%;
    }

    .hero-brand {
        font-size: clamp(3rem, 14vw, 4.5rem);
    }

    .hero-line {
        font-size: 1.05rem;
        max-width: 22rem;
    }

    .work-card:hover {
        transform: none;
    }

    .work-preview-slot {
        min-height: 0;
    }

    .work-preview {
        min-height: 12rem;
    }

    .work-preview--phone {
        height: min(22rem, 48vh);
        max-width: 180px;
    }

    .work-intro {
        margin-bottom: 1.5rem;
    }

    .work-mark {
        font-size: clamp(3.4rem, 16vw, 5.5rem);
        top: -0.4em;
    }

    .work-toggle {
        padding: 0.95rem 0 0.85rem;
        min-height: 44px;
    }

    .work-index {
        padding: 0.35rem 1.1rem 0.3rem;
    }

    .build-mark {
        font-size: clamp(3.4rem, 16vw, 5.5rem);
    }
}

@media (max-width: 480px) {
    .moon-orbit {
        transform: scale(0.7);
        transform-origin: 88% 18%;
    }

    .method-inline {
        font-size: 0.82rem;
    }

    .work-preview--phone {
        height: min(18rem, 42vh);
        max-width: 150px;
    }
}
