/* ========================================
   RK Logic — v2
   ======================================== */

:root {
    --bg-primary: #07070c;
    --bg-secondary: #0b0b13;
    --bg-card: rgba(14, 14, 22, 0.7);
    --bg-card-hover: rgba(20, 20, 32, 0.8);
    --bg-nav: rgba(7, 7, 12, 0.82);

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(59, 130, 246, 0.35);

    --text-primary: #e8e8ed;
    --text-secondary: #7c7c96;
    --text-tertiary: #3e3e56;

    --accent-blue: #3b82f6;
    --accent-blue-deep: #1e40af;
    --accent-blue-bright: #60a5fa;
    --accent-teal: #2dd4bf;
    --accent-orange: #f97316;
    --accent-orange-glow: rgba(249, 115, 22, 0.25);
    --accent-purple: #8b5cf6;

    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    --container: 1200px;
    --nav-height: 72px;
    --section-gap: clamp(100px, 14vw, 180px);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 24px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-primary);
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 1920px;
    margin: 0 auto;
}

body.menu-open { overflow: hidden; }

/* Grain overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 180px 180px;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 3px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1920px;
    height: var(--nav-height);
    z-index: 1000;
    transition: background 0.5s,
                border-color 0.5s;
    border-bottom: 1px solid transparent;
}

.nav--hidden { transform: translateX(-50%) translateY(-100%); }

.nav--scrolled {
    background: var(--bg-nav);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom-color: var(--border-subtle);
}

.nav__inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav__logo {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1001;
}

.nav__logo-img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.7))
           drop-shadow(0 0 12px rgba(59, 130, 246, 0.5))
           drop-shadow(0 0 24px rgba(59, 130, 246, 0.3));
    transition: filter 0.3s;
}

.nav__logo:hover .nav__logo-img {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.9))
           drop-shadow(0 0 16px rgba(59, 130, 246, 0.6))
           drop-shadow(0 0 32px rgba(59, 130, 246, 0.4));
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav__links a {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    transition: color 0.3s;
    position: relative;
}

.nav__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--accent-blue);
    transition: width 0.4s var(--ease-out);
}

.nav__links a:hover,
.nav__links a.active { color: var(--text-primary); }

.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }

.nav__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.nav__toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--text-primary);
    transition: transform 0.35s var(--ease-out);
    position: absolute;
}

.nav__toggle span:first-child { transform: translateY(-5px); }
.nav__toggle span:last-child { transform: translateY(5px); }
.nav__toggle.active span:first-child { transform: rotate(45deg); }
.nav__toggle.active span:last-child { transform: rotate(-45deg); }

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse 60% 50% at 25% 50%, rgba(59, 130, 246, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 75% 30%, rgba(139, 92, 246, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 50% 80%, rgba(45, 212, 191, 0.04) 0%, transparent 70%),
        var(--bg-primary);
}

.hero__content {
    position: relative;
    z-index: 3;
    margin-left: auto;
    margin-right: 0;
    padding: calc(var(--nav-height) + 60px) 48px 100px 0;
    display: flex;
    align-items: center;
    width: fit-content;
}

.hero__text {
    max-width: 800px;
}

.hero__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.7s var(--ease-out) 0.2s forwards;
}

.hero__title {
    font-size: clamp(3rem, 8.5vw, 7.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 36px;
}

.hero__title-line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.08em;
}

.hero__title .word {
    display: inline-block;
    transform: translateY(120%);
    animation: wordSlideUp 0.9s var(--ease-out) forwards;
    will-change: transform;
}

.hero__title-accent .word {
    background: linear-gradient(135deg, var(--accent-blue-bright) 0%, var(--accent-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__title-accent {
    font-style: italic;
}

@keyframes wordSlideUp {
    to { transform: translateY(0); }
}

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

.hero__subtitle {
    font-size: clamp(1rem, 1.6vw, 1.125rem);
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 48px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.8s var(--ease-out) 0.9s forwards;
}

.hero__scroll {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.6s var(--ease-out) 1.4s forwards;
}

.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--accent-blue), transparent);
    animation: scrollPulse 2.5s ease-in-out infinite 1.6s;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.8; transform: scaleY(1); }
    50% { opacity: 0.2; transform: scaleY(0.5); }
}

/* --- Desk Scene --- */
.hero__desk {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero__desk-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    display: block;
}

.hero__desk-screen {
    position: absolute;
    overflow: hidden;
    border-radius: 4px;
    background: #0000aa;
    z-index: 2;
    box-shadow:
        0 0 40px rgba(0, 0, 170, 0.3),
        0 0 100px rgba(0, 0, 170, 0.12);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    line-height: 1.45;
    color: #aaa;
    display: flex;
    flex-direction: column;
}

/* Scanlines */
.hero__desk-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 20;
}

/* Vignette / screen curvature */
.hero__desk-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 20;
}

/* Gradient fade: image → dark for text readability */
.hero__fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        to right,
        transparent 0%,
        transparent 32%,
        rgba(7, 7, 12, 0.42) 48%,
        rgba(7, 7, 12, 0.74) 62%,
        rgba(7, 7, 12, 0.9) 82%
    );
    pointer-events: none;
}

/* Bottom fade for smooth transition to next section */
.hero__fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

/* Screen flash overlay */
.crt__flash {
    position: absolute;
    inset: 0;
    background: rgba(170, 170, 255, 0.6);
    opacity: 0;
    pointer-events: none;
    z-index: 25;
    border-radius: inherit;
    transition: opacity 0.12s;
}

.crt--flash .crt__flash {
    opacity: 1;
    transition: opacity 0.02s;
}

/* QBasic IDE elements */
.crt__bar {
    background: #c0c0c0;
    color: #000;
    padding: 0.1em 0.5em;
    font-size: 0.85em;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
}

.crt__bar-hl {
    background: #000;
    color: #fff;
    padding: 0 0.4em;
}

.crt__title {
    background: #00aaaa;
    color: #000;
    text-align: center;
    padding: 0 0.4em;
    font-size: 0.85em;
    flex-shrink: 0;
}

.crt__editor {
    flex: 1;
    padding: 0.5em 0.7em;
    white-space: pre;
    overflow: hidden;
    text-shadow: 0 0 3px rgba(170, 170, 170, 0.3);
}

.crt__status {
    background: #c0c0c0;
    color: #000;
    padding: 0.1em 0.5em;
    font-size: 0.75em;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
}

/* BIOS / DOS terminal text */
.crt__term {
    flex: 1;
    padding: 0.5em 0.6em;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.1;
    color: inherit;
    white-space: pre;
    overflow: hidden;
    text-shadow: 0 0 2px rgba(200, 200, 200, 0.2);
    background: transparent;
    border: none;
    min-height: 0;
}

/* Interactive menu items */
.crt__menu-item {
    cursor: pointer;
    padding: 0 0.3em;
}

.crt__menu-item:hover {
    background: #000;
    color: #fff;
}

.crt__menu-item--active {
    background: #000;
    color: #fff;
}

/* Dropdown menu */
.crt__dropdown {
    position: absolute;
    top: 1.35em;
    left: 0.2em;
    background: #c0c0c0;
    border: 2px outset #ddd;
    z-index: 10;
    min-width: 12em;
}

.crt__dropdown-item {
    padding: 0.1em 1em;
    color: #000;
    cursor: pointer;
    white-space: nowrap;
}

.crt__dropdown-item:hover {
    background: #000080;
    color: #fff;
}

.crt__dropdown-sep {
    border-top: 1px solid #808080;
    margin: 2px 0;
}

/* File dialog */
.crt__dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #c0c0c0;
    border: 2px outset #ddd;
    z-index: 15;
    min-width: 60%;
}

.crt__dialog-title {
    background: #000080;
    color: #fff;
    padding: 0.1em 0.5em;
    font-size: 0.85em;
}

.crt__dialog-list {
    background: #fff;
    color: #000;
    margin: 0.4em;
    max-height: 6em;
    overflow-y: auto;
}

.crt__dialog-file {
    padding: 0.1em 0.4em;
    cursor: pointer;
}

.crt__dialog-file:hover,
.crt__dialog-file--selected {
    background: #000080;
    color: #fff;
}

.crt__dialog-buttons {
    text-align: center;
    padding: 0.3em;
}

.crt__dialog-btn {
    background: #c0c0c0;
    border: 2px outset #ddd;
    padding: 0.1em 1.2em;
    margin: 0 0.3em;
    cursor: pointer;
    color: #000;
    font-family: inherit;
    font-size: inherit;
}

.crt__dialog-btn:active {
    border-style: inset;
}

/* QBasic syntax colors */
.qb-kw { color: #fff; }
.qb-str { color: #55ffff; }

/* Block cursor with blink */
.crt__cursor {
    color: #aaa;
    animation: crt-blink 1s step-end infinite;
}

/* White cursor for BIOS/DOS phases */
.crt__cursor--bios {
    color: #ccc;
}

.crt--typing .crt__cursor {
    animation: none;
    opacity: 1;
}

@keyframes crt-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* Running state — DOS output screen */
.crt--run {
    background: #000 !important;
}

.crt--run .crt__bar,
.crt--run .crt__title,
.crt--run .crt__status {
    display: none;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 16px 32px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.35s, box-shadow 0.35s;
    text-decoration: none;
    will-change: transform;
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 1.1s forwards;
    transform: translateY(20px);
}

.btn--primary {
    background: var(--accent-orange);
    color: #fff;
}

.btn--primary:hover {
    background: #fb923c;
    box-shadow: 0 8px 32px var(--accent-orange-glow),
                0 2px 8px rgba(249, 115, 22, 0.3);
}

.btn__arrow {
    transition: transform 0.35s var(--ease-out);
}

.btn--primary:hover .btn__arrow {
    transform: translateX(5px);
}

/* --- Marquee --- */
.marquee {
    padding: 20px 0;
    overflow: hidden;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.marquee__track {
    display: flex;
    width: max-content;
    animation: marqueeScroll 40s linear infinite;
}

.marquee__track:hover {
    animation-play-state: paused;
}

.marquee__content {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.marquee__dot {
    width: 4px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.6;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Section Commons --- */
.section__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-blue);
    margin-bottom: 20px;
}

.section__title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5.5vw, 4.5rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 72px;
}

/* --- Services --- */
.services {
    position: relative;
    padding: var(--section-gap) 0;
    overflow: hidden;
}

.services__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.services__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.services__fade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 80% 70% at 50% 50%, rgba(7, 7, 12, 0.55) 0%, rgba(7, 7, 12, 0.85) 70%),
        linear-gradient(to bottom, var(--bg-primary) 0%, transparent 12%, transparent 88%, var(--bg-primary) 100%);
    pointer-events: none;
}

.services .container {
    position: relative;
    z-index: 2;
}

/* --- Card Grid --- */
.services__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* --- Flip Card --- */
.card {
    perspective: 900px;
    height: 220px;
    --card-glow: rgba(59, 130, 246, 0.12);
}

.card:nth-child(1) { --card-glow: rgba(59, 130, 246, 0.12); --card-accent: var(--accent-blue); }
.card:nth-child(2) { --card-glow: rgba(139, 92, 246, 0.12); --card-accent: var(--accent-purple); }
.card:nth-child(3) { --card-glow: rgba(45, 212, 191, 0.12); --card-accent: var(--accent-teal); }
.card:nth-child(4) { --card-glow: rgba(249, 115, 22, 0.10); --card-accent: var(--accent-orange); }

.card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.55s var(--ease-out);
}

.card:hover .card__inner {
    transform: rotateY(180deg);
}

.card__front,
.card__back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
}

.card__front {
    background: var(--bg-card);
    justify-content: flex-end;
    transition: box-shadow 0.4s, border-color 0.4s;
}

.card:hover .card__front {
    box-shadow: 0 4px 24px var(--card-glow), 0 0 0 1px var(--card-glow);
    border-color: var(--card-glow);
}

.card__back {
    background: var(--bg-card-hover);
    border-color: var(--card-glow);
    box-shadow: 0 4px 24px var(--card-glow);
    transform: rotateY(180deg);
    justify-content: center;
}

.card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--card-glow);
    color: var(--card-accent);
    margin-bottom: 20px;
}

.card__icon svg {
    width: 20px;
    height: 20px;
}

.card__title {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.card__category {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--card-accent);
}

.card__desc {
    font-size: 0.875rem;
    line-height: 1.75;
    color: var(--text-primary);
}

/* --- About --- */
.about {
    padding: var(--section-gap) 0;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.about__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.35;
}

.about .container {
    position: relative;
    z-index: 1;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-blue-deep), transparent);
}

.about__body {
    max-width: 720px;
}

.about__lead {
    font-size: clamp(1.125rem, 2vw, 1.3125rem);
    line-height: 1.85;
    color: var(--text-primary);
    padding-left: 28px;
    border-left: 2px solid var(--accent-blue);
    margin-bottom: 28px;
}

.about__text {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    padding-left: 28px;
}

.about__capabilities {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 72px;
}

.about__capability {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-blue-bright);
    padding: 0 28px;
    transition: color 0.3s;
}

.about__capability:first-child { padding-left: 0; }
.about__capability:hover { color: var(--text-primary); }

.about__divider {
    width: 1px;
    height: 14px;
    background: var(--text-tertiary);
    flex-shrink: 0;
}

/* --- Contact --- */
.contact {
    padding: var(--section-gap) 0 calc(var(--section-gap) * 0.8);
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

.contact__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
}

.contact .container {
    position: relative;
    z-index: 1;
}

.contact .section__title {
    margin-bottom: 20px;
    font-size: clamp(2.75rem, 6vw, 5rem);
}

.contact__text {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto 56px;
}

.contact__email {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 3.25rem);
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--accent-blue-bright), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    transition: filter 0.4s;
}

.contact__email::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue-bright), var(--accent-teal));
    transition: width 0.6s var(--ease-out);
}

.contact__email:hover { filter: brightness(1.3); }
.contact__email:hover::after { width: 100%; }

/* --- Footer --- */
.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border-subtle);
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer__copy {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

.footer__logo {
    display: flex;
    align-items: center;
}

.footer__logo-img {
    height: 22px;
    width: auto;
    opacity: 0.8;
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 0.1s; }
.reveal--delay-2 { transition-delay: 0.2s; }
.reveal--delay-3 { transition-delay: 0.3s; }

/* --- Tablet --- */
@media (max-width: 1024px) {
    .hero__content {
        justify-content: flex-start;
    }

    .services__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Mobile --- */
@media (max-width: 768px) {
    :root { --nav-height: 64px; }

    .hero__desk,
    .hero__fade { display: none; }

    .hero__content {
        justify-content: flex-start;
    }

    .container,
    .hero__content,
    .nav__inner {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav__links {
        position: fixed;
        inset: 0;
        background: rgba(7, 7, 12, 0.97);
        backdrop-filter: blur(28px);
        -webkit-backdrop-filter: blur(28px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s, visibility 0.4s;
        z-index: 1000;
    }

    .nav__links.active {
        opacity: 1;
        visibility: visible;
    }

    .nav__links a {
        font-size: 2rem;
        font-family: var(--font-display);
        color: var(--text-primary);
        letter-spacing: 0;
    }

    .nav__links a::after { display: none; }
    .nav__toggle { display: flex; }

    .hero__title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }

    .hero__scroll { display: none; }

    .services__grid {
        grid-template-columns: 1fr;
    }

    .card {
        height: 200px;
    }

    .section__title { margin-bottom: 48px; }

    .about__lead,
    .about__text { padding-left: 20px; }

    .about__capabilities {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-top: 48px;
    }

    .about__capability { padding: 0; }
    .about__divider { display: none; }

    .footer .container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero__content {
        padding-top: calc(var(--nav-height) + 36px);
    }

    .card {
        height: auto;
    }

    .card__inner {
        transform-style: flat;
        transition: none;
    }

    .card:hover .card__inner {
        transform: none;
    }

    .card__front,
    .card__back {
        position: relative;
        backface-visibility: visible;
        -webkit-backface-visibility: visible;
    }

    .card__back {
        transform: none;
        border-top: none;
        border-radius: 0 0 14px 14px;
    }

    .card__front {
        border-radius: 14px 14px 0 0;
        border-bottom: none;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html { scroll-behavior: auto; }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .hero__tag,
    .hero__subtitle,
    .btn {
        opacity: 1;
        transform: none;
    }

    .hero__title .word {
        transform: none;
    }

    .marquee__track {
        animation: none;
    }
}
