/* stocks-web(app/globals.css)과 같은 토큰 체계를 그대로 가져왔다 — 서로 다른
   정적/Next.js 앱이지만 "같은 브랜드의 화면"으로 보이게 하려는 의도다. 하나를
   고치면 다른 쪽도 맞춰야 한다는 점을 감안한다. */
:root {
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --font-ui: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max-width: 1180px;
}
:root,
:root[data-theme="light"] {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --border: #e3e5ee;
  --text: #14161f;
  --muted: #6b7280;
  --muted-2: #9297a3;
  --accent: #5850ec;
  --accent-strong: #4640d6;
  --accent-contrast: #ffffff;
  --accent-tint: rgba(88, 80, 236, 0.08);
  --accent-tint-border: rgba(88, 80, 236, 0.22);
  --ghost-bg: #eef0f5;
  --ghost-text: #3d414d;
  --ghost-border: #dfe2ea;
  --live: #1a8a4a;
  --live-tint: rgba(26, 138, 74, 0.1);
  --shadow: 0 1px 2px rgba(20, 22, 31, 0.04), 0 8px 24px -12px rgba(20, 22, 31, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07111f;
    --surface: rgba(17, 33, 51, 0.82);
    --surface-2: rgba(255, 255, 255, 0.03);
    --border: rgba(196, 219, 239, 0.14);
    --text: #f4f8fb;
    --muted: #94a8bb;
    --muted-2: #71859b;
    --accent: #b69aff;
    --accent-strong: #c9b3ff;
    --accent-contrast: #161027;
    --accent-tint: rgba(182, 154, 255, 0.1);
    --accent-tint-border: rgba(182, 154, 255, 0.24);
    --ghost-bg: rgba(255, 255, 255, 0.05);
    --ghost-text: #cdd8e6;
    --ghost-border: rgba(196, 219, 239, 0.16);
    --live: #5eead4;
    --live-tint: rgba(94, 234, 212, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.55);
  }
}
:root[data-theme="dark"] {
  --bg: #07111f;
  --surface: rgba(17, 33, 51, 0.82);
  --surface-2: rgba(255, 255, 255, 0.03);
  --border: rgba(196, 219, 239, 0.14);
  --text: #f4f8fb;
  --muted: #94a8bb;
  --muted-2: #71859b;
  --accent: #b69aff;
  --accent-strong: #c9b3ff;
  --accent-contrast: #161027;
  --accent-tint: rgba(182, 154, 255, 0.1);
  --accent-tint-border: rgba(182, 154, 255, 0.24);
  --ghost-bg: rgba(255, 255, 255, 0.05);
  --ghost-text: #cdd8e6;
  --ghost-border: rgba(196, 219, 239, 0.16);
  --live: #5eead4;
  --live-tint: rgba(94, 234, 212, 0.1);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -14px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-ui);
  line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
}
a { color: inherit; text-decoration: none; }
.skip-link {
  position: fixed; z-index: 100; top: 1rem; left: 1rem; padding: .75rem 1rem;
  color: var(--accent-contrast); background: var(--accent); border-radius: 999px; transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
.site-shell { width: min(calc(100% - 40px), var(--max-width)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; border-bottom: 1px solid var(--border);
  background: var(--bg); backdrop-filter: blur(8px);
}
.brand { display: inline-flex; gap: .6rem; align-items: center; font-weight: 800; letter-spacing: .02em; }
.brand-mark { position: relative; display: inline-block; width: 22px; height: 22px; transform: rotate(30deg); }
.brand-mark span { position: absolute; width: 9px; height: 9px; border: 1px solid var(--accent); border-radius: 50%; }
.brand-mark span:nth-child(1) { top: 0; left: 6px; }
.brand-mark span:nth-child(2) { bottom: 1px; left: 0; }
.brand-mark span:nth-child(3) { right: 0; bottom: 1px; }
.brand b { font-size: .98rem; }
nav { display: flex; gap: clamp(1rem, 3vw, 1.6rem); align-items: center; color: var(--muted); font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
nav a { transition: color 160ms ease; }
nav a:hover, nav a:focus-visible { color: var(--text); }
.theme-toggle {
  display: inline-flex; gap: .4rem; align-items: center; padding: .45rem .7rem;
  color: var(--ghost-text); background: var(--ghost-bg); border: 1px solid var(--ghost-border);
  border-radius: 999px; font-size: .72rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.theme-toggle:hover { border-color: var(--accent-tint-border); }

main { padding: 0 0 2rem; }
.eyebrow { display: flex; gap: .6rem; align-items: center; margin: 0 0 1.1rem; color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { display: inline-block; width: 22px; height: 1px; background: currentcolor; }

.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .92fr);
  gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 560px; padding: clamp(3rem, 8vw, 5.5rem) 0;
}
.hero h1 {
  max-width: 620px; margin: 0; font-size: clamp(2.6rem, 5.4vw, 4.2rem); font-weight: 720;
  line-height: 1.14; letter-spacing: -.03em; word-break: keep-all;
}
.hero h1 .accent-text { color: var(--accent); }
.hero-description {
  max-width: 500px; margin: 1.6rem 0 0; color: var(--muted);
  font-size: clamp(.96rem, 1.3vw, 1.06rem); line-height: 1.85; word-break: keep-all;
}
.hero-actions { display: flex; gap: 1.3rem; flex-wrap: wrap; align-items: center; margin-top: 2.2rem; }
.primary-button {
  padding: .85rem 1.35rem; color: var(--accent-contrast); background: var(--accent); border-radius: 999px;
  font-size: .86rem; font-weight: 800; transition: background 160ms ease, transform 160ms ease;
}
.primary-button:hover, .primary-button:focus-visible { background: var(--accent-strong); transform: translateY(-1px); }
.text-link { display: inline-flex; gap: .45rem; align-items: center; color: var(--muted); font-size: .86rem; transition: color 160ms ease; }
.text-link:hover, .text-link:focus-visible { color: var(--text); }
.text-link span { color: var(--accent); font-size: 1.05rem; }

/* 히어로의 시각적 초점 — 반짝이는 궤도 애니메이션 대신, "이것저것 만들어보는
   개발자의 작업 목록"이라는 톤을 그대로 드러내는 터미널 카드를 썼다. */
.terminal-card {
  padding: 1.3rem 1.5rem 1.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); font-family: var(--font-mono); font-size: .8rem;
}
.terminal-dots { display: flex; gap: .4rem; margin-bottom: 1.1rem; }
.terminal-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.terminal-prompt { margin: 0 0 1rem; color: var(--muted-2); }
.terminal-prompt b { color: var(--accent); font-weight: 600; }
.terminal-rows { display: flex; flex-direction: column; gap: .65rem; }
.terminal-row {
  display: grid; grid-template-columns: 106px 74px 1fr; gap: .6rem; align-items: baseline;
}
.terminal-row .t-name { color: var(--text); font-weight: 600; }
.terminal-row .t-status { display: inline-flex; gap: .4rem; align-items: center; font-size: .72rem; }
.terminal-row .t-status i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.terminal-row .t-status.is-live i { background: var(--live); box-shadow: 0 0 6px var(--live); }
.terminal-row .t-status.is-live { color: var(--live); }
.terminal-row .t-desc { color: var(--muted); font-size: .74rem; }
.terminal-cursor { display: inline-block; margin-left: .15rem; color: var(--accent); animation: blink 1.1s step-end infinite; }

.signal-strip { overflow: hidden; padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.signal-strip p {
  margin: 0; color: var(--muted-2); font-family: var(--font-mono);
  font-size: clamp(.66rem, 1.1vw, .78rem); font-weight: 600; letter-spacing: clamp(.14em, .8vw, .38em);
  text-align: center; white-space: nowrap;
}
.signal-strip span { color: var(--accent); }

.projects-section { padding: clamp(4rem, 9vw, 6.5rem) 0; }
.section-heading { display: grid; grid-template-columns: 1fr .6fr; gap: 3rem; align-items: end; margin-bottom: 2.5rem; }
.section-heading h2, .about-copy h2 {
  margin: 0; font-size: clamp(1.9rem, 3.6vw, 2.7rem); font-weight: 700; line-height: 1.2; letter-spacing: -.02em;
  word-break: keep-all;
}
.section-heading > p, .about-copy > p:last-child {
  max-width: 420px; margin: 0 0 .3rem; color: var(--muted); line-height: 1.8; word-break: keep-all;
}

.projects-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.ad-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1rem; }
.ad-slot {
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.ad-sidebar .ad-slot { min-height: 250px; }
.ad-banner { padding: clamp(2rem, 5vw, 3rem) 0 0; }
.ad-banner .ad-slot { min-height: 90px; }
.project-card {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem;
  padding: 1.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); transition: border-color 160ms ease, transform 160ms ease;
}
.project-card:hover { border-color: var(--accent-tint-border); transform: translateY(-2px); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.card-index { color: var(--muted-2); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; }
.badge {
  display: inline-block; padding: .3rem .6rem; color: var(--accent); background: var(--accent-tint);
  border: 1px solid var(--accent-tint-border); border-radius: 999px; font-size: .66rem; font-weight: 700;
  white-space: nowrap;
}
.badge-live { color: var(--live); background: var(--live-tint); border-color: color-mix(in srgb, var(--live) 35%, transparent); }
.badge-muted { color: var(--muted-2); background: transparent; border-color: var(--border); }

.card-copy p.card-kicker {
  margin: 0 0 .4rem; color: var(--muted-2); font-family: var(--font-mono); font-size: .66rem;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.card-copy h3 { margin: 0 0 .6rem; font-size: clamp(1.3rem, 2.2vw, 1.6rem); letter-spacing: -.01em; }
.card-copy > p.card-desc { margin: 0; max-width: 520px; color: var(--muted); font-size: .87rem; line-height: 1.75; word-break: keep-all; }

.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.tag-list li {
  padding: .34rem .6rem; color: var(--ghost-text); background: var(--ghost-bg); border: 1px solid var(--ghost-border);
  border-radius: 999px; font-size: .68rem;
}

.card-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .3rem; }
.card-link-btn {
  display: inline-flex; gap: .4rem; align-items: center; height: 30px; padding: 0 .85rem;
  border-radius: 999px; font-size: .76rem; font-weight: 700; border: 1px solid transparent;
}
.card-link-btn.primary { color: var(--accent-contrast); background: var(--accent); }
.card-link-btn.primary:hover, .card-link-btn.primary:focus-visible { background: var(--accent-strong); }
.card-link-btn.ghost { color: var(--ghost-text); background: var(--ghost-bg); border-color: var(--ghost-border); }
.card-link-btn.ghost:hover, .card-link-btn.ghost:focus-visible { border-color: var(--muted-2); }
.card-note { margin: 0; color: var(--muted-2); font-size: .7rem; }

.about-section {
  display: grid; grid-template-columns: 1fr .8fr; gap: 3rem; align-items: start;
  padding: clamp(3.5rem, 8vw, 5.5rem) 0; border-top: 1px solid var(--border);
}
.about-copy > p:last-child { margin-top: 1.2rem; }
.stack-note {
  padding: 1.1rem 1.3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.stack-note p { margin: 0 0 .5rem; color: var(--muted); font-size: .78rem; line-height: 1.7; word-break: keep-all; }
.stack-note ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.stack-note li {
  padding: .32rem .58rem; color: var(--ghost-text); background: var(--ghost-bg); border: 1px solid var(--ghost-border);
  border-radius: var(--radius-sm); font-family: var(--font-ui); font-weight: 600; font-size: .7rem;
}

footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem;
  min-height: 96px; color: var(--muted-2); border-top: 1px solid var(--border); font-size: .74rem;
}
footer p { margin: 0; }
.footer-brand { color: var(--muted); font-size: .8rem; }
.footer-brand .brand-mark { transform: scale(.82) rotate(30deg); }

@keyframes blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 3rem; }
  .section-heading { grid-template-columns: 1fr; gap: 1.2rem; }
  .project-grid { grid-template-columns: 1fr; }
  .projects-layout { grid-template-columns: 1fr; }
  .ad-sidebar { position: static; flex-direction: row; }
  .ad-sidebar .ad-slot { flex: 1; }
  .about-section { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-shell { width: min(calc(100% - 28px), var(--max-width)); }
  nav a:not(.nav-cta) { display: none; }
  .hero { gap: 2rem; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .terminal-row { grid-template-columns: 1fr; gap: .15rem; }
  footer { justify-content: flex-start; flex-direction: column; align-items: flex-start; padding: 1.6rem 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    scroll-behavior: auto !important; transition-duration: .01ms !important;
  }
}
