/* ============================================
   JungSeong Collective — 精誠企劃
   Direction 3: Monochrome Impact
   ============================================ */

:root {
  --bg: #000;
  --fg: #f5f5f5;
  --muted: #777;
  --line: #1f1f1f;
  --shock: #FFDE00;
  --shock-warm: #ffd500;
  color-scheme: dark;
  font-family: 'Noto Sans KR', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: none; }
a { color: inherit; text-decoration: none; cursor: none; }

/* ============ Preloader (S2) ============ */
#preloader {
  position: fixed; inset: 0;
  background: #000;
  z-index: 200;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(40px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-left, 0px)) 40px max(32px, env(safe-area-inset-right, 0px));
}
#preloader.done { pointer-events: none; animation: preHide 0.6s ease forwards; }
@keyframes preHide { to { opacity: 0; } }
.pre-top { display: flex; justify-content: space-between; align-items: center; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.pre-top strong { color: var(--fg); font-weight: 600; letter-spacing: 3px; }
.pre-center { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; gap: 20px; }
.pre-bar-wrap { width: min(400px, 70vw); display: flex; align-items: center; gap: 16px; font: 500 11px/1 'JetBrains Mono', monospace; }
.pre-bar { flex: 1; height: 1px; background: #222; position: relative; overflow: hidden; --p: 100%; }
.pre-bar::after { content: ""; position: absolute; inset: 0 var(--p) 0 0; background: var(--shock); transition: right 0.1s linear; }
.pre-pct { color: var(--shock); min-width: 48px; text-align: right; }
.pre-reveal {
  font-family: 'Ma Shan Zheng', serif;
  font-size: clamp(60px, 10vw, 120px);
  letter-spacing: 0.04em;
  color: var(--fg);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.4s;
}
.pre-reveal.show { opacity: 1; }
.pre-reveal span { display: inline-block; opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s; }
.pre-reveal.show span:nth-child(1) { transition-delay: 0s; opacity: 1; transform: none; }
.pre-reveal.show span:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: none; }
.pre-reveal.show span:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: none; }
.pre-reveal.show span:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: none; }
.pre-flash { position: fixed; inset: 0; background: var(--shock); z-index: 210; opacity: 0; pointer-events: none; }
.pre-flash.on { animation: flash 0.4s ease; }
@keyframes flash { 0% { opacity: 0 } 40% { opacity: 1 } 100% { opacity: 0 } }

/* ============ Marquee (S4) ============ */
#marquee {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0;
  z-index: 55;
  background: var(--shock);
  color: #000;
  height: 32px;
  display: flex; align-items: center;
  overflow: hidden;
  border-bottom: 1px solid #000;
  font: 600 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.marq-track { display: flex; gap: 60px; white-space: nowrap; animation: marq 40s linear infinite; }
#marquee:hover .marq-track { animation-play-state: paused; }
.marq-track span::after { content: "●"; margin-left: 60px; font-size: 7px; vertical-align: middle; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============ Progress bar (SC5) ============ */
#progress {
  position: fixed;
  top: calc(32px + env(safe-area-inset-top, 0px));
  left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 54;
}
#progress::before {
  content: "";
  display: block;
  width: var(--p, 0%);
  height: 100%;
  background: var(--shock);
  transition: width 0.1s linear;
}

/* ============ Nav ============ */
#nav {
  position: fixed;
  top: calc(34px + env(safe-area-inset-top, 0px));
  left: 0; right: 0;
  z-index: 50;
  padding: 14px max(24px, env(safe-area-inset-left, 0px));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}
#nav .logo { display: flex; align-items: center; gap: 12px; }
#nav .logo-mark { font-family: 'Ma Shan Zheng', serif; font-size: 18px; letter-spacing: 1px; }
#nav .logo-name { font-weight: 600; color: var(--fg); }
#nav .logo-name small { display: block; font-weight: 400; color: var(--muted); font-size: 9px; letter-spacing: 1.5px; margin-top: 2px; }
#nav .right { display: flex; align-items: center; gap: 20px; }
#nav .live { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--shock); box-shadow: 0 0 10px var(--shock); animation: pulse 1.6s ease infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.6; } }
#clock { color: var(--fg); font-variant-numeric: tabular-nums; }
.menu-btn { display: flex; flex-direction: column; gap: 4px; padding: 6px; }
.menu-btn span { width: 24px; height: 1px; background: var(--fg); transition: background 0.2s; }
.menu-btn:hover span { background: var(--shock); }

/* ============ Menu overlay (M4) ============ */
#menu-overlay {
  position: fixed; inset: 0;
  background: #000;
  z-index: 100;
  padding: max(80px, calc(80px + env(safe-area-inset-top, 0px))) max(32px, env(safe-area-inset-left, 0px)) 40px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.7s cubic-bezier(0.76, 0, 0.24, 1);
  display: flex; flex-direction: column; justify-content: space-between;
}
#menu-overlay.open { clip-path: inset(0 0 0 0); }
#menu-overlay .close { position: absolute; top: max(40px, calc(40px + env(safe-area-inset-top, 0px))); right: max(32px, env(safe-area-inset-right, 0px)); font-size: 24px; }
#menu-overlay ul { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-top: 60px; }
#menu-overlay li {
  font-family: 'Fraunces', serif;
  font-size: clamp(44px, 10vw, 120px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  position: relative;
  padding-bottom: 6px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s, transform 0.6s;
}
#menu-overlay.open li { opacity: 1; transform: none; }
#menu-overlay.open li:nth-child(1) { transition-delay: 0.2s; }
#menu-overlay.open li:nth-child(2) { transition-delay: 0.3s; }
#menu-overlay.open li:nth-child(3) { transition-delay: 0.4s; }
#menu-overlay.open li:nth-child(4) { transition-delay: 0.5s; }
#menu-overlay li a { display: inline-block; position: relative; }
#menu-overlay li a::after { content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 3px; background: var(--shock); transition: width 0.5s cubic-bezier(0.76, 0, 0.24, 1); }
#menu-overlay li a:hover { color: var(--shock); }
#menu-overlay li a:hover::after { width: 100%; }
#menu-overlay li em { font-style: italic; color: var(--muted); font-size: 0.4em; font-weight: 400; margin-left: 20px; letter-spacing: 3px; text-transform: uppercase; }
.menu-foot { display: flex; justify-content: space-between; font: 500 11px/1.8 'JetBrains Mono', monospace; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.menu-foot strong { color: var(--shock); display: block; font-weight: 600; }

/* ============ Custom cursor (S1) ============ */
#cursor-dot, #cursor-ring {
  position: fixed; top: 0; left: 0;
  pointer-events: none;
  z-index: 300;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
#cursor-dot { width: 6px; height: 6px; background: var(--shock); transition: width 0.2s, height 0.2s; }
#cursor-ring { width: 40px; height: 40px; border: 1px solid var(--shock); transition: width 0.3s, height 0.3s, opacity 0.3s; }
#cursor-ring.hover { width: 72px; height: 72px; border-color: var(--shock); }
#cursor-ring.hover::before { content: attr(data-label); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 600 10px/1 'JetBrains Mono', monospace; letter-spacing: 2px; color: var(--shock); }
@media (hover: none) { #cursor-dot, #cursor-ring { display: none; } body, a, button { cursor: auto; } }

/* ============ Main sections shared ============ */
main { padding-top: 76px; }
section {
  padding-block: 80px 100px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  position: relative;
}
.eyebrow { display: inline-flex; gap: 12px; align-items: center; font: 500 10px/1 'JetBrains Mono', monospace; letter-spacing: 3px; text-transform: uppercase; color: var(--muted); margin-bottom: 36px; }
.eyebrow .dot { width: 6px; height: 6px; background: var(--shock); border-radius: 50%; }
.eyebrow strong { color: var(--shock); font-weight: 500; }

/* ============ Hero ============ */
#hero { min-height: 82vh; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 60px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 20px 28px; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 30px; }
.hero-tags .hot { color: var(--shock); }
.hanja-hero {
  font-family: 'Ma Shan Zheng', serif;
  font-size: clamp(110px, 24vw, 340px);
  line-height: 0.82;
  letter-spacing: -0.015em;
  white-space: nowrap;
  color: var(--fg);
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: none;
}
.hero-shock {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(32px, 6.5vw, 86px);
  color: var(--shock);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 18px;
}
.hero-caption { display: flex; justify-content: space-between; gap: 24px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); font: 500 12px/1.5 'JetBrains Mono', monospace; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.hero-caption .r { text-align: right; color: var(--fg); font-family: 'Noto Sans KR', sans-serif; text-transform: none; letter-spacing: 0.5px; }

/* ============ Philosophy (SC3) ============ */
#philosophy { background: #0a0a0a; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 140px; }
.philo-quote {
  max-width: 900px;
  margin: 20px 0;
  font-family: 'Noto Serif KR', 'Fraunces', serif;
  font-size: clamp(22px, 3.2vw, 42px);
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.philo-quote .stanza { display: block; margin-bottom: 0.7em; }
.philo-quote .stanza:last-child { margin-bottom: 0; }
.philo-quote .stanza.final { margin-top: 0.3em; padding-top: 0.6em; border-top: 1px solid var(--line); }
.philo-quote .w { display: inline-block; opacity: 0.25; transition: opacity 0.5s; }
.philo-quote .shock { color: var(--shock); font-style: italic; font-family: 'Fraunces', 'Noto Serif KR', serif; font-weight: 700; }
.philo-source { margin-top: 30px; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }

/* ============ Services (SC1 — Pin + Horizontal) ============ */
#services-pin { height: 300vh; position: relative; }
.services-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; align-items: center; }
.services-track {
  display: flex;
  will-change: transform;
}
.service-panel {
  flex: 0 0 100vw;
  height: 100vh;
  padding: 100px max(32px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.service-panel .panel-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(100px, 20vw, 260px);
  font-weight: 900;
  line-height: 0.85;
  color: var(--shock);
  letter-spacing: -0.04em;
  position: absolute;
  right: max(24px, env(safe-area-inset-right, 0px));
  bottom: 60px;
  opacity: 0.08;
  pointer-events: none;
}
.service-panel .panel-tag { font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 3px; text-transform: uppercase; color: var(--shock); margin-bottom: 24px; }
.service-panel h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(60px, 11vw, 160px);
  line-height: 0.9;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  max-width: 1100px;
}
.service-panel h2 em { font-style: italic; color: var(--muted); font-weight: 400; }
.service-panel .desc { max-width: 560px; color: #bbb; font-size: 16px; line-height: 1.75; margin-bottom: 36px; }
.service-panel .chips { display: flex; flex-wrap: wrap; gap: 10px; max-width: 700px; }
.service-panel .chip { font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 1.5px; text-transform: uppercase; padding: 10px 16px; border: 1px solid var(--line); color: var(--muted); border-radius: 100px; transition: all 0.3s; }
.service-panel .chip:hover { border-color: var(--shock); color: var(--shock); }

/* ============ Credentials (SC2) ============ */
#credentials { padding-block: 120px; }
.creds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 30px; }
.cred { border-top: 1px solid var(--line); padding-top: 30px; }
.cred .n { font-family: 'Fraunces', serif; font-size: clamp(72px, 12vw, 160px); font-weight: 900; line-height: 0.9; letter-spacing: -0.04em; color: var(--fg); font-variant-numeric: tabular-nums; }
.cred .n .plus { color: var(--shock); font-weight: 700; }
.cred .lbl { margin-top: 12px; font: 500 11px/1 'JetBrains Mono', monospace; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }

/* ============ Services list (Glitch hover M1) ============ */
#services-list { padding-block: 100px; border-top: 1px solid var(--line); }
.svc-line {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.svc-line .n { font-family: 'Fraunces', serif; font-size: 44px; color: var(--shock); font-weight: 700; line-height: 1; }
.svc-line .name {
  font-family: 'Fraunces', serif;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 0;
  position: relative;
  transition: letter-spacing 0.4s;
}
.svc-line .name em { font-style: italic; font-weight: 400; color: var(--muted); }
.svc-line:hover .name { letter-spacing: 0.02em; animation: glitch 0.25s steps(1) infinite; }
@keyframes glitch {
  0%, 100% { text-shadow: none; transform: translate(0); }
  25% { text-shadow: -2px 0 #ff00c1, 2px 0 #00fff9; transform: translate(-1px, 0); }
  50% { text-shadow: 2px 0 var(--shock); transform: translate(1px, 0); }
}
.svc-line .meta { font: 500 11px/1.6 'JetBrains Mono', monospace; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; text-align: right; }

/* ============ Contact (big phone only) ============ */
#contact { padding-block: 120px 140px; text-align: center; }
#contact .eyebrow { margin-bottom: 50px; }
.contact-phone {
  display: block;
  padding-block: 20px;
  position: relative;
  transition: letter-spacing 0.4s;
}
.contact-phone .cp-lbl {
  display: block;
  font: 500 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 30px;
}
.contact-phone .cp-num {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: clamp(72px, 17vw, 260px);
  font-weight: 700;
  font-style: italic;
  line-height: 0.88;
  letter-spacing: -0.04em;
  color: var(--shock);
  transition: letter-spacing 0.4s, text-shadow 0.4s;
}
.contact-phone:hover .cp-num { letter-spacing: -0.02em; text-shadow: 0 0 60px rgba(255, 222, 0, 0.25); }
.contact-phone .cp-sub {
  display: block;
  margin-top: 36px;
  font: 500 12px/1 'JetBrains Mono', monospace;
  letter-spacing: 3px;
  color: var(--muted);
  text-transform: uppercase;
}
.contact-phone .cp-sub .arrow {
  color: var(--shock);
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.3s;
}
.contact-phone:hover .cp-sub .arrow { transform: translateX(8px); }

/* ============ Footer ============ */
footer {
  padding: 0 0 40px;
  border-top: 1px solid var(--line);
}
.foot-meta {
  padding: 60px max(24px, env(safe-area-inset-left, 0px)) 0;
  display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap;
}
.foot-mark { font-family: 'Ma Shan Zheng', serif; font-size: clamp(50px, 8vw, 90px); line-height: 0.9; color: var(--fg); letter-spacing: 0.02em; }
.foot-brand { font: 500 11px/1.8 'JetBrains Mono', monospace; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; text-align: right; }
.foot-brand strong { color: var(--shock); display: block; font-weight: 600; }
.foot-bottom { display: flex; justify-content: space-between; margin-top: 30px; padding: 20px max(24px, env(safe-area-inset-left, 0px)) 0; font: 500 10px/1 'JetBrains Mono', monospace; letter-spacing: 2px; color: #555; text-transform: uppercase; border-top: 1px solid var(--line); }

/* ============ Floating Action Buttons ============ */
.fab-stack {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.fab-stack.ready { opacity: 1; transform: none; pointer-events: auto; }
.fab {
  width: 58px; height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
  color: inherit;
}
.fab:hover { transform: scale(1.1); }
.fab:active { transform: scale(0.96); }
.fab svg { width: 26px; height: 26px; display: block; }
.fab.kakao { background: #FEE500; color: #191919; }
.fab.phone { background: #000; color: var(--shock); border: 1px solid var(--shock); animation: fab-pulse 2.4s ease-in-out infinite; }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(0,0,0,0.5), 0 0 0 0 rgba(255, 222, 0, 0.5); }
  50% { box-shadow: 0 10px 28px rgba(0,0,0,0.5), 0 0 0 14px rgba(255, 222, 0, 0); }
}
.fab .flabel {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #000;
  color: var(--shock);
  padding: 7px 14px;
  font: 600 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--shock);
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.fab:hover .flabel { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ============ Responsive (Mobile ≤ 760px) ============ */
@media (max-width: 760px) {
  #marquee { font-size: 10px; letter-spacing: 1px; }
  #nav .logo-name small { display: none; }
  #nav .right { gap: 12px; }
  #clock, #visitor { display: none; }
  .hero-caption { flex-direction: column; gap: 14px; }
  .hero-caption .r { text-align: left; }
  #services-pin { height: auto; }
  .services-stage { position: static; height: auto; }
  .services-track { flex-direction: column; transform: none !important; }
  .service-panel { flex: 0 0 auto; height: auto; min-height: 90vh; padding-block: 80px; border-bottom: 1px solid var(--line); }
  .creds-grid { grid-template-columns: 1fr; gap: 30px; }
  .svc-line { grid-template-columns: 46px 1fr; row-gap: 8px; }
  .svc-line .n { font-size: 32px; }
  .svc-line .meta { grid-column: 1 / -1; text-align: left; }
  #contact { padding-block: 80px 100px; }
  .foot-meta { flex-direction: column; align-items: flex-start; }
  .foot-brand { text-align: left; }
  .fab { width: 52px; height: 52px; }
  .fab svg { width: 22px; height: 22px; }
  .fab .flabel { display: none; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
