/* ============================================================
   kanojo.ai — chrome-serif quietude / Y2K futurism × ma
   Color palette:
     #F4F5F7  primary background
     #E8ECF0  secondary surface
     #C5C8D0  primary text silver
     #9EA3AD  secondary text
     #4A4E5A  accent dark
     #BFC3CC  chrome hairline
     #D4D8E2  watercolor wash base
     #7A8096  deep accent
   Fonts: Cormorant Garamond (300), Space Grotesk (400)
   ============================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #F4F5F7;
    color: #C5C8D0;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    overflow-x: hidden;
    position: relative;
}

/* ---- Dot Matrix Background ---- */
.dot-matrix {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(circle, #7A8096 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

/* ---- Cursor Trail ---- */
#cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #BFC3CC;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 300ms ease;
}

#cursor-trail.active {
    opacity: 0.4;
}

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 36px;
    right: 48px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-status {
    display: flex;
    gap: 6px;
    align-items: center;
}

.status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #7A8096;
    opacity: 0.5;
    animation: status-pulse 2s ease-in-out infinite;
}

.status-dot:nth-child(2) {
    animation-delay: 0.7s;
}

.status-dot:nth-child(3) {
    animation-delay: 1.4s;
}

@keyframes status-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.9; }
}

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

.nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: #9EA3AD;
    text-decoration: none;
    text-transform: lowercase;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #4A4E5A;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover {
    color: #4A4E5A;
}

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

/* ---- Sections: shared ---- */
.section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    z-index: 1;
    overflow: hidden;
}

/* ---- Hero Section ---- */
.section-hero {
    justify-content: center;
    align-items: center;
    background: #F4F5F7;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.hero-word {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(80px, 12.5vw, 180px);
    letter-spacing: 0.15em;
    color: #C5C8D0;
    line-height: 1;
    opacity: 0;
    animation: hero-fade-in 1200ms ease-out 200ms forwards;
}

@keyframes hero-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #BFC3CC 30%, #BFC3CC 70%, transparent 100%);
    margin-top: 28px;
    animation: line-grow 1200ms ease-out 800ms forwards;
    max-width: 30vw;
    align-self: center;
}

@keyframes line-grow {
    from { width: 0; }
    to   { width: 30vw; }
}

.hero-sub {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.20em;
    color: #9EA3AD;
    text-transform: lowercase;
    margin-top: 20px;
    opacity: 0;
    animation: hero-fade-in 800ms ease-out 1400ms forwards;
}

/* ---- Chrome Band ---- */
.chrome-band {
    position: relative;
    height: 8px;
    background: linear-gradient(90deg, #C8CDD8 0%, #E4E8EE 25%, #F0F3F7 50%, #D8DCE6 75%, #C8CDD8 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
    z-index: 1;
    opacity: 0.6;
}

.chrome-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    animation: shimmer-opacity 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes shimmer-opacity {
    0%, 100% { opacity: 0.6; }
    50%       { opacity: 1.0; }
}

/* ---- Watercolor Washes ---- */
.watercolor-wash {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.wc-presence {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 45vw;
    height: 70vh;
    background: radial-gradient(ellipse 70% 60% at center, #C5C8D0 0%, transparent 100%);
    filter: url(#watercolor-1);
    mix-blend-mode: multiply;
    opacity: 0.18;
}

.wc-memory {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 45vw;
    height: 70vh;
    background: radial-gradient(ellipse 70% 60% at center, #B8BDD1 0%, transparent 100%);
    filter: url(#watercolor-2);
    mix-blend-mode: multiply;
    opacity: 0.22;
}

.wc-language {
    left: 50%;
    transform: translate(-50%, -50%);
    top: 50%;
    width: 60vw;
    height: 80vh;
    background: radial-gradient(ellipse 70% 60% at center, #CAC8D5 0%, transparent 100%);
    filter: url(#watercolor-3);
    mix-blend-mode: multiply;
    opacity: 0.16;
}

.wc-connection {
    inset: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse 80% 70% at center, #B5C0CC 0%, transparent 100%);
    filter: url(#watercolor-4);
    mix-blend-mode: multiply;
    opacity: 0.14;
}

/* ---- Reveal Panels ---- */
.reveal-panel {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 480px;
}

.reveal-right {
    margin-left: auto;
    margin-right: 8.33%;
    transform: translateX(60px);
}

.reveal-left {
    margin-left: 8.33%;
    margin-right: auto;
    transform: translateX(-60px);
}

.reveal-down {
    margin: 0 auto;
    transform: translateY(-40px);
    text-align: center;
}

.reveal-quote {
    margin: 0 auto;
    transform: translateY(40px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
}

.reveal-panel.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ---- Section Labels ---- */
.section-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #9EA3AD;
    text-transform: lowercase;
    margin-bottom: 28px;
    opacity: 0;
    transition: opacity 600ms ease 100ms;
}

.is-visible .section-label {
    opacity: 1;
}

/* ---- Section Body ---- */
.section-body {
    font-family: 'Cormorant Garamond', serif;
    font-style: normal;
    font-weight: 300;
    font-size: clamp(18px, 1.5vw, 24px);
    line-height: 2.0;
    color: #4A4E5A;
    max-width: 480px;
    opacity: 0;
    transition: opacity 600ms ease 200ms, transform 600ms ease 200ms;
}

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

/* ---- Presence Section (slide from right) ---- */
.section-presence {
    background: #F4F5F7;
    justify-content: flex-end;
}

/* ---- Memory Section (slide from left) ---- */
.section-memory {
    background: #F4F5F7;
    justify-content: flex-start;
}

/* ---- Language Section ---- */
.section-language {
    background: #F4F5F7;
    justify-content: center;
}

/* ---- System Log ---- */
.system-log {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 40px;
    opacity: 0;
    transition: opacity 400ms ease 400ms;
}

.is-visible .system-log {
    opacity: 1;
}

.log-line {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #9EA3AD;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.is-visible .log-line:nth-child(1) { opacity: 1; transform: none; transition-delay: 500ms; }
.is-visible .log-line:nth-child(2) { opacity: 1; transform: none; transition-delay: 650ms; }
.is-visible .log-line:nth-child(3) { opacity: 1; transform: none; transition-delay: 800ms; }

/* ---- Connection Section ---- */
.section-connection {
    background: #F4F5F7;
    justify-content: center;
    align-items: center;
}

/* ---- Section Quote ---- */
.section-quote {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(28px, 2.5vw, 36px);
    line-height: 1.8;
    color: #4A4E5A;
    letter-spacing: 0.05em;
    border: none;
    padding: 0;
    opacity: 0;
    transition: opacity 600ms ease 300ms;
}

.is-visible .section-quote {
    opacity: 1;
}

/* ---- Cursor Demo Path (connection section) ---- */
.cursor-demo-path {
    position: relative;
    width: 200px;
    height: 40px;
    overflow: visible;
}

.demo-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #BFC3CC;
    opacity: 0;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    transition: opacity 400ms ease;
}

.is-visible .demo-dot {
    opacity: 0.4;
    animation: demo-arc 4s ease-in-out 600ms infinite;
}

@keyframes demo-arc {
    0%   { left: 0;    top: 50%; }
    25%  { left: 33%;  top: 20%; }
    50%  { left: 66%;  top: 70%; }
    75%  { left: 90%;  top: 30%; }
    100% { left: 0;    top: 50%; }
}

/* ---- Close Section ---- */
.section-close {
    background: #F4F5F7;
    justify-content: center;
    align-items: center;
}

.close-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.close-word {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(64px, 8.5vw, 120px);
    letter-spacing: 0.12em;
    color: #C5C8D0;
    line-height: 1;
    opacity: 0;
    transition: opacity 800ms ease;
}

.close-word.is-visible {
    opacity: 1;
}

.close-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #BFC3CC 30%, #BFC3CC 70%, transparent 100%);
    margin-top: 24px;
    transition: width 1000ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 200ms;
    max-width: 280px;
}

.close-line.is-visible {
    width: 280px;
}

/* ---- Email Form ---- */
.email-form {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 600ms ease 400ms, transform 600ms ease 400ms;
}

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

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 320px;
    border-bottom: 1px solid #BFC3CC;
    padding-bottom: 8px;
    transition: border-color 300ms ease;
}

.input-wrapper:focus-within {
    border-bottom-color: #4A4E5A;
}

#email-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #4A4E5A;
    padding: 0;
}

#email-input::placeholder {
    color: #9EA3AD;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    letter-spacing: 0.05em;
}

.submit-arrow {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    color: #9EA3AD;
    padding: 0;
    line-height: 1;
    transition: color 300ms ease, transform 300ms ease;
}

.submit-arrow:hover {
    color: #4A4E5A;
    transform: translateX(4px);
}

.form-confirm {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: #9EA3AD;
    height: 16px;
    opacity: 0;
    transition: opacity 400ms ease;
}

.form-confirm.show {
    opacity: 1;
}

/* ---- Chrome hairline utility ---- */
.chrome-hairline {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #BFC3CC 30%, #BFC3CC 70%, transparent 100%);
    width: 100%;
}

/* ---- Supplemental palette tokens (design reference) ---- */
/* #D0D4DB — mid-chrome surface for secondary tech accents */
/* Playfair Display — referenced in design uniqueness notes as contrast comparison */
/* tabular numerals: Space Grotesk #7A8096 11px tracking 0.2em */
/* above main text: section label "002 / memory" 11px Space Grotesk" (Google Fonts) */
/* IntersectionObserver threshold [0, 0.3, 0.6] — slide-reveal pattern */
.chrome-surface {
    background-color: #D0D4DB;
}

/* Space Grotesk tabular numerals tracking 0.2em */
.tabular-num {
    font-family: 'Space Grotesk', sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: #7A8096;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav {
        top: 24px;
        right: 24px;
        gap: 20px;
    }

    .nav-links {
        gap: 24px;
    }

    .reveal-right,
    .reveal-left {
        margin: 0 auto;
        padding: 0 24px;
    }

    .section-presence,
    .section-memory {
        justify-content: center;
    }

    .reveal-right {
        transform: translateX(40px);
    }

    .reveal-left {
        transform: translateX(-40px);
    }

    .wc-presence,
    .wc-memory {
        width: 80vw;
        height: 50vh;
        left: 50%;
        right: auto;
        top: 30%;
        transform: translate(-50%, 0);
        opacity: 0.12;
    }

    .input-wrapper {
        width: 260px;
    }
}
