/* ═══════════════════════════════════════════════════
   908 Doha Enterprise — Global Styles
   Dark / Black-White Professional
═══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black:   #000000;
  --bg:      #080808;
  --surface: #111111;
  --border:  rgba(255,255,255,0.08);
  --white:   #FFFFFF;
  --gray:    #707070;
  --light:   #A8A8A8;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'Inter', sans-serif;
}

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

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--sans);
  cursor: none;
  overflow-x: hidden;
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════════ */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--black);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo {
  font-family: var(--mono);
  font-size: 2rem; font-weight: 700;
  letter-spacing: 0.1em;
}
.loader-logo span { color: var(--gray); }

.loader-bar {
  width: 200px; height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.loader-fill {
  position: absolute; left: 0; top: 0;
  height: 100%; width: 0;
  background: var(--white);
  transition: width 0.05s linear;
}
.loader-pct {
  font-family: var(--mono);
  font-size: 0.7rem; color: var(--gray);
  letter-spacing: 0.2em;
}

/* ══════════════════════════════════════════════════
   CURSOR
══════════════════════════════════════════════════ */
#cursor-ring {
  position: fixed; pointer-events: none; z-index: 9998;
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s;
}
#cursor-dot {
  position: fixed; pointer-events: none; z-index: 9999;
  width: 4px; height: 4px;
  background: var(--white);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
body:has(a:hover) #cursor-ring,
body:has(button:hover) #cursor-ring,
body:has(.sys-card:hover) #cursor-ring {
  width: 56px; height: 56px;
  border-color: rgba(255,255,255,0.9);
}

/* ══════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════ */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 48px;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
#nav.scrolled {
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(16px);
  padding: 16px 48px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1rem; font-weight: 700;
  letter-spacing: 0.1em;
}
.nav-logo span { color: var(--gray); }

.nav-links {
  display: flex; gap: 40px; list-style: none;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.7rem; font-weight: 400;
  color: var(--gray); text-decoration: none;
  letter-spacing: 0.15em; text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--white); }

.nav-right {
  display: flex; align-items: center; gap: 24px;
}
.nav-lang {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--gray);
}

/* ── Hamburger ──────────────────────────────────── */
.menu-btn {
  display: flex; flex-direction: column;
  justify-content: center; gap: 5px;
  width: 28px; height: 28px;
  background: none; border: none; cursor: none;
  padding: 0;
}
.menu-btn span {
  display: block; width: 100%; height: 1px;
  background: var(--white);
  transition: transform 0.3s, opacity 0.3s, width 0.3s;
  transform-origin: center;
}
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Menu Overlay ───────────────────────────────── */
#menu-overlay {
  position: fixed; inset: 0; z-index: 99;
  background: var(--black);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#menu-overlay.open { opacity: 1; visibility: visible; }

.overlay-nav {
  display: flex; flex-direction: column;
  align-items: center; gap: 32px;
}
.overlay-link {
  font-family: var(--mono); font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700; color: var(--gray);
  text-decoration: none; letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s, transform 0.2s;
  position: relative;
}
.overlay-link::after {
  content: ''; position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--white);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.overlay-link:hover { color: var(--white); transform: translateX(8px); }
.overlay-link:hover::after { transform: scaleX(1); }
.overlay-team { color: rgba(255,255,255,0.4); }
.overlay-team:hover { color: var(--white); }

.overlay-footer {
  position: absolute; bottom: 48px;
}
.lang-btn {
  background: none; border: none; cursor: none;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--gray); letter-spacing: 0.1em;
  transition: color 0.2s;
}
.lang-btn.active, .lang-btn:hover { color: var(--white); }

/* ══════════════════════════════════════════════════
   SCROLL DOT NAV
══════════════════════════════════════════════════ */
#scroll-nav {
  position: fixed; right: 32px; top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex; flex-direction: column; gap: 12px;
}
.scroll-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: none;
  transition: background 0.3s, transform 0.3s;
}
.scroll-dot.active {
  background: var(--white);
  transform: scale(1.4);
}

/* ══════════════════════════════════════════════════
   SECTIONS COMMON
══════════════════════════════════════════════════ */
section {
  position: relative;
  padding: 120px 80px;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.65rem; font-weight: 400;
  color: var(--gray); letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.section-title {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700; line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

/* ── Reveal animations ──────────────────────────── */
.reveal-line {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal-line.visible { opacity: 1; transform: translateY(0); }

.reveal-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-fade.visible { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════ */
#hero {
  min-height: 100vh; padding: 0;
  align-items: center; justify-content: center;
  overflow: hidden;
}

#particle-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}

.hero-content {
  position: relative; z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 48px;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.65rem; letter-spacing: 0.4em;
  color: var(--gray); margin-bottom: 32px;
  opacity: 0; animation: fadeUp 0.8s 0.5s forwards;
}

.hero-headline {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700; line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  opacity: 0; animation: fadeUp 0.8s 0.8s forwards;
  min-height: 1.2em;
}

.ko-break { display: block; margin-top: 0.5em; }

.typewriter::after {
  content: '|';
  animation: blink 0.8s infinite;
  margin-left: 2px;
}
.typewriter.done::after { display: none; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-sub {
  font-family: var(--sans);
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: var(--light); line-height: 1.7;
  max-width: 580px; margin: 0 auto 48px;
  opacity: 0; animation: fadeUp 0.8s 1.1s forwards;
}

.cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.15em;
  text-transform: uppercase; text-decoration: none;
  color: var(--black); background: var(--white);
  padding: 14px 28px; border: none;
  cursor: none; position: relative; overflow: hidden;
  transition: background 0.3s, color 0.3s;
  opacity: 0; animation: fadeUp 0.8s 1.4s forwards;
}
.cta-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--black);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  z-index: 0;
}
.cta-btn:hover::before { transform: translateX(0); }
.cta-btn:hover { color: var(--white); }
.cta-btn span, .cta-btn svg { position: relative; z-index: 1; }

/* Override for non-hero CTAs */
section:not(#hero) .cta-btn,
footer .cta-btn {
  opacity: 1; animation: none;
}

.hero-scroll-hint {
  position: absolute; bottom: 48px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--gray); letter-spacing: 0.3em;
  opacity: 0; animation: fadeUp 0.8s 1.8s forwards;
}
.scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--gray), transparent);
  animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse {
  0%,100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════
   ABOUT
══════════════════════════════════════════════════ */
#about {
  background: var(--bg);
}
#about::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-body {
  font-size: 1rem; color: var(--light);
  line-height: 1.8; margin-bottom: 20px;
}

.about-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
}
.stat-item { text-align: left; }
.stat-num {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 4vw, 4rem);
  font-weight: 700; line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.65rem; color: var(--gray);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ══════════════════════════════════════════════════
   SYSTEMS
══════════════════════════════════════════════════ */
#systems {
  background: var(--black);
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.sys-card {
  background: var(--black);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  transition: background 0.4s;
  cursor: none;
}
.sys-card::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--white), transparent);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}
.sys-card:hover { background: var(--surface); }
.sys-card:hover::after { transform: scaleX(1); }

.sys-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
}
.sys-id {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--gray); letter-spacing: 0.3em;
}
.sys-status {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--gray); letter-spacing: 0.1em;
}
.sys-card:hover .sys-status { color: #5FFF7A; }

.sys-mini-viz {
  width: 100%; height: 80px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  position: relative; overflow: hidden;
}

.sys-name {
  font-family: var(--mono);
  font-size: 1.1rem; font-weight: 600;
  margin-bottom: 16px; line-height: 1.3;
}
.sys-desc {
  font-size: 0.85rem; color: var(--light);
  line-height: 1.7; margin-bottom: 24px;
}
.sys-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s ease;
}
.sys-card:hover .sys-tags { max-height: 100px; }
.sys-tags span {
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.1em; color: var(--gray);
  border: 1px solid var(--border);
  padding: 4px 10px;
}

/* ══════════════════════════════════════════════════
   TECHNOLOGY
══════════════════════════════════════════════════ */
#technology {
  background: var(--bg);
}
#technology::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.tech-flow {
  display: flex; align-items: flex-start;
  gap: 0;
  position: relative;
}

.tech-step {
  flex: 1; text-align: center;
  padding: 0 20px;
}
.tech-connector {
  flex: 0 0 80px;
  display: flex; align-items: center;
  padding-top: 48px;
}
.connector-svg { width: 100%; }
.connector-svg line {
  stroke-dasharray: 4 4;
  animation: dashMove 2s linear infinite;
}
@keyframes dashMove { to { stroke-dashoffset: -16; } }

.step-num {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--gray); letter-spacing: 0.3em;
  margin-bottom: 20px;
}
.step-icon {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s;
}
.step-icon svg { width: 28px; height: 28px; }
.tech-step:hover .step-icon { border-color: rgba(255,255,255,0.4); }

.tech-step h4 {
  font-family: var(--mono); font-size: 0.9rem;
  font-weight: 600; margin-bottom: 12px;
}
.tech-step p {
  font-size: 0.8rem; color: var(--light);
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════
   CONTACT
══════════════════════════════════════════════════ */
#contact {
  background: var(--black);
  overflow: hidden;
}
#contact-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.4;
}

.contact-inner {
  position: relative; z-index: 2;
  max-width: 640px;
}

.contact-sub {
  font-size: 1rem; color: var(--light);
  line-height: 1.7; margin-bottom: 48px;
}

.contact-form { display: flex; flex-direction: column; gap: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--gray); letter-spacing: 0.2em; text-transform: uppercase;
}
.form-field input,
.form-field select {
  background: transparent;
  border: none; border-bottom: 1px solid var(--border);
  color: var(--white);
  font-family: var(--sans); font-size: 0.9rem;
  padding: 12px 0;
  outline: none; cursor: none;
  transition: border-color 0.3s;
  -webkit-appearance: none;
}
.form-field input::placeholder { color: var(--gray); }
.form-field input:focus,
.form-field select:focus {
  border-color: var(--white);
  box-shadow: 0 4px 20px -10px rgba(255,255,255,0.2);
}
.form-field select { color: var(--gray); }
.form-field select option { background: var(--black); color: var(--white); }

.contact-form .cta-btn { align-self: flex-start; }

/* ══════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════ */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding: 64px 80px;
  border-bottom: 1px solid var(--border);
}

.footer-logo {
  font-family: var(--mono); font-size: 1rem; font-weight: 700;
  letter-spacing: 0.08em; margin-bottom: 16px;
}
.footer-logo span { color: var(--gray); }

.footer-tagline {
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--gray); letter-spacing: 0.15em;
}

.footer-section-label {
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--gray); letter-spacing: 0.3em;
  text-transform: uppercase; margin-bottom: 20px;
}

.footer-email {
  font-family: var(--mono); font-size: 0.8rem;
  color: var(--light); text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.footer-email:hover { color: var(--white); }

.footer-members {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
}
.footer-members li {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--light); letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 8px;
}
.member-role { color: var(--gray); font-size: 0.7rem; }
.member-link {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--light); text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.member-link:hover { color: var(--white); }

.footer-links {
  list-style: none; display: flex; flex-direction: column; gap: 10px;
}
.footer-links a {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--gray); text-decoration: none;
  letter-spacing: 0.05em; transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 80px;
}
.footer-copy {
  font-family: var(--mono); font-size: 0.62rem;
  color: rgba(255,255,255,0.3); letter-spacing: 0.1em;
}

/* ══════════════════════════════════════════════════
   KOREAN MODE — 자간 최소화
══════════════════════════════════════════════════ */
body.lang-ko .hero-tag,
body.lang-ko .hero-headline,
body.lang-ko .hero-sub,
body.lang-ko .cta-btn span,
body.lang-ko .section-title,
body.lang-ko .section-label,
body.lang-ko .about-body,
body.lang-ko .sys-name,
body.lang-ko .sys-desc,
body.lang-ko .sys-id,
body.lang-ko .tech-step h4,
body.lang-ko .tech-step p,
body.lang-ko .contact-sub,
body.lang-ko .form-field label,
body.lang-ko .footer-tagline,
body.lang-ko .footer-copy,
body.lang-ko .footer-email,
body.lang-ko .footer-members li,
body.lang-ko .nav-links a,
body.lang-ko .overlay-link,
body.lang-ko .stat-label {
  letter-spacing: 0 !important;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  section { padding: 100px 48px; }
  .about-grid { grid-template-columns: 1fr; gap: 60px; }
  .systems-grid { grid-template-columns: 1fr; }
  .tech-flow { flex-direction: column; align-items: center; gap: 0; }
  .tech-connector { transform: none; padding: 0; flex: 0 0 32px; width: 1px; }
  .tech-connector .connector-svg { display: none; }
  .tech-connector::after {
    content: '';
    display: block;
    width: 1px; height: 32px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    margin: 0 auto;
  }
  .footer-top { grid-template-columns: 1fr 1fr; padding: 48px; }
  .footer-bottom { padding: 16px 48px; flex-direction: column; gap: 8px; text-align: center; }
  #scroll-nav { display: none; }
}

@media (max-width: 768px) {
  section { padding: 80px 24px; }
  #nav { padding: 20px 24px; }
  #nav.scrolled { padding: 14px 24px; }
  .nav-links { display: none; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 32px; }
  .form-row { grid-template-columns: 1fr; }
  #scroll-nav { display: none; }
  #cursor-ring, #cursor-dot { display: none; }
  body { cursor: auto; }
  .lang-btn, .form-field input, .form-field select, .cta-btn { cursor: pointer; }
  .cta-btn { letter-spacing: 0.05em; }
  #particle-canvas, #contact-canvas { display: block; }
  .footer-top { grid-template-columns: 1fr 1fr; padding: 40px 24px; gap: 32px; }
  .footer-bottom { padding: 16px 24px; flex-direction: column; gap: 6px; text-align: center; }
}
