/* ── Custom properties ── */
:root, [data-theme="dark"] {
    --bg:        #0F0D0A;
    --surface:   #181512;
    --surface-2: #201D19;
    --border:    #262220;
    --text:      #F0EEEB;
    --text-2:    #807B76;
    --text-3:    #302D29;
    --accent:    #4ADE80;
    --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --dot-color: rgba(255,255,255,0.055);
    color-scheme: dark;
}
[data-theme="light"] {
    --bg:        #FFFDF7;
    --surface:   #F5F2ED;
    --surface-2: #EDE9E3;
    --border:    #E0DAD2;
    --text:      #0F0D0A;
    --text-2:    #7A7570;
    --text-3:    #C5C0B8;
    --accent:    #127f36;
    --dot-color: rgba(0,0,0,0.04);
    color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Grain texture overlay ── */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.038;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.80' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 300px 300px;
}
[data-theme="light"] .grain { opacity: 0.024; }

/* ── Skip link ── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 200;
    padding: 10px 20px;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top 0.15s var(--ease-out);
}
.skip-link:focus { top: 0; outline: none; }

/* ── Visually hidden (screen-reader only) ── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Focus styles ── */
:focus { outline: none; }
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
}

/* ── Scroll margin for fixed nav ── */
[id] { scroll-margin-top: 80px; }

/* ── Base ── */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Container ── */
.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ── Nav ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 40px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    transition: transform 0.25s var(--ease-out), background 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}
.nav.scrolled {
    background: var(--bg);
    border-bottom-color: var(--border);
}
.nav.hidden {
    transform: translateY(-100%);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}
.nav-mark {
    display: flex;
    align-items: center;
    position: relative;
    top: -1px;
}
.nav-word {
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-links {
    display: flex;
    gap: 28px;
}
.nav-links a {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: 0.02em;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-3); }
.theme-toggle:active { transform: scale(0.92); }

/* sun shown in dark, moon shown in light */
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }

/* ── Hero ── */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 38%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    height: 520px;
    background: radial-gradient(ellipse, rgba(74, 222, 128, 0.09) 0%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* Floating background marks */
.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.float-mark {
    position: absolute;
    color: var(--accent);
    animation: float-up linear infinite;
    opacity: 0;
}
@keyframes float-up {
    0%   { transform: translateY(0)    rotate(0deg);   opacity: 0; }
    10%  { opacity: var(--fopacity, 0.06); }
    90%  { opacity: var(--fopacity, 0.06); }
    100% { transform: translateY(-70vh) rotate(22deg); opacity: 0; }
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.25rem;
}

/* Logo row */
.hero-logo {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.hero-mark {
    flex-shrink: 0;
    color: var(--accent);
    margin-top: calc(0.53 * clamp(3.5rem, 8vw, 5.5rem) - 14px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sonar-ring {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0;
    pointer-events: none;
    animation: sonar-pulse 2.6s ease-out 1.9s infinite;
}
.sonar-ring-2 {
    animation-delay: 3.2s;
}
@keyframes sonar-pulse {
    0%   { transform: scale(1);   opacity: 0.5; }
    100% { transform: scale(3.6); opacity: 0; }
}
.hero-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}
.hero-word {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(3.5rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1;
}
.hero-sub {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(0.6rem, 1vw, 0.75rem);
    font-weight: 400;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--text-2);
}

.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 300;
    color: var(--text-2);
    letter-spacing: 0.01em;
    max-width: 36ch;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--bg);
    background: var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    transition: opacity 0.15s ease, transform 0.18s var(--ease-out), box-shadow 0.22s ease;
}
.hero-cta:hover { opacity: 0.88; }
.hero-cta:active { transform: scale(0.97); opacity: 1; }
.hero-cta svg { transition: transform 0.18s var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
    .hero-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74, 222, 128, 0.22); }
    .hero-cta:hover svg { transform: translateX(3px); }
}
[data-theme="light"] .hero-cta:hover { box-shadow: 0 8px 24px rgba(18, 127, 54, 0.22); }

/* ── Hero animations ── */
.hero-mark,
.hero-word,
.hero-sub,
.hero-cta {
    opacity: 0;
}
.hero-tagline .word {
    display: inline-block;
    opacity: 0;
}

.hero-inner.animate .hero-mark {
    animation: mark-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}
.hero-inner.animate .hero-word {
    animation: word-enter 0.4s var(--ease-out) 0.75s forwards;
}
.hero-inner.animate .hero-sub {
    animation: sub-enter 0.35s var(--ease-out) 1.05s forwards;
}
.hero-inner.animate .hero-tagline .word:nth-child(1) { animation: fade-up 0.35s var(--ease-out) 1.30s forwards; }
.hero-inner.animate .hero-tagline .word:nth-child(2) { animation: fade-up 0.35s var(--ease-out) 1.43s forwards; }
.hero-inner.animate .hero-tagline .word:nth-child(3) { animation: fade-up 0.35s var(--ease-out) 1.56s forwards; }
.hero-inner.animate .hero-tagline .word:nth-child(4) { animation: fade-up 0.35s var(--ease-out) 1.69s forwards; }
.hero-inner.animate .hero-tagline .word:nth-child(5) { animation: fade-up 0.35s var(--ease-out) 1.82s forwards; }
.hero-inner.animate .hero-cta {
    animation: fade-up 0.4s var(--ease-out) 2.05s forwards;
}

@keyframes mark-enter {
    from { opacity: 0; transform: translateX(-22px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes word-enter {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes sub-enter {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Sections ── */
.section {
    padding: 96px 0;
    border-top: 1px solid var(--border);
}

.section-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-label::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.65;
}

/* ── Services ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.service-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 2px solid var(--border);
    border-radius: 10px;
    padding: 2rem 2rem 2.25rem;
    transition: border-top-color 0.2s ease;
}
.service-card:hover {
    border-top-color: var(--accent);
}
.service-num {
    position: absolute;
    bottom: 0.5rem;
    right: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: rgba(255,255,255,0.05);
    pointer-events: none;
    user-select: none;
    transition: color 0.25s ease;
}
[data-theme="light"] .service-num { color: rgba(0,0,0,0.04); }
.service-card:hover .service-num { color: rgba(255,255,255,0.085); }
[data-theme="light"] .service-card:hover .service-num { color: rgba(0,0,0,0.065); }
.service-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.6rem;
}
.service-desc {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-2);
    line-height: 1.7;
}

/* ── Glimpse strip ── */
.glimpse {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    height: 340px;
    overflow: hidden;
}
.glimpse-item {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}
.glimpse-item + .glimpse-item {
    border-left: 1px solid var(--border);
}
.glimpse-item:nth-child(1) {
    background: linear-gradient(150deg, var(--surface) 0%, var(--surface-2) 100%);
}
.glimpse-item:nth-child(2) {
    background: linear-gradient(150deg, rgba(74,222,128,0.04) 0%, var(--surface) 55%, var(--surface-2) 100%);
}
.glimpse-item:nth-child(3) {
    background: linear-gradient(150deg, var(--surface-2) 0%, var(--surface) 100%);
}
.glimpse-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.6;
}

/* ── Two-col layout (Studio, Contact) ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}
.section-heading {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0;
    line-height: 1.15;
    color: var(--text);
}
.section-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.section-body p {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-2);
    line-height: 1.75;
}

/* ── Studio layout ── */
.studio-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.studio-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
}
.studio-image {
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.studio-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
}
.img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    color: var(--text-3);
    position: relative;
    z-index: 1;
}
.img-placeholder::after {
    content: 'studio photo';
    font-size: 0.55rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}

/* ── Contact ── */
.contact-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    letter-spacing: 0.02em;
    transition: border-color 0.2s, color 0.2s, padding-left 0.18s var(--ease-out);
}
.contact-link:hover {
    color: var(--accent);
    border-color: var(--accent);
    padding-left: 3px;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
}
.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.footer-copy {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-3);
    letter-spacing: 0.02em;
}
.footer-mark {
    color: var(--text-3);
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.footer-mark:hover { color: var(--accent); }

/* ── Scroll fade-in ── */
.fade-target {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.fade-target.visible {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger service cards */
.service-card:nth-child(2) { transition-delay: 0.07s; }
.service-card:nth-child(3) { transition-delay: 0.14s; }
.service-card:nth-child(4) { transition-delay: 0.21s; }

/* ── Responsive ── */
@media (max-width: 720px) {
    .container { padding: 0 24px; }
    .nav { padding: 0 24px; }
    .nav-links { display: none; }
    .hero { padding: 72px 24px; }
    .hero-mark { margin-top: 16px; }
    .section { padding: 64px 0; }
    .services-grid { grid-template-columns: 1fr; }
    .two-col { grid-template-columns: 1fr; gap: 2rem; }
    .glimpse { height: 180px; }
    .studio-layout { grid-template-columns: 1fr; gap: 2rem; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .float-mark,
    .sonar-ring { animation: none; }

    /* Cancel hero animations at full specificity */
    .hero-inner.animate .hero-mark,
    .hero-inner.animate .hero-word,
    .hero-inner.animate .hero-sub,
    .hero-inner.animate .hero-cta,
    .hero-inner.animate .hero-tagline .word:nth-child(1),
    .hero-inner.animate .hero-tagline .word:nth-child(2),
    .hero-inner.animate .hero-tagline .word:nth-child(3),
    .hero-inner.animate .hero-tagline .word:nth-child(4),
    .hero-inner.animate .hero-tagline .word:nth-child(5) { animation: none; }

    .hero-mark,
    .hero-word,
    .hero-sub,
    .hero-cta,
    .hero-tagline .word { opacity: 1; }

    .fade-target {
        transform: none;
        transition: opacity 0.2s ease;
    }
}
