/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
  --bg:            #ffffff;
  --bg-soft:       #f8f8f8;
  --border:        #e8e8e8;
  --text:          #111111;
  --text-2:        #555555;
  --text-muted:    #999999;
  --header-bg:     rgba(255,255,255,0.92);
  --link:          #111111;
  --link-hover:    #555555;
}

[data-theme="dark"] {
  --bg:            #0d0d0d;
  --bg-soft:       #141414;
  --border:        #222222;
  --text:          #f0f0f0;
  --text-2:        #999999;
  --text-muted:    #555555;
  --header-bg:     rgba(13,13,13,0.94);
  --link:          #f0f0f0;
  --link-hover:    #999999;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 52px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.section-label-col {
  padding-top: 2px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  gap: 16px;
}

.brand {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.brand:hover { opacity: 0.6; }

.main-nav {
  display: none;
  align-items: center;
  gap: 24px;
}
.main-nav a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.main-nav a:hover,
.main-nav a.active { color: var(--text); }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.header-meta {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.meta-location { color: var(--text-2); font-size: 13px; }
.meta-temp     { font-size: 13px; font-variant-numeric: tabular-nums; }
.meta-time     { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.meta-sep      { color: var(--border); }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--text); }

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

.mobile-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.mobile-menu-btn:hover { color: var(--text); }

.mobile-nav {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
  padding: 14px 24px 18px;
  gap: 14px;
  background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  font-size: 16px;
  color: var(--text-2);
  transition: color 0.15s;
}
.mobile-nav-link:hover { color: var(--text); }

/* =============================================
   HERO
   ============================================= */
.hero-section {
  padding: 64px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.hero-eyebrow {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

h1.hero-name {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-size: clamp(26px, 4.6vw, 38px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.hero-line {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
}

.hero-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 16px;
}

.hero-links {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.hero-link:hover {
  color: var(--text);
  border-color: var(--text-2);
}

.link-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.hero-dot {
  font-size: 14px;
  color: var(--text-muted);
}

.listening-to {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.listening-label {
  color: var(--text-muted);
}

.listening-to {
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}
.listening-to:hover .listening-song {
  border-color: var(--text-2);
  color: var(--text);
}

.listening-song {
  color: var(--text-2);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.listening-artist {
  color: var(--text-muted);
}

.listening-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.listening-bars span {
  width: 2px;
  background: var(--text-2);
  animation: listening-bounce 0.9s ease-in-out infinite;
}
.listening-bars span:nth-child(1) { height: 40%; animation-delay: -0.6s; }
.listening-bars span:nth-child(2) { height: 100%; animation-delay: -0.3s; }
.listening-bars span:nth-child(3) { height: 60%; animation-delay: 0s; }

@keyframes listening-bounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

.hero-photo-wrap {
  width: 280px;
  flex-shrink: 0;
}

.hero-photo {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 12px;
  filter: grayscale(20%);
  transition: filter 0.3s;
}
.hero-photo:hover { filter: grayscale(0%); }

/* =============================================
   SECTION BODY TEXT
   ============================================= */
.section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.body-text {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.7;
}

.muted { color: var(--text-muted) !important; }

/* =============================================
   WORK
   ============================================= */
.work-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.work-company-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.work-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.work-company {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.work-period {
  font-size: 13px;
  color: var(--text-muted);
}

.work-role {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.work-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.65;
}

.work-aside {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* =============================================
   PROJECTS
   ============================================= */
.project-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.project-row:first-child { padding-top: 0; }
.project-row:last-child { border-bottom: none; padding-bottom: 0; }

.project-row--dim .project-name,
.project-row--dim .project-desc {
  color: var(--text-muted);
}

.project-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.project-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.project-name:hover {
  color: var(--text-2);
  border-color: var(--text-2);
}
.project-name:hover .link-arrow {
  transform: translate(2px, -2px);
}

.project-desc {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
}

.project-stack {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.link-arrow {
  width: 13px;
  height: 13px;
  transition: transform 0.15s;
}

/* =============================================
   STACK
   ============================================= */
.stack-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stack-list {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
}

.now-block {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.now-text {
  font-size: 16px;
  color: var(--text-2);
}

.now-path {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 6px;
}

.now-line {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.5;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-line {
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.6;
}

.contact-email {
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  margin-top: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.contact-email:hover {
  color: var(--text-2);
  border-color: var(--text-muted);
}

.contact-alt {
  font-size: 16px;
  margin-top: 0;
}

.contact-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.social-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.social-text-link:hover {
  color: var(--text);
  border-color: var(--text-2);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-note {
  font-size: 13px;
}

.footer-visitors {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.visitor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  animation: visitor-pulse 2s ease-in-out infinite;
}

@keyframes visitor-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}

/* =============================================
   FADE-IN ANIMATIONS
   ============================================= */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   RESPONSIVE — DESKTOP
   ============================================= */
@media (min-width: 680px) {
  .main-nav   { display: flex; }
  .header-meta { display: flex; }
  .mobile-menu-btn { display: none; }

  .section-grid {
    grid-template-columns: 120px 1fr;
    gap: 0 40px;
  }

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

  .hero-photo-wrap {
    width: 280px;
    order: 0;
  }
  .hero-photo { height: 380px; }

  .hero-text { order: -1; }
}

/* =============================================
   QUOTE SPRITE
   ============================================= */
.quote-sprite {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sprite-img {
  width: auto;
  height: 84px;
  object-fit: contain;
  animation: sprite-float 3.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

[data-theme="dark"] .sprite-img {
  filter: invert(1) drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

@keyframes sprite-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.quote-sprite:hover .sprite-img,
.quote-sprite:focus-visible .sprite-img,
.quote-sprite.active .sprite-img {
  animation-play-state: paused;
  transform: translateY(-2px);
}

.quote-bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 220px;
  max-width: 68vw;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: bottom right;
}

.quote-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 22px;
  width: 10px;
  height: 10px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: translateY(-5px) rotate(45deg);
}

.quote-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
}

.quote-author {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.quote-sprite:hover .quote-bubble,
.quote-sprite:focus-visible .quote-bubble,
.quote-sprite.active .quote-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (max-width: 679px) {
  .quote-sprite { right: 14px; bottom: 14px; }
  .sprite-img { height: 64px; }
}
