/* ================================================
   PORTFOLIO — Premium Minimalist Dark
   Font: Pretendard Variable
   Accent: #FF4D00 (Electric Vermillion)
   ================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0c0c0c;
  --bg-el: #131313;
  --bg-card: #181818;
  --border: #1e1e1e;
  --border-lt: #2a2a2a;
  --text: #9a9a9a;
  --text-dim: #818181;
  --text-h: #e8e8e8;
  --text-bright: #f5f5f5;
  --accent: #FF4D00;
  --accent-soft: rgba(255,77,0,.06);
  --accent-mid: rgba(255,77,0,.15);
  --accent-glow: rgba(255,77,0,.25);
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --ease: cubic-bezier(.22,1,.36,1);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Noto Sans KR', sans-serif;
  background: var(--bg); color: var(--text); overflow-x: hidden; line-height: 1.7;
}
::selection { background: var(--accent); color: var(--bg); }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }

/* ── Film Grain ── */
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: .022;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Loader ── */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: clip-path .9s var(--ease);
  clip-path: inset(0 0 0 0);
}
.loader.done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.loader-name {
  font-size: clamp(36px, 8vw, 80px); font-weight: 800; color: var(--text-h);
  letter-spacing: -.05em; margin-bottom: 24px;
}
.loader-name .dot { color: var(--accent); }
.loader-bar-track {
  width: 120px; height: 2px; background: var(--border); border-radius: 1px; overflow: hidden;
}
.loader-bar {
  height: 100%; width: 0; background: var(--accent); transition: width .1s;
}
.loader-pct {
  font-size: 12px; color: var(--text-dim); margin-top: 12px; letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 48px; display: flex; justify-content: space-between; align-items: center;
  background: transparent; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: all .5s var(--ease);
}
.nav.scrolled {
  padding: 14px 48px;
  background: rgba(12,12,12,.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom-color: rgba(255,255,255,.04);
}
.nav-logo {
  font-size: 15px; font-weight: 700; color: var(--text-h); letter-spacing: -.03em;
}
.nav-logo .dot { color: var(--accent); }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 13px; color: var(--text-dim); letter-spacing: -.01em;
  transition: color .3s; position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-h); }
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  width: 0; height: 1px; background: var(--accent);
  transition: width .3s var(--ease);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

/* ── Mobile Nav Toggle ── */
.nav-toggle {
  display: none; width: 28px; height: 20px; position: relative;
  background: none; border: none; cursor: pointer; padding: 0;
}
.nav-toggle span {
  display: block; position: absolute; left: 0; width: 100%; height: 1.5px;
  background: var(--text-h); border-radius: 1px; transition: all .35s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; }
.nav-toggle span:nth-child(3) { top: 18px; }
.nav-toggle.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

/* ── Scroll Progress ── */
.scroll-progress {
  position: fixed; top: 0; left: 0; width: 100%; height: 2px; z-index: 110;
  background: var(--accent); transform-origin: left;
  transform: scaleX(0); will-change: transform;
}

/* ── Hero ── */
.hero-container { position: relative; }
.hero-sticky {
  position: relative; height: 100vh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .38;
  transition: opacity .15s linear, transform .15s linear;
  transform-origin: center center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(12,12,12,.55) 0%, transparent 70%),
    linear-gradient(180deg,
      rgba(12,12,12,.5) 0%, rgba(12,12,12,.25) 35%,
      rgba(12,12,12,.35) 65%, rgba(12,12,12,.95) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2; text-align: center; padding: 0 24px;
}
.hero-content h1 {
  font-size: clamp(56px, 11vw, 140px); font-weight: 700;
  color: var(--text-bright); letter-spacing: -.02em; line-height: .95;
  margin-bottom: 20px;
  opacity: 0; transform: translateY(50px);
  text-shadow: 0 2px 40px rgba(0,0,0,.6), 0 0px 80px rgba(0,0,0,.4);
}
.hero-content h1.split-ready {
  opacity: 1; transform: none;
}
.hero-content h1 .char {
  display: inline-block; opacity: 0;
  transform: translateY(100%) rotateX(25deg);
  filter: blur(4px);
}
body.loaded .hero-content h1 .char {
  animation: charIn .7s var(--ease) calc(.25s + var(--i) * .06s) forwards;
}
@keyframes charIn {
  to { opacity: 1; transform: translateY(0) rotateX(0deg); filter: blur(0); }
}
.hero-content h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(255,77,0,.4), 0 0 60px rgba(255,77,0,.15);
}
.hero-tagline {
  font-size: clamp(12px, 1.6vw, 17px); font-weight: 500;
  color: var(--text); letter-spacing: .2em; text-transform: uppercase;
  text-shadow: 0 1px 20px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(30px);
}
.tl-mono {
  font-family: 'JetBrains Mono', monospace; font-weight: 500;
  color: var(--accent); letter-spacing: .08em; font-size: .85em;
}
.hero-sub {
  font-size: 15px; color: var(--text); max-width: 460px;
  margin: 28px auto 0; line-height: 1.85;
  text-shadow: 0 1px 16px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(20px);
}

body.loaded .hero-tagline { animation: riseIn .9s var(--ease) .6s forwards; }
body.loaded .hero-sub { animation: riseIn .9s var(--ease) .9s forwards; }
body.loaded .scroll-indicator { animation: riseIn .8s var(--ease) 1.2s forwards; }

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

.scroll-indicator {
  position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 2; opacity: 0;
}
.scroll-indicator span {
  font-size: 10px; color: var(--text-dim); letter-spacing: .15em; text-transform: uppercase;
}
.scroll-indicator .line {
  width: 1px; height: 28px;
  background: linear-gradient(var(--accent), transparent);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: .2; transform: scaleY(.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ── Sections ── */
.section { padding: clamp(80px, 10vw, 120px) clamp(24px, 8vw, 160px); position: relative; }
.section--alt { background: var(--bg-el); }
.section-label {
  font-size: 11px; font-weight: 600; color: var(--accent);
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px;
}
.section-title {
  font-size: clamp(32px, 4.5vw, 56px); font-weight: 700;
  color: var(--text-h); letter-spacing: -.02em; line-height: 1.12;
  margin-bottom: 20px;
}
.section-desc {
  font-size: 16px; color: var(--text); max-width: 500px;
  line-height: 1.85; margin-bottom: 56px;
}

/* ── About ── */
.about-grid {
  display: grid; grid-template-columns: .85fr 1.15fr;
  gap: 80px; align-items: start;
}
.about-photo-wrap { position: relative; }
.about-photo-wrap img {
  border-radius: var(--r-lg); width: 100%; aspect-ratio: 3/4;
  object-fit: cover; filter: grayscale(15%) contrast(1.05);
}
.about-photo-wrap::after {
  content: ''; position: absolute;
  top: 16px; left: 16px; right: -16px; bottom: -16px;
  border: 1px solid rgba(255,77,0,.15); border-radius: var(--r-lg); z-index: -1;
}
.about-text h3 {
  font-size: 22px; font-weight: 700; color: var(--text-h);
  letter-spacing: -.02em; margin-bottom: 20px; line-height: 1.5;
}
.about-text p {
  font-size: 15px; color: var(--text); line-height: 1.9; margin-bottom: 16px;
}

.about-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 28px; margin-top: 48px; padding-top: 40px;
  border-top: 1px solid var(--border);
}
.stat-num {
  font-size: 40px; font-weight: 800; color: var(--accent);
  letter-spacing: -.04em; line-height: 1;
}
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.tech-tag {
  font-size: 12px; padding: 6px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--border-lt); color: var(--text);
  background: var(--bg-el); transition: all .3s var(--ease);
}
.tech-tag:hover { border-color: var(--accent); color: var(--accent); }
.tech-tag.hl {
  border-color: rgba(255,77,0,.3); color: var(--accent); background: var(--accent-soft);
}

/* ── Experience Timeline ── */
.timeline { position: relative; padding-left: 36px; }
.timeline::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 0;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 56px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -40px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.timeline-item.alt::before { background: var(--border-lt); }
.tl-date { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; letter-spacing: .02em; }
.tl-company {
  font-size: 20px; font-weight: 700; color: var(--text-h);
  letter-spacing: -.02em; margin-bottom: 4px;
}
.tl-role { font-size: 13px; color: var(--accent); font-weight: 500; margin-bottom: 14px; }
.tl-bullets { list-style: none; }
.tl-bullets li {
  font-size: 14px; color: var(--text); line-height: 1.85;
  padding-left: 16px; position: relative; margin-bottom: 4px;
}
.tl-bullets li::before {
  content: ''; position: absolute; left: 0; top: 10px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--border-lt);
}
.tl-transition {
  font-size: 11px; color: var(--text-dim); padding: 12px 0 24px 0;
  font-style: italic;
}

/* ── Projects ── */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.projects-grid > :nth-child(even) { margin-top: 64px; }

.proj-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  transition: all .45s var(--ease); cursor: default;
}
.proj-card:hover {
  border-color: rgba(255,77,0,.2); transform: translateY(-6px);
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.proj-card-img-wrap { overflow: hidden; }
.proj-card-img {
  width: 100%; height: 200px; object-fit: cover; opacity: .65;
  transition: all .5s var(--ease);
}
.proj-card:hover .proj-card-img { opacity: .85; transform: scale(1.04); }

.proj-card-icon {
  height: 200px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-el); font-size: 56px; opacity: .5;
}
.proj-body { padding: 28px; }
.proj-body h3 {
  font-size: 18px; font-weight: 700; color: var(--text-h);
  letter-spacing: -.02em; margin-bottom: 10px;
}
.proj-body p {
  font-size: 14px; color: var(--text); line-height: 1.8; margin-bottom: 16px;
}
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-tag {
  font-size: 11px; padding: 4px 10px; border-radius: 4px;
  background: rgba(255,255,255,.04); color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── Contact ── */
.contact-section {
  text-align: center; padding: clamp(80px, 10vw, 120px) clamp(24px, 6vw, 96px);
  background: var(--bg-el); border-top: 1px solid var(--border);
}
.contact-section h2 {
  font-size: clamp(36px, 5vw, 64px); font-weight: 700;
  color: var(--text-h); letter-spacing: -.02em; margin-bottom: 16px;
}
.contact-section h2 .accent { color: var(--accent); }
.contact-section p {
  font-size: 16px; color: var(--text); margin-bottom: 48px; line-height: 1.85;
}
.contact-links { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.contact-link {
  font-size: 14px; padding: 14px 28px; border-radius: var(--r-sm);
  border: 1px solid var(--border-lt); color: var(--text);
  transition: all .3s var(--ease); min-height: 44px;
}
.contact-link:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.contact-link.primary {
  background: var(--accent); border-color: var(--accent);
  color: var(--bg); font-weight: 600;
}
.contact-link.primary:hover {
  background: #e04400; transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,77,0,.3);
}

/* ── Footer ── */
.footer {
  text-align: center; padding: 28px; font-size: 11px;
  color: var(--text-dim); border-top: 1px solid var(--border);
}

/* ── Reveal ── */
.reveal {
  opacity: 0; transform: translateY(28px);
  clip-path: inset(8% 0 0 0);
  transition: opacity .9s var(--ease), transform .9s var(--ease), clip-path .9s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
.reveal.d1 { transition-delay: .1s; }
.reveal.d2 { transition-delay: .2s; }
.reveal.d3 { transition-delay: .3s; }
.reveal.d4 { transition-delay: .4s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .about-grid { gap: 48px; }
  .projects-grid > :nth-child(even) { margin-top: 48px; }
}
@media (max-width: 768px) {
  .section-desc { margin-bottom: 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-photo-wrap { max-width: 280px; }
  .about-stats { grid-template-columns: repeat(3,1fr); gap: 16px; }
  .stat-num { font-size: 28px; }
  .projects-grid { grid-template-columns: 1fr; }
  .projects-grid > :nth-child(even) { margin-top: 0; }
  .nav { padding: 14px 20px; }
  .nav.scrolled { padding: 10px 20px; }
  .nav-toggle { display: block; }
  .nav-links {
    display: flex; flex-direction: column; position: fixed;
    top: 0; right: 0; width: 260px; height: 100vh;
    background: rgba(12,12,12,.95); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    padding: 80px 32px 32px; gap: 24px;
    transform: translateX(100%); transition: transform .45s var(--ease);
    border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 16px; padding: 8px 0; min-height: 44px; }
  .timeline { padding-left: 28px; }
  .timeline-item::before { left: -32px; }
}
@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
  .stat-num { font-size: 24px; }
  .hero-content h1 { letter-spacing: -.01em; }
}
