/* ==========================================================================
   APRO Fleet 랜딩 (aprofleet.com)
   색·글자·간격·모서리는 frontend/v2/DESIGN.md와 디자인 시스템 tokens.json 값만 쓴다.
   다크(관제실 톤)가 기본, 라이트는 토글.
   ========================================================================== */

:root,
:root[data-theme="dark"] {
  --bg: #000000;
  --bg2: #161616;
  --panel: #161616;
  --panel2: #262626;
  --line: #393939;
  --title: #ffffff;
  --ink: #f4f4f4;
  --mid: #c6c6c6;
  --faint: #a3a3a3;
  --primary-text: #60a5fa;
  --ok-text: #4ade80;
  --warn-text: #e7b85f;
  --surface-hover: rgba(148, 163, 184, 0.1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f4f4;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #f4f4f4;
  --line: #e0e0e0;
  --title: #000000;
  --ink: #161616;
  --mid: #393939;
  --faint: #404040;
  --primary-text: #1d4ed8;
  --ok-text: #1b6d3e;
  --warn-text: #865b0b;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  color-scheme: light;
}

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-ink: #ffffff;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --ok: #37b26c;
  --warn: #e7b85f;
  --status-ink-on-light: #171717;
  --font-sans: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Roboto Mono", monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --wrap: 1180px;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.015em;
  word-break: keep-all;
  text-rendering: optimizeLegibility;
}

@media (-webkit-min-device-pixel-ratio: 2) {
  body {
    -webkit-font-smoothing: antialiased;
  }
}

h1, h2, h3, h4, p, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico-16 {
  width: 16px;
  height: 16px;
}

.mono {
  font-family: var(--font-mono);
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) {
  .wrap {
    padding: 0 32px;
  }
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--panel);
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--title);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover {
  background: var(--panel2);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--mid);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--title);
}
.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
}
.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.icon-btn {
  width: 40px;
  padding: 0;
  justify-content: center;
}

/* ---------- 상단바 ---------- */
.gnb {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.gnb-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.gnb-logo img {
  height: 28px;
  width: auto;
  display: block;
}
.gnb-nav {
  display: none;
  gap: 4px;
}
@media (min-width: 900px) {
  .gnb-nav {
    display: flex;
  }
}
.gnb-nav a {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
  transition: background 0.15s, color 0.15s;
}
.gnb-nav a:hover {
  background: var(--surface-hover);
  color: var(--title);
}
.gnb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.only-wide {
  display: none;
}
@media (min-width: 640px) {
  .only-wide {
    display: inline-flex;
  }
}

/* 전체 화면 메뉴 */
.menu {
  position: relative;
}
.menu-caret {
  transition: transform 0.15s;
}
.menu.is-open .menu-caret {
  transform: rotate(180deg);
}
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 520px;
  max-width: calc(100vw - 32px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.menu-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
.menu-item:hover,
.menu-item:focus-visible {
  background: var(--panel2);
}
.menu-item b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--title);
}
.menu-item small {
  display: block;
  font-size: 12px;
  color: var(--faint);
}
.menu-item .ico {
  margin-top: 2px;
  color: var(--mid);
}

/* ---------- 히어로 ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 24px;
}
.dot-ok {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--ok);
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--title);
  margin-bottom: 16px;
}
.hero-lead {
  font-size: 18px;
  font-weight: 500;
  color: var(--mid);
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 64px;
}
.hero-video {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.hero-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-toggle {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.video-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}
.sites {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 32px;
  margin-top: 48px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mid);
}
.sites-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.sites span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.sites .ico {
  color: var(--faint);
}

/* ---------- 섹션 공통 ---------- */
.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--line);
}
.section-alt {
  background: var(--bg2);
}
.section-head {
  margin-bottom: 32px;
}
.section-no {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-text);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--title);
}
.section-head p {
  margin-top: 8px;
  color: var(--mid);
}
.section-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.section-head-row p {
  max-width: 400px;
  font-size: 14px;
}

/* ---------- 운영 흐름 탭 ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 900px) {
  .tabs {
    grid-template-columns: repeat(4, 1fr);
  }
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--mid);
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.tab:hover {
  background: var(--panel2);
  color: var(--title);
}
.tab-no {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}
.tab-name {
  font-size: 16px;
  font-weight: 500;
}
.tab.is-active {
  background: var(--panel2);
  color: var(--title);
}
.tab.is-active .tab-name {
  font-weight: 700;
}
.tab.is-active .tab-no {
  color: var(--primary-text);
}

.panel-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 640px) {
  .panel-box {
    padding: 32px;
  }
}
.flow-panel {
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 900px) {
  .flow-panel {
    grid-template-columns: 1fr 1fr;
  }
}
.flow-panel:not([hidden]) {
  animation: panelIn 0.25s ease-out;
}
@keyframes panelIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.flow-panel h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--title);
  margin-bottom: 12px;
}
.flow-panel .desc {
  color: var(--mid);
  margin-bottom: 24px;
}
.points {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}
.points li {
  display: flex;
  gap: 8px;
}
.points .ico {
  margin-top: 2px;
  color: var(--primary-text);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-visual {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--bg);
}
.flow-visual svg {
  display: block;
  width: 100%;
  height: auto;
}
/* 그림 안의 색도 토큰을 따른다 */
.v-bg { fill: var(--bg); }
.v-panel { fill: var(--panel2); stroke: var(--line); }
.v-line { stroke: var(--line); fill: none; }
.v-route { stroke: var(--primary); fill: none; }
.v-node { fill: var(--panel); stroke: var(--primary); }
.v-fill-primary { fill: var(--primary); }
.v-text { fill: var(--title); font-family: var(--font-sans); }
.v-text-mid { fill: var(--mid); font-family: var(--font-sans); }
.v-text-faint { fill: var(--faint); font-family: var(--font-mono); }
.v-text-on-primary { fill: var(--primary-ink); font-family: var(--font-sans); }
.v-ok { fill: var(--ok); }
.v-warn { fill: var(--warn); }
.v-warn-line { stroke: var(--warn); fill: var(--panel2); }
.v-warn-text { fill: var(--warn-text); font-family: var(--font-mono); }
.draw-line {
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
}
.flow-panel:not([hidden]) .draw-line {
  animation: drawLine 1.4s 0.15s ease-out forwards;
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

/* ---------- 워크스페이스 ---------- */
.ws-groups {
  display: grid;
  gap: 40px;
}
.ws-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 12px;
}
.ws-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 768px) {
  .ws-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, border-color 0.15s;
}
a.card:hover {
  background: var(--panel2);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-ico {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--panel2);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--title);
}
.card-go {
  color: var(--faint);
  transition: color 0.15s, transform 0.15s;
}
a.card:hover .card-go {
  color: var(--title);
  transform: translateX(2px);
}
.card h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 4px;
}
.card p {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 16px;
  flex: 1;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.tag {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--mid);
}
.domain {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--faint);
}

/* ---------- 개발자 ---------- */
.dev-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 768px) {
  .dev-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.dev-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: background 0.15s;
}
a.dev-row:hover {
  background: var(--panel2);
}
.dev-row .grow {
  flex: 1;
  min-width: 200px;
}
.dev-row b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--title);
}
.dev-row small {
  display: block;
  font-size: 12px;
  color: var(--faint);
}
.dev-row .card-ico {
  width: 36px;
  height: 36px;
}
.proto {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--panel2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--mid);
}
.dev-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 가이드 · 마무리 ---------- */
.guide-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 64px;
}
@media (min-width: 768px) {
  .guide-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.guide {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 24px;
}
.guide .grow {
  flex: 1;
}
.guide p {
  margin: 0;
}
.closing {
  text-align: center;
  padding: 64px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}
.closing h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--title);
  margin-bottom: 8px;
}
.closing p {
  color: var(--mid);
  margin-bottom: 32px;
}
.closing .hero-cta {
  margin-bottom: 0;
}

/* ---------- 푸터 ---------- */
.footer {
  padding: 64px 0 32px;
  background: var(--bg2);
  font-size: 14px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
@media (min-width: 768px) {
  .footer-cols {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}
.footer-brand {
  grid-column: 1 / -1;
}
@media (min-width: 768px) {
  .footer-brand {
    grid-column: auto;
  }
}
.footer-brand img {
  height: 24px;
  width: auto;
  display: block;
  margin-bottom: 12px;
}
.footer-brand p {
  font-size: 12px;
  color: var(--faint);
}
.footer h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--title);
  margin-bottom: 12px;
}
.footer li + li {
  margin-top: 8px;
}
.footer li a {
  color: var(--mid);
  transition: color 0.15s;
}
.footer li a:hover {
  color: var(--title);
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--faint);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .flow-panel:not([hidden]),
  .flow-panel:not([hidden]) .draw-line {
    animation: none;
    stroke-dashoffset: 0;
  }
}
