/* ==========================================================================
   J.Pixels — site styles
   Loaded after tailwind.css, so these rules win where they overlap.
   Tokens first, then layout primitives, then components, then motion.
   ========================================================================== */

:root {
    --bg-0: #050816;
    --bg-1: #09111f;
    --bg-2: #111c33;
    --line: rgba(255, 255, 255, 0.08);
    --brand: #06b6d4;
    --brand-light: #6ee7ff;
    --accent: #f59e0b;
    --ink: #f8fafc;
    --ink-dim: #cbd5e1;

    /* One spacing rhythm for section padding, so vertical spacing stays
       consistent from 320px to 1440px+ without a stack of breakpoints. */
    --section-y: clamp(3.5rem, 2rem + 7vw, 7rem);
    --gutter: clamp(1.25rem, 0.75rem + 2vw, 2rem);
}

/* `clip` rather than `hidden`: it contains stray decoration without creating a
   scroll container, which would break position:sticky and scroll anchoring.
   The actual overflow sources are contained locally (see .deco-layer). */
html {
    overflow-x: clip;
    scroll-behavior: smooth;
    /* Offset in-page anchors so the fixed nav never covers a section heading. */
    scroll-padding-top: 6rem;
}

body {
    background:
        radial-gradient(circle at top left, rgba(6, 182, 212, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 30%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1) 42%, var(--bg-0));
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Accessibility primitives
   -------------------------------------------------------------------------- */

.skip-link {
    position: absolute;
    left: 50%;
    top: 0.5rem;
    transform: translate(-50%, -160%);
    z-index: 100;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    background: var(--accent);
    color: #050816;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

/* Visible, consistent focus ring on everything interactive. Uses :focus-visible
   so it appears for keyboard users without flashing on every mouse click. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--brand-light);
    outline-offset: 3px;
    border-radius: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.shell {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: var(--section-y);
}

/* Holds the blurred decorative rings. Clipping here — rather than on <body> —
   is what removes the horizontal scrollbar at every breakpoint. */
.deco-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.soft-ring {
    position: absolute;
    border-radius: 9999px;
    filter: blur(60px);
    opacity: 0.75;
    pointer-events: none;
}

.hero-grid {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 96px 96px;
    -webkit-mask-image: radial-gradient(circle at center, #000, transparent 85%);
    mask-image: radial-gradient(circle at center, #000, transparent 85%);
}

/* --------------------------------------------------------------------------
   Typography — fluid, so headings never overflow at 320px or bloat at 1440px
   -------------------------------------------------------------------------- */

.hero-title {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: clamp(2.05rem, 1.15rem + 4.1vw, 4.75rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.section-heading {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.9rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.hero-subtitle {
    max-width: 58ch;
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
    line-height: 1.65;
}

.section-intro {
    max-width: 62ch;
    line-height: 1.7;
}

.section-eyebrow {
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-size: clamp(0.68rem, 0.64rem + 0.15vw, 0.8rem);
}

.gradient-text {
    background: linear-gradient(90deg, #f8fafc 0%, #67e8f9 45%, #fbbf24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   Buttons — a real primary/secondary hierarchy.
   Both hero CTAs previously shared one style, so neither read as the main action.
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;               /* comfortably above the 44px tap-target floor */
    padding: 0.85rem 1.75rem;
    border-radius: 9999px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.btn-primary {
    background: linear-gradient(90deg, var(--brand) 0%, var(--accent) 100%);
    /* Dark ink on the bright gradient. The previous gradient-on-gradient text
       failed contrast badly at every size. */
    color: #05101c;
    box-shadow: 0 14px 34px rgba(6, 182, 212, 0.24);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(6, 182, 212, 0.34);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--ink);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(110, 231, 255, 0.5);
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.glass-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
}

.nav-shell {
    background: rgba(2, 6, 23, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
}

.stat-pill {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.feature-card,
.journey-card,
.contact-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.lift {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

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

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.portrait-frame {
    position: relative;
    z-index: 10;
    background: radial-gradient(circle at top, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

/* --------------------------------------------------------------------------
   Portfolio category cards (real <button>s, so they need the reset)
   -------------------------------------------------------------------------- */

.category-card {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 60px rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.4);
}

.category-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-card:hover .category-card__img,
.category-card:focus-visible .category-card__img {
    transform: scale(1.07);
}

.category-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.35rem;
    padding: clamp(1rem, 0.6rem + 1.4vw, 1.5rem);
    background: linear-gradient(to top, rgba(3, 7, 18, 0.96) 0%, rgba(3, 7, 18, 0.4) 52%, rgba(3, 7, 18, 0.05) 100%);
}

.category-card__count {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brand-light);
}

.category-card__cta {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.category-card:hover .category-card__cta,
.category-card:focus-visible .category-card__cta {
    opacity: 1;
    transform: translateY(0);
}

/* Touch devices get no hover, so the CTA must always be legible there. */
@media (hover: none) {
    .category-card__cta {
        opacity: 1;
        transform: none;
    }
}

/* The Visiting Cards set has no images yet — say so instead of opening an
   empty gallery. */
.category-card[aria-disabled="true"] {
    cursor: default;
    opacity: 0.62;
}

.category-card[aria-disabled="true"]:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.12);
}

.category-card[aria-disabled="true"]:hover .category-card__img {
    transform: none;
}

/* --------------------------------------------------------------------------
   Gallery modal + masonry
   -------------------------------------------------------------------------- */

.gallery-modal,
.lightbox {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.is-open,
.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.gallery-modal .modal-content {
    transform: translateY(24px) scale(0.98);
    transition: transform 0.3s ease;
}

.gallery-modal.is-open .modal-content {
    transform: none;
}

.masonry-grid {
    column-count: 1;
    column-gap: 1rem;
}

@media (min-width: 640px) {
    .masonry-grid { column-count: 2; }
}

@media (min-width: 1024px) {
    .masonry-grid { column-count: 3; column-gap: 1.25rem; }
}

@media (min-width: 1440px) {
    .masonry-grid { column-count: 4; }
}

.masonry-item {
    break-inside: avoid;
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* width/height are set on every <img>, so the browser reserves the correct box
   before the file arrives — no layout shift as the gallery fills in. */
.masonry-item img {
    display: block;
    width: 100%;
    height: auto;
}

.lightbox__img {
    max-width: min(92vw, 1400px);
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.25rem;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.icon-btn:hover {
    background: var(--brand);
    color: #05101c;
}

@media (max-width: 640px) {
    .gallery-modal .modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .lightbox__nav {
        width: 42px;
        height: 42px;
    }
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field {
    width: 100%;
    min-height: 48px;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--ink);
    font: inherit;
}

.field::placeholder {
    color: #64748b;
}

.field:focus {
    outline: none;
    border-color: rgba(110, 231, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}

.field-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Motion — every animated rule below is disabled under prefers-reduced-motion
   -------------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

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

@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

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

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    /* Reveal-on-scroll must not leave content invisible when its transition is
       stripped out — show everything immediately instead. */
    .reveal {
        opacity: 1;
        transform: none;
    }

    .marquee {
        animation: none;
        /* Without the scroll animation the duplicated track would just be
           repeated text, so collapse it to a single readable row. */
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .lift:hover,
    .category-card:hover,
    .masonry-item:hover,
    .btn:hover {
        transform: none;
    }
}
