/* ============================
   1. RESET & BASE
   ============================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg-deep);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dim);
}

a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

strong {
  font-weight: 600;
  color: var(--color-text);
}

/* ============================
   2. CUSTOM PROPERTIES
   ============================ */

:root {
  /* Base */
  --color-bg-deep: #0a0a0f;
  --color-bg: #12121a;
  --color-bg-elevated: #1a1a2e;
  --color-surface: #16213e;

  /* Primary: CS console green */
  --color-primary: #00ff41;
  --color-primary-dim: #00cc33;
  --color-primary-glow: rgba(0, 255, 65, 0.15);

  /* Accent */
  --color-accent: #f0a500;
  --color-accent-dim: #cc8800;

  /* Text */
  --color-text: #e0e0e8;
  --color-text-secondary: #8888a0;
  --color-text-dim: #555570;

  /* Utility */
  --color-border: #2a2a3e;
  --color-danger: #ff4444;
  --color-success: #00ff41;

  /* Fonts */
  --font-display: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 3rem;
  --text-4xl: 4.5rem;

  /* Leading */
  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.8;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max: 1100px;
  --container-padding: var(--space-6);
}

/* ============================
   3. TYPOGRAPHY
   ============================ */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
}

/* ============================
   4. LAYOUT
   ============================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--space-24) 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-bg-deep);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  z-index: 1000;
  border-radius: 0 0 4px 4px;
}

.skip-link:focus {
  top: 0;
}

.section__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-12);
  color: var(--color-text);
}

.prompt {
  color: var(--color-primary-dim);
  margin-right: var(--space-2);
}

/* ============================
   5. COMPONENTS
   ============================ */

/* 5a. Console Bar */
.console-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-6);
  z-index: 100;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-primary-dim);
  opacity: 1;
  transition: opacity 0.6s ease, transform 0.6s ease;
  display: none;
  justify-content: space-between;
  align-items: center;
}

.console-bar__hint {
  color: var(--color-text-dim);
  font-size: var(--text-xs);
}

.console-bar__hint kbd {
  display: inline-block;
  padding: 0 var(--space-2);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-primary-dim);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.console-bar.is-hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

/* 5b. Cursor */
.cursor {
  display: inline-block;
  color: var(--color-primary);
  animation: blink 1s step-end infinite;
}

/* 5c. Text utilities */
.text-glow {
  color: var(--color-primary);
  text-shadow: 0 0 10px var(--color-primary-glow), 0 0 40px var(--color-primary-glow);
}

.text-glow--large {
  font-size: var(--text-xl);
}

.text-success {
  color: var(--color-success);
}

.text-dim {
  color: var(--color-text-dim);
}

.text-accent {
  color: var(--color-accent);
}

/* 5d. Server Cards */
.server-cards {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.server-card {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-6);
  border: 1px dashed var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  min-width: 140px;
}

.server-card--corps {
  border-color: var(--color-primary-dim);
  color: var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.server-card__name {
  margin-right: var(--space-2);
}

/* 5d2. Old Logo Artifact */
.old-logo {
  margin-top: var(--space-6);
  margin-bottom: 0;
}

.old-logo__frame {
  position: relative;
  display: inline-block;
  background: #000;
  border: 1px solid var(--color-border);
  padding: var(--space-4) var(--space-6);
  overflow: hidden;
}

.old-logo__img {
  display: block;
  max-width: 260px;
  width: 100%;
  opacity: 0.8;
  filter: grayscale(0.15) brightness(0.9);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.old-logo__frame:hover .old-logo__img {
  opacity: 1;
  filter: grayscale(0) brightness(1);
}

.old-logo__scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  mix-blend-mode: multiply;
}

.old-logo__caption {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

/* 5e. Server Status */
.server-status {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  padding: var(--space-4) var(--space-6);
  border: 1px dashed var(--color-border);
  background: var(--color-bg);
  margin-top: var(--space-6);
  overflow-x: auto;
  line-height: var(--leading-relaxed);
  position: relative;
}

.server-status code {
  font-family: inherit;
  color: var(--color-text-secondary);
}

.server-status--active {
  border-color: var(--color-primary-dim);
}

.server-status--active code {
  color: var(--color-primary-dim);
}

.server-status--inactive {
  opacity: 0.5;
  border-color: var(--color-text-dim);
}

.server-status--inactive code {
  color: var(--color-text-dim);
}

.server-status__map {
  transition: opacity 0.2s;
}

.server-status--upcoming {
  border-color: var(--color-accent-dim);
}

.server-status--upcoming code {
  color: var(--color-accent-dim);
}

/* 5e2. Server List (Golden Era) */
.server-list {
  margin-top: var(--space-8);
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  overflow: hidden;
}

.server-list__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-list__header--cw {
  border-top: 1px solid var(--color-border);
}

.server-list__count {
  color: var(--color-text-dim);
  font-weight: 400;
}

.server-list__grid {
  display: grid;
  grid-template-columns: 1fr;
}

.server-list__item {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  border-bottom: 1px solid rgba(42, 42, 62, 0.4);
  transition: background 0.15s ease;
}

.server-list__item:last-child {
  border-bottom: none;
}

.server-list__item:hover {
  background: var(--color-bg-elevated);
}

.server-list__item--hot {
  background: rgba(0, 255, 65, 0.02);
}

.server-list__tag {
  color: var(--color-primary-dim);
  font-weight: 700;
}

.server-list__addr {
  color: var(--color-text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-list__players {
  text-align: right;
  font-weight: 700;
  min-width: 40px;
}

.server-list__map {
  color: var(--color-text-dim);
  text-align: right;
  min-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 5f. Clan Roster & Results */
.clan-roster {
  margin-top: var(--space-4);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary-dim);
  background: var(--color-bg);
  font-family: var(--font-display);
  font-size: var(--text-xs);
}

.clan-roster__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clan-roster__game {
  font-weight: 400;
  color: var(--color-text-dim);
}

.clan-roster__list {
  padding: var(--space-2) 0;
}

.clan-roster__player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) var(--space-4);
  color: var(--color-text-secondary);
  transition: background 0.15s ease;
}

.clan-roster__player:hover {
  background: var(--color-bg-elevated);
}

.clan-roster__name {
  color: var(--color-text);
  font-weight: 700;
}

.clan-roster__info {
  color: var(--color-text-dim);
}

.clan-results {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.clan-results__section {
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}

.clan-results__label {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--color-border);
}

.clan-results__list {
  padding: var(--space-2) 0;
}

.clan-results__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.clan-results__place {
  font-weight: 700;
  min-width: 20px;
}

.clan-results__item--gold .clan-results__place {
  color: #ffd700;
}

.clan-results__item--silver .clan-results__place {
  color: #c0c0c0;
}

.clan-results__event {
  color: var(--color-text-secondary);
}

.timeline__note {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  font-style: italic;
}

@media (min-width: 640px) {
  .clan-results {
    grid-template-columns: 1fr 1fr;
  }
}

/* 5g. Person Card */
.people-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.person-card {
  position: relative;
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-text-dim);
  background: var(--color-bg);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.person-card:hover {
  box-shadow: 0 0 30px var(--color-primary-glow);
  border-color: var(--color-border);
}

.person-card--active {
  border-top-color: var(--color-primary);
}

.person-card--active:hover {
  border-top-color: var(--color-primary);
}

.person-card__number {
  position: absolute;
  top: var(--space-3);
  left: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  opacity: 0.5;
}

.person-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.person-card--active .person-card__name {
  color: var(--color-primary);
}

.person-card__role {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.person-card__origin {
  color: var(--color-text-dim);
}

.person-card__tagline {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  font-style: italic;
  margin-bottom: var(--space-6);
}

.person-card__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot--active {
  background: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary);
  animation: pulse 2s ease-in-out infinite;
}

.status-dot--offline {
  background: var(--color-text-dim);
}

.status-dot--upcoming {
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
  animation: pulse-accent 2s ease-in-out infinite;
}

/* 5g. CTA Button */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: var(--color-bg-deep);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  text-decoration: none;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  cursor: crosshair;
}

.cta-button:hover {
  color: var(--color-bg-deep);
  box-shadow: 0 0 30px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  transform: translateY(-2px);
}

.cta-button__icon {
  flex-shrink: 0;
}

.cta-link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  transition: color 0.2s ease;
}

.cta-link:hover {
  color: var(--color-primary-dim);
}

/* 5h. Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-12);
  left: 50%;
  transform: translateX(-50%);
}

.scroll-indicator__track {
  width: 1px;
  height: 40px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.scroll-indicator__dot {
  width: 3px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  position: absolute;
  left: -1px;
  animation: scroll-dot 2s ease-in-out infinite;
}

/* ============================
   6. SECTIONS
   ============================ */

/* 6a. Hero */
.section--hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 0;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .section--hero {
    padding-top: 40px; /* console bar space */
  }
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.04;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse at center, var(--color-primary-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.6;
}

.hero__content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-size: var(--text-3xl);
  color: var(--color-primary);
  text-shadow: 0 0 20px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  margin-bottom: var(--space-6);
  display: inline-block;
  position: relative;
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--color-primary);
  width: 0;
  animation:
    typing 1.2s steps(8) 0.5s forwards,
    blink 1s step-end 2 0.5s,
    cursor-hide 0.4s ease 2.2s forwards;
}

@keyframes cursor-hide {
  to { border-right-color: transparent; }
}

.hero__dots {
  position: absolute;
  left: 95%;
  top: 18%;
  bottom: 25%;
  width: 160px;
  margin-left: 4px;
  opacity: 0;
  animation: fade-in 0.8s ease 2s forwards;
  -webkit-mask-image: linear-gradient(to right, white 5%, transparent 90%);
  mask-image: linear-gradient(to right, white 5%, transparent 90%);
  overflow: hidden;
  display: none;
}

.hero__dots-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(180, 255, 210, 0.12);
}

.hero__dots-track--top { top: 30%; }
.hero__dots-track--mid { top: 50%; background: rgba(255, 60, 60, 0.12); }
.hero__dots-track--bottom { top: 70%; }

.hero__dot {
  position: absolute;
  top: var(--y);
  left: 0;
  font-family: var(--font-display);
  font-size: var(--s);
  line-height: 0;
  color: #b0ffd0;
  text-shadow: 0 0 4px rgba(180, 255, 210, 0.5);
  animation: dot-flow var(--t, 7s) linear var(--d) infinite;
  will-change: transform;
}

.hero__dot--red {
  color: #ff4050;
  text-shadow: 0 0 4px rgba(255, 64, 80, 0.5);
}

@keyframes dot-flow {
  from { transform: translateX(0); }
  to { transform: translateX(160px); }
}

@media (min-width: 640px) {
  .hero__dots {
    display: block;
  }
}

@media (min-width: 1024px) {
  .hero__dots {
    width: 240px;
  }

  @keyframes dot-flow {
    from { transform: translateX(0); }
    to { transform: translateX(240px); }
  }
}

.hero__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  opacity: 0;
  animation: fade-in 0.8s ease 2s forwards;
  margin-bottom: var(--space-4);
}

.hero__badge {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
  opacity: 0;
  animation: fade-in 0.8s ease 2.4s forwards;
}

/* 6b. Story / Timeline */
.section--story {
  padding-top: var(--space-32);
}

.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-border);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--space-16);
}

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

.timeline__dot {
  position: absolute;
  left: -27px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-text-dim);
  border: 2px solid var(--color-bg-deep);
  z-index: 1;
}

.timeline__dot--highlight {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  animation: pulse 2s ease-in-out infinite;
}

.timeline__dot--dim {
  background: var(--color-text-dim);
  opacity: 0.5;
}

.timeline__dot--alive {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
  animation: breathe 3s ease-in-out infinite;
}

.timeline__date {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
  margin-bottom: var(--space-2);
  letter-spacing: 0.05em;
}

.timeline__content h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

.timeline__content p {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 600px;
}

/* 6c. People */
.section--people {
  padding-top: var(--space-32);
}

/* 6d. What's Next */
.section--next {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.next__content {
  max-width: 700px;
}

.next__now,
.next__planned {
  margin-bottom: var(--space-12);
}

.next__now h3,
.next__planned h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.next__list {
  list-style: none;
  padding: 0;
}

.next__list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

.next__list li .status-dot {
  flex-shrink: 0;
}

.next__cta {
  margin-top: var(--space-16);
  padding-top: var(--space-12);
  border-top: 1px solid var(--color-border);
}

.next__text {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
}

.next__actions {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex-wrap: wrap;
}

/* 6e. Footer */
.footer {
  padding: var(--space-16) 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.footer__text {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-text-dim);
}

.footer__text em {
  color: var(--color-text-secondary);
}

/* ============================
   7. ANIMATIONS
   ============================ */

@keyframes typing {
  from { width: 0; }
  to { width: 8ch; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 6px var(--color-primary-glow);
  }
  50% {
    box-shadow: 0 0 16px var(--color-primary), 0 0 30px var(--color-primary-glow);
  }
}

@keyframes breathe {
  0%, 100% {
    box-shadow: 0 0 6px var(--color-primary-glow);
    opacity: 0.8;
  }
  50% {
    box-shadow: 0 0 20px var(--color-primary), 0 0 40px var(--color-primary-glow);
    opacity: 1;
  }
}

@keyframes pulse-accent {
  0%, 100% {
    box-shadow: 0 0 4px rgba(240, 165, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 12px var(--color-accent), 0 0 24px rgba(240, 165, 0, 0.3);
  }
}

@keyframes scroll-dot {
  0% { top: 0; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { top: 32px; opacity: 0; }
}

@keyframes glitch {
  0%, 8%, 30%, 38%, 65%, 73%, 100% {
    transform: translate(0, 0) skew(0deg);
  }
  2% { transform: translate(-2px, 1px) skew(0.5deg); }
  4% { transform: translate(3px, -1px) skew(-0.3deg); }
  6% { transform: translate(-1px, -1px) skew(0.2deg); }
  32% { transform: translate(1px, -2px) skew(-0.4deg); }
  34% { transform: translate(-2px, 1px) skew(0.3deg); }
  36% { transform: translate(1px, 0) skew(-0.1deg); }
  67% { transform: translate(-1px, 1px) skew(0.3deg); }
  69% { transform: translate(2px, -1px) skew(-0.2deg); }
  71% { transform: translate(-1px, 0) skew(0.1deg); }
}

@keyframes glitch-color {
  0%, 8%, 30%, 38%, 65%, 73%, 100% {
    text-shadow: 0 0 20px var(--color-primary-glow), 0 0 60px var(--color-primary-glow);
  }
  3% {
    text-shadow: -2px 0 rgba(255, 0, 64, 0.5), 2px 0 rgba(0, 255, 255, 0.5), 0 0 20px var(--color-primary-glow);
  }
  5% {
    text-shadow: 2px 0 rgba(255, 0, 64, 0.35), -2px 0 rgba(0, 255, 255, 0.35), 0 0 40px var(--color-primary-glow);
  }
  33% {
    text-shadow: -1px 0 rgba(255, 0, 64, 0.4), 1px 0 rgba(0, 255, 255, 0.4), 0 0 30px var(--color-primary-glow);
  }
  68% {
    text-shadow: 1px 0 rgba(255, 0, 64, 0.3), -1px 0 rgba(0, 255, 255, 0.3), 0 0 20px var(--color-primary-glow);
  }
}

/* Scroll-triggered animations */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
  transition-delay: calc(var(--stagger, 0) * 0.12s);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* No-JS fallback */
.no-js [data-animate] {
  opacity: 1;
  transform: none;
}

.no-js .typing-text {
  width: auto;
  border-right: none;
  animation: none;
}

.no-js .hero__subtitle,
.no-js .hero__badge {
  opacity: 1;
  animation: none;
}

/* ============================
   8. PROJECTS
   ============================ */

.section--projects {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.projects-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

.project-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-6);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  border-color: var(--color-primary-dim);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.05);
}

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

.project-card__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

.project-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
}

.project-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
  max-width: 500px;
}

.project-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.project-card__tag {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--color-text-dim);
  border: 1px dashed var(--color-border);
  padding: 2px var(--space-2);
  border-radius: 2px;
  letter-spacing: 0.03em;
}

.project-card__footer {
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.project-card__link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-primary-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.project-card__link:hover {
  color: var(--color-primary);
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================
   9. LINK WIDGET
   ============================ */

.link-widget {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-4);
  z-index: 1000;
}

@media (min-width: 640px) {
  .link-widget {
    right: var(--space-6);
  }
}

.link-widget__trigger {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #3a3a58;
  border: 1px solid #2563eb;
  color: #e0e4ec;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3), 0 0 4px rgba(37, 99, 235, 0.15);
}

.link-widget__trigger:hover,
.link-widget.is-open .link-widget__trigger {
  background: #4a4a6a;
  border-color: #60a5fa;
  color: #2563eb;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.5), 0 0 8px rgba(96, 165, 250, 0.3);
}

.link-widget__trigger-text {
  pointer-events: none;
}

.link-widget__menu {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  right: 0;
  min-width: 180px;
  background: #3a3a58;
  border: 1px solid #2563eb;
  border-radius: 4px;
  padding: var(--space-2) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0.25s;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.35), 0 0 6px rgba(37, 99, 235, 0.2);
}

.link-widget__menu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: calc(var(--space-3) + 4px);
}

.link-widget:hover .link-widget__menu,
.link-widget.is-open .link-widget__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s 0s;
}

.link-widget__header {
  display: block;
  padding: var(--space-1) var(--space-4) var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: #8888a0;
  border-bottom: 1px solid #2a2a42;
  margin-bottom: var(--space-1);
}

.link-widget__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: #c0c4d0;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.link-widget__item:hover {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}

.link-widget__item--discord:hover {
  color: #5865f2;
}

.link-widget__prefix {
  color: #8888a0;
  font-size: 10px;
}

.link-widget__item:hover .link-widget__prefix {
  color: #60a5fa;
}

/* Gaming mode: restore green-themed link-widget */
body.mode-gaming .link-widget__trigger {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-primary-dim);
  box-shadow: none;
}

body.mode-gaming .link-widget__trigger:hover,
body.mode-gaming .link-widget.is-open .link-widget__trigger {
  background: var(--color-surface);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 12px var(--color-primary-glow);
}

body.mode-gaming .link-widget__menu {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.3), 0 0 4px rgba(0, 255, 65, 0.15);
}

body.mode-gaming .link-widget__header {
  color: var(--color-text-dim);
  border-bottom-color: var(--color-border);
}

body.mode-gaming .link-widget__item {
  color: var(--color-text-secondary);
}

body.mode-gaming .link-widget__item:hover {
  color: var(--color-primary);
  background: rgba(0, 255, 65, 0.05);
}

body.mode-gaming .link-widget__prefix {
  color: var(--color-primary-dim);
}

body.mode-gaming .link-widget__item:hover .link-widget__prefix {
  color: var(--color-primary);
}

/* ============================
   9. CONSOLE OVERLAY (Easter Egg)
   ============================ */

.console-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.97);
  border-bottom: 2px solid var(--color-primary-dim);
  z-index: 9999;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--color-primary-dim);
  transform: translateY(-100%);
  transition: transform 0.3s ease, visibility 0s 0.3s;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.console-overlay.is-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s ease, visibility 0s 0s;
}

.console-overlay__header {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-dim);
}

.console-overlay__output {
  padding: var(--space-4);
  overflow-y: auto;
  flex: 1;
}

.console-overlay__line {
  line-height: var(--leading-relaxed);
  white-space: pre;
}

.console-overlay__input {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-border);
  gap: var(--space-2);
}

.console-overlay__prompt {
  color: var(--color-primary);
}

.console-overlay__field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  outline: none;
  caret-color: var(--color-primary);
}

.console-overlay__field::placeholder {
  color: var(--color-text-dim);
}

/* 9b. Console AI Mode */
.console-overlay__ai-badge {
  color: var(--color-accent);
  font-weight: 700;
  margin-left: var(--space-2);
}

.console-overlay__ai-remaining {
  color: var(--color-accent);
}

.console-overlay__line--ai {
  color: var(--color-accent);
}

.console-overlay__line--ai-user {
  color: var(--color-primary);
}

.console-overlay__line--ai-system {
  color: var(--color-text-dim);
  font-style: italic;
}

.console-overlay__line a {
  color: var(--color-primary);
  text-decoration: underline;
}

.console-overlay__line--ai a {
  color: var(--color-accent);
}

.console-overlay__thinking {
  color: var(--color-accent);
}

.pro-chat__msg a {
  color: #2563eb;
  text-decoration: underline;
}

.pro-chat__msg--user a {
  color: #ffffff;
}

/* ============================
   10. SCANLINES
   ============================ */

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.03) 1px,
    rgba(0, 0, 0, 0.03) 2px
  );
}

/* ============================
   11. RESPONSIVE
   ============================ */

@media (min-width: 640px) {
  .people-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .section__title {
    font-size: var(--text-3xl);
  }
}

@media (min-width: 1024px) {
  .hero__title {
    font-size: var(--text-4xl);
  }

  .typing-text {
    animation:
      typing-lg 1.2s steps(8) 0.5s forwards,
      blink 1s step-end 2 0.5s,
      cursor-hide 0.4s ease 2.2s forwards;
  }

  @keyframes typing-lg {
    from { width: 0; }
    to { width: 8ch; }
  }

  /* Desktop timeline: centered */
  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline__item {
    width: 50%;
    padding-right: var(--space-12);
    text-align: right;
  }

  .timeline__item .timeline__content p {
    margin-left: auto;
  }

  .timeline__item .server-cards,
  .timeline__item .server-status,
  .timeline__item .server-list {
    margin-left: auto;
  }

  .timeline__dot {
    left: auto;
    right: -5px;
  }

  .timeline__item:nth-child(even) {
    margin-left: 50%;
    padding-right: 0;
    padding-left: var(--space-12);
    text-align: left;
  }

  .timeline__item:nth-child(even) .timeline__dot {
    right: auto;
    left: -5px;
  }

  .timeline__item:nth-child(even) .timeline__content p {
    margin-left: 0;
  }

  .timeline__item:nth-child(even) .server-cards,
  .timeline__item:nth-child(even) .server-status,
  .timeline__item:nth-child(even) .server-list {
    margin-left: 0;
  }

  /* People: 4 columns */
  .people-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Server list: wider grid */
  .server-list__item {
    grid-template-columns: 48px 1fr 50px 120px;
  }
}

/* ============================
   12. LAYER SYSTEM (Gaming ↔ Pro)
   ============================ */

.layer {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.layer--pro {
  position: relative;
}

.layer--gaming {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

body.mode-gaming .layer--pro {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  overflow: hidden;
  visibility: hidden;
}

body.mode-gaming .layer--gaming {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  height: auto;
  overflow-x: hidden;
  visibility: visible;
}

.scanlines,
.console-bar {
  display: none;
}

body.mode-gaming .scanlines {
  display: block;
}

body.mode-gaming .console-bar {
  display: none;
}

@media (min-width: 1024px) {
  body.mode-gaming .console-bar {
    display: flex;
  }
}

/* ============================
   12b. MOBILE CONSOLE BUTTON
   ============================ */

.console-mobile-btn {
  display: none;
}

body.mode-gaming .console-mobile-btn {
  display: flex;
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-primary-dim);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.mode-gaming .console-mobile-btn:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 14px rgba(0, 255, 65, 0.3);
}

.console-mobile-btn__icon {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.05em;
}

@media (min-width: 1024px) {
  body.mode-gaming .console-mobile-btn {
    display: none;
  }
}

/* ============================
   13. MODE TOGGLE BUTTON
   ============================ */

.mode-toggle {
  position: fixed;
  bottom: var(--space-8);
  left: var(--space-4);
  z-index: 1000;
  background: #3a3a58;
  border: 1px solid #2563eb;
  border-radius: 20px;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: #e0e4ec;
  cursor: pointer;
  transition: border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  letter-spacing: 0.03em;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3), 0 0 4px rgba(37, 99, 235, 0.15);
}

.mode-toggle:hover {
  background: #4a4a6a;
  border-color: #60a5fa;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.5), 0 0 8px rgba(96, 165, 250, 0.3);
}

body.mode-gaming .mode-toggle {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
  box-shadow: none;
}

body.mode-gaming .mode-toggle:hover {
  background: var(--color-surface);
  border-color: var(--color-primary-dim);
  color: var(--color-text);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.08);
}

/* mode-toggle pro hover is defined in section 14 */

.mode-toggle__label--to-pro {
  display: none;
}

body.mode-gaming .mode-toggle__label--to-gaming {
  display: none;
}

body.mode-gaming .mode-toggle__label--to-pro {
  display: inline;
}

/* ============================
   14. PROFESSIONAL MODE STYLES
   ============================ */

/* Pro light theme tokens */
.layer--pro {
  --pro-bg: #f8f9fb;
  --pro-bg-elevated: #ffffff;
  --pro-text: #1a1a2e;
  --pro-text-secondary: #5a5a72;
  --pro-text-dim: #9a9ab0;
  --pro-accent: #2563eb;
  --pro-accent-dim: #1d4ed8;
  --pro-border: #e2e4ea;
  --pro-border-hover: #c5c8d4;
}

.layer--pro {
  background: var(--pro-bg);
  color: var(--pro-text);
  overflow-x: hidden;
}

/* Pro Hero */
.section--pro-hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.pro-hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 30%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(96, 165, 250, 0.08) 0%, transparent 40%);
}

.pro-hero__content {
  position: relative;
  max-width: 800px;
  z-index: 1;
}

.pro-hero__badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-6);
  padding: var(--space-2) var(--space-4);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 20px;
  background: rgba(96, 165, 250, 0.08);
}

.pro-hero__title {
  font-family: var(--font-body);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--space-6);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.pro-hero__accent {
  color: #60a5fa;
}

.pro-hero__tagline {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.65);
  line-height: var(--leading-relaxed);
  max-width: 550px;
  margin-bottom: var(--space-8);
}

.pro-hero__actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.pro-btn {
  display: inline-flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.pro-btn--primary {
  background: #2563eb;
  color: #ffffff;
}

.pro-btn--primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.pro-btn--outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pro-btn--outline:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

/* Stats bar */
.section--stats {
  padding: var(--space-12) 0;
  background: var(--pro-bg);
  border-bottom: 1px solid var(--pro-border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-8);
  text-align: center;
}

.stat-item__number {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--pro-accent);
  margin-bottom: var(--space-1);
}

.stat-item__label {
  font-size: var(--text-xs);
  color: var(--pro-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pro Section Headers */
.pro-section__header {
  margin-bottom: var(--space-12);
}

.pro-section__label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--pro-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-3);
}

.pro-section__title {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--pro-text);
  letter-spacing: -0.01em;
}

/* Services */
.section--services {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
  background: var(--pro-bg);
}

.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.service-card {
  background: var(--pro-bg-elevated);
  border: 1px solid var(--pro-border);
  border-radius: 10px;
  padding: var(--space-6);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  border-top: 3px solid transparent;
}

@media (min-width: 640px) {
  .service-card {
    padding: var(--space-8);
  }
}

.service-card:hover {
  border-top-color: var(--pro-accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.service-card__icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 10px;
  margin-bottom: var(--space-4);
}

.service-card__icon {
  font-size: var(--text-xl);
  color: var(--pro-accent);
}

.service-card__title {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--pro-text);
  margin-bottom: var(--space-3);
}

.service-card__desc {
  font-size: var(--text-sm);
  color: var(--pro-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.service-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.service-card__features li {
  font-size: 11px;
  color: var(--pro-text-secondary);
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid var(--pro-border);
  padding: 3px 10px;
  border-radius: 12px;
}

.service-card__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--pro-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.service-card__link:hover {
  color: var(--pro-accent-dim);
}

.service-card__link--soon {
  color: var(--pro-text-dim);
  font-style: italic;
  text-decoration: none;
}

/* Pro Projects */
.section--pro-projects {
  padding-top: var(--space-24);
  padding-bottom: var(--space-32);
  background: #f0f2f5;
}

.pro-projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.pro-project {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-4);
  background: var(--pro-bg-elevated);
  border: 1px solid var(--pro-border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (min-width: 640px) {
  .pro-project {
    flex-wrap: nowrap;
    padding: var(--space-4) var(--space-6);
  }
}

.pro-project:hover {
  border-color: var(--pro-accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
  transform: translateX(4px);
}

.pro-project__name {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--pro-text);
  white-space: nowrap;
}

.pro-project__desc {
  font-size: var(--text-sm);
  color: var(--pro-text-secondary);
  flex: 1;
}

.pro-project__tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--pro-accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pro-project--wip {
  cursor: default;
  border-style: dashed;
}

.pro-project--wip .pro-project__tag {
  color: #d97706;
  background: rgba(217, 119, 6, 0.08);
}

/* Contact */
.section--contact {
  padding-top: var(--space-24);
  padding-bottom: var(--space-32);
  background: var(--pro-bg);
}

.contact__content {
  max-width: 600px;
}

.contact__text {
  font-size: var(--text-base);
  color: var(--pro-text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-8);
}

.contact__methods {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--pro-bg-elevated);
  border: 1px solid var(--pro-border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact__item:hover {
  border-color: var(--pro-accent);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
}

.contact__icon {
  font-size: var(--text-xl);
  color: var(--pro-accent);
  flex-shrink: 0;
}

.contact__label {
  font-size: var(--text-xs);
  color: var(--pro-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.contact__value {
  font-size: var(--text-base);
  color: var(--pro-accent);
  font-weight: 500;
}

/* Pro Footer */
.footer--pro {
  background: #1a1a2e;
}

.footer--pro .footer__text {
  color: #8888a0;
}

/* Mode toggle pro styles are now default (section 13) */

/* Pro Chat Widget */
.pro-chat {
  position: fixed;
  bottom: calc(var(--space-8) + 56px);
  right: var(--space-4);
  z-index: 1000;
}

@media (min-width: 640px) {
  .pro-chat {
    right: var(--space-6);
  }
}

.pro-chat__trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 18px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35), 0 0 12px rgba(37, 99, 235, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.pro-chat__trigger:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.45), 0 0 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.pro-chat__trigger svg {
  flex-shrink: 0;
}

.pro-chat__window {
  position: absolute;
  bottom: calc(100% + var(--space-3));
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #ffffff;
  border: 1px solid #e2e4ea;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.pro-chat.is-open .pro-chat__window {
  display: flex;
}

.pro-chat.is-open .pro-chat__trigger {
  display: none;
}

.pro-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #2563eb;
  color: #ffffff;
}

.pro-chat__title {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
}

.pro-chat__close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s ease;
}

.pro-chat__close:hover {
  color: #ffffff;
}

.pro-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 340px;
  background: #f8f9fb;
}

.pro-chat__msg {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 85%;
  word-wrap: break-word;
}

.pro-chat__msg--user {
  background: #2563eb;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.pro-chat__msg--ai {
  background: #ffffff;
  color: #1a1a2e;
  border: 1px solid #e2e4ea;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.pro-chat__msg--thinking {
  background: #ffffff;
  color: #9a9ab0;
  border: 1px solid #e2e4ea;
  align-self: flex-start;
  font-style: italic;
  border-bottom-left-radius: 4px;
}

.pro-chat__msg--error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  align-self: flex-start;
  font-size: 12px;
  border-bottom-left-radius: 4px;
}

.pro-chat__input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e2e4ea;
  background: #ffffff;
}

.pro-chat__input {
  flex: 1;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: #1a1a2e;
  outline: none;
  transition: border-color 0.2s ease;
}

.pro-chat__input:focus {
  border-color: #2563eb;
}

.pro-chat__input::placeholder {
  color: #9a9ab0;
}

.pro-chat__send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.pro-chat__send:hover {
  background: #1d4ed8;
}

/* Mobile: full-width chat */
@media (max-width: 639px) {
  .pro-chat.is-open {
    z-index: 9000;
  }

  .pro-chat__window {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 12px 12px 0 0;
    border-bottom: none;
    z-index: 9000;
  }

  .pro-chat__messages {
    max-height: 60vh;
  }
}

/* Portfolio strip */
.portfolio-strip {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-12) var(--container-padding);
}

.portfolio-strip__overflow {
  overflow: hidden;
  position: relative;
}

.portfolio-strip__overflow::before,
.portfolio-strip__overflow::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}

.portfolio-strip__overflow::before {
  left: 0;
  background: linear-gradient(to right, var(--pro-bg, #f8f9fb), transparent);
}

.portfolio-strip__overflow::after {
  right: 0;
  background: linear-gradient(to left, var(--pro-bg, #f8f9fb), transparent);
}

.portfolio-strip__track {
  display: flex;
  gap: var(--space-4);
  width: max-content;
  will-change: transform;
}

.portfolio-strip__item {
  flex-shrink: 0;
  width: 200px;
  height: 130px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e4ea;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.25s ease;
  cursor: pointer;
}

.portfolio-strip__item:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}

.portfolio-strip__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Floating portfolio preview */
.portfolio-preview {
  position: fixed;
  z-index: 5000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(37, 99, 235, 0.12);
  opacity: 0;
  transform: scale(0.9) translateY(6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  width: 360px;
  height: 234px;
}

.portfolio-preview.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.portfolio-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

/* Cookie settings button */
.cookie-settings-btn {
  position: fixed;
  bottom: var(--space-3);
  left: var(--space-3);
  z-index: 9400;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid #334155;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.cookie-settings-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  width: calc(100% - var(--space-8));
  max-width: 640px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  padding: var(--space-4) var(--space-6);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner__content {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.cookie-banner__text strong {
  color: #e2e8f0;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 8px 20px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cookie-banner__btn--accept {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.cookie-banner__btn--accept:hover {
  background: #1d4ed8;
}

.cookie-banner__btn--reject {
  background: transparent;
  color: #94a3b8;
  border-color: #334155;
}

.cookie-banner__btn--reject:hover {
  border-color: #94a3b8;
  color: #e2e8f0;
}

/* Pro responsive */
@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .contact__methods {
    flex-direction: row;
  }

  .contact__item {
    flex: 1;
  }

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

  .pro-project {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-6);
  }

  .pro-project__desc {
    flex: none;
  }
}

@media (min-width: 1024px) {
  .pro-hero__title {
    font-size: var(--text-4xl);
  }

  .pro-hero__tagline {
    font-size: var(--text-xl);
  }
}

/* ============================
   15. 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;
  }

  .typing-text {
    width: auto;
    border-right: none;
  }

  .hero__subtitle,
  .hero__badge {
    opacity: 1;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}
