/* ── Reset ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
html, body { height: auto; overflow: auto; }
body { background: #F9F7F4; color: #1a1614; font-family: 'DM Sans', system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
img, video { display: block; width: 100%; height: auto; }
* { cursor: none !important; }

/* ── Tokens ──────────────────────────────── */
:root {
    --bg:         #F9F7F4;
    --text:       #1a1614;
    --text-mid:   #5a4830;
    --text-soft:  #8a7050;
    --accent:     #c4572a;
    --rule:       rgba(90,72,48,0.11);
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans:  'DM Sans', system-ui, sans-serif;
    --font-hand:  'Caveat', cursive;
}

/* ── Glass cursor ────────────────────────── */
.cursor-glass {
    position: fixed;
    top: 0; left: 0;
    width: 160px; height: 160px;
    pointer-events: none;
    z-index: 99999;
    will-change: transform;
    transform-origin: center center;
    backdrop-filter: url(#cursor-lens) brightness(1.22) contrast(1.15) saturate(1.2);
    -webkit-backdrop-filter: url(#cursor-lens) brightness(1.22) contrast(1.15) saturate(1.2);
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.7);
    box-shadow:
        inset 0 2px 0 rgba(255,255,255,0.9),
        inset 0 -1px 0 rgba(255,255,255,0.2),
        inset 1px 0 0 rgba(255,255,255,0.4),
        inset -1px 0 0 rgba(255,255,255,0.15),
        0 12px 40px rgba(0,0,0,0.12),
        0 2px 8px rgba(0,0,0,0.06);
    opacity: 0;
    transition: opacity 0.4s ease;
    animation: blob-idle 6s ease-in-out infinite;
}
@keyframes blob-idle {
    0%   { border-radius: 68% 32% 44% 56% / 55% 48% 52% 45%; }
    14%  { border-radius: 42% 58% 62% 38% / 38% 64% 36% 62%; }
    28%  { border-radius: 55% 45% 35% 65% / 62% 35% 65% 38%; }
    42%  { border-radius: 36% 64% 58% 42% / 48% 56% 44% 52%; }
    57%  { border-radius: 64% 36% 48% 52% / 36% 58% 42% 64%; }
    71%  { border-radius: 45% 55% 68% 32% / 60% 42% 58% 40%; }
    85%  { border-radius: 52% 48% 38% 62% / 44% 66% 34% 56%; }
    100% { border-radius: 68% 32% 44% 56% / 55% 48% 52% 45%; }
}
.cursor-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        138deg,
        rgba(255,255,255,0.55) 0%,
        rgba(255,255,255,0.14) 32%,
        rgba(255,255,255,0.02) 62%,
        rgba(180,210,255,0.07) 100%
    );
    pointer-events: none;
}
.cursor-glass::after {
    content: '';
    position: absolute;
    bottom: 9%; right: 11%;
    width: 24%; height: 13%;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    filter: blur(4px);
    pointer-events: none;
}
.cursor-glass.is-visible { opacity: 1; }
.cursor-glass.is-clicking {
    animation: none;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.1);
}
.cursor-glass.is-hovering {
    border-color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1.5px 0 rgba(255,255,255,0.9),
        inset 0 -1px 0 rgba(255,255,255,0.3),
        inset 1px 0 0 rgba(255,255,255,0.4),
        inset -1px 0 0 rgba(255,255,255,0.2),
        0 0 0 0.5px rgba(255,255,255,0.25),
        0 8px 32px rgba(0,0,0,0.1);
}

/* ── Back nav ────────────────────────────── */
.back-nav {
    position: fixed;
    top: 36px; left: 44px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
    color: var(--text-soft);
    transition: color 0.2s;
    padding: 10px 14px;
}
/* Expand hit area to match bubble morph (bubble adds PAD/2 = 9px each side) */
.back-nav::after {
    content: '';
    position: absolute;
    inset: -9px;
}
.back-nav:hover { color: var(--text); }

/* ── Page wrapper ────────────────────────── */
.page {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 48px 140px;
}

/* ── Project header ──────────────────────── */
.proj-header {
    padding-top: 148px;
    padding-bottom: 72px;
}
.proj-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}
.proj-num {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.proj-tags {
    font-size: 0.6875rem;
    letter-spacing: 0.07em;
    color: var(--text-soft);
}
.proj-title {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 9vw, 8.5rem);
    font-weight: 300;
    line-height: 0.9;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 24px;
}
.proj-subtitle {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-mid);
    max-width: 560px;
    line-height: 1.45;
    margin-bottom: 52px;
}
.proj-meta {
    display: flex;
    gap: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
}
.proj-meta-label {
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 5px;
}
.proj-meta-value {
    font-size: 0.9375rem;
    color: var(--text-mid);
    font-weight: 300;
}

/* ── Hero image ──────────────────────────── */
.proj-hero-img {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(90,72,48,0.05);
    margin-bottom: 96px;
}

/* ── At a glance strip ───────────────────── */
.proj-glance {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    margin-bottom: 96px;
}
.proj-glance-item {
    padding: 36px 40px 36px 0;
}
.proj-glance-item + .proj-glance-item {
    padding-left: 40px;
    border-left: 1px solid var(--rule);
}
.proj-glance-label {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 12px;
}
.proj-glance-text {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 300;
    line-height: 1.35;
    color: var(--text);
}
@media (max-width: 680px) {
    .proj-glance { grid-template-columns: 1fr; }
    .proj-glance-item + .proj-glance-item { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; }
}

/* ── Section ─────────────────────────────── */
.proj-section {
    max-width: 680px;
    margin-bottom: 72px;
}
.section-label {
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 16px;
}
.proj-section h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 20px;
}
.proj-section p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-mid);
    font-weight: 300;
}
.proj-section p + p { margin-top: 14px; }
.proj-section strong { font-weight: 500; color: var(--text); }

/* ── Feature block ───────────────────────── */
.proj-feature {
    margin: 56px 0;
}
.proj-feature-img {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(90,72,48,0.04);
    margin-bottom: 14px;
}
.proj-feature-caption {
    font-size: 0.8125rem;
    color: var(--text-soft);
    line-height: 1.55;
    font-weight: 300;
}

/* ── Two-column images ───────────────────── */
.proj-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 56px 0;
}
.proj-2col .proj-feature-img { margin-bottom: 0; }

/* ── Stats strip ─────────────────────────── */
.proj-stats {
    display: flex;
    gap: 0;
    margin: 88px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.proj-stat {
    flex: 1;
    padding: 40px 0;
    padding-right: 32px;
}
.proj-stat + .proj-stat {
    padding-left: 32px;
    border-left: 1px solid var(--rule);
}
.proj-stat-num {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 300;
    color: var(--text);
    line-height: 1;
    margin-bottom: 8px;
}
.proj-stat-label {
    font-size: 0.8125rem;
    color: var(--text-soft);
    line-height: 1.5;
    font-weight: 300;
    max-width: 160px;
}

/* ── Pull quote ──────────────────────────── */
.proj-quote {
    font-family: var(--font-serif);
    font-size: clamp(1.3rem, 2.4vw, 1.9rem);
    font-style: italic;
    font-weight: 300;
    line-height: 1.45;
    color: var(--text);
    padding: 64px 0;
    border-top: 1px solid var(--rule);
    max-width: 680px;
}

/* ── Next project ────────────────────────── */
.proj-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 56px;
    border-top: 1px solid var(--rule);
    margin-top: 112px;
    transition: opacity 0.2s;
}
.proj-next:hover { opacity: 0.7; }
.proj-next-label {
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-soft);
    margin-bottom: 8px;
}
.proj-next-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.8vw, 2.2rem);
    font-weight: 300;
    color: var(--text);
}
.proj-next-arrow {
    font-size: 1.75rem;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    transition: color 0.2s;
}
.proj-next:hover .proj-next-arrow { color: var(--text); }

/* ── Section nav ─────────────────────────── */
.section-nav {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: flex-end;
}
.section-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 0;
    position: relative;
}
.section-nav-label {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    color: var(--text-soft);
    white-space: nowrap;
    opacity: 0.45;
    transition: opacity 0.18s, color 0.18s;
    pointer-events: none;
}
.section-nav-item:hover .section-nav-label {
    opacity: 1;
    color: var(--text-mid);
}
.section-nav-item.is-active .section-nav-label {
    opacity: 1;
    color: var(--accent);
}
.section-nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(90,72,48,0.25);
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}
.section-nav-item.is-active .section-nav-dot {
    background: var(--accent);
    transform: scale(1.5);
}
.section-nav-item:hover .section-nav-dot {
    background: var(--text-mid);
}
@media (max-width: 900px) {
    .section-nav { display: none; }
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 680px) {
    .page { padding: 0 24px 100px; }
    .back-nav { top: 24px; left: 24px; }
    .proj-header { padding-top: 100px; }
    .proj-meta { flex-wrap: wrap; gap: 24px; }
    .proj-stats { flex-direction: column; }
    .proj-stat + .proj-stat { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; }
    .proj-2col { grid-template-columns: 1fr; }
}
