/* ============================================================
   candygirl.bar — Cyberpunk Archive Aesthetic
   Colors: #111827 #0a0e1a #1e3a5f #6b7fa3 #8892a4 #c0cad8 #e8edf5 #2a1f3d #7c6b9e
   Fonts: Commissioner (variable), Space Mono
   ============================================================ */

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

:root {
    --bg-darkest:   #0a0e1a;
    --bg-dark:      #111827;
    --navy:         #1e3a5f;
    --steel:        #6b7fa3;
    --nav-text:     #8892a4;
    --body-text:    #c0cad8;
    --hero-text:    #e8edf5;
    --violet-ember: #2a1f3d;
    --violet-accent:#7c6b9e;
    --chrome:       #a8b8cc;
    --chrome-bright:#d4dfe8;
    --font-main:    'Commissioner', sans-serif;
    --font-mono:    'Space Mono', monospace;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-darkest);
    color: var(--body-text);
    font-family: var(--font-main);
    font-weight: 300;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* --- Film Grain Overlay --- */
#grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    opacity: 0.08;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    animation: grain-shift 0.5s steps(2) infinite;
}

@keyframes grain-shift {
    0%   { background-position: 0 0; }
    25%  { background-position: -30px 15px; }
    50%  { background-position: 15px -30px; }
    75%  { background-position: -15px 30px; }
    100% { background-position: 30px -15px; }
}

/* --- Violet Ember Atmospheric Layer --- */
#ember-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse 80% 60% at 50% 80%,
        var(--violet-ember) 0%,
        transparent 70%
    );
    animation: ember-pulse 8s ease-in-out infinite alternate;
}

@keyframes ember-pulse {
    0%   { opacity: 0.35; transform: scale(1); }
    50%  { opacity: 0.55; transform: scale(1.05); }
    100% { opacity: 0.40; transform: scale(0.97); }
}

/* --- Navigation --- */
#site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--navy);
    background: rgba(10, 14, 26, 0.88);
    backdrop-filter: blur(8px);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 48px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--chrome-bright);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 40px;
    list-style: none;
}

.nav-link {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--nav-text);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--violet-accent);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--hero-text);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Band Base (Z-pattern sections) --- */
.band {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    overflow: hidden;
}

/* --- Diagonal Chrome Rails --- */
.diagonal-rail {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--chrome) 20%,
        var(--chrome-bright) 50%,
        var(--chrome) 80%,
        transparent 100%
    );
    transform: rotate(-15deg);
    transform-origin: center;
    z-index: 2;
    pointer-events: none;
}

.rail-hero      { top: 92%; }
.rail-archive   { top: -2%; }
.rail-artifacts { top: 92%; }
.rail-signal    { top: -2%; }
.rail-contact   { top: 92%; }

/* ============================================================
   BAND 1 — Hero (left-anchored)
   ============================================================ */
#hero {
    display: flex;
    align-items: center;
    padding-top: 64px; /* nav height */
    background: var(--bg-darkest);
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 120px 80px 120px 80px;
    max-width: 55%;
    flex-shrink: 0;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--violet-accent);
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-headline {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(72px, 9vw, 120px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hero-text);
    line-height: 0.95;
    margin-bottom: 32px;
    /* Variable weight controlled by JS */
    font-variation-settings: 'wght' 700;
}

.hero-subhead {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 1.15rem;
    color: var(--body-text);
    line-height: 1.7;
    margin-bottom: 48px;
    max-width: 420px;
}

.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--chrome-bright);
    text-decoration: none;
    position: relative;
}

.cta-rail {
    display: block;
    width: 60px;
    height: 1px;
    background: var(--chrome-bright);
    transition: width 0.4s ease;
}

.cta-link:hover .cta-rail {
    width: 100px;
}

.cta-link:hover .cta-text {
    color: var(--hero-text);
}

/* Hero Image Frame */
.hero-image-frame {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    z-index: 2;
}

.image-clip {
    position: absolute;
    overflow: hidden;
}

.hero-clip {
    top: 8%;
    left: 5%;
    right: 0;
    bottom: 8%;
    clip-path: polygon(12% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 15%);
}

.image-inner {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.7) contrast(1.2) brightness(0.7);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(124, 107, 158, 0.2);
    mix-blend-mode: multiply;
}

/* Synthetic photo fills using CSS gradients + noise */
.photo-1 {
    background:
        linear-gradient(135deg, #0a0e1a 0%, #1e3a5f 30%, #2a1f3d 60%, #111827 100%);
    position: relative;
}
.photo-1::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 40% 60% at 35% 40%, rgba(200,200,180,0.25) 0%, transparent 60%),
        radial-gradient(ellipse 20% 30% at 70% 70%, rgba(180,160,140,0.15) 0%, transparent 50%);
}
.photo-1::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    opacity: 0.35;
    mix-blend-mode: overlay;
}

.photo-2 {
    background: linear-gradient(160deg, #0a0e1a 0%, #111827 40%, #1e3a5f 100%);
}
.photo-2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 70% at 60% 30%, rgba(180,200,220,0.2) 0%, transparent 60%);
}

.photo-3 {
    background: linear-gradient(200deg, #111827 0%, #2a1f3d 50%, #0a0e1a 100%);
}
.photo-3::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 40% at 50% 50%, rgba(170,150,200,0.2) 0%, transparent 70%);
}

.photo-4 {
    background: linear-gradient(120deg, #1e3a5f 0%, #0a0e1a 40%, #2a1f3d 100%);
}
.photo-4::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 30% 60%, rgba(200,190,160,0.18) 0%, transparent 60%);
}

.photo-5 {
    background: linear-gradient(170deg, #0a0e1a 0%, #1e3a5f 35%, #111827 65%, #2a1f3d 100%);
}
.photo-5::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 45% 65% at 40% 35%, rgba(190,200,215,0.22) 0%, transparent 60%);
}

/* ============================================================
   BAND 2 — Archive (right-anchored)
   ============================================================ */
#archive {
    background: var(--bg-dark);
    padding: 120px 80px;
}

.archive-grid {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.archive-header {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 48px;
    margin-bottom: 80px;
}

.section-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--violet-accent);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
}

.section-headline {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(48px, 6vw, 80px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hero-text);
    line-height: 0.95;
    font-variation-settings: 'wght' 700;
}

.archive-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.archive-card {
    position: relative;
    cursor: pointer;
}

.card-image-frame {
    position: relative;
    height: 280px;
    margin-bottom: 24px;
}

.card-clip-a {
    inset: 0;
    clip-path: polygon(0% 8%, 100% 0%, 100% 92%, 8% 100%);
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.card-clip-b {
    inset: 0;
    clip-path: polygon(0% 0%, 92% 0%, 100% 8%, 100% 100%, 0% 100%);
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.card-clip-c {
    inset: 0;
    clip-path: polygon(8% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 8%);
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.archive-card:hover .card-clip-a {
    clip-path: polygon(0% 0%, 100% 4%, 100% 100%, 4% 96%);
}

.archive-card:hover .card-clip-b {
    clip-path: polygon(0% 4%, 96% 0%, 100% 0%, 100% 96%, 0% 100%);
}

.archive-card:hover .card-clip-c {
    clip-path: polygon(4% 0%, 100% 0%, 100% 100%, 0% 96%, 0% 4%);
}

.card-meta {
    padding: 0 4px;
}

.card-code {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--steel);
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.card-title {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: var(--hero-text);
    margin-bottom: 8px;
    font-variation-settings: 'wght' 600;
}

.card-desc {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 0.875rem;
    color: var(--body-text);
    line-height: 1.6;
}

/* ============================================================
   BAND 3 — Artifacts (left-anchored)
   ============================================================ */
#artifacts {
    background: var(--bg-darkest);
    padding: 140px 80px;
}

.artifacts-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    position: relative;
    z-index: 3;
}

.artifacts-image-col {
    position: relative;
    height: 600px;
}

.artifacts-clip {
    inset: 0;
    clip-path: polygon(0% 0%, 88% 0%, 100% 12%, 100% 100%, 12% 100%, 0% 88%);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

.artifacts-clip:hover {
    clip-path: polygon(0% 4%, 84% 0%, 100% 16%, 96% 100%, 8% 100%, 0% 84%);
}

.artifacts-text-col {
    padding-left: 40px;
}

.artifacts-body {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 1.05rem;
    color: var(--body-text);
    line-height: 1.8;
    margin: 24px 0 48px;
    max-width: 480px;
}

.artifact-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    border-top: 1px solid var(--navy);
    padding-top: 40px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-num {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(28px, 3vw, 40px);
    color: var(--chrome-bright);
    letter-spacing: 0.02em;
    font-variation-settings: 'wght' 700;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--steel);
    text-transform: uppercase;
}

/* ============================================================
   BAND 4 — Signal (right-anchored)
   ============================================================ */
#signal {
    background: var(--bg-dark);
    padding: 120px 80px;
}

.signal-layout {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 3;
}

.signal-header {
    text-align: right;
    margin-bottom: 80px;
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.signal-card {
    cursor: pointer;
}

.signal-clip {
    padding: 40px 32px;
    transition: clip-path 0.7s cubic-bezier(0.77, 0, 0.175, 1);
    position: relative;
}

.signal-clip-a {
    background: linear-gradient(135deg, var(--violet-ember), var(--bg-dark));
    clip-path: polygon(0% 0%, 100% 4%, 100% 96%, 4% 100%);
}

.signal-clip-b {
    background: linear-gradient(135deg, var(--navy), var(--bg-darkest));
    clip-path: polygon(4% 0%, 100% 0%, 96% 100%, 0% 96%);
}

.signal-clip-c {
    background: linear-gradient(135deg, #1c1428, var(--bg-dark));
    clip-path: polygon(0% 4%, 96% 0%, 100% 100%, 4% 96%);
}

.signal-card:hover .signal-clip-a {
    clip-path: polygon(0% 4%, 96% 0%, 100% 100%, 4% 96%);
}

.signal-card:hover .signal-clip-b {
    clip-path: polygon(0% 0%, 100% 4%, 96% 100%, 0% 96%);
}

.signal-card:hover .signal-clip-c {
    clip-path: polygon(4% 0%, 100% 0%, 96% 100%, 0% 96%);
}

.signal-freq {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    color: var(--violet-accent);
    text-transform: uppercase;
    display: block;
    margin-bottom: 16px;
}

.signal-title {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--hero-text);
    margin-bottom: 12px;
    font-variation-settings: 'wght' 600;
}

.signal-body {
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 0.875rem;
    color: var(--body-text);
    line-height: 1.7;
}

/* ============================================================
   BAND 5 — Contact
   ============================================================ */
#contact {
    background: var(--bg-darkest);
    padding: 140px 80px;
}

.contact-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    align-items: start;
    position: relative;
    z-index: 3;
}

.contact-headline {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: clamp(56px, 7vw, 96px);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hero-text);
    line-height: 0.95;
    margin: 16px 0 24px;
    font-variation-settings: 'wght' 700;
}

.contact-sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    color: var(--steel);
    text-transform: uppercase;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--steel);
    text-transform: uppercase;
}

.form-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--navy);
    color: var(--hero-text);
    font-family: var(--font-main);
    font-weight: 300;
    font-size: 1rem;
    padding: 12px 0;
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
}

.form-input::placeholder {
    color: var(--steel);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--violet-accent);
}

.form-textarea {
    resize: none;
    min-height: 120px;
    line-height: 1.6;
}

.form-submit {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-top: 8px;
    align-self: flex-start;
}

.submit-text {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--chrome-bright);
    transition: color 0.3s ease;
}

.submit-rail {
    display: block;
    width: 50px;
    height: 1px;
    background: var(--chrome-bright);
    transition: width 0.4s ease;
}

.form-submit:hover .submit-text {
    color: var(--hero-text);
}

.form-submit:hover .submit-rail {
    width: 80px;
}

/* ============================================================
   Footer
   ============================================================ */
#site-footer {
    background: var(--bg-darkest);
    border-top: 1px solid var(--navy);
    position: relative;
    overflow: hidden;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 3;
}

.footer-logo {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    color: var(--chrome);
    text-transform: uppercase;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: var(--steel);
    text-transform: uppercase;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--nav-text);
}

.footer-rail {
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 120%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%, var(--chrome) 30%, var(--chrome-bright) 50%, var(--chrome) 70%, transparent 100%
    );
    transform: rotate(-15deg);
    pointer-events: none;
}

/* ============================================================
   Scroll-reveal: morph-text initial state
   ============================================================ */
.morph-text {
    font-variation-settings: 'wght' 300;
    transition: font-variation-settings 0.1s linear;
}

/* ============================================================
   Intersection Observer entrance: clip-path morph-in
   ============================================================ */
.band-2 .archive-items,
.band-3 .artifacts-layout,
.band-4 .signal-grid {
    opacity: 0;
    clip-path: polygon(0% 5%, 100% 0%, 100% 95%, 0% 100%);
    transition:
        opacity 0.9s ease,
        clip-path 0.9s cubic-bezier(0.77, 0, 0.175, 1);
}

.band-2 .archive-items.in-view,
.band-3 .artifacts-layout.in-view,
.band-4 .signal-grid.in-view {
    opacity: 1;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .hero-content { max-width: 70%; padding: 100px 48px; }
    .hero-image-frame { width: 50%; }
    .archive-items { grid-template-columns: repeat(2, 1fr); }
    .signal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav-links { display: none; }

    #hero {
        flex-direction: column;
        min-height: 100svh;
    }

    .hero-content {
        max-width: 100%;
        padding: 100px 32px 60px;
        position: relative;
        z-index: 4;
    }

    .hero-image-frame {
        position: relative;
        width: 100%;
        height: 50vh;
    }

    .hero-clip {
        top: 0; left: 0; right: 0; bottom: 0;
        clip-path: polygon(0% 8%, 100% 0%, 100% 100%, 0% 100%);
    }

    #archive,
    #artifacts,
    #signal,
    #contact { padding: 80px 32px; }

    .archive-items { grid-template-columns: 1fr; }
    .signal-grid { grid-template-columns: 1fr; }
    .artifacts-layout { grid-template-columns: 1fr; }
    .artifacts-image-col { height: 300px; }
    .contact-layout { grid-template-columns: 1fr; gap: 60px; }
    .footer-inner { flex-direction: column; gap: 16px; text-align: center; padding: 32px; }
    .archive-header { justify-content: flex-start; flex-direction: column; align-items: flex-start; gap: 8px; }
}
