/* ===== 색 (라이트가 기본, 다크는 아래에서 덮어씀) ===== */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --line: #e2e5ee;
  --text: #11131a;
  --muted: #5d6478;
  --accent: #4f5bd5;
  --violet: #8b5cf6;
  --mint: #0ea5a4;
  --pass: #15803d;
  --grid: rgba(17, 19, 26, 0.05);
  --shadow: 0 10px 30px rgba(30, 40, 90, 0.08);

  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --radius: 20px;
  --max: 1120px;
}

:root[data-theme="dark"] {
  --bg: #0a0c13;
  --surface: #11141e;
  --surface-2: #171b28;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eceef5;
  --muted: #9aa1b6;
  --accent: #8190ff;
  --violet: #b794ff;
  --mint: #5eead4;
  --pass: #4ade80;
  --grid: rgba(255, 255, 255, 0.04);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

/* 테마를 고른 적이 없으면 컴퓨터 설정을 따름 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c13;
    --surface: #11141e;
    --surface-2: #171b28;
    --line: rgba(255, 255, 255, 0.08);
    --text: #eceef5;
    --muted: #9aa1b6;
    --accent: #8190ff;
    --violet: #b794ff;
    --mint: #5eead4;
    --pass: #4ade80;
    --grid: rgba(255, 255, 255, 0.04);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  }
}

/* ===== 한국어 / 영어 전환 ===== */
html.en .ko { display: none !important; }
html:not(.en) .en { display: none !important; }

/* ===== 기본 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
  overflow-x: clip; /* 장식이 화면 밖으로 나가도 가로 스크롤이 생기지 않게 */
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }
code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
}

/* 위쪽만 보이는 모눈 배경 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

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

/* ===== 상단 메뉴 ===== */
.nav {
  position: sticky;
  top: 16px;
  z-index: 10;
  max-width: var(--max);
  margin: 16px auto 0;
  padding: 10px 14px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  width: calc(100% - 32px);
}

.logo { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }

.nav-tools { display: flex; gap: 6px; }
.tool-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 12px var(--mono);
  cursor: pointer;
}
.tool-btn:hover { border-color: var(--accent); }

/* ===== 첫 화면 ===== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 56px;
  padding: 96px 0 64px;
}

.glow {
  position: absolute;
  top: 40px;
  left: 10%;
  width: min(520px, 80vw);
  height: 360px;
  z-index: -1;
  background: radial-gradient(circle at 30% 40%, var(--accent), transparent 60%),
              radial-gradient(circle at 70% 60%, var(--violet), transparent 60%);
  filter: blur(90px);
  opacity: 0.25;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 0 var(--pass);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--pass) 60%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

.tagline { margin-top: 28px; font-size: 13px; color: var(--accent); }

h1 {
  margin-top: 10px;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.grad {
  background: linear-gradient(100deg, var(--accent), var(--violet) 55%, var(--mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead { margin-top: 24px; max-width: 560px; color: var(--muted); font-size: 17px; }

.hero-btns { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.hero-btns.center { justify-content: center; }

.btn {
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }

/* 사진 + 천천히 도는 테두리 */
.photo-wrap {
  position: relative;
  width: 100%;
  max-width: 340px;
  justify-self: center;
  aspect-ratio: 558 / 720;
}
.photo-ring {
  position: absolute;
  inset: -3px;
  border-radius: 32px;
  background: conic-gradient(from var(--angle, 0deg), var(--accent), var(--violet), var(--mint), var(--accent));
  animation: spin 6s linear infinite;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes spin { to { --angle: 360deg; } }

.photo {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
  display: block;
}
.photo-tag {
  position: absolute;
  left: -28px;
  bottom: 28px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.5;
}
.photo-tag span { color: var(--muted); font-size: 11px; }

/* ===== 숫자 ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stat { padding: 26px 28px; display: flex; flex-direction: column; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 14px; }

/* ===== 기술 띠 ===== */
.marquee {
  margin: 40px 0 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
.marquee-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: slide 40s linear infinite;
}
.marquee-track span {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
@keyframes slide { to { transform: translateX(calc(-50% - 6px)); } }

/* ===== 섹션 공통 ===== */
.section { padding-top: 112px; scroll-margin-top: 60px; }
.eyebrow { font-size: 13px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
h2 {
  margin-top: 8px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.25;
}

/* ===== 공부하는 방식 ===== */
.steps {
  list-style: none;
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.steps li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  color: var(--accent);
  font-family: var(--mono);
}
.step-no { font-size: 11px; color: var(--accent); }
.steps b { display: block; margin-top: 8px; font-size: 18px; }
.steps p { margin-top: 6px; color: var(--muted); font-size: 14px; }

/* ===== 프로젝트 ===== */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.filter {
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 14px var(--sans);
  cursor: pointer;
}
.filter.on { background: var(--text); color: var(--bg); }

.bento {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.card {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card.wide { grid-column: span 3; }
.card.hide { display: none; }

/* 마우스를 따라다니는 빛 (위치는 main.js 가 넣어 줌) */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px circle at var(--x, 50%) var(--y, 50%),
              color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: var(--shadow);
}

.card-top { display: flex; justify-content: space-between; align-items: center; }
.emoji {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  font-size: 24px;
}
.date { font-size: 12px; color: var(--muted); }
.card h3 { margin-top: 20px; font-size: 20px; letter-spacing: -0.02em; }
.card h3::after { content: " ↗"; color: var(--muted); font-weight: 400; transition: color 0.2s; }
.card:hover h3::after { color: var(--accent); }
.card p { margin-top: 10px; color: var(--muted); font-size: 14.5px; flex: 1; }

.card-foot {
  margin-top: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--muted);
}
.pass {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--pass);
  background: color-mix(in srgb, var(--pass) 12%, transparent);
}
.pass.muted { color: var(--muted); background: var(--surface-2); }

.note { margin-top: 18px; font-size: 13px; color: var(--muted); }

/* ===== 경험 ===== */
.journey {
  margin-top: 36px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}
.timeline { list-style: none; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 30px 28px; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted);
}
.timeline li.now::before { border-color: var(--pass); background: var(--pass); }
.when { font-size: 12px; color: var(--accent); }
.timeline b { display: block; font-size: 17px; margin-top: 2px; }
.timeline p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.ideas {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  position: sticky;
  top: 100px;
}
.ideas-title { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.idea { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.idea:last-child { border-bottom: 0; padding-bottom: 0; }
.idea b { font-size: 15px; }
.idea p { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.idea-src { display: block; margin-top: 6px; font-size: 12px; color: var(--accent); }

/* ===== 기록 ===== */
.posts { list-style: none; margin-top: 28px; border-top: 1px solid var(--line); }
.posts li {
  display: flex;
  gap: 24px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.posts .mono { color: var(--muted); font-size: 13px; padding-top: 3px; flex-shrink: 0; }
.more { display: inline-block; margin-top: 20px; color: var(--accent); font-weight: 600; }
.more:hover { text-decoration: underline; }

/* ===== 연락 ===== */
.contact {
  margin-top: 112px;
  padding: 64px 32px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 50%),
    radial-gradient(circle at 80% 100%, color-mix(in srgb, var(--violet) 18%, transparent), transparent 50%),
    var(--surface);
}
.contact p { margin-top: 12px; color: var(--muted); }

.footer { padding: 48px 24px; text-align: center; font-size: 12px; color: var(--muted); }

/* ===== 스크롤하면 나타나기 ===== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.reveal.shown { opacity: 1; transform: none; }

/* ===== 태블릿 ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 64px; gap: 48px; }
  .photo-wrap { max-width: 260px; order: -1; justify-self: start; }
  .photo-tag { left: auto; right: -24px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li::after { display: none; }
  .card, .card.wide { grid-column: span 3; }
  .journey { grid-template-columns: 1fr; }
  .ideas { position: static; }
}

/* ===== 모바일 ===== */
@media (max-width: 640px) {
  main { padding: 0 16px; }
  .nav { padding-left: 18px; }
  .nav-links { display: none; }
  .photo-wrap { max-width: 200px; }
  /* 이름표를 사진 위에 겹치지 않고 사진 오른쪽 빈 공간에 둔다 */
  .photo-tag {
    left: calc(100% + 14px);
    right: auto;
    bottom: 50%;
    transform: translateY(50%);
    width: calc(100vw - 32px - 100% - 14px);
    padding: 10px 12px;
  }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat { flex-direction: row; align-items: baseline; gap: 12px; padding: 18px 22px; }
  .stat strong { font-size: 30px; }
  .steps { grid-template-columns: 1fr; }
  .bento { grid-template-columns: 1fr; }
  .card, .card.wide { grid-column: auto; padding: 22px; }
  .card-foot { flex-direction: column; align-items: flex-start; }
  .section { padding-top: 80px; }
  .posts li { flex-direction: column; gap: 2px; }
  .contact { margin-top: 80px; padding: 48px 20px; }
}

/* 움직임 줄이기 설정을 켠 사람에게는 애니메이션을 끔 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
