/* ==========================================================================
   박성주 Portfolio — shared stylesheet
   Tokens: white / deep-gray text / single blue accent, per brief.
   Type: Pretendard (Korean-first sans, one family, weight-driven hierarchy).
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --surface-hover: #eef1f5;
  --border: #e6e8ec;
  --text: #14171f;
  --text-soft: #5b6472;
  --text-faint: #8b93a1;
  --accent: #2c5fe0;
  --accent-dark: #1f47b8;
  --accent-tint: #ecf1fd;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --maxw: 1040px;
  --shadow-hover: 0 16px 32px -16px rgba(20, 23, 31, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

section { padding: 88px 0; }
section + section { border-top: 1px solid var(--border); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }

.eyebrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 12px;
}

.section-title {
  font-size: 28px;
  margin-bottom: 40px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav .wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav .name { font-weight: 700; font-size: 16px; }
.nav .links { display: flex; gap: 28px; font-size: 14px; color: var(--text-soft); }
.nav .links a:hover { color: var(--text); }
.nav .back { font-size: 14px; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.nav .back:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: end;
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero > * { animation: heroIn .8s cubic-bezier(.2,.7,.3,1) both; }
.hero > *:last-child { animation-delay: .1s; }
.hero h1 { font-size: 56px; line-height: 1.05; }
.hero .role { font-size: 20px; color: var(--accent); font-weight: 600; margin: 14px 0 20px; }
.hero p.pitch { font-size: 18px; color: var(--text-soft); max-width: 46ch; margin: 0 0 28px; }
.hero .links { display: flex; gap: 12px; }
.hero .links a {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
}
.hero .links a.primary { background: var(--text); color: #fff; border-color: var(--text); }
.hero .links a.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.hero .links a:not(.primary):hover { border-color: var(--accent); color: var(--accent); }

.readout { display: flex; flex-direction: column; gap: 22px; padding-bottom: 4px; }
.readout .stat { display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.readout .stat .num { font-size: 30px; font-weight: 700; color: var(--text); min-width: 76px; }
.readout .stat .label { font-size: 14px; color: var(--text-soft); }

/* ---------- Three pillars ---------- */
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.pillars .pillar { background: #fff; padding: 24px 26px; }
.pillars .pillar h4 { font-size: 13px; color: var(--text-faint); font-weight: 600; margin-bottom: 10px; }
.pillars .pillar .main { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.pillars .pillar .sub { font-size: 13.5px; color: var(--text-soft); }

/* ---------- About ---------- */
.about p { font-size: 17px; color: var(--text-soft); max-width: 62ch; }
.about p + p { margin-top: 18px; }

/* ---------- How I solve — connected path ---------- */
.path { display: flex; align-items: flex-start; position: relative; }
.path::before {
  content: "";
  position: absolute;
  top: 9px; left: 30px; right: 30px;
  height: 2px;
  background: var(--border);
}
.step { flex: 1; text-align: center; position: relative; padding: 0 6px; }
.step .dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  margin: 0 auto 16px; position: relative; z-index: 1;
}
.step:not(:first-child):not(:last-child) .dot { border-color: var(--accent); }
.step .title { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.step .desc { font-size: 13px; color: var(--text-soft); }

/* ---------- Experience ---------- */
.exp-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.exp-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.exp-head .role { font-size: 19px; font-weight: 700; }
.exp-head .period { font-size: 14px; color: var(--text-faint); }
.exp-card .system { color: var(--text-soft); margin-bottom: 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tag { font-size: 12.5px; font-weight: 600; color: var(--accent); background: var(--accent-tint); padding: 5px 12px; border-radius: 999px; }
.tag.mono { color: var(--text-soft); background: var(--surface); }
.bullets { margin: 0; padding-left: 20px; color: var(--text-soft); font-size: 15px; }
.bullets li + li { margin-top: 8px; }

/* ---------- Project cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-2 .card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
.grid-2 .card:last-child:nth-child(odd) .thumb { width: 300px; flex-shrink: 0; }
.grid-2 .card:last-child:nth-child(odd) .body { justify-content: center; }
@media (max-width: 860px) {
  .grid-2 .card:last-child:nth-child(odd) { flex-direction: column; }
  .grid-2 .card:last-child:nth-child(odd) .thumb { width: 100%; }
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--border); }
.card .thumb { aspect-ratio: 16/9; background: var(--surface); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card .desc { font-size: 14.5px; color: var(--text-soft); margin-bottom: 18px; flex: 1; }
.card .cta { font-size: 14px; font-weight: 600; color: var(--accent); }
.card:hover .cta { color: var(--accent-dark); }

.more-projects { margin-top: 28px; font-size: 14.5px; color: var(--text-soft); }
.more-projects a { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border); }
.more-projects a:hover { color: var(--accent); border-color: var(--accent); }
.more-projects .sep { color: var(--text-faint); margin: 0 10px; }

/* ---------- Featured project (Industrial Defect Inspection) ---------- */
.featured {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  transition: box-shadow .18s ease, transform .18s ease;
}
.featured:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.featured .kicker { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.featured h3 { font-size: 22px; margin-bottom: 10px; }
.featured .desc { font-size: 15px; color: var(--text-soft); margin-bottom: 16px; }
.featured .cta { font-size: 14px; font-weight: 600; color: var(--accent); }
.featured .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.featured .stat-box { background: var(--surface); border-radius: var(--radius-sm); padding: 14px 16px; }
.featured .stat-box .model { font-size: 12px; color: var(--text-faint); font-weight: 600; margin-bottom: 4px; }
.featured .stat-box .val { font-size: 20px; font-weight: 700; }
.featured .stat-box .metric-label { font-size: 12px; color: var(--text-soft); }

@media (max-width: 860px) {
  .featured { grid-template-columns: 1fr; }
}

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 28px; }
.skill-col h4 { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 16px; }
.skill-col ul { list-style: none; margin: 0; padding: 0; font-size: 15px; color: var(--text-soft); }
.skill-col li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.skill-col li:last-child { border-bottom: none; }

/* ---------- Education / Contact ---------- */
.edu-item { display: flex; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.edu-item:last-child { border-bottom: none; }
.edu-item .org { width: 210px; flex-shrink: 0; font-weight: 700; font-size: 15.5px; }
.edu-item .detail .title { font-weight: 600; margin-bottom: 4px; }
.edu-item .detail .sub { font-size: 14px; color: var(--text-soft); }

.contact-card {
  background: var(--accent-tint);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
}
.contact-card .closing {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  max-width: 46ch;
  margin: 0 auto 28px;
  letter-spacing: -0.01em;
}
.contact-card .links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.contact-card .links a {
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.contact-card .links a:hover { border-color: var(--accent); color: var(--accent); }

footer { padding: 32px 0 56px; text-align: center; font-size: 13px; color: var(--text-faint); }

/* ---------- Detail page ---------- */
.detail-hero { padding: 56px 0 40px; }
.detail-hero h1 { font-size: 38px; margin-bottom: 10px; }
.detail-hero .tagline { font-size: 17px; color: var(--text-soft); margin-bottom: 20px; }
.detail-hero .tags { margin-bottom: 0; }

.overview-table { width: 100%; border-collapse: collapse; }
.overview-table tr { border-bottom: 1px solid var(--border); }
.overview-table tr:last-child { border-bottom: none; }
.overview-table td { padding: 14px 4px; font-size: 14.5px; }
.overview-table td:first-child { width: 140px; color: var(--text-faint); font-weight: 600; }

.dsec { margin-bottom: 56px; }
.dsec:last-child { margin-bottom: 0; }
.dsec .num { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.dsec h2 { font-size: 22px; margin-bottom: 16px; }
.dsec p { font-size: 16px; color: var(--text-soft); max-width: 64ch; }

.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 24px 0 8px; }
.flow .node { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; font-size: 13.5px; font-weight: 600; }
.flow .node.warn { background: #fdf2f2; border-color: #f3d6d6; color: #b3413e; }
.flow .arrow { color: var(--text-faint); padding: 0 10px; font-size: 15px; }

.contribution { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px 28px; background: var(--surface); }
.contribution h4 { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.contribution ul { margin: 0; padding-left: 20px; font-size: 15px; color: var(--text); }
.contribution li + li { margin-top: 8px; }

.arch-flow { display: flex; flex-direction: column; gap: 0; align-items: flex-start; }
.arch-flow .node { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 14px; font-weight: 600; }
.arch-flow .down { color: var(--text-faint); padding: 4px 0 4px 18px; font-size: 15px; }
.arch-flow .branch { display: flex; gap: 24px; margin-left: 18px; }
.arch-flow .branch .node.good { border-color: var(--accent); color: var(--accent-dark); }

.detail-img { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; margin: 8px 0 4px; }
.detail-img img { width: 100%; display: block; }
.caption { font-size: 13px; color: var(--text-faint); margin-top: 8px; }

.gh-button { display: inline-flex; align-items: center; gap: 8px; background: var(--text); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14.5px; font-weight: 600; }
.gh-button:hover { background: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 40px; }
  .pillars { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .path { flex-direction: column; gap: 20px; }
  .path::before { display: none; }
  .step { text-align: left; display: flex; gap: 14px; align-items: flex-start; }
  .step .dot { margin: 3px 0 0; flex-shrink: 0; }
  .edu-item { flex-direction: column; gap: 6px; }
  .edu-item .org { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; animation: none !important; }
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
