:root {
  --bg: #f2f7f0;
  --surface: rgba(255, 255, 255, 0.82);
  --text: #111;
  --muted: #444;
  --border: rgba(228, 228, 224, 0.8);
  --accent: #2563eb;
  --font: 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --max: 720px;
  --nav-h: 52px;
  --skeleton-base: rgba(228, 228, 224, 0.55);
  --skeleton-highlight: rgba(255, 255, 255, 0.72);
}

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

html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.9s ease;
  -webkit-font-smoothing: antialiased;
}

/* ===== Skeleton ===== */
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 0%,
    var(--skeleton-highlight) 50%,
    var(--skeleton-base) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.aurora-bg {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16vh;
  height: min(48vh, 440px);
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%);
  mask-image: linear-gradient(to top, #000 55%, transparent 100%);
}

.aurora-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

ul { list-style: none; }

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

/* ===== Header ===== */
.header {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  font-size: 15px;
  color: var(--muted);
  transition: color 0.2s;
}

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

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 24px 0 32px;
}

.intro-label {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.intro-title {
  font-family: 'Press Start 2P', var(--font);
  font-size: clamp(1rem, 4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1;
  text-transform: uppercase;
  min-height: clamp(1rem, 4vw, 2.25rem);
  margin-bottom: 20px;
}

.shuffle-char-wrapper {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
  position: relative;
}

.shuffle-char-strip {
  display: inline-block;
  will-change: transform;
}

.shuffle-char {
  line-height: 1;
  display: inline-block;
  text-align: center;
}

.intro-desc {
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 20px;
}

.intro-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.intro-tags li {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
}

.intro-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: 15px;
  color: var(--muted);
}

.email-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phone-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.phone-group .phone-icon {
  flex-shrink: 0;
  color: var(--muted);
}

.copy-email-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}

.copy-email-btn:hover {
  color: var(--text);
  background: var(--surface);
}

.copy-email-btn.copied {
  color: var(--accent);
}

.copy-toast {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 200;
  pointer-events: none;
}

.copy-toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

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

.phone-group:hover .phone-icon {
  color: var(--accent);
}

.location-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.location-group .location-icon {
  flex-shrink: 0;
  color: var(--muted);
}

.location-group:hover .location-icon {
  color: var(--accent);
}

.sep {
  margin: 0 8px;
  opacity: 0.4;
}

/* ===== Block title ===== */
.block-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ===== Experience ===== */
.experience,
.works,
.photos {
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-step {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0 16px;
}

.timeline-marker {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 3px;
}

.timeline-marker::after {
  content: '';
  position: absolute;
  top: 14px;
  bottom: -20px;
  width: 1px;
  background: var(--border);
}

.timeline-step:last-child .timeline-marker::after {
  display: none;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--muted);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.timeline-step:first-child .timeline-dot {
  background: var(--text);
  border-color: var(--text);
}

.timeline-body {
  padding-bottom: 24px;
}

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

.timeline-period {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.timeline-role {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
}

.timeline-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 46ch;
}

/* ===== Works ===== */
.works-grid {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.work-card {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  min-height: 168px;
  padding: 20px 20px 22px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: var(--work-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #c026d3 100%));
  box-shadow: 0 10px 28px rgba(79, 70, 229, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.work-card--dark {
  color: #fff;
  background: #111;
  border: 1px solid #222;
  border-radius: 1.5rem;
  box-shadow: none;
}

.work-card--umbrly {
  background: #2f3d4f;
  border-color: #3d5068;
  --spotlight-color: rgba(147, 197, 253, 0.22);
}

.spotlight-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --spotlight-color: rgba(255, 255, 255, 0.25);
}

.spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    var(--spotlight-color),
    transparent 80%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

.spotlight-card:hover::before,
.spotlight-card:focus-within::before {
  opacity: 0.6;
}

.work-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.28);
}

.work-card--dark:hover,
.spotlight-card:hover {
  transform: none;
  box-shadow: none;
}

.work-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.work-card-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(4px);
}

.work-card--dark .work-card-tag {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  backdrop-filter: none;
}

.work-card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.work-card-desc {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 32ch;
}

.work-card--dark .work-card-desc {
  color: rgba(255, 255, 255, 0.55);
}

/* ===== Photos ===== */

.photo-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  touch-action: pan-y;
}

.photo-carousel-skeleton {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 6px;
}

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.photo-slide img.is-loaded {
  opacity: 1;
}

.photo-carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.photo-slide {
  flex: 0 0 100%;
  border: none;
  padding: 0;
  background: none;
  cursor: grab;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.photo-slide:active {
  cursor: grabbing;
}

.photo-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.photo-carousel:hover .photo-carousel-btn,
.photo-carousel:focus-within .photo-carousel-btn {
  opacity: 1;
}

.photo-carousel-btn:hover {
  color: var(--text);
}

.photo-carousel-prev { left: 10px; }
.photo-carousel-next { right: 10px; }

.photo-carousel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}

.photo-carousel-caption {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

.photo-carousel-dots {
  display: flex;
  gap: 6px;
}

.photo-dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.photo-dot.active {
  background: var(--muted);
  transform: scale(1.2);
}

/* ===== Footer ===== */
.footer {
  flex-shrink: 0;
  padding: 16px 0 24px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ===== Profile modal ===== */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.profile-modal.active {
  opacity: 1;
  visibility: visible;
}

.profile-modal[hidden] { display: none; }
.profile-modal:not([hidden]) { display: flex; }

.profile-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow: hidden;
  padding: 36px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  transform: translateY(8px);
  transition: transform 0.25s ease;
}

.profile-modal.active .profile-modal-panel {
  transform: translateY(0);
}

.profile-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.profile-modal-close:hover {
  color: var(--text);
}

.profile-modal-title {
  flex-shrink: 0;
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 16px;
  padding-right: 36px;
}

.profile-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  -webkit-overflow-scrolling: touch;
}

.profile-modal-body :first-child { margin-top: 0; }
.profile-modal-body :last-child { margin-bottom: 0; }

.profile-modal-body h1,
.profile-modal-body h2,
.profile-modal-body h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 1.2em 0 0.5em;
}

.profile-modal-body h1 { font-size: 20px; }
.profile-modal-body h1:first-child { margin-top: 0; }

.profile-modal-body p {
  margin-bottom: 0.75em;
  color: var(--text);
}

.profile-modal-body ul,
.profile-modal-body ol {
  margin: 0 0 0.75em;
  padding-left: 1.25em;
}

.profile-modal-body li {
  margin-bottom: 0.35em;
}

.profile-modal-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-modal-body blockquote {
  margin: 0.75em 0;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 15px;
}

.profile-modal-body code {
  font-family: var(--mono);
  font-size: 13px;
  padding: 0.1em 0.35em;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.profile-modal-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em 0;
}

.profile-modal-placeholder {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
}

.profile-modal-skeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-modal-skeleton .skeleton-line {
  height: 14px;
  width: 100%;
}

.profile-modal-skeleton .skeleton-line:nth-child(1) { width: 38%; height: 18px; }
.profile-modal-skeleton .skeleton-line:nth-child(2) { width: 92%; }
.profile-modal-skeleton .skeleton-line:nth-child(3) { width: 88%; }
.profile-modal-skeleton .skeleton-line:nth-child(4) { width: 76%; }
.profile-modal-skeleton .skeleton-line:nth-child(5) { width: 84%; }
.profile-modal-skeleton .skeleton-line:nth-child(6) { width: 62%; }

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox[hidden] { display: none; }
.lightbox:not([hidden]) { display: flex; }

.lightbox-figure {
  max-width: 88vw;
  max-height: 82vh;
  text-align: center;
}

.lightbox-figure img {
  max-height: 76vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-figure figcaption {
  font-family: var(--mono);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 12px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.6;
  padding: 12px;
  transition: opacity 0.2s;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close { top: 8px; right: 8px; font-size: 2rem; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .main {
    justify-content: flex-start;
    padding-top: 16px;
    gap: 32px;
  }

  .nav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-bg { display: none; }
  .skeleton { animation: none; background: var(--skeleton-base); }
  .photo-slide img { opacity: 1; transition: none; }
  .work-card { transition: none; }
  .work-card:hover { transform: none; }
  .spotlight-card::before { transition: none; opacity: 0 !important; }
}

@media (min-height: 700px) {
  .main {
    min-height: calc(100vh - var(--nav-h) - 60px);
  }
}
