/* ============================================
   Swiss Design System — Orange / Gray / Black
   ============================================ */
:root {
  --black: #0a0a0a;
  --dark: #141414;
  --gray: #1e1e1e;
  --gray-mid: #3a3a3a;
  --gray-text: #888;
  --gray-light: #b0b0b0;
  --white: #f0f0f0;
  --orange: #ff5c00;
  --orange-dim: rgba(255, 92, 0, 0.12);

  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --nav-h: 60px;
}

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

html { scroll-padding-top: var(--nav-h); }

body {
  font-family: var(--mono);
  background: var(--black);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ============================================
   Noise
   ============================================ */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-size: 200px;
  animation: grain 0.6s steps(6) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0) }
  20% { transform: translate(-5%, -10%) }
  40% { transform: translate(8%, 5%) }
  60% { transform: translate(-3%, 12%) }
  80% { transform: translate(10%, -5%) }
}

/* ============================================
   Nav
   ============================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 64px);
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray);
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--gray-text);
  transition: color 0.2s;
}

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

/* ============================================
   Hero — Full Screen, Swiss Grid
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--nav-h) clamp(24px, 4vw, 64px) 0;
  position: relative;
  border-bottom: 1px solid var(--gray);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.hero-label {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--orange);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(4.5rem, 10vw, 9rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero-line {
  display: block;
  overflow: hidden;
}

.hero-title em {
  font-style: normal;
  color: var(--orange);
}

.hero-sub {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--gray-text);
  line-height: 1.8;
  letter-spacing: 0.02em;
  margin-bottom: 40px;
  max-width: 480px;
}

.hero-cta {
  display: flex;
  gap: 16px;
}

/* Buttons */
.btn-solid {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  background: var(--orange);
  color: var(--black);
  border: none;
  transition: all 0.2s;
}

.btn-solid:hover {
  background: #ff7a33;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 92, 0, 0.3);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  border: 1px solid var(--gray-mid);
  color: var(--gray-light);
  transition: all 0.2s;
}

.btn-ghost:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-2px);
}

/* Hero right — geometric block */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: flex-end;
}

.hero-block {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  border: 1px solid var(--gray);
  position: relative;
  overflow: hidden;
}

.hero-block-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--gray);
}

.hero-block-line:nth-child(1) { top: 33.3%; }
.hero-block-line:nth-child(2) { top: 66.6%; }
.hero-block-line:nth-child(3) { left: 50%; top: 0; bottom: 0; width: 1px; height: 100%; }

.hero-block-accent {
  position: absolute;
  bottom: 0; right: 0;
  width: 33.3%;
  height: 33.3%;
  background: var(--orange);
  opacity: 0.9;
}

/* Stats */
.hero-stats {
  display: flex;
  gap: 48px;
  max-width: 400px;
  width: 100%;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gray-text);
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: clamp(24px, 4vw, 64px);
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-scroll span {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gray-text);
}

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

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

@keyframes scrollLine {
  0% { left: -100%; }
  50% { left: 0; }
  100% { left: 100%; }
}

/* ============================================
   Sections — Swiss Grid
   ============================================ */
.section {
  padding: 120px clamp(24px, 4vw, 64px);
}

.section-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-left {
  position: relative;
}

.section-num {
  font-size: 7rem;
  font-weight: 800;
  color: var(--gray);
  line-height: 1;
  letter-spacing: -0.04em;
  display: block;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--orange);
  text-transform: uppercase;
}

.section-text {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--gray-light);
  line-height: 1.9;
  margin-bottom: 24px;
  max-width: 640px;
}

/* Skills */
.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.skill {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1px solid var(--gray-mid);
  color: var(--gray-text);
  transition: all 0.2s;
}

.skill:hover {
  border-color: var(--orange);
  color: var(--orange);
}

/* Divider */
.divider {
  padding: 0 clamp(24px, 4vw, 64px);
  max-width: 1400px + 128px;
  margin: 0 auto;
}

.divider-line {
  height: 1px;
  background: var(--gray);
}

/* ============================================
   Projects
   ============================================ */
.projects {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.project {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 36px 0;
  border-bottom: 1px solid var(--gray);
  transition: all 0.2s;
  opacity: 0;
  transform: translateY(20px);
}

.project:first-child {
  border-top: 1px solid var(--gray);
}

.project:hover {
  padding-left: 16px;
  background: var(--orange-dim);
}

.project-idx {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-mid);
  letter-spacing: 0.05em;
}

.project:hover .project-idx { color: var(--orange); }

.project-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

.project-desc {
  font-size: 1.2rem;
  color: var(--gray-text);
  letter-spacing: 0.02em;
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-lang {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--orange);
  padding: 4px 12px;
  border: 1px solid rgba(255, 92, 0, 0.3);
  white-space: nowrap;
}

/* ============================================
   Product Cards (homepage)
   ============================================ */
.product-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 32px;
  background: var(--gray);
}

.product-card {
  background: var(--dark);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all 0.25s;
  position: relative;
}

.product-card--blue {
  --card-accent: #00c8ff;
}

.product-card--blue:hover {
  background: rgba(0, 200, 255, 0.06);
}

.product-card--ghost {
  --card-accent: var(--gray-mid);
  opacity: 0.5;
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-card-badge {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--card-accent);
  padding: 4px 10px;
  border: 1px solid;
  border-color: var(--card-accent);
  text-transform: uppercase;
}

.product-card--ghost .product-card-badge {
  border-color: var(--gray-mid);
  color: var(--gray-mid);
}

.product-card-arrow {
  font-size: 1.6rem;
  color: var(--gray-mid);
  transition: all 0.2s;
}

.product-card:hover .product-card-arrow {
  color: var(--card-accent);
  transform: translate(2px, -2px);
}

.product-card-name {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
}

.product-card--blue .product-card-name {
  color: #00c8ff;
}

.product-card-desc {
  font-size: 1.2rem;
  color: var(--gray-text);
  line-height: 1.7;
  max-width: 380px;
}

.product-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.product-card-tags span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--gray-mid);
  color: var(--gray-text);
  transition: all 0.2s;
}

.product-card:hover .product-card-tags span {
  border-color: rgba(0, 200, 255, 0.3);
  color: var(--gray-light);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--gray);
  padding: 32px clamp(24px, 4vw, 64px);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-text);
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.10em;
  color: var(--gray-text);
  transition: color 0.2s;
}

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

/* ============================================
   Gear Link
   ============================================ */
.gear-link {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 200;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  border: 1px solid var(--gray);
  color: var(--gray-text);
  transition: all 0.2s;
}

.gear-link:hover {
  color: var(--orange);
  border-color: var(--orange);
  transform: rotate(30deg);
}

/* ============================================
   Animations — CSS (works in background tabs)
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.anim-fade {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.anim-slide > * {
  display: block;
}

.anim-slide {
  overflow: hidden;
}

.anim-slide::after {
  content: attr(data-text);
}

/* Use direct child animation for slide */
.hero-line.anim-slide {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translateY(110%);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-right { align-items: flex-start; }
  .hero-block { max-width: 280px; }

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

  .section-num { font-size: 4.5rem; }
  .product-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-title { font-size: clamp(3rem, 14vw, 6rem); }

  .hero-stats { gap: 32px; }
  .hero-block { display: none; }

  .project {
    grid-template-columns: 32px 1fr;
    gap: 16px;
  }

  .project-lang { display: none; }

  .footer-inner { flex-direction: column; gap: 16px; }
}

.product-card--red {
  --card-accent: #e74c3c;
}

.product-card--red:hover {
  background: rgba(231, 76, 60, 0.06);
}

.product-card--red .product-card-name {
  color: #e74c3c;
}

.product-card--red:hover .product-card-tags span {
  border-color: rgba(231, 76, 60, 0.3);
  color: var(--gray-light);
}
