/* JGreaterLab — red / black, inspired by clawbro.ai (dark surfaces, red accents) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cb-bg: #000000;
    --cb-bg-raised: #0a0a0a;
    --cb-surface: #0f0f0f;
    --cb-surface-hover: #171717;
    --cb-border: rgba(255, 255, 255, 0.08);
    --cb-border-strong: rgba(255, 255, 255, 0.16);
    --cb-text: #fafafa;
    --cb-text-secondary: #a3a3a3;
    --cb-text-tertiary: #737373;
    --cb-accent: #e11d48;
    --cb-accent-bright: #ff4d4d;
    --cb-accent-deep: #9f1239;
    --cb-rose: #fb7185;
    --cb-warm: #f59e0b;
    --font-display: "Syne", system-ui, sans-serif;
    --font-sans: "Space Grotesk", system-ui, sans-serif;
    --shadow-glow: 0 0 60px -12px rgba(239, 68, 68, 0.42);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Stage layout: wider rail on large screens; copy stays measured */
    --container-max: 90rem;
    --gutter: clamp(1rem, 2.6vw, 2.5rem);
    --nav-blur: 20px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.75rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

@media (hover: none), (pointer: coarse) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--font-sans);
    color: var(--cb-text);
    background: var(--cb-bg);
    line-height: 1.6;
    overflow-x: clip;
    overscroll-behavior-y: contain;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.nav-menu-open {
    overflow: hidden;
}

.container {
    width: min(100% - (2 * var(--gutter)), var(--container-max));
    max-width: none;
    margin: 0 auto;
    padding: 0;
}

/* —— Navigation —— */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(var(--nav-blur)) saturate(1.2);
    -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(1.2);
    border-bottom: 1px solid var(--cb-border);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.94);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    border-bottom-color: var(--cb-border-strong);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    width: min(100% - (2 * var(--gutter)), var(--container-max));
    max-width: none;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.12rem;
    text-decoration: none;
    color: var(--cb-text);
    flex-shrink: 0;
    margin-right: auto;
    min-width: 0;
}

.nav-logo-img {
    display: block;
    height: 50px;
    width: auto;
    max-width: min(50vw, 240px);
    flex-shrink: 0;
    object-fit: contain;
    object-position: left center;
    -webkit-user-drag: none;
}

.nav-brand-text {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: clamp(1.12rem, 3.1vw, 1.38rem);
    letter-spacing: -0.015em;
    color: var(--cb-text);
    white-space: nowrap;
    line-height: 1.42;
}

.nav-brand-name {
    font-weight: 700;
}

.nav-brand-tld {
    font-weight: 500;
    color: var(--cb-text-secondary);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.15rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--cb-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
}

.nav-menu a:hover {
    color: var(--cb-text);
    background: rgba(255, 255, 255, 0.06);
}

.nav-menu a.nav-link-cta {
    color: #fff;
    background: linear-gradient(135deg, var(--cb-accent) 0%, var(--cb-accent-deep) 100%);
    margin-left: 0.35rem;
    box-shadow: 0 4px 22px rgba(239, 68, 68, 0.4);
}

.nav-menu a.nav-link-cta:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--cb-accent-bright) 0%, var(--cb-accent) 100%);
    box-shadow: 0 6px 28px rgba(239, 68, 68, 0.5);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--cb-text);
    border-radius: 2px;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
    transform-origin: center;
}

.nav-backdrop {
    display: none;
}

/* —— Hero —— */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px var(--gutter) 88px;
    overflow: hidden;
    background: var(--cb-bg);
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 80% at 50% -30%, rgba(239, 68, 68, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 10%, rgba(225, 29, 72, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 0% 40%, rgba(127, 29, 29, 0.12) 0%, transparent 45%);
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
    opacity: 0.5;
}

.hero-content {
    position: relative;
    max-width: 820px;
    z-index: 1;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cb-accent-bright);
    margin-bottom: 1.25rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    background: rgba(239, 68, 68, 0.09);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--cb-text);
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.hero-title .accent-word {
    background: linear-gradient(90deg, var(--cb-accent-bright) 0%, var(--cb-rose) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: var(--cb-text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.hero-description {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    color: var(--cb-text-tertiary);
    margin-bottom: 2.25rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.65;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* —— Buttons —— */
.btn {
    display: inline-block;
    padding: 0.85rem 1.75rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-sans);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--cb-accent-bright) 0%, var(--cb-accent) 55%, var(--cb-accent-deep) 100%);
    box-shadow: 0 4px 24px rgba(239, 68, 68, 0.45);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.55);
}

.btn-secondary {
    color: var(--cb-text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cb-border-strong);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.btn-disabled,
.btn-primary.btn-disabled {
    opacity: 0.45;
    pointer-events: none;
    transform: none;
    box-shadow: none;
}

.project-card.reveal-ready,
.service-card.reveal-ready {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.55s ease, transform 0.55s ease;
    will-change: opacity, transform;
}

.project-card.reveal-ready.is-visible,
.service-card.reveal-ready.is-visible {
    opacity: 1;
    transform: none;
    will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
    .project-card.reveal-ready,
    .service-card.reveal-ready {
        opacity: 1;
        transform: none;
        transition: none;
        will-change: auto;
    }
}

/* —— Sections —— */
section {
    padding: 88px 0;
    position: relative;
}

#projects,
#tools,
section[id] {
    scroll-margin-top: 4.75rem;
}

#home {
    scroll-margin-top: 0;
}

.projects,
.tools {
    padding: 72px 0 100px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3.5rem;
    color: var(--cb-text);
    letter-spacing: -0.03em;
    scroll-margin-top: 4.75rem;
}

.section-lead {
    text-align: center;
    color: var(--cb-text-tertiary);
    font-size: clamp(0.92rem, 1.5vw, 1.05rem);
    line-height: 1.5;
    max-width: 36rem;
    margin: -2.6rem auto 2.5rem;
}

/* —— About —— */
.about {
    background: var(--cb-bg-raised);
    border-top: 1px solid var(--cb-border);
    border-bottom: 1px solid var(--cb-border);
}

.about-content {
    max-width: 820px;
    margin: 0 auto;
}

.about-profile {
    display: flex;
    justify-content: center;
    margin-bottom: 1.8rem;
}

.about-profile-img {
    width: min(240px, 62vw);
    height: auto;
    border-radius: 18px;
    border: 1px solid var(--cb-border);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
    object-fit: cover;
}

.about-text .lead {
    font-size: 1.2rem;
    color: var(--cb-text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.75;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--cb-text-tertiary);
    line-height: 1.8;
}

.about-highlights {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.highlight-item {
    text-align: center;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--cb-border);
    background: rgba(13, 18, 32, 0.6);
    min-width: 120px;
}

.highlight-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cb-accent-bright) 0%, var(--cb-rose) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.highlight-label {
    display: block;
    color: var(--cb-text-tertiary);
    margin-top: 0.4rem;
    font-size: 0.85rem;
}

/* —— Projects —— */
.projects {
    background: var(--cb-bg);
}

.projects::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cb-border-strong), transparent);
}

.projects .section-title {
    margin-bottom: 0.75rem;
}

.projects .section-lead {
    margin: 0 auto 2.25rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 1.1rem;
    justify-content: center;
}

.project-card {
    background: var(--cb-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
    border: 1px solid var(--cb-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    max-width: none;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

.project-card:hover {
    border-color: rgba(248, 113, 113, 0.32);
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(248, 113, 113, 0.1);
    background: var(--cb-surface-hover);
}

.project-image,
.project-image-large {
    width: 100%;
    height: 10.5rem;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(12, 12, 12, 0.95) 0%, rgba(8, 8, 8, 1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--cb-border);
}

.project-img {
    width: auto;
    max-width: calc(100% - 0.6rem);
    height: auto;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(1) saturate(1);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
    background: rgba(15, 15, 15, 0.6);
    padding: calc(0.3rem * 1.2);
}

.project-card:hover .project-img {
    transform: scale(1.02);
}

.project-video {
    display: block;
    pointer-events: none;
}

.project-image--bleed {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.project-image--bleed .project-img,
.project-image--bleed .project-video {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.project-image--catchtex {
    background: #09090b;
    padding: 0;
}

.project-image--catchtex .project-img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center top;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    filter: none;
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--cb-text-secondary);
    font-weight: 700;
    background: linear-gradient(145deg, var(--cb-bg-raised), var(--cb-surface));
    border-radius: var(--radius-sm);
}

.project-content {
    padding: 0.45rem 0.7rem 0.5rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 0.22rem;
}

.project-title {
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--cb-text);
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.project-category {
    color: var(--cb-accent-bright);
    font-weight: 600;
    margin-bottom: 0;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    padding: 0.12rem 0.48rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.26);
    border-radius: 999px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.project-description {
    color: var(--cb-text-tertiary);
    margin-bottom: 0;
    line-height: 1.35;
    font-size: 0.76rem;
    height: calc(1.35em * 3 + 0.4rem);
    max-height: calc(1.35em * 3 + 0.4rem);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.18rem 0.35rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--cb-border);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.project-description::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.project-features {
    list-style: none;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.2rem;
    justify-content: center;
    min-height: 2.45rem;
    max-height: 2.45rem;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.project-features::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.project-features li {
    background: rgba(255, 255, 255, 0.04);
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    font-size: 0.68rem;
    color: var(--cb-text-secondary);
    border: 1px solid var(--cb-border);
    font-weight: 500;
    transition: border-color var(--transition), background var(--transition);
    line-height: 1.25;
}

.project-features li:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.38);
    color: var(--cb-text);
}

.project-actions {
    margin-top: auto;
    min-height: 5.15rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.project-card .btn-primary {
    width: 100%;
    text-align: center;
    padding: 0.42rem 0.9rem;
    font-weight: 600;
    margin-top: 0;
    flex: 0 0 auto;
    height: auto;
    align-self: stretch;
    background: rgba(255, 255, 255, 0.04);
    color: var(--cb-text);
    border: 1px solid var(--cb-border);
    box-shadow: none;
    font-size: 0.82rem;
}

.project-card .btn-primary:hover {
    transform: none;
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.45);
    color: var(--cb-accent-bright);
    box-shadow: none;
}

.project-card .btn-primary.btn-disabled:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--cb-border);
    color: var(--cb-text);
}

/* —— Services —— */
.services {
    background: var(--cb-bg-raised);
    border-top: 1px solid var(--cb-border);
}

/* —— Tools & Platforms (tile style) —— */
.tools {
    background: var(--cb-bg);
    border-top: 1px solid var(--cb-border);
    border-bottom: 1px solid var(--cb-border);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 0.65rem;
}

.tool-link-card {
    --tool-a: rgba(244, 63, 94, 0.16);
    --tool-b: rgba(56, 189, 248, 0.12);
    --tool-c: rgba(168, 85, 247, 0.12);
    --tool-d: rgba(251, 191, 36, 0.1);
    position: relative;
    isolation: isolate;
    text-decoration: none;
    color: var(--cb-text);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        radial-gradient(90% 70% at 12% 0%, var(--tool-a) 0%, transparent 55%),
        radial-gradient(80% 60% at 100% 8%, var(--tool-b) 0%, transparent 52%),
        radial-gradient(70% 55% at 78% 100%, var(--tool-c) 0%, transparent 58%),
        radial-gradient(55% 45% at 0% 85%, var(--tool-d) 0%, transparent 60%),
        #000;
    padding: 0.7rem 0.55rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.45);
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.tool-link-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.07) 0%,
            transparent 28%,
            transparent 72%,
            rgba(255, 255, 255, 0.03) 100%
        );
    opacity: 0.55;
    pointer-events: none;
    z-index: 0;
}

.tool-link-card::after {
    content: "";
    position: absolute;
    inset: -40% -20%;
    background: conic-gradient(
        from 210deg,
        transparent 0deg,
        rgba(244, 63, 94, 0.08) 40deg,
        transparent 80deg,
        rgba(56, 189, 248, 0.07) 130deg,
        transparent 170deg,
        rgba(168, 85, 247, 0.07) 220deg,
        transparent 260deg,
        rgba(52, 211, 153, 0.06) 300deg,
        transparent 340deg
    );
    opacity: 0.35;
    filter: blur(18px);
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.35s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.tool-link-card > * {
    position: relative;
    z-index: 1;
}

/* Soft color rotation across the grid */
.tool-link-card:nth-child(6n + 1) {
    --tool-a: rgba(244, 63, 94, 0.15);
    --tool-b: rgba(56, 189, 248, 0.11);
    --tool-c: rgba(168, 85, 247, 0.1);
    --tool-d: rgba(251, 191, 36, 0.08);
}
.tool-link-card:nth-child(6n + 2) {
    --tool-a: rgba(56, 189, 248, 0.14);
    --tool-b: rgba(52, 211, 153, 0.1);
    --tool-c: rgba(244, 63, 94, 0.08);
    --tool-d: rgba(168, 85, 247, 0.1);
}
.tool-link-card:nth-child(6n + 3) {
    --tool-a: rgba(168, 85, 247, 0.14);
    --tool-b: rgba(244, 63, 94, 0.09);
    --tool-c: rgba(56, 189, 248, 0.1);
    --tool-d: rgba(251, 191, 36, 0.08);
}
.tool-link-card:nth-child(6n + 4) {
    --tool-a: rgba(52, 211, 153, 0.13);
    --tool-b: rgba(56, 189, 248, 0.1);
    --tool-c: rgba(168, 85, 247, 0.09);
    --tool-d: rgba(244, 63, 94, 0.07);
}
.tool-link-card:nth-child(6n + 5) {
    --tool-a: rgba(251, 191, 36, 0.13);
    --tool-b: rgba(244, 63, 94, 0.09);
    --tool-c: rgba(56, 189, 248, 0.09);
    --tool-d: rgba(168, 85, 247, 0.08);
}
.tool-link-card:nth-child(6n + 6) {
    --tool-a: rgba(99, 102, 241, 0.14);
    --tool-b: rgba(236, 72, 153, 0.09);
    --tool-c: rgba(34, 211, 238, 0.1);
    --tool-d: rgba(251, 146, 60, 0.08);
}

.tool-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 0.45rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.04);
}

.tool-link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 28px rgba(56, 189, 248, 0.08),
        0 0 36px rgba(168, 85, 247, 0.07),
        0 0 40px rgba(244, 63, 94, 0.06),
        0 18px 36px rgba(0, 0, 0, 0.55);
}

.tool-link-card:hover::after {
    opacity: 0.55;
    transform: rotate(18deg) scale(1.05);
}

.tool-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.12);
}

.tool-link-title {
    font-family: var(--font-display);
    font-size: 1.22rem;
    margin-bottom: 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.tool-link-subtitle {
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--cb-text-tertiary);
}

@media (hover: none) and (pointer: coarse) {
    .tool-link-card:hover {
        transform: none;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 8px 24px rgba(0, 0, 0, 0.45);
    }

    .tool-link-card:hover::after {
        opacity: 0.35;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tool-link-card,
    .tool-link-card::after {
        transition: none;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.service-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    border: 1px solid var(--cb-border);
    background: var(--cb-surface);
}

.service-card:hover {
    border-color: rgba(248, 113, 113, 0.26);
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    background: var(--cb-surface-hover);
}

.service-icon {
    margin-bottom: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80px;
}

.service-icon-img {
    max-width: 72px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(239, 68, 68, 0.22));
}

.service-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--cb-text);
    letter-spacing: -0.02em;
}

.service-description {
    color: var(--cb-text-tertiary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* —— Contact —— */
.contact {
    background: var(--cb-bg);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--cb-text);
    letter-spacing: -0.03em;
}

.contact-info p {
    color: var(--cb-text-tertiary);
    margin-bottom: 2rem;
    line-height: 1.75;
}

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

.contact-item {
    color: var(--cb-text-tertiary);
}

.contact-item strong {
    display: block;
    color: var(--cb-text);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.contact-item a {
    color: var(--cb-accent-bright);
    text-decoration: none;
    transition: color var(--transition);
}

.contact-item a:hover {
    color: #fff;
    text-decoration: underline;
}

.contact-item address {
    font-style: normal;
    line-height: 1.8;
}

.contact-form-wrapper {
    background: var(--cb-surface);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--cb-border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--cb-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--cb-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    background: var(--cb-bg-raised);
    color: var(--cb-text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(248, 113, 113, 0.55);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--cb-text-tertiary);
}

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

.contact-form .btn-primary {
    width: 100%;
    text-align: center;
}

/* —— Footer —— */
.footer {
    background: var(--cb-bg-raised);
    color: var(--cb-text);
    padding: 2.25rem 0;
    border-top: 1px solid var(--cb-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-content p {
    color: var(--cb-text-tertiary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--cb-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--cb-accent-bright);
}

.btn-legal-notice {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cb-text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--cb-border-strong);
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.btn-legal-notice:hover {
    color: var(--cb-accent-bright);
    border-color: rgba(248, 113, 113, 0.45);
    background: rgba(239, 68, 68, 0.1);
}

.btn-legal-notice:focus-visible {
    outline: 2px solid var(--cb-accent-bright);
    outline-offset: 2px;
}

body.legal-modal-open {
    overflow: hidden;
}

.legal-modal[hidden] {
    display: none !important;
}

.legal-modal:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

.legal-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.legal-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 28rem;
    max-height: min(85vh, 640px);
    background: var(--cb-surface);
    border: 1px solid var(--cb-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
}

.legal-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--cb-text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.legal-modal__close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--cb-accent-bright);
}

.legal-modal__scroll {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.75rem 1.35rem 1.25rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.legal-modal__scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.legal-modal__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 2.25rem 0.75rem 0;
    color: var(--cb-text);
    letter-spacing: -0.02em;
}

.legal-modal__intro {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--cb-text-tertiary);
    margin: 0 0 1.25rem;
}

.legal-modal__intro a {
    color: var(--cb-accent-bright);
}

.legal-modal__h {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 1.15rem 0 0.45rem;
    color: var(--cb-text);
}

.legal-modal__scroll p {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--cb-text-secondary);
    margin: 0 0 0.65rem;
}

.legal-modal__scroll a {
    color: var(--cb-accent-bright);
}

.legal-modal__foot {
    margin-top: 1.5rem !important;
    margin-bottom: 0 !important;
    text-align: center;
}

.legal-modal__done {
    min-width: 8rem;
}

/* —— Responsive —— */
@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: none;
        margin: 0;
        gap: 1.25rem;
    }

    .project-card {
        max-width: none;
        width: 100%;
        justify-self: stretch;
    }
}

@media (min-width: 1440px) {
    :root {
        --container-max: 96rem;
    }

    .projects-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.35rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
        gap: 0.7rem;
    }

    .hero {
        padding: 140px var(--gutter) 100px;
    }

    section {
        padding-block: clamp(4.5rem, 6vw, 6.5rem);
    }
}

@media (min-width: 1800px) {
    :root {
        --container-max: 104rem;
    }

    .projects-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;
    }

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

@media (max-width: 768px) {
    :root {
        --nav-blur: 8px;
        --gutter: clamp(0.9rem, 4.5vw, 1.25rem);
    }

    .navbar {
        backdrop-filter: blur(var(--nav-blur));
        -webkit-backdrop-filter: blur(var(--nav-blur));
    }

    .navbar .container {
        position: relative;
        z-index: 2;
        padding: 0.45rem 0;
    }

    section.hero,
    section.projects,
    section.services,
    section.tools,
    section.about,
    section.contact,
    footer {
        content-visibility: auto;
        contain-intrinsic-size: auto 800px;
    }

    .hero {
        min-height: 100svh;
        padding: calc(5.5rem + env(safe-area-inset-top, 0px)) var(--gutter) 4rem;
    }

    .hero-grid {
        opacity: 0.28;
        background-size: 40px 40px;
    }

    /* Full-screen dim behind open menu; sits under .navbar (1000), above page content */
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 900;
        background: rgba(0, 0, 0, 0.78);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.28s ease, visibility 0.28s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-backdrop.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-menu {
        position: fixed;
        top: calc(4.5rem + env(safe-area-inset-top, 0px));
        left: 0;
        right: 0;
        max-width: 100%;
        max-height: min(560px, calc(100vh - 5.25rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
        max-height: min(560px, calc(100dvh - 5.25rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
        flex-direction: column;
        align-items: stretch;
        background: rgba(0, 0, 0, 0.98);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        width: 100%;
        padding: 0.65rem max(1.25rem, env(safe-area-inset-right, 0px)) calc(1rem + env(safe-area-inset-bottom, 0px)) max(1.25rem, env(safe-area-inset-left, 0px));
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--cb-border);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        border: 1px solid var(--cb-border);
        border-top: none;
        transform: translateX(-100%);
        opacity: 0;
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.26s ease;
        gap: 0.2rem;
        z-index: 3;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        pointer-events: none;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu a {
        color: var(--cb-text);
        padding: 0.95rem 1.05rem;
        border-radius: var(--radius-sm);
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .nav-menu a:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .nav-menu a:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .nav-menu a.nav-link-cta {
        margin-left: 0;
        text-align: center;
        justify-content: center;
        margin-top: 0.35rem;
        min-height: 50px;
    }

    .nav-toggle {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        margin-left: 0.35rem;
        border: 1px solid var(--cb-border-strong);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.04);
        gap: 5px;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-toggle:focus-visible {
        outline: 2px solid var(--cb-accent-bright);
        outline-offset: 2px;
    }

    .nav-toggle:active {
        background: rgba(255, 255, 255, 0.08);
    }

    .nav-toggle span {
        width: 18px;
    }

    .nav-toggle.is-open {
        border-color: rgba(248, 113, 113, 0.5);
        background: rgba(239, 68, 68, 0.12);
    }

    .nav-toggle.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.is-open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0.2);
    }

    .nav-toggle.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Brand “JGreaterLab” / “.com” on two lines — fits narrow viewports next to logo + menu */
    .nav-brand-text {
        white-space: normal;
    }

    .nav-brand-tld {
        display: block;
        line-height: 1.15;
    }

    .hero-title .accent-word {
        display: block;
        line-height: 1.05;
    }

    .section-title {
        font-size: 1.85rem;
    }

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

    .project-image--catchtex {
        height: 12.5rem;
    }

    .project-description {
        height: calc(1.4em * 3 + 0.56rem);
        max-height: calc(1.4em * 3 + 0.56rem);
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .about-highlights {
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (hover: none) and (pointer: coarse) {
    .project-card:hover,
    .tool-link-card:hover,
    .service-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }

    .project-card:hover .project-img {
        transform: none;
    }
}

@media (max-width: 480px) {
    .nav-logo-img {
        height: 42px;
        max-width: min(58vw, 220px);
    }

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

    .project-card {
        margin: 0;
        border-radius: var(--radius-md);
    }
}
