/* ============================================
   SWISS MINIMALIST DESIGN SYSTEM
   ============================================ */

:root {
  --black: #0A0A0A;
  --white: #FAFAFA;
  --red: #FF0000;
  --gray-100: #F5F5F5;
  --gray-200: #E5E5E5;
  --gray-400: #999999;
  --gray-600: #666666;
  --gray-800: #333333;

  --font: 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;
  --space-5xl: 128px;
  --space-6xl: 192px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

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

ul {
  list-style: none;
}

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

::selection {
  background: var(--red);
  color: var(--white);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9996;
  pointer-events: none;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ---- Custom Cursor ---- */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  mix-blend-mode: difference;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--white);
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s;
}

.cursor-ring {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out-expo),
              height 0.3s var(--ease-out-expo),
              border-color 0.3s;
}

.cursor-dot.hover {
  width: 16px;
  height: 16px;
  background: var(--red);
  mix-blend-mode: normal;
}

.cursor-ring.hover {
  width: 64px;
  height: 64px;
  border-color: var(--red);
}

@media (pointer: coarse) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
  body {
    cursor: auto;
  }
}

/* ---- Scroll Progress ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--red);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ---- Preloader ---- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--black);
  transition: transform 0.9s var(--ease-in-out);
}

#preloader.done {
  transform: translateY(-100%);
}

.preloader-books {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#preloader-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.book {
  position: absolute;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.book.visible {
  opacity: 1;
}

.book.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.book:nth-child(2) .book-name { font-size: clamp(22px, 3.2vw, 32px); }
.book:nth-child(3) .book-name { font-size: clamp(16px, 2.2vw, 22px); }
.book:nth-child(4) .book-name { font-size: clamp(18px, 2.5vw, 26px); }
.book:nth-child(5) .book-name { font-size: clamp(16px, 2.1vw, 22px); }
.book:nth-child(6) .book-name { font-size: clamp(20px, 2.8vw, 28px); }
.book:nth-child(7) .book-name { font-size: clamp(17px, 2.3vw, 24px); }
.book:nth-child(8) .book-name { font-size: clamp(21px, 2.8vw, 28px); }
.book:nth-child(9) .book-name { font-size: clamp(17px, 2.2vw, 22px); }

.book-name {
  font-weight: 700;
  color: var(--white);
  display: block;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.book-author {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-400);
  display: block;
  margin-top: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Navigation ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  transition: background 0.4s, backdrop-filter 0.4s;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--white);
  cursor: none;
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  letter-spacing: 0.02em;
  transition: color 0.3s;
  cursor: none;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s var(--ease-out-expo);
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ---- Hero ---- */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-4xl) var(--space-2xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.06) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}

.hero-content {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3xl);
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-globe {
  flex: 0 0 420px;
  height: 420px;
}

#globe-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-overline {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-xl);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-name {
  display: flex;
  flex-direction: column;
}

.hero-name-line {
  font-size: clamp(44px, 8vw, 120px);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--white);
}

.hero-name-line:last-child {
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-2xl);
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.hero-meta .separator {
  color: var(--red);
  font-weight: 700;
}

.hero-time {
  position: absolute;
  bottom: var(--space-2xl);
  right: var(--space-2xl);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.hero-time-label {
  font-size: 10px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.hero-scroll {
  position: absolute;
  bottom: var(--space-2xl);
  left: var(--space-2xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--gray-400);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: var(--gray-400);
  position: relative;
  overflow: hidden;
}

.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--red);
  animation: scroll-line 2s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { top: -100%; }
  50% { top: 100%; }
  50.01% { top: -100%; }
  100% { top: 100%; }
}

/* ---- Ticker ---- */
.ticker {
  background: var(--white);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  overflow: hidden;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 25s linear infinite;
}

.ticker-content {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  padding-right: var(--space-2xl);
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-800);
  white-space: nowrap;
}

.ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

/* ---- Sections ---- */
.section {
  padding: var(--space-5xl) var(--space-2xl);
}

.section--dark {
  background: var(--black);
  color: var(--white);
}

.section--dark .section-number {
  color: var(--red);
}

.section--dark .tag {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--gray-400);
}

.section--dark .tag:hover {
  border-color: var(--red);
  color: var(--white);
}

.section-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-3xl);
}

.section-label {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  position: sticky;
  top: var(--space-4xl);
  align-self: start;
}

.section-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-400);
}

.section-content {
  max-width: 800px;
}

/* ---- About ---- */
.about-text {
  font-size: clamp(18px, 2.5vw, 22px);
  line-height: 1.7;
  color: var(--gray-600);
  margin-bottom: var(--space-lg);
  font-weight: 400;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
  margin-top: var(--space-3xl);
  padding-top: var(--space-3xl);
  border-top: 1px solid var(--gray-200);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.stat-number {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
}

/* ---- Experience ---- */
.exp-item {
  padding: var(--space-xl) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: padding-left 0.4s var(--ease-out-expo);
}

.exp-item:first-child {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.exp-item:hover {
  padding-left: var(--space-lg);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
  margin-bottom: var(--space-md);
}

.exp-role {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.exp-company {
  font-size: 14px;
  color: var(--gray-400);
  margin-top: var(--space-xs);
}

.exp-date {
  font-size: 13px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.exp-details {
  margin: var(--space-md) 0;
}

.exp-details li {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  padding-left: var(--space-lg);
  position: relative;
  margin-bottom: var(--space-sm);
}

.exp-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
}

.exp-tags,
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.tag {
  font-size: 12px;
  font-weight: 500;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  color: var(--gray-600);
  transition: all 0.3s;
  letter-spacing: 0.02em;
}

.tag:hover {
  border-color: var(--red);
  color: var(--black);
}

/* ---- Projects ---- */
.project-card {
  display: block;
  padding: var(--space-2xl);
  border: 1px solid var(--gray-200);
  border-radius: 2px;
  margin-bottom: var(--space-lg);
  transition: all 0.4s var(--ease-out-expo);
  cursor: none;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--black);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s var(--ease-out-expo);
  z-index: 0;
}

.project-card:hover::before {
  transform: scaleY(1);
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-card:hover {
  border-color: var(--black);
  color: var(--white);
}

.project-card:hover .tag {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--gray-400);
}

.project-card:hover .project-arrow {
  transform: translate(4px, -4px);
  color: var(--red);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.project-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}

.project-arrow {
  width: 24px;
  height: 24px;
  color: var(--gray-400);
  transition: transform 0.3s var(--ease-out-expo), color 0.3s;
}

.project-name {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-md);
}

.project-desc {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
  max-width: 600px;
  transition: color 0.4s;
}

.project-card:hover .project-desc {
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Skills ---- */
.skill-group {
  margin-bottom: var(--space-2xl);
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gray-400);
  margin-bottom: var(--space-md);
}

.skill-item {
  font-size: 14px;
  font-weight: 500;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 2px;
  transition: all 0.3s, opacity 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  cursor: default;
  opacity: 0;
  transform: translateY(12px);
}

.skill-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-item:hover {
  border-color: var(--red);
  color: var(--white);
  background: rgba(255, 0, 0, 0.08);
}

/* ---- Contact ---- */
.section--contact {
  background: var(--white);
  padding: var(--space-6xl) var(--space-2xl);
  text-align: center;
}

.section--contact .section-label {
  position: static;
  align-items: center;
  margin-bottom: var(--space-3xl);
}

.contact-inner {
  max-width: 800px;
  margin: 0 auto;
}

.contact-heading {
  font-size: clamp(36px, 7vw, 80px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-2xl);
}

.contact-email {
  display: inline-block;
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 500;
  color: var(--red);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--red);
  transition: all 0.3s;
  cursor: none;
}

.contact-email:hover {
  letter-spacing: 0.04em;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-3xl);
}

.contact-link {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-400);
  transition: color 0.3s;
  cursor: none;
  position: relative;
}

.contact-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.3s var(--ease-out-expo);
}

.contact-link:hover {
  color: var(--black);
}

.contact-link:hover::after {
  width: 100%;
}

/* ---- Footer ---- */
.footer {
  background: var(--black);
  color: var(--gray-400);
  padding: var(--space-lg) var(--space-2xl);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* ---- Reveal Animation ---- */
.reveal-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out-expo),
              transform 0.8s var(--ease-out-expo);
}

.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-up[data-delay="1"] { transition-delay: 0.1s; }
.reveal-up[data-delay="2"] { transition-delay: 0.2s; }
.reveal-up[data-delay="3"] { transition-delay: 0.35s; }
.reveal-up[data-delay="4"] { transition-delay: 0.5s; }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .section-label {
    position: static;
    flex-direction: row;
    align-items: baseline;
    gap: var(--space-md);
  }

  .section-number {
    font-size: 32px;
  }

  .hero-globe {
    flex: 0 0 300px;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .nav {
    padding: var(--space-md) var(--space-lg);
  }

  .nav-links {
    gap: var(--space-md);
  }

  .nav-link {
    font-size: 12px;
  }

  .hero {
    padding: var(--space-4xl) var(--space-lg);
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-globe {
    flex: 0 0 auto;
    width: 260px;
    height: 260px;
    align-self: center;
  }

  .hero-meta {
    flex-wrap: wrap;
  }

  .section {
    padding: var(--space-4xl) var(--space-lg);
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .exp-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .project-card {
    padding: var(--space-lg);
  }

  .hero-scroll {
    left: var(--space-lg);
    bottom: var(--space-lg);
  }

  .hero-time {
    right: var(--space-lg);
    bottom: var(--space-lg);
  }

  .contact-links {
    flex-direction: column;
    gap: var(--space-md);
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-sm);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-globe {
    width: 220px;
    height: 220px;
  }

  .hero-name-line {
    font-size: 48px;
  }

  .about-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .nav-links {
    gap: var(--space-sm);
  }

  .ticker-content {
    gap: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

/* ---- Focus Visible ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

.nav-link:focus-visible {
  color: var(--white);
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-up {
    opacity: 1;
    transform: none;
  }

  .skill-item {
    opacity: 1;
    transform: none;
  }

  .ticker-track {
    animation: none;
  }
}
