/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f5;
  --surface: #ffffff;
  --surface-dark: #f2f1ee;
  --border: #e6e4de;
  --text: #1a1a1a;
  --text-dim: #767570;
  --text-faint: #aeaca5;
  --accent: #1a1a1a;
  --accent-dark: #000000;
  --accent-soft: #1a1a1a0d;
  --gold: #1a1a1a;
  --gold-soft: #1a1a1a0d;
  --grad-1: #c9c7c0;
  --grad-2: #4a4944;
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --maxw: 1120px;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  --mono: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif;
  --script: "Dancing Script", "Noto Sans KR", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

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

section { padding: 72px 0; }
@media (max-width: 640px) {
  section { padding: 48px 0; }
}

.section-alt { background: var(--bg-alt); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 14px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--gold);
}

h1, h2, h3 { font-weight: 700; line-height: 1.3; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: clamp(24px, 3vw, 32px); }
h3 { font-size: 19px; }
p { color: var(--text-dim); margin: 0 0 16px; }

.section-head { margin-bottom: 48px; max-width: 640px; }
.section-head.center { max-width: 640px; margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head.center .eyebrow::before { display: none; }

/* ==========================================================================
   Header / nav
   ========================================================================== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 24px;
  text-align: center;
}
.site-header .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.brand-logo {
  font-family: var(--script);
  font-weight: 700;
  font-size: clamp(30px, 4.5vw, 42px);
  color: var(--text);
  line-height: 1;
}

/* Small square brand icon (like the small 'n' badge) */
.brand-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* Use existing circular logo as the small icon (no new file needed) */
  background-image: url('assets/images/logo-circle.png');
}

.header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.header-subtitle {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent-dark); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  border-color: var(--text);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent-dark); background: var(--accent-dark); color: #fff; }
section .btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
section .btn-ghost:hover { border-color: var(--accent-dark); color: var(--accent-dark); }

/* ==========================================================================
   About
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}
.about-photo {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-alt);
}
.about-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.about-facts {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.fact {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: 16px;
}
.fact span:first-child { color: var(--text-faint); font-family: var(--mono); flex-shrink: 0; }
.fact span:last-child { color: var(--text); text-align: right; }

/* ==========================================================================
   History / Resume
   ========================================================================== */
.timeline {
  max-width: 640px;
  margin: 0 auto;
}
.resume-item {
  position: relative;
  padding: 0 0 28px 28px;
  border-left: 2px solid var(--border);
}
.resume-item:last-child { padding-bottom: 0; }
.resume-item::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--bg-alt);
}
.resume-date {
  display: block;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 6px;
}
.resume-item h4 {
  font-size: 15.5px;
  margin: 0 0 4px;
  color: var(--text);
}
.resume-item h4 a {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.resume-item h4 a:hover { color: var(--accent-dark); border-bottom-color: var(--accent-dark); }
.resume-item p { font-size: 13.5px; margin: 0; }
.resume-item.ghost {
  border-left-style: dashed;
  color: var(--text-faint);
}
.resume-item.ghost::before { background: var(--border); border-color: var(--bg-alt); }
.resume-item.ghost p { font-family: var(--mono); font-size: 13px; margin: 0; }

.cert-block {
  max-width: 640px;
  margin: 56px auto 0;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.cert-block h3 {
  font-size: 15px;
  color: var(--accent-dark);
  margin-bottom: 20px;
}
.cert-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.cert-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 9px 18px;
  border-radius: 100px;
}
.cert-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}

/* ==========================================================================
   Projects / Portfolio
   ========================================================================== */
.filters {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 48px;
}
.filter-btn {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 0;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-faint);
  background: none;
  cursor: pointer;
}
.filter-btn:hover { color: var(--text); }
.filter-btn.active { color: var(--text); border-bottom-color: var(--text); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 700px) {
  .project-grid { grid-template-columns: 1fr; }
}
.project-grid.is-filtering .card { display: none; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}
.card:hover { opacity: 0.75; }
.card-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--grad-1) 0%, var(--grad-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffffcc;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  padding: 16px;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
}
.card-title {
  padding: 16px 18px;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-dim);
  margin: 0;
}

/* ghost "more projects coming" card */
.card-ghost {
  display: flex;
  flex-direction: column;
  border-style: dashed;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-faint);
  padding: 24px;
  min-height: 200px;
}
.card-ghost .plus {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  color: var(--text-faint);
}
.card-ghost p { font-size: 13.5px; color: var(--text-faint); margin: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background: var(--surface-dark);
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  text-align: center;
}
.footer-wordmark {
  font-family: var(--script);
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
}
.footer-social {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.footer-social a { color: var(--text-dim); }
.footer-social a:hover { color: var(--accent-dark); }
.footer-copy { color: var(--text-faint); font-size: 12px; }

/* ==========================================================================
   Project detail pages
   ========================================================================== */
.detail-hero {
  padding: 56px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
}
.back-link:hover { color: var(--accent-dark); }

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.detail-meta div span:first-child {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.detail-meta div span:last-child { font-size: 14.5px; color: var(--text); }

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.detail-stats div span:first-child {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.detail-stats div span:last-child {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
}

.detail-body {
  padding: 64px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 800px) {
  .detail-body { grid-template-columns: 1fr; gap: 24px; padding: 40px 0; }
}

.toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
}
.toc a {
  font-size: 13.5px;
  color: var(--text-faint);
  padding: 6px 0;
}
.toc a:hover { color: var(--accent-dark); }

.detail-content > section {
  padding: 0 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.detail-content > section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.placeholder-figure {
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 13px;
  margin: 20px 0;
}

.figure {
  margin: 20px 0;
}
.figure img {
  width: 100%;
  border: 1px solid var(--border);
}
.figure-caption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
}
.figure-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (max-width: 640px) {
  .figure-row { grid-template-columns: 1fr; }
}
.figure-row .figure { margin: 0; }

.flowchart {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  margin: 20px 0;
}
.flowchart-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.flowchart-box {
  background: var(--bg);
  border: 1.5px solid var(--accent-dark);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: var(--text);
  white-space: pre-line;
}
.flowchart-box.dim {
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 500;
}
.flowchart-box.highlight {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}
.flowchart-arrow {
  color: var(--text-faint);
  font-size: 16px;
  flex-shrink: 0;
}
.flowchart-arrow.down { font-size: 18px; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
}
.data-table th, .data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.data-table td { color: var(--text-dim); }
.data-table tr:last-child td { border-bottom: none; }
.data-table td.highlight { color: var(--text); font-weight: 700; }

.callout {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--text);
}
.callout strong { color: var(--accent-dark); }

.detail-content ul.bullets {
  display: grid;
  gap: 10px;
}
.detail-content ul.bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--text-dim);
  font-size: 14.5px;
}
.detail-content ul.bullets li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.detail-nav {
  display: flex;
  justify-content: space-between;
  padding: 40px 0 80px;
  border-top: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.detail-nav a {
  font-size: 14px;
  color: var(--text-dim);
}
.detail-nav a:hover { color: var(--accent-dark); }
