/* 계엄령.com - Neomorphic scholarly monograph */
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box;}
:root{
    --abyss:#0B1929;--slate:#132D46;--bathyal:#1A3A5C;
    --shadow-dark:#071320;--shadow-light:#1E4D73;
    --teal:#00B4D8;--gold:#C9A84C;--coral:#E85D4A;
    --text-primary:#E0E8F0;--text-secondary:#8FA3B8;
}
body{font-family:'Inter',sans-serif;font-weight:400;font-size:clamp(1rem,1.8vw,1.125rem);line-height:1.85;color:var(--text-primary);background:var(--slate);overflow-x:hidden;word-break:keep-all;}

/* Progress bar */
.progress-bar{position:fixed;top:0;left:0;width:2px;height:0%;background:var(--teal);z-index:200;transition:height 100ms linear;}

/* Chapter toggle */
.chapter-toggle{position:fixed;bottom:24px;right:24px;width:48px;height:48px;border-radius:50%;border:none;background:var(--bathyal);color:var(--text-primary);cursor:pointer;z-index:150;box-shadow:6px 6px 12px var(--shadow-dark),-6px -6px 12px var(--shadow-light);display:flex;align-items:center;justify-content:center;transition:box-shadow 300ms cubic-bezier(0.22,1,0.36,1);}
.chapter-toggle:active{box-shadow:inset 4px 4px 8px var(--shadow-dark),inset -4px -4px 8px var(--shadow-light);}

/* Chapter index overlay */
.chapter-index{position:fixed;inset:0;background:rgba(11,25,41,0.92);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);z-index:140;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity 400ms ease;}
.chapter-index.open{opacity:1;pointer-events:auto;}
.chapter-index nav{display:flex;flex-direction:column;gap:20px;}
.index-link{font-family:'Cormorant Garamond',serif;font-weight:600;font-size:clamp(1.2rem,3vw,2rem);color:var(--text-secondary);text-decoration:none;transition:color 300ms ease;}
.index-link:hover{color:var(--teal);}

/* Chapter layout */
.chapter{position:relative;display:flex;gap:clamp(20px,4vw,40px);padding:clamp(40px,6vw,80px) clamp(20px,4vw,40px);max-width:1200px;margin:0 auto;}
.chapter-prologue{min-height:100vh;align-items:center;background:var(--abyss);margin:0;max-width:none;padding-left:clamp(40px,10vw,120px);}
.chapter-epilogue{background:linear-gradient(180deg,var(--slate) 0%,var(--bathyal) 100%);margin:0;max-width:none;padding-left:clamp(40px,10vw,120px);}
.chapter-timeline{margin:0;max-width:none;}

/* Column system */
.editorial-col{flex:0 0 55%;max-width:55%;}
.editorial-col-full{flex:0 0 100%;max-width:100%;}
.margin-col{flex:1;display:flex;flex-direction:column;gap:20px;padding-top:80px;}

/* Chapter watermark */
.chapter-watermark{position:absolute;font-family:'Cormorant Garamond',serif;font-weight:700;font-size:20vw;color:var(--bathyal);opacity:0.04;top:0;left:5%;line-height:1;pointer-events:none;user-select:none;}

/* Neomorphic elements */
.nm-raised{background:var(--bathyal);border-radius:12px;padding:clamp(16px,2vw,24px);box-shadow:3px 3px 6px var(--shadow-dark),-3px -3px 6px var(--shadow-light);}
.nm-panel{background:var(--bathyal);border-radius:16px;padding:clamp(20px,3vw,36px);box-shadow:6px 6px 12px var(--shadow-dark),-6px -6px 12px var(--shadow-light);margin-bottom:clamp(16px,2vw,24px);}
.nm-panel p{margin-bottom:1em;}
.nm-panel p:last-child{margin-bottom:0;}
.nm-inset{background:var(--slate);border-radius:16px;padding:clamp(20px,3vw,36px);box-shadow:inset 4px 4px 8px var(--shadow-dark),inset -4px -4px 8px var(--shadow-light);margin-bottom:clamp(16px,2vw,24px);}

/* Divider */
.nm-divider{display:flex;justify-content:center;padding:clamp(20px,3vw,40px) 0;}
.divider-bar{width:70%;height:4px;border-radius:2px;box-shadow:inset 2px 2px 4px var(--shadow-dark),inset -2px -2px 4px var(--shadow-light);}

/* Hero date - kinetic typography */
.hero-date{font-family:'Cormorant Garamond',serif;font-weight:700;font-size:clamp(4rem,12vw,10rem);letter-spacing:0.08em;color:var(--text-primary);display:flex;flex-wrap:wrap;}
.hero-date span{display:inline-block;opacity:0;transform:translate(var(--tx,0),var(--ty,0)) rotate(var(--rot,0deg));transition:opacity 1.2s cubic-bezier(0.22,1,0.36,1),transform 1.2s cubic-bezier(0.22,1,0.36,1);transition-delay:calc(var(--i) * 0.1s);}
.hero-date.kinetic-active span{opacity:1;transform:translate(0,0) rotate(0deg);}
.date-dot{color:var(--teal);}
.prologue-sub{font-family:'Space Grotesk',sans-serif;font-weight:500;font-size:clamp(0.85rem,1.4vw,1rem);color:var(--text-secondary);letter-spacing:0.04em;margin-top:1.5rem;opacity:0;transition:opacity 800ms ease 1.5s;}
.chapter-prologue.visible .prologue-sub{opacity:1;}

/* Chapter headings */
.chapter-heading{font-family:'Cormorant Garamond',serif;font-weight:600;font-size:clamp(2.5rem,7vw,6rem);letter-spacing:0.08em;color:var(--text-primary);margin-bottom:clamp(20px,3vw,40px);}
.chapter-heading span{display:inline-block;opacity:0;transform:translateY(20px) rotate(-5deg);transition:opacity 600ms cubic-bezier(0.22,1,0.36,1),transform 600ms cubic-bezier(0.22,1,0.36,1);transition-delay:calc(var(--i) * 0.06s);}
.chapter-heading.kinetic-active span{opacity:1;transform:translateY(0) rotate(0deg);}

/* Annotations */
.annotation{margin-bottom:16px;}
.annotation-label{display:block;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:clamp(0.75rem,1.2vw,0.875rem);color:var(--teal);letter-spacing:0.04em;margin-bottom:0.5rem;text-shadow:0 0 8px rgba(0,180,216,0.3);}
.annotation p{font-size:0.9rem;color:var(--text-secondary);line-height:1.6;}
.annotation-gold .annotation-label{color:var(--gold);}

/* Timeline */
.timeline-container{overflow-x:auto;padding:clamp(20px,3vw,40px) 0;-webkit-overflow-scrolling:touch;}
.timeline-rail{position:relative;width:max(100%,900px);height:200px;}
.timeline-track{position:absolute;top:50%;left:0;right:0;height:4px;border-radius:2px;box-shadow:inset 2px 2px 4px var(--shadow-dark),inset -2px -2px 4px var(--shadow-light);transform:translateY(-50%);}
.timeline-node{position:absolute;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:8px;}
.node-shape{width:28px;height:28px;border-radius:50%;background:var(--bathyal);box-shadow:4px 4px 8px var(--shadow-dark),-4px -4px 8px var(--shadow-light);}
.node-triangle .node-shape{border-radius:0;clip-path:polygon(50% 0%,100% 100%,0% 100%);}
.node-hexagon .node-shape{border-radius:0;clip-path:polygon(25% 0%,75% 0%,100% 50%,75% 100%,25% 100%,0% 50%);}
.node-square .node-shape{border-radius:4px;}
.node-time{font-family:'Space Grotesk',sans-serif;font-weight:500;font-size:0.8rem;color:var(--teal);letter-spacing:0.04em;text-shadow:0 0 8px rgba(0,180,216,0.3);}
.node-label{font-family:'Inter',sans-serif;font-weight:400;font-size:0.8rem;color:var(--text-secondary);text-align:center;max-width:120px;line-height:1.4;}

/* Structure diagram */
.structure-diagram{position:relative;display:flex;align-items:center;justify-content:center;min-height:200px;}
.diagram-layer{display:flex;align-items:center;justify-content:center;border-radius:16px;position:absolute;}
.layer-outer{width:90%;height:180px;box-shadow:inset 3px 3px 6px var(--shadow-dark),inset -3px -3px 6px var(--shadow-light);}
.layer-middle{width:60%;height:120px;box-shadow:inset 3px 3px 6px var(--shadow-dark),inset -3px -3px 6px var(--shadow-light);}
.layer-inner{width:30%;height:60px;background:var(--bathyal);box-shadow:4px 4px 8px var(--shadow-dark),-4px -4px 8px var(--shadow-light);}
.diagram-label{font-family:'Space Grotesk',sans-serif;font-weight:500;font-size:0.75rem;color:var(--text-secondary);letter-spacing:0.04em;}

/* Pullquote */
.pullquote{font-family:'Cormorant Garamond',serif;font-weight:500;font-style:italic;font-size:clamp(1.3rem,2.5vw,2rem);color:var(--gold);line-height:1.5;padding:clamp(20px,3vw,40px) 0;margin-top:clamp(16px,2vw,24px);position:relative;}
.pullquote::before{content:'\201C';font-size:3em;color:var(--gold);opacity:0.3;position:absolute;top:-10px;left:-10px;font-family:'Cormorant Garamond',serif;}

/* Scroll entrance */
.chapter[data-anim]{opacity:0;transform:translateY(30px);transition:opacity 700ms ease,transform 700ms ease;}
.chapter[data-anim].visible{opacity:1;transform:translateY(0);}

/* Footer */
.site-footer{text-align:center;padding:clamp(40px,6vw,60px);}
.site-footer p{font-family:'Space Grotesk',sans-serif;font-weight:500;font-size:0.8rem;color:var(--text-secondary);opacity:0.4;letter-spacing:0.04em;}

/* Tablet */
@media(max-width:900px){
    .chapter{flex-direction:column;}
    .editorial-col{flex:1;max-width:100%;}
    .margin-col{padding-top:0;flex-direction:row;flex-wrap:wrap;gap:12px;}
    .annotation{flex:1;min-width:200px;}
}

/* Mobile */
@media(max-width:600px){
    .chapter-watermark{font-size:30vw;opacity:0.03;}
    .chapter-prologue,.chapter-epilogue{padding-left:clamp(20px,4vw,40px);}
    .timeline-rail{width:900px;}
    .structure-diagram{min-height:160px;}
    .layer-outer{height:140px;}
    .layer-middle{height:100px;}
    .layer-inner{height:50px;}
}

/* Reduced motion */
@media(prefers-reduced-motion:reduce){
    .hero-date span,.chapter-heading span{transition:none;opacity:1;transform:none;}
    .chapter[data-anim]{transition:none;opacity:1;transform:none;}
    .prologue-sub{transition:none;opacity:1;}
}
