/* Portfolio — shared styles (technical dashboard tone) */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --grid: #f1f5f9;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", "Pretendard Variable", Pretendard, -apple-system, system-ui,
    "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

/* ============ i18n ============ */
[data-lang="ko"] .en { display: none !important; }
[data-lang="en"] .ko { display: none !important; }

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 40px 72px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ NAV ============ */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.site-nav .brand {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.site-nav .brand:hover { text-decoration: none; color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 16px; }

.nav-links { display: flex; gap: 16px; }
.nav-links a {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
}
.lang-toggle button {
  border: 0;
  background: var(--surface);
  color: var(--text-3);
  padding: 5px 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.lang-toggle button.active {
  background: var(--text);
  color: #fff;
}

/* ============ TYPO ============ */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

h1 {
  font-size: 34px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.section {
  margin-top: 56px;
}
.section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.section-head .sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }

.lede {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 780px;
  margin: 14px 0 0;
}

/* ============ CARDS / TILES ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px 14px;
}
.metric-tile .m-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-tile .m-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 6px;
  line-height: 1.1;
}
.metric-tile .m-value .unit { font-size: 14px; color: var(--text-3); font-weight: 500; margin-left: 2px; }
.metric-tile .m-note { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* ============ TAGS ============ */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--grid);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
}
.tag.accent { color: var(--accent); background: var(--accent-soft); border-color: #bfdbfe; }

/* ============ PROJECT CARDS (main) ============ */
.project-grid { display: grid; gap: 16px; }

.project-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 26px;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
}
/* stretched-link: title anchor covers the whole card */
.project-card .card-link { color: inherit; text-decoration: none; }
.project-card:hover .card-link { color: var(--accent); }
.project-card .card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
}
/* live link sits above the stretched overlay */
.project-card .pc-live {
  position: relative;
  z-index: 1;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 3px 9px;
  white-space: nowrap;
}
.project-card .pc-live:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.project-card .pc-live.muted { border-style: dashed; cursor: default; }
.project-card .pc-live.muted:hover { color: var(--text-3); border-color: var(--border-strong); }
.pc-kind-row { display: flex; align-items: center; gap: 10px; }
.project-card .pc-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.project-card .pc-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.project-card .pc-kind {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.project-card .pc-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin: 8px 0 14px;
}
.project-card .pc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.project-card .pc-stat {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ============ DETAIL PAGE ============ */
.proj-header { margin-bottom: 28px; }
.proj-header .meta-row {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-2);
}
.proj-header .meta-row .meta-item strong {
  color: var(--text);
  font-weight: 600;
}

.challenge {
  border-left: 3px solid var(--accent);
}
.challenge h3 { font-size: 15px; margin: 0 0 8px; font-weight: 650; }
.challenge p { font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0; }
.challenge .label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
}
.challenge .label.problem { color: var(--red); background: var(--red-soft); }
.challenge .label.solution { color: var(--green); background: var(--green-soft); }

.challenge-grid { display: grid; gap: 14px; }

/* screenshots */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.shot {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.shot img { display: block; width: 100%; height: auto; }
.shot .cap {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  line-height: 1.5;
}
.shot.wide { grid-column: 1 / -1; }

/* architecture diagram wrapper */
.arch-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  overflow-x: auto;
}
.arch-wrap svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }

/* CSS layered architecture diagram */
.arch {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 520px;
}
.arch-layer {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
}
.arch-layer + .arch-layer { border-top: 1px dashed var(--border); }
.arch-layer .layer-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
  line-height: 1.4;
}
.arch-nodes { display: flex; flex-wrap: wrap; gap: 8px; }
.node {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  background: var(--grid);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 12px;
  line-height: 1.3;
}
.node .n-sub { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-3); font-weight: 400; margin-top: 2px; }
.node.accent { background: var(--accent-soft); border-color: #bfdbfe; color: var(--accent); }
.node.green { background: var(--green-soft); border-color: #bbf7d0; color: #15803d; }
.node.violet { background: var(--violet-soft); border-color: #ddd6fe; color: var(--violet); }
.node.amber { background: var(--amber-soft); border-color: #fde68a; color: #b45309; }
.arch-flow {
  text-align: center;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-3);
  padding: 2px 0;
}

/* HERO SHOT — product proof in the first scroll */
.hero-shot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 28px;
}
.hero-shot img { display: block; width: 100%; height: auto; }
.hero-shot .cap {
  font-size: 12.5px;
  color: var(--text-2);
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  line-height: 1.55;
}

/* FEATURES — outcome-framed, screenshot per feature */
.feature {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0;
}
.feature + .feature { border-top: 1px solid var(--border); }
.feature.reverse .f-media { order: -1; }
.feature .f-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.feature h3 {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  line-height: 1.35;
}
.feature p { font-size: 14px; color: var(--text-2); line-height: 1.7; margin: 0; }
.feature .f-tags { margin-top: 12px; }
.feature .f-media {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.feature .f-media img { display: block; width: 100%; height: auto; }
/* text-only feature (no screenshot available) */
.feature.text-only { grid-template-columns: 1fr; }

/* HOW IT WORKS — numbered steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.steps.five { grid-template-columns: repeat(5, 1fr); }
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 18px 16px;
}
.step-card .n {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.step-card h4 { font-size: 13.5px; font-weight: 650; margin: 8px 0 5px; line-height: 1.35; }
.step-card p { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 0; }

/* inline pipeline (horizontal steps) */
.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}
.pipeline .step {
  flex: 1 1 0;
  min-width: 120px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  position: relative;
  margin: 6px;
}
.pipeline .step .s-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
}
.pipeline .step .s-title { font-size: 13px; font-weight: 650; margin-top: 4px; }
.pipeline .step .s-desc { font-size: 11.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }

/* prev/next */
.proj-pager {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 56px;
}
.proj-pager a {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text-2);
}
.proj-pager a:hover { border-color: var(--accent); text-decoration: none; }
.proj-pager a .dir {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}
.proj-pager a strong { color: var(--text); }
.proj-pager a.next { text-align: right; }

/* ============ SKILLS ============ */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.skill-group h3 {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 10px;
}

/* ============ CONTACT / FOOTER ============ */
.contact-row { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: #fff;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
}
.btn:hover { background: var(--accent); text-decoration: none; }
.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }

.footer {
  margin-top: 72px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 800px) {
  .page { padding: 24px 20px 56px; }
  h1 { font-size: 26px; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .skill-grid { grid-template-columns: 1fr; }
  .shot-grid { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 18px; }
  .feature.reverse .f-media { order: 0; }
  .steps, .steps.five { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .proj-pager { flex-direction: column; }
  .proj-pager a.next { text-align: left; }
}
