/* ============================================================
   D3Square Landing — Style
   ============================================================ */

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

:root {
  --navy-950: #020617;
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --navy-600: #475569;
  --navy-500: #64748b;
  --navy-400: #94a3b8;
  --navy-300: #cbd5e1;
  --navy-200: #e2e8f0;
  --navy-100: #f1f5f9;
  --navy-50:  #f8fafc;
  --blue-700: #1d4ed8;
  --blue-600: #1e40af;
  --blue-500: #2563eb;
  --blue-100: #dbeafe;
  --blue-50:  #eff6ff;
  --white:    #ffffff;
  --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --container: 1200px;
  --nav-h: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--navy-900);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy-900);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-600);
  transition: color .2s;
}
.nav-links a:hover { color: var(--navy-900); }
.nav-cta {
  background: var(--navy-900) !important;
  color: var(--white) !important;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px !important;
  transition: background .2s !important;
}
.nav-cta:hover { background: var(--navy-700) !important; }

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy-900);
  border-radius: 2px;
  transition: .3s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 28px;
  border-radius: 10px;
  transition: all .25s;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--navy-900);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-700); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--navy-700);
  border: 1.5px solid var(--navy-200);
}
.btn-ghost:hover { border-color: var(--navy-400); background: var(--navy-50); }
.btn-lg { padding: 16px 40px; font-size: 16px; border-radius: 12px; }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--navy-950);
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}
.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-500);
  margin-bottom: 20px;
}
.hero-title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 24px;
}
.hero-title span { display: block; }
.hero-desc {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--navy-400);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 40px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.hero .btn-primary { background: var(--blue-600); }
.hero .btn-primary:hover { background: var(--blue-500); }
.hero .btn-ghost { color: var(--navy-300); border-color: var(--navy-600); }
.hero .btn-ghost:hover { border-color: var(--navy-400); background: rgba(255,255,255,0.05); }

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--navy-400), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Sections --- */
.section {
  padding: 140px 0;
}
.section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--navy-900);
  margin-bottom: 20px;
}
.section-desc {
  font-size: 17px;
  color: var(--navy-500);
  line-height: 1.8;
  max-width: 520px;
}

/* --- Problem --- */
.problem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.problem-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.problem-card {
  padding: 24px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  transition: transform .4s, opacity .4s;
}
.problem-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 8px;
  margin-bottom: 12px;
  color: var(--navy-500);
}
.problem-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.problem-card p {
  font-size: 13px;
  color: var(--navy-500);
  line-height: 1.6;
}

/* --- Platform Diagram --- */
.section-platform {
  background: var(--navy-50);
  text-align: center;
}
.platform-visual {
  margin-top: 60px;
  overflow-x: auto;
}
.platform-diagram {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.platform-node rect {
  transition: fill .4s, stroke .4s;
}
.platform-node.active rect {
  fill: var(--blue-50);
  stroke: var(--blue-600);
}
.platform-line {
  stroke-dashoffset: 0;
  transition: stroke .4s;
}

/* --- Features --- */
.section-features {
  padding-bottom: 60px;
}
.feature-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  padding: 80px 0;
  border-bottom: 1px solid var(--navy-100);
}
.feature-block:last-child { border-bottom: none; }
.feature-block.reverse { direction: rtl; }
.feature-block.reverse > * { direction: ltr; }

.feature-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-600);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.feature-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}
.feature-desc {
  font-size: 16px;
  color: var(--navy-500);
  line-height: 1.8;
  margin-bottom: 24px;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  font-size: 14px;
  color: var(--navy-600);
  padding-left: 20px;
  position: relative;
}
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-600);
}

/* Feature Graphics */
.feature-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-graphic {
  width: 100%;
  max-width: 480px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: 16px;
  padding: 32px;
  position: relative;
}

/* Data Grid Graphic */
.data-grid {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
}
.data-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  padding: 8px 0;
  border-bottom: 1px solid var(--navy-100);
}
.data-row span {
  padding: 4px 8px;
  color: var(--navy-700);
}
.data-header {
  font-weight: 600;
  color: var(--navy-500);
  border-bottom: 2px solid var(--navy-200);
}
.data-header span { color: var(--navy-500); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.data-row.highlight {
  background: #fef3c7;
  border-radius: 4px;
}
.data-row.highlight span:nth-child(2) { color: #b45309; font-weight: 600; }
.data-badge {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  color: #166534;
  font-weight: 500;
}

/* Model Chart Graphic */
.graphic-model { background: var(--white); }
.model-chart { width: 100%; }
.model-curve {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset 1.5s ease;
}
.model-curve.drawn { stroke-dashoffset: 0; }

/* Optimization Graphic */
.graphic-optim { background: var(--white); }
.optim-chart { width: 100%; }
.pareto-curve {
  transition: stroke-dashoffset 1.5s ease .3s;
}
.pareto-curve.drawn { stroke-dashoffset: 0; }
.pareto-point {
  opacity: 0;
  transform-origin: center;
  transition: opacity .4s, transform .4s;
}
.pareto-point.show {
  opacity: 1;
}

/* Active Learning Graphic */
.graphic-al {
  background: var(--white);
  padding: 40px 24px;
}
.al-cycle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.al-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s, transform .5s;
  transition-delay: calc(var(--i) * 0.15s);
}
.al-step.show { opacity: 1; transform: none; }
.al-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-50);
  border: 1.5px solid var(--blue-100);
  border-radius: 12px;
  color: var(--blue-600);
}
.al-step span {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-600);
  white-space: nowrap;
}
.al-arrow {
  opacity: 0;
  transition: opacity .4s .3s;
}
.al-arrow.show { opacity: 1; }
.al-loop-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-600);
  opacity: 0;
  transition: opacity .6s .8s;
}
.al-loop-label.show { opacity: 1; }

/* --- Workflow --- */
.section-workflow {
  background: var(--navy-950);
  color: var(--white);
}
.section-workflow .section-eyebrow { color: var(--blue-500); }
.section-workflow .section-title { color: var(--white); }

.workflow-timeline {
  margin-top: 80px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.workflow-line {
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--navy-700);
}
.workflow-step {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-bottom: 48px;
  position: relative;
}
.workflow-step:last-child { padding-bottom: 0; }
.workflow-dot {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--navy-800);
  border: 2px solid var(--navy-600);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background .4s, border-color .4s;
}
.workflow-step.visible .workflow-dot {
  background: var(--blue-600);
  border-color: var(--blue-500);
}
.workflow-card {
  flex: 1;
  padding: 24px 28px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--navy-800);
  border-radius: 12px;
  transition: border-color .4s, background .4s;
}
.workflow-step.visible .workflow-card {
  border-color: var(--navy-600);
  background: rgba(255,255,255,0.06);
}
.workflow-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue-500);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.workflow-card h4 {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0;
  color: var(--white);
}
.workflow-card p {
  font-size: 14px;
  color: var(--navy-400);
  line-height: 1.7;
}

/* --- Stats --- */
.section-stats {
  padding: 100px 0;
  background: var(--white);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  text-align: center;
}
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-item > div:first-child {
  display: flex;
  align-items: baseline;
}
.stat-number {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 800;
  color: var(--navy-900);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-unit {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--blue-600);
  margin-left: 4px;
}
.stat-desc {
  font-size: 15px;
  color: var(--navy-500);
  margin-top: 8px;
}

/* --- Use Cases --- */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 60px;
}
.usecase-card {
  padding: 32px 24px;
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  border-radius: 16px;
  transition: transform .3s, box-shadow .3s;
}
.usecase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.06);
}
.usecase-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 12px;
  margin-bottom: 20px;
  color: var(--blue-600);
  border: 1px solid var(--navy-100);
}
.usecase-card h4 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.usecase-card p {
  font-size: 13px;
  color: var(--navy-500);
  line-height: 1.7;
}

/* --- Lab --- */
.section-lab {
  background: var(--navy-50);
}
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.lab-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.lab-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy-700);
}
.lab-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lab-dash-item {
  padding: 28px 24px;
  background: var(--white);
  border: 1px solid var(--navy-100);
  border-radius: 12px;
  text-align: center;
}
.lab-dash-label {
  font-size: 12px;
  color: var(--navy-500);
  margin-bottom: 8px;
  font-weight: 500;
}
.lab-dash-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy-900);
  font-variant-numeric: tabular-nums;
}

/* --- CTA --- */
.section-cta {
  background: var(--navy-950);
  text-align: center;
  padding: 160px 0;
}
.cta-title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 20px;
}
.cta-desc {
  font-size: 17px;
  color: var(--navy-400);
  margin-bottom: 40px;
}
.cta-actions .btn-primary {
  background: var(--blue-600);
}
.cta-actions .btn-primary:hover {
  background: var(--blue-500);
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  background: var(--navy-950);
  border-top: 1px solid var(--navy-800);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy-300);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  font-size: 13px;
  color: var(--navy-500);
  transition: color .2s;
}
.footer-links a:hover { color: var(--navy-300); }
.footer-copy {
  font-size: 12px;
  color: var(--navy-600);
}

/* --- Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: none;
}
.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .usecases-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: flex; }

  .section { padding: 80px 0; }

  .problem-grid,
  .feature-block,
  .feature-block.reverse,
  .lab-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .feature-block.reverse { direction: ltr; }

  .stats-grid { grid-template-columns: 1fr; gap: 32px; }
  .usecases-grid { grid-template-columns: 1fr; }

  .hero-actions { flex-direction: column; align-items: center; }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .al-cycle { gap: 8px; }
  .al-arrow { display: none; }
  .al-cycle { display: grid; grid-template-columns: repeat(2, 1fr); }

  .platform-diagram { min-width: 700px; }

  .workflow-step { gap: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-title { font-size: 32px; }
  .section-title { font-size: 28px; }
  .feature-title { font-size: 24px; }
  .lab-dashboard { grid-template-columns: 1fr; }
}
