/* =============================================================
   styles.css — park.seong.uk
   Mobile-first, dark default, CSS custom properties for theming
   ============================================================= */

/* ── Custom Properties ──────────────────────────────────────── */
:root {
  /* Colors — dark theme (default) */
  --bg:          #0a0a0a;
  --bg-surface:  #111111;
  --bg-elevated: #1a1a1a;
  --border:      #222222;
  --text:        #e5e5e5;
  --text-muted:  #737373;
  --text-subtle: #525252;
  --accent:      #3b82f6;
  --accent-dim:  rgba(59, 130, 246, 0.12);
  --accent-hover:#60a5fa;

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, 'Noto Sans KR', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code',
               'Consolas', monospace;

  /* Spacing scale */
  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Layout */
  --max-width:     1100px;
  --header-height: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 200ms;
}

/* Light theme */
[data-theme="light"] {
  --bg:          #ffffff;
  --bg-surface:  #f8f8f8;
  --bg-elevated: #f0f0f0;
  --border:      #e0e0e0;
  --text:        #111111;
  --text-muted:  #555555;
  --text-subtle: #888888;
  --accent:      #2563eb;
  --accent-dim:  rgba(37, 99, 235, 0.08);
  --accent-hover:#1d4ed8;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--duration) var(--ease),
              color var(--duration) var(--ease);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Layout Utilities ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section {
  padding-block: var(--space-3xl);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: var(--space-xl);
}

/* ── Scroll Animation ────────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }

/* No-JS fallback: show everything */
.no-js .fade-in {
  opacity: 1;
  transform: none;
}

/* ── Header / Nav ────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background-color: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration) var(--ease),
              background-color var(--duration) var(--ease),
              backdrop-filter var(--duration) var(--ease);
}

.header.scrolled {
  border-color: var(--border);
  backdrop-filter: blur(12px);
  background-color: color-mix(in srgb, var(--bg) 85%, transparent);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  transition: color var(--duration) var(--ease);
}

.nav-logo span {
  color: var(--accent);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Desktop nav links */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

.nav-links a:hover {
  color: var(--text);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  background-color: var(--bg-elevated);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.icon-sun  { display: none; }
.icon-moon { display: block; }

[data-theme="light"] .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}

.hamburger:hover {
  background-color: var(--bg-elevated);
  color: var(--text);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--duration) var(--ease),
              opacity var(--duration) var(--ease);
  transform-origin: center;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile nav drawer */
.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-height) 0 0 0;
  z-index: 99;
  background-color: var(--bg);
  padding: var(--space-xl) var(--space-lg);
  border-top: 1px solid var(--border);
  flex-direction: column;
  gap: var(--space-md);
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text-muted);
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--border);
  transition: color var(--duration) var(--ease);
}

.mobile-nav a:hover,
.mobile-nav a:focus {
  color: var(--accent);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  padding-block: calc(var(--header-height) + var(--space-2xl)) var(--space-3xl);
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
}

.hero-name {
  font-size: clamp(2.5rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: var(--space-md);
}

.hero-name .name-ko {
  display: block;
  color: var(--text);
}

.hero-name .name-en {
  display: block;
  color: var(--text-muted);
}

.hero-title {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

.hero-highlight {
  color: var(--accent);
  font-weight: 700;
}

.hero-tagline {
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: var(--space-xl);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  transition: background-color var(--duration) var(--ease),
              color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-subtle);
  background-color: var(--bg-elevated);
}

.hero-scroll-hint {
  margin-top: var(--space-3xl);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
}

.scroll-line {
  width: 40px;
  height: 1px;
  background: var(--border);
}

/* ── About ───────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  gap: var(--space-2xl);
}

.about-photo {
  display: flex;
  justify-content: center;
}

.about-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid var(--border);
  transition: border-color var(--duration) var(--ease);
}

.about-photo img:hover {
  border-color: var(--accent);
}

.about-bio {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 600px;
}

.about-bio p + p {
  margin-top: var(--space-md);
}

.about-bio strong {
  color: var(--text);
  font-weight: 600;
}

.about-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  letter-spacing: 0.06em;
  min-width: 80px;
}

.detail-value {
  color: var(--text-muted);
}

/* ── Skills ──────────────────────────────────────────────────── */
#skills {
  background-color: var(--bg-surface);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-md);
}

.skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              background-color var(--duration) var(--ease);
}

.skill-card:hover {
  border-color: var(--accent);
  background-color: var(--accent-dim);
  transform: translateY(-2px);
}

.skill-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
}

[data-theme="dark"] .skill-icon[alt="Express"] {
  filter: invert(1);
}

.skill-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.skill-bar-wrap {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.skill-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1s var(--ease);
}

/* ── Projects ────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  gap: var(--space-lg);
}

.project-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color var(--duration) var(--ease),
              transform var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(
    135deg,
    var(--bg-elevated) 0%,
    color-mix(in srgb, var(--accent) 15%, var(--bg-elevated)) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}

.project-body {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--accent-dim);
  color: var(--accent);
}

.timeline-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: var(--accent-dim);
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.project-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.project-links {
  display: flex;
  gap: var(--space-md);
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

.project-link:hover {
  color: var(--accent);
}

.project-link svg {
  width: 14px;
  height: 14px;
}

/* ── Experience ──────────────────────────────────────────────── */
#experience {
  background-color: var(--bg-surface);
}

.timeline {
  position: relative;
  padding-left: var(--space-xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: calc(-1 * var(--space-xl));
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  transform: translateX(-4.5px);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
}

.timeline-role {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-xs);
}

.timeline-company {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.timeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.timeline-desc li {
  position: relative;
  padding-left: var(--space-md);
  margin-bottom: var(--space-xs);
}

.timeline-desc li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-subtle);
}

/* ── Contact ─────────────────────────────────────────────────── */
.contact-inner {
  max-width: 560px;
}

.contact-text {
  font-size: 1.0625rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: var(--space-xl);
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 2px;
  transition: color var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
  margin-bottom: var(--space-xl);
}

.contact-email:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.contact-email svg {
  width: 18px;
  height: 18px;
}

.contact-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-subtle);
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-xl);
  background-color: var(--bg-surface);
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--duration) var(--ease);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links svg {
  width: 16px;
  height: 16px;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-subtle);
}

/* ── 768px breakpoint ────────────────────────────────────────── */
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
  }

  .about-photo img {
    width: 220px;
    height: 220px;
  }

  .about-grid {
    grid-template-columns: auto 1fr 1fr;
    align-items: start;
  }

  .footer .container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* ── 1024px breakpoint ───────────────────────────────────────── */
@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skills-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .header,
  .hamburger,
  .theme-toggle,
  .hero-scroll-hint {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }
}

/* ── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}
