/* ═══════════════════════════════════════
   THEME TOKENS
═══════════════════════════════════════ */
:root,
[data-theme="light"] {
    --bg:           #f8f7f3;
    --bg-2:         #f0ede6;
    --bg-3:         #ffffff;
    --surface:      #ffffff;
    --red:          #e8201e;
    --red-dim:      rgba(232,32,30,0.08);
    --red-glow:     rgba(232,32,30,0.3);
    --text:         #0f0f14;
    --text-dim:     rgba(15,15,20,0.58);
    --text-muted:   rgba(15,15,20,0.32);
    --border:       rgba(15,15,20,0.1);
    --border-r:     rgba(232,32,30,0.25);
    --nav-bg:       rgba(248,247,243,0.92);
    --nav-border:   rgba(15,15,20,0.1);
    --card-bg:      #ffffff;
    --spring:       cubic-bezier(0.625, 0.05, 0, 1);
}

[data-theme="dark"] {
    --bg:           #08080d;
    --bg-2:         #0e0e18;
    --bg-3:         #141422;
    --surface:      #0e0e18;
    --red:          #e8201e;
    --red-dim:      rgba(232,32,30,0.12);
    --red-glow:     rgba(232,32,30,0.38);
    --text:         #e8e3d8;
    --text-dim:     rgba(232,227,216,0.55);
    --text-muted:   rgba(232,227,216,0.25);
    --border:       rgba(232,227,216,0.08);
    --border-r:     rgba(232,32,30,0.28);
    --nav-bg:       rgba(8,8,13,0.92);
    --nav-border:   rgba(232,227,216,0.08);
    --card-bg:      #0e0e18;
    --spring:       cubic-bezier(0.625, 0.05, 0, 1);
}

/* ═══════════════════════════════════════
   BASE
═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans JP', sans-serif;
    overflow-x: hidden;
    cursor: none;
    transition: background 0.4s, color 0.4s;
}

/* ═══════════════════════════════════════
   CURSOR
═══════════════════════════════════════ */
#cursor {
    position: fixed; width: 8px; height: 8px;
    background: var(--red); border-radius: 50%;
    pointer-events: none; z-index: 99999;
    transform: translate(-50%,-50%);
    transition: width .2s var(--spring), height .2s var(--spring);
    top: 0; left: 0;
}
#cursor-ring {
    position: fixed; width: 32px; height: 32px;
    border: 1px solid rgba(232,32,30,0.4); border-radius: 50%;
    pointer-events: none; z-index: 99998;
    transform: translate(-50%,-50%);
    transition: width .4s var(--spring), height .4s var(--spring);
    top: 0; left: 0;
}

/* ═══════════════════════════════════════
   SCANLINES (dark mode only)
═══════════════════════════════════════ */
#scanlines {
    position: fixed; inset: 0;
    background: repeating-linear-gradient(0deg,transparent,transparent 4px,rgba(0,0,0,.05) 4px,rgba(0,0,0,.05) 5px);
    pointer-events: none; z-index: 9990;
    opacity: 0;
    animation: scan-drift 10s linear infinite;
    transition: opacity .4s;
}
[data-theme="dark"] #scanlines { opacity: 1; }
@keyframes scan-drift { from { background-position: 0 0; } to { background-position: 0 80px; } }

/* ═══════════════════════════════════════
   GRAIN
═══════════════════════════════════════ */
#grain {
    position: fixed; inset: -50%; width: 200%; height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px; opacity: 0.018;
    pointer-events: none; z-index: 9989;
    animation: grain-j .12s steps(2) infinite;
}
@keyframes grain-j {
    0%  { transform:translate(0,0); }   25% { transform:translate(-1.5%,2%); }
    50% { transform:translate(2%,-1.5%);}75% { transform:translate(-2%,1%); }
}

/* ═══════════════════════════════════════
   INTRO OVERLAY
═══════════════════════════════════════ */
#intro-overlay {
    position: fixed; inset: 0; background: #0f0f14;
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    clip-path: inset(0 0 0 0);
}
.chart-line { stroke-dasharray: 1000; stroke-dashoffset: 1000; }

/* ═══════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════ */
#main-header {
    position: fixed; top: 0; left: 0; right: 0; height: 68px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--nav-border);
    border-left: 3px solid var(--red);
    z-index: 500; transition: background .4s, border-color .4s;
}
.nav-inner {
    height: 100%; max-width: 1380px; margin: 0 auto;
    padding: 0 2rem; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.nav-logo-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .7rem; letter-spacing: .18em; color: var(--text); line-height: 1.2;
    transition: color .3s;
}
.nav-logo-sub { font-family: 'IBM Plex Mono', monospace; font-size: .52rem; color: var(--red); letter-spacing: .14em; }

#nav-links a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .65rem; letter-spacing: .14em; text-transform: uppercase;
    color: var(--text-dim); text-decoration: none; position: relative; transition: color .3s;
}
#nav-links a::after {
    content: ''; position: absolute; bottom: -3px; left: 0;
    width: 0; height: 1px; background: var(--red); transition: width .4s var(--spring);
}
#nav-links a:hover { color: var(--text); }
#nav-links a:hover::after { width: 100%; }
#nav-links a.active { color: var(--text); }

.btn-nav {
    font-family: 'IBM Plex Mono', monospace !important;
    font-size: .62rem !important; letter-spacing: .16em !important;
    text-transform: uppercase !important; color: #fff !important;
    background: var(--red) !important; padding: .52rem 1.2rem !important;
    clip-path: polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px) !important;
    transition: filter .3s !important;
}
.btn-nav::after { display: none !important; }
.btn-nav:not(.tr-cta-btn):hover { filter: drop-shadow(0 0 12px var(--red-glow)) !important; color: #fff !important; }
.tr-cta-btn:hover { animation: rgb-glitch 0.45s steps(4) infinite; color: #fff !important; }

/* Theme toggle */
#theme-toggle {
    width: 36px; height: 36px; background: none; border: 1px solid var(--border);
    cursor: none; display: flex; align-items: center; justify-content: center;
    transition: border-color .3s, background .3s;
    clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px);
}
#theme-toggle:hover { border-color: var(--red); background: var(--red-dim); }
#theme-toggle svg { color: var(--text-dim); transition: color .3s; }
#theme-toggle:hover svg { color: var(--red); }

/* Burger */
.bline { display: block; width: 20px; height: 1px; background: var(--text); transition: transform .3s, opacity .3s; }

@media (max-width: 768px) {
    #nav-links {
        display: flex !important; /* override Tailwind 'hidden' */
        position: fixed; top: 68px; left: 0; right: 0;
        background: var(--nav-bg); backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--border);
        padding: 1rem 1.5rem;
        flex-direction: row; flex-wrap: wrap;
        align-items: center; gap: .5rem 1.25rem;
        transform: translateY(calc(-100% - 80px));
        transition: transform .4s var(--spring);
        pointer-events: none;
        visibility: hidden;
    }
    #nav-links.open {
        transform: translateY(0);
        pointer-events: auto;
        visibility: visible;
    }
    /* Keep Contact Us button full-width at the bottom of the wrap */
    #nav-links .btn-nav {
        margin-top: .25rem;
    }
    /* Burger → × animation */
    #burger-btn.open .bline:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
    #burger-btn.open .bline:nth-child(2) { opacity: 0; transform: scaleX(0); }
    #burger-btn.open .bline:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }
}

/* ═══════════════════════════════════════
   HERO
═══════════════════════════════════════ */
#hero {
    position: relative; min-height: 100vh;
    display: flex; align-items: center; overflow: hidden; padding-top: 68px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 100px), 50% 100%, 0 calc(100% - 100px));
}
#hero::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(125deg,rgba(8,8,13,.82) 0%,rgba(8,8,13,.5) 55%,rgba(232,32,30,.06) 100%);
    z-index: 1;
}
.hero-video {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%; max-width: none; max-height: none;
    object-fit: cover; opacity: .55; z-index: 0;
}
.hero-bottom-cut { display: none; }
.hero-content {
    position: relative; z-index: 3;
    max-width: 860px; margin: 0 auto; padding: 0 2rem; width: 100%;
    text-align: center;
}

.hero-eyebrow {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    margin-bottom: 1.75rem; opacity: 0; transform: translateY(20px);
}
.hero-eyebrow-line { width: 32px; height: 1px; background: var(--red); }

/* Periodic color twitch — filter only, so GSAP can own opacity/transform freely */
@keyframes text-twitch {
    0%, 84.9%, 100% { filter: none; }
    85%  { filter: drop-shadow(-9px 0 0 rgba(255,0,50,.95)) drop-shadow(9px 0 0 rgba(0,210,255,.95)); }
    87%  { filter: drop-shadow(9px 0 0 rgba(255,0,50,.95)) drop-shadow(-9px 0 0 rgba(0,210,255,.95)); }
    89%  { filter: drop-shadow(-6px 0 0 rgba(255,0,50,.7)) drop-shadow(6px 0 0 rgba(0,210,255,.7)); }
    91%  { filter: drop-shadow(4px 0 0 rgba(255,0,50,.4)) drop-shadow(-4px 0 0 rgba(0,210,255,.4)); }
    93%  { filter: none; }
}

.hero-h1 {
    font-family: 'Do Hyeon', sans-serif;
    font-size: clamp(2.8rem, 7.5vw, 6.2rem);
    line-height: 1.02; color: #f8f7f3;
    margin-bottom: 1.25rem; opacity: 0; transform: translateY(30px);
    text-shadow: 0 2px 24px rgba(0,0,0,0.65), 0 4px 60px rgba(0,0,0,0.4);
    animation: text-twitch 3s linear infinite;
}
.hero-h1 .red {
    color: var(--red);
    text-shadow: 0 2px 24px rgba(0,0,0,0.65), 0 0 40px rgba(232,32,30,0.4);
}

.hero-sub {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(.66rem, 1.4vw, .82rem);
    color: rgba(248,247,243,.82); letter-spacing: .1em;
    margin-bottom: 2.75rem; opacity: 0; transform: translateY(18px);
    text-shadow: 0 1px 12px rgba(0,0,0,0.6);
}
.hero-sub .hero-gt {
    color: var(--red);
    animation: gt-pulse 2s ease-in-out infinite;
}
@keyframes gt-pulse {
    0%,100% { opacity:1; } 50% { opacity:.4; }
}

.hero-ctas {
    display: flex; gap: 1.25rem; flex-wrap: wrap;
    justify-content: center;
    opacity: 0; transform: translateY(18px);
}

/* ── Scroll hint — sits just above the triangle tip ── */
.scroll-hint {
    position: absolute;
    bottom: 22px;
    left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    z-index: 4;
    animation: scroll-bounce 3s ease-in-out infinite;
}
@keyframes scroll-bounce {
    0%,100% { transform: translateX(-50%) translateY(0); opacity: .55; }
    50%     { transform: translateX(-50%) translateY(9px); opacity: 1; }
}

/* ── Glassmorphism hero buttons ── */
.btn-primary {
    display: inline-flex; align-items: center; gap: .6rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
    color: #fff;
    background: rgba(232,32,30,0.78);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255,80,60,0.55);
    padding: 1rem 2.2rem;
    text-decoration: none; cursor: none;
    border-radius: 3px;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 24px rgba(232,32,30,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: box-shadow .35s var(--spring), transform .2s var(--spring), background .3s;
}
.btn-primary::before {
    content: '';
    position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: skewX(-20deg);
    transition: left .6s var(--spring);
}
.btn-primary:hover::before { left: 120%; }
.btn-primary:hover {
    background: rgba(232,32,30,0.92);
    box-shadow: 0 6px 36px rgba(232,32,30,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:active { transform: scale(.97); }

.btn-ghost {
    display: inline-flex; align-items: center; gap: .6rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 1rem 2.2rem;
    text-decoration: none; cursor: none;
    border-radius: 3px;
    position: relative; overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: border-color .35s, background .35s, box-shadow .35s;
}
.btn-ghost::before {
    content: '';
    position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: skewX(-20deg);
    transition: left .6s var(--spring);
}
.btn-ghost:hover::before { left: 120%; }
.btn-ghost:hover {
    border-color: rgba(232,32,30,0.5);
    background: rgba(232,32,30,0.12);
    box-shadow: 0 4px 24px rgba(232,32,30,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ── RGB glitch on button text ── */
.btn-rgb {
    display: inline-block;
    animation: rgb-twitch 4s steps(1) infinite;
}
@keyframes rgb-twitch {
    0%,87%,100% { text-shadow: none; filter: none; }
    88% { text-shadow: -3px 0 rgba(255,0,60,0.9), 3px 0 rgba(0,200,255,0.9); filter: brightness(1.12); }
    89% { text-shadow:  2px 0 rgba(255,0,60,0.9),-2px 0 rgba(0,200,255,0.9); }
    90% { text-shadow: none; }
    91% { text-shadow: -2px 0 rgba(255,0,60,0.8), 2px 0 rgba(0,200,255,0.8); filter: brightness(1.08); }
    92% { text-shadow: none; filter: none; }
}
.btn-ghost .btn-rgb { animation-delay: 1.8s; }

/* Hero corner accents */
.hero-corner { position: absolute; z-index: 4; }

/* ── RGB chromatic aberration — applied on hover for H1 and buttons ── */
@keyframes rgb-glitch {
    0%   { filter: none; transform: none; }
    20%  { filter: drop-shadow(-10px 0 0 rgba(255,0,50,1)) drop-shadow(10px 0 0 rgba(0,210,255,1)); transform: translateX(-5px); }
    40%  { filter: drop-shadow(10px 0 0 rgba(255,0,50,1)) drop-shadow(-10px 0 0 rgba(0,210,255,1)); transform: translateX(5px); }
    60%  { filter: drop-shadow(-8px 2px 0 rgba(255,0,50,.9)) drop-shadow(8px -2px 0 rgba(0,210,255,.9)) blur(0.5px); transform: translateX(-3px); }
    80%  { filter: drop-shadow(6px 0 0 rgba(255,0,50,.7)) drop-shadow(-6px 0 0 rgba(0,210,255,.7)); transform: translateX(2px); }
    100% { filter: none; transform: none; }
}
.hero-h1:hover { animation: rgb-glitch 0.55s steps(4) infinite; }
.btn-primary:hover,
.btn-ghost:hover { animation: rgb-glitch 0.45s steps(4) infinite; }

/* Glitch ambient flicker (continuous) */
.glitch { position: relative; cursor: default; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; }
.glitch::before { color: var(--red); transform: translateX(-3px); animation: gl-b 6s steps(1) infinite; }
.glitch::after  { color: #0ff; mix-blend-mode: screen; transform: translateX(3px); animation: gl-a 6s steps(1) infinite; }
@keyframes gl-b {
    0%,88%,100%{clip-path:inset(0 0 100% 0);opacity:0}
    90%{clip-path:inset(18% 0 60% 0);opacity:.8;transform:translateX(-4px)}
    92%{clip-path:inset(55% 0 10% 0);opacity:.8;transform:translateX(3px)}
    93%{clip-path:inset(0 0 100% 0);opacity:0}
}
@keyframes gl-a {
    0%,88%,100%{clip-path:inset(100% 0 0 0);opacity:0}
    90%{clip-path:inset(30% 0 45% 0);opacity:.5;transform:translateX(4px)}
    92%{clip-path:inset(8% 0 62% 0);opacity:.5;transform:translateX(-3px)}
    93%{clip-path:inset(100% 0 0 0);opacity:0}
}

/* ═══════════════════════════════════════
   SHARED SECTION ELEMENTS
═══════════════════════════════════════ */
.wrap { max-width: 1380px; margin: 0 auto; padding: 0 2rem; }

.sec-eyebrow {
    display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem;
}
.sec-eyebrow-line { width: 26px; height: 1px; background: var(--red); flex-shrink: 0; }
.sec-eyebrow span {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .56rem; letter-spacing: .28em; text-transform: uppercase; color: var(--red);
}
.sec-title {
    font-family: 'Do Hyeon', sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
    color: var(--text); line-height: 1.08;
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .85s var(--spring), transform .85s var(--spring); }
.reveal.in { opacity: 1; transform: none; }
.reveal-x { opacity: 0; transform: translateX(40px); transition: opacity .85s var(--spring), transform .85s var(--spring); }
.reveal-x.in { opacity: 1; transform: none; }
.reveal-l { opacity: 0; transform: translateX(-40px); transition: opacity .85s var(--spring), transform .85s var(--spring); }
.reveal-l.in { opacity: 1; transform: none; }
.d1{transition-delay:.1s}.d2{transition-delay:.2s}.d3{transition-delay:.3s}.d4{transition-delay:.4s}.d5{transition-delay:.5s}

/* ═══════════════════════════════════════
   ABOUT
═══════════════════════════════════════ */
#about { background: var(--bg); padding: 5rem 0 6rem; }

.about-info-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 5rem; align-items: start; margin-bottom: 6rem;
}

.about-text-block p {
    font-size: .82rem; color: var(--text-dim); line-height: 1.8; margin-top: 1.5rem;
}

.about-detail { border-top: 1px solid var(--border); padding: 1.25rem 0; }
.about-detail:last-child { border-bottom: 1px solid var(--border); }
.about-detail-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: .56rem; letter-spacing: .22em; text-transform: uppercase;
    color: var(--red); margin-bottom: .4rem;
}
.about-detail p { font-size: .82rem; color: var(--text-dim); line-height: 1.72; margin-top: 0; }

.about-cta-block { display: flex; flex-direction: column; gap: 2rem; }
.about-stat-inline {
    display: flex; align-items: baseline; gap: .5rem; padding: 1.5rem;
    border: 1px solid var(--border); border-left: 3px solid var(--red);
    background: var(--surface); transition: border-color .3s;
}
.about-stat-inline:hover { border-color: var(--red); }
.about-stat-num { font-family: 'Do Hyeon', sans-serif; font-size: 2.8rem; color: var(--red); line-height: 1; }
.about-stat-text { font-size: .8rem; color: var(--text-dim); line-height: 1.4; }

/* ── STAT CARDS (Avatar-style number reveal) ── */
.stat-cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; padding-bottom: 2.5rem; }
.stat-card { position: relative; overflow: visible; cursor: none; }
.stat-card-img { position: relative; overflow: hidden; border: 1px solid var(--border); height: 340px; transition: border-color .4s; }
.stat-card:hover .stat-card-img { border-color: var(--red); }
.stat-card-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%) brightness(.78); transition: filter .8s var(--spring), transform .8s var(--spring); }
.stat-card:hover .stat-card-img img { filter: grayscale(15%) brightness(.65); transform: scale(1.05); }
.stat-card-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(232,32,30,.22) 0%, transparent 55%); opacity: 0; transition: opacity .5s; }
.stat-card:hover .stat-card-img::after { opacity: 1; }
.stat-num-wrap { position: absolute; bottom: -0.25rem; left: -.5rem; z-index: 10; }
.stat-num-big { font-family: 'Do Hyeon', sans-serif; font-size: clamp(5rem, 8vw, 7.5rem); line-height: 1; color: rgba(232,32,30,.18); transition: color .45s var(--spring), text-shadow .45s; user-select: none; }
.stat-card:hover .stat-num-big { color: var(--red); text-shadow: 0 0 40px rgba(232,32,30,.45); }
.stat-label-wrap { position: absolute; bottom: 1.25rem; left: 0; right: 0; padding: 0 1.25rem; transform: translateY(8px); opacity: 0; transition: transform .4s var(--spring), opacity .4s; }
.stat-card:hover .stat-label-wrap { transform: translateY(0); opacity: 1; }
.stat-label-pct { font-family: 'Do Hyeon', sans-serif; font-size: 1.1rem; color: #fff; display: block; }
.stat-label-text { font-family: 'IBM Plex Mono', monospace; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.75); display: block; margin-top: .15rem; }

/* ═══════════════════════════════════════
   SERVICES — STICKY SCROLL GALLERY
═══════════════════════════════════════ */
#services { background: #08080d; padding-top: 5rem; border-top: 1px solid var(--border); }

#svc-gallery { position: relative; }

.svc-sticky {
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow: hidden;
}

/* All slides stacked absolute; slides 2-6 start collapsed at center point */
.svc-slide {
    position: absolute;
    inset: 0;
    clip-path: inset(0 50% 0 50%); /* zero-width from center — hidden before JS runs */
    overflow: hidden;
}
.svc-slide:first-child {
    clip-path: inset(25% 12.5% 25% 12.5%); /* slide 1 visible: 75%w × 50%h */
}

/* Progress lines — left grows upward, right grows downward */
#svc-line-left,
#svc-line-right {
    position: absolute;
    top: 0; bottom: 0;
    width: 1.5px;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    transform: scaleY(0);
    box-shadow: 0 0 10px rgba(232,32,30,.5);
}
#svc-line-left {
    left: 2rem;
    background: linear-gradient(to top, var(--red) 0%, rgba(232,32,30,.25) 100%);
    transform-origin: bottom center;
}
#svc-line-right {
    right: 2rem;
    background: linear-gradient(to bottom, var(--red) 0%, rgba(232,32,30,.25) 100%);
    transform-origin: top center;
}

/* Services header — force cream text; #services bg is always #08080d */
#services > .wrap .sec-title { color: #e8e3d8; }
#services > .wrap p { color: rgba(232,227,216,0.55) !important; }

.svc-slide > img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.48) grayscale(15%);
}

/* Dark gradient — bottom heavy so text reads clearly */
.svc-slide-grad {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(8,8,13,.92) 0%, rgba(8,8,13,.45) 40%, rgba(8,8,13,.1) 75%, transparent 100%);
    z-index: 1; pointer-events: none;
}

/* Centered text overlay */
.svc-slide-info {
    position: absolute;
    bottom: 28%;
    left: 50%; transform: translateX(-50%);
    text-align: center;
    z-index: 2;
    width: min(92%, 640px);
    pointer-events: none;
}
/* Slides 2-6 start invisible; GSAP fades them in */
.svc-slide:not(:first-child) .svc-slide-info { opacity: 0; }

.svc-slide-num {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: .58rem; letter-spacing: .28em; color: var(--red);
    margin-bottom: .65rem; text-transform: uppercase;
}
.svc-slide-title {
    font-family: 'Do Hyeon', sans-serif;
    font-size: clamp(2rem, 5vw, 3.8rem);
    color: #f8f7f3; line-height: 1.05;
    margin-bottom: .75rem;
    text-shadow: 0 2px 20px rgba(0,0,0,.75);
}
.svc-slide-desc {
    font-size: .85rem; color: rgba(248,247,243,.7);
    line-height: 1.72; max-width: 460px; margin: 0 auto;
}
/* Single-line override for long titles */
.svc-slide-title-sm {
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    white-space: nowrap;
}

/* ═══════════════════════════════════════
   TRACK RECORD
═══════════════════════════════════════ */
#track-record { background: var(--bg); padding: 5rem 0; border-top: 1px solid var(--border); }

/* Stats strip */
.tr-stats { display: grid; grid-template-columns: repeat(4,1fr); border: 1px solid var(--border); margin-bottom: 4rem; }
.tr-stat { padding: 1.75rem 1.5rem; border-right: 1px solid var(--border); }
.tr-stat:last-child { border-right: none; }
.tr-stat-num { font-family: 'Do Hyeon', sans-serif; font-size: clamp(2rem, 4vw, 3.6rem); color: var(--text); line-height: 1; letter-spacing: -.02em; }
.tr-stat-label { margin-top: .4rem; font-family: 'IBM Plex Mono', monospace; font-size: .5rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }

/* Body grid */
.tr-body { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); }
.tr-col-left,
.tr-col-right { display: flex; flex-direction: column; }
.tr-col-right { border-left: 1px solid var(--border); }

/* Column header */
.tr-col-head { display: flex; align-items: center; gap: 1rem; padding: 1.6rem 2rem; border-bottom: 1px solid var(--border); }
.tr-col-head-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--red-dim); border: 1px solid var(--border-r); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tr-col-head-title { font-family: 'Do Hyeon', sans-serif; font-size: clamp(1.3rem, 2vw, 1.75rem); letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.tr-col-head-count { margin-left: auto; font-family: 'Do Hyeon', sans-serif; font-size: 1.5rem; color: var(--text-muted); }

/* Research items */
.tr-item { display: flex; align-items: flex-start; gap: 1rem; padding: .9rem 2rem; border-bottom: 1px solid var(--border); transition: background .2s, padding-left .25s var(--spring); }
.tr-item:last-child { border-bottom: none; }
.tr-item:hover { background: var(--red-dim); padding-left: calc(2rem + 5px); }
.tr-item:hover .tr-item-dot { transform: scale(1.6); }
.tr-item-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--red); margin-top: .42rem; flex-shrink: 0; transition: transform .2s; }
.tr-item-text { font-size: clamp(.7rem, 1.05vw, .8rem); color: var(--text-dim); line-height: 1.55; }

/* Coordination items */
.tr-coord-item { display: flex; align-items: flex-start; gap: 1.4rem; padding: .9rem 2rem; border-bottom: 1px solid var(--border); transition: background .2s; }
.tr-coord-item:hover { background: var(--red-dim); }
.tr-coord-year { font-family: 'Do Hyeon', sans-serif; font-size: clamp(1.25rem, 1.8vw, 1.6rem); color: var(--red); line-height: 1.15; flex-shrink: 0; min-width: 52px; }
.tr-coord-text { font-size: clamp(.7rem, 1.05vw, .8rem); color: var(--text-dim); line-height: 1.55; padding-top: .22rem; }

/* CTA slot */
.tr-cta-slot { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; border-bottom: none; }
.tr-cta-btn {
    font-size: .78rem !important;
    padding: 1rem 2.6rem !important;
    letter-spacing: .22em !important;
}

@media (max-width: 768px) {
    .tr-stats { grid-template-columns: repeat(2,1fr); }
    .tr-stat:nth-child(2) { border-right: none; }
    .tr-stat:nth-child(3) { border-top: 1px solid var(--border); }
    .tr-body { grid-template-columns: 1fr; }
    .tr-col-right { border-left: none; border-top: 1px solid var(--border); }
}

/* ═══════════════════════════════════════
   FAQ
═══════════════════════════════════════ */
#faq { background: var(--bg-2); padding: 5rem 0; border-top: 1px solid var(--border); }

.accordion-item { border: 1px solid var(--border); background: var(--surface); margin-bottom: 2px; transition: border-color .35s; }
.accordion-item.open { border-color: var(--border-r); }
.accordion-btn { width: 100%; padding: 1.35rem 1.75rem; display: flex; justify-content: space-between; align-items: center; background: none; border: none; cursor: none; text-align: left; }
.accordion-q { font-family: 'Do Hyeon', sans-serif; font-size: 1rem; color: var(--text); }
.accordion-icon { width: 26px; height: 26px; border: 1px solid var(--border-r); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .3s, transform .45s var(--spring); clip-path: polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px); }
.accordion-item.open .accordion-icon { background: var(--red); transform: rotate(45deg); }
.accordion-content { height: 0; overflow: hidden; transition: height .45s var(--spring); }
.accordion-inner { margin: 0 1.75rem 1.5rem; padding-left: 1rem; border-left: 2px solid var(--red); font-size: .83rem; color: var(--text-dim); line-height: 1.72; }

/* ═══════════════════════════════════════
   CONTACT — stays dark regardless of theme
═══════════════════════════════════════ */
#contact { background: #08080d; border-top: 1px solid rgba(232,227,216,.07); position: relative; overflow: hidden; padding: 0; }
#contact::before { content: ''; position: absolute; top: -200px; right: -200px; width: 600px; height: 600px; background: radial-gradient(ellipse,rgba(232,32,30,.06) 0%,transparent 70%); pointer-events: none; }
.contact-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .05; }

.cform-label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: .56rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(232,227,216,.55); margin-bottom: .45rem; }
.cform-input { width: 100%; background: rgba(255,255,255,.04); border: 1px solid rgba(232,227,216,.1); padding: .82rem 1.1rem; color: #e8e3d8; font-family: 'Noto Sans JP', sans-serif; font-size: .83rem; outline: none; transition: border-color .3s; clip-path: polygon(7px 0,100% 0,100% calc(100% - 7px),calc(100% - 7px) 100%,0 100%,0 7px); }
.cform-input::placeholder { color: rgba(232,227,216,.25); }
.cform-input:focus { border-color: var(--red); }
.map-container iframe { filter: grayscale(100%) invert(1) brightness(.38) contrast(1.2); transition: filter .5s; }
.map-container:hover iframe { filter: grayscale(70%) brightness(.52) contrast(1.1); }
.cinfo-row { display: flex; align-items: flex-start; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid rgba(232,227,216,.07); }
.cinfo-row:last-child { border-bottom: none; }
/* contact right-col alignment spacer — matches left col eyebrow + h2 + subtitle */
.contact-info-spacer { height: calc(1.75rem + clamp(2rem,4vw,3rem) * 1.15 + .5rem + 1rem + 2.25rem); }
/* Leaflet light map overrides */
#contact-map { background: #e8e6e1; }
#contact-map .leaflet-popup-content-wrapper { background: #fff; border-radius: 0; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
#contact-map .leaflet-popup-tip { background: #fff; }
#contact-map .leaflet-control-zoom a { background: #fff; color: #1a1a24; border-color: #ccc; border-radius: 0 !important; font-weight: 400; }
#contact-map .leaflet-control-zoom a:hover { background: #e8201e; color: #fff; border-color: #e8201e; }
#contact-map .leaflet-attribution-flag { display: none !important; }
#contact-map .leaflet-control-attribution { background: rgba(255,255,255,.7); font-size: .55rem; }

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer { background: var(--bg); border-top: 1px solid var(--border); padding: 2.5rem 0; transition: background .4s; }
.footer-inner { max-width: 1380px; margin: 0 auto; padding: 0 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.25rem; }
.flink { font-family: 'IBM Plex Mono', monospace; font-size: .57rem; letter-spacing: .12em; color: var(--text-muted); text-decoration: none; transition: color .3s; }
.flink:hover { color: var(--red); }

/* ═══════════════════════════════════════
   MISC
═══════════════════════════════════════ */
*:focus-visible { outline: 1px solid var(--red); outline-offset: 3px; }
.grecaptcha-badge { bottom: 80px !important; }

/* ── Chatbase widget height cap ── */
#chatbase-bubble-window,
iframe[id^="chatbase"] {
    max-height: 520px !important;
    height: 520px !important;
}
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══════════════════════════════════════
   ABOUT — STAT IMAGE COLUMN
═══════════════════════════════════════ */
.sac-col { display: flex; flex-direction: column; gap: 1rem; padding-top: 3.5rem; }

.sac-wipe { position: relative; overflow: hidden; clip-path: inset(0 0 0 100%); }

.sac-wipe img { width: 100%; height: 195px; object-fit: cover; display: block; transform: translateX(40%); filter: grayscale(100%) brightness(0.65); transition: filter 0.5s ease; }
.sac-card:hover .sac-wipe img { filter: grayscale(0%) brightness(0.78); }

.sac-grad { position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,13,.9) 0%, rgba(8,8,13,.35) 55%, transparent 100%); z-index: 1; pointer-events: none; }

.sac-lbl { position: absolute; bottom: .75rem; left: .85rem; display: flex; flex-direction: column; gap: .05rem; text-align: left; z-index: 2; }

.sac-num { font-family: 'Do Hyeon', sans-serif; font-size: clamp(4rem, 6.5vw, 5.6rem); line-height: 1; color: var(--red); text-shadow: 0 0 32px rgba(232,32,30,.55); user-select: none; pointer-events: none; }

.sac-lbl-name { font-family: 'Do Hyeon', sans-serif; font-size: .9rem; color: #fff; display: block; }

.sac-lbl-sub { font-family: 'IBM Plex Mono', monospace; font-size: .48rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.5); display: block; margin-top: .1rem; }

/* ── h2 typewriter cursor blink ── */
.sec-title-typed::after { content: '|'; animation: caret-blink .75s step-end infinite; color: var(--red); margin-left: 2px; }
@keyframes caret-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width:1024px) {
    .about-info-grid  { grid-template-columns:1fr !important; gap:3rem !important; }
    .stat-cards-row   { grid-template-columns:1fr 1fr !important; }
    .svc-grid         { grid-template-columns:repeat(2,1fr) !important; }
    .track-grid       { grid-template-columns:1fr !important; }
    .contact-grid     { grid-template-columns:1fr !important; gap:3rem !important; }
}
@media (max-width:640px) {
    .stat-cards-row { grid-template-columns:1fr !important; }
    .svc-grid       { grid-template-columns:1fr !important; }
    .hero-h1        { font-size:2.6rem !important; }
    #hero           { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 55px), 50% 100%, 0 calc(100% - 55px)) !important; }
    .scroll-hint    { bottom: 12px; }
}
