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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--content, #4a4a4a);
  background: #f5f5f5;
  overflow-x: hidden;
}

.section {
  min-height: 100vh;
  width: 100%;
}

/* ── Hero ── */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hero-bg, #e8e8e8);
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.hero__profile-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.hero__ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px dashed color-mix(in srgb, var(--accent, #4a4a4a) 35%, transparent);
  transform-origin: center center;
  animation: heroRingSpin 24s linear infinite;
}

.hero__profile {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  margin-top: -70px;
  margin-left: -70px;
  border-radius: 50%;
  overflow: hidden;
  transform-origin: center center;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 0 0 6px color-mix(in srgb, var(--accent, #4a4a4a) 6%, transparent);
  animation: heroProfileGlow 3s ease-in-out infinite;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__name {
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent, #4a4a4a);
}

.hero__social {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.social-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  color: var(--accent, #4a4a4a);
  opacity: 0.85;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  transition: opacity 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.social-link__ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent, #4a4a4a) 20%, transparent);
  opacity: 0;
  animation: socialRingPulse 3s ease-out infinite;
}

.social-link:nth-child(1) .social-link__ring { animation-delay: 0s; }
.social-link:nth-child(2) .social-link__ring { animation-delay: -1s; }
.social-link:nth-child(3) .social-link__ring { animation-delay: -2s; }

.social-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.social-link svg {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.social-link:hover svg {
  transform: scale(1.12);
}

@keyframes heroRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes heroProfileGlow {
  0%, 100% {
    box-shadow:
      0 4px 24px rgba(0, 0, 0, 0.08),
      0 0 0 6px color-mix(in srgb, var(--accent, #4a4a4a) 6%, transparent);
  }
  50% {
    box-shadow:
      0 8px 32px rgba(0, 0, 0, 0.12),
      0 0 0 10px color-mix(in srgb, var(--accent, #4a4a4a) 10%, transparent);
  }
}

@keyframes socialRingPulse {
  0% {
    opacity: 0.6;
    scale: 1;
  }
  70% {
    opacity: 0;
    scale: 1.35;
  }
  100% {
    opacity: 0;
    scale: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__ring,
  .hero__profile,
  .social-link__ring {
    animation: none;
  }
}

/* ── Stage (terminal ↔ timeline, same slot) ── */

.stage-section {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.stage-panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.stage-panel[hidden] {
  display: none !important;
}

/* ── Terminal ── */

.terminal-section {
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.terminal-wrapper {
  width: 90%;
  max-width: 680px;
  opacity: 0;
  transform: translateY(40px);
}

.terminal {
  background: #0f0f1a;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  font-family: 'IBM Plex Mono', monospace;
}

.terminal__header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #1e1e30;
}

.terminal__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.terminal__dot--red    { background: #ff5f57; }
.terminal__dot--yellow { background: #febc2e; }
.terminal__dot--green  { background: #28c840; }

.terminal__title {
  margin-left: 8px;
  font-size: 0.75rem;
  color: #666;
}

.terminal__body {
  padding: 24px 20px;
  min-height: 120px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #c8c8d4;
}

.terminal__prompt {
  color: #6ee7b7;
}

.terminal__command {
  color: #e2e8f0;
}

.terminal__cursor {
  color: #6ee7b7;
  animation: blink 1s step-end infinite;
}

.terminal__cursor--hidden {
  display: none;
}

@keyframes blink {
  50% { opacity: 0; }
}

.terminal__processing {
  margin-top: 8px;
}

.terminal__output {
  color: #fbbf24;
}

.terminal__dots {
  display: inline-block;
  width: 1.5em;
  text-align: left;
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { opacity: 0.4; }
  50%  { opacity: 0.7; }
  75%  { opacity: 1; }
}

/* ── Timeline ── */

.timeline-section {
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  box-sizing: border-box;
}

.timeline__container {
  max-width: 640px;
  width: 100%;
  opacity: 0;
  transform: translateY(30px);
}

.timeline__title {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--content, #4a4a4a);
}

.timeline__subtitle {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 3rem;
}

.timeline__placeholder {
  position: relative;
  padding-left: 2rem;
}

.timeline__placeholder::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #ddd;
}

.timeline__item {
  position: relative;
  padding-bottom: 2.5rem;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--content, #4a4a4a);
  border: 3px solid #fafafa;
  box-shadow: 0 0 0 2px #ddd;
}

.timeline__year {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  color: #999;
  margin-bottom: 0.35rem;
}

.timeline__text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--content, #4a4a4a);
  white-space: pre-line;
}

/* ── Transitions ── */

.timeline-section.is-visible .timeline__container {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.terminal-section.is-fading {
  opacity: 0;
  transition: opacity 0.6s ease;
}
