/* ============================================================
   DESIGN SYSTEM — Dark Premium / Dev + Cyber
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@300;400;500;600&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-primary:    #05070f;
  --bg-secondary:  #0a0d1a;
  --bg-card:       #0d1120;
  --bg-card-hover: #111827;

  --cyan:     #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.12);
  --green:    #39ff14;
  --gold:     #c9a84c;
  --gold-dim: rgba(201, 168, 76, 0.15);

  --text-primary:   #e8edf5;
  --text-secondary: #8a96b0;
  --text-muted:     #4a5568;

  --border:        rgba(255, 255, 255, 0.06);
  --border-cyan:   rgba(0, 229, 255, 0.25);
  --border-gold:   rgba(201, 168, 76, 0.35);

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-body: 'Inter', system-ui, sans-serif;

  /* 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: 1.5rem;
  --space-24: 2.5rem;

  /* Layout */
  --max-width: 1100px;
  --header-h: 64px;
  --radius: 8px;
  --radius-lg: 14px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-med:  280ms ease;
  --t-slow: 500ms ease;

  /* Shadows */
  --shadow-cyan: 0 0 18px rgba(0, 229, 255, 0.18);
  --shadow-gold: 0 0 18px rgba(201, 168, 76, 0.18);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  /* Subtle background texture */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #05070f 0%, #070a14 100%);
}

/* Blueprint grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* --- Accessibility --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--cyan);
  color: var(--bg-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--space-4); }

/* Visible focus ring for keyboard nav */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

p { color: var(--text-secondary); }

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--t-fast), opacity var(--t-fast);
}
a:hover { opacity: 0.8; }

code, .mono { font-family: var(--font-mono); }

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

main { position: relative; z-index: 1; }

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

/* --- Header / Nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  transition: opacity var(--t-fast);
}
.nav-logo:hover { opacity: 0.85; }
.nav-logo .logo-bracket { color: var(--cyan); }
.nav-logo .logo-dot { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: color var(--t-fast), background var(--t-fast);
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--cyan-dim);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
}

/* Contact lock badge */
.nav-contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lock-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  line-height: 1.4;
  transition: all var(--t-med);
}

.lock-badge.locked {
  background: rgba(255, 80, 80, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.lock-badge.unlocked {
  background: rgba(57, 255, 20, 0.12);
  color: var(--green);
  border: 1px solid rgba(57, 255, 20, 0.3);
}

/* Disabled nav link */
.nav-links a.disabled {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Language toggle button --- */
.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t-fast);
  line-height: 1.4;
  order: -1; /* appears before hamburger on mobile */
}
.lang-toggle:hover {
  background: rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-gold);
}

/* --- Hamburger (mobile) --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--t-med);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-med);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--cyan-dim);
  color: var(--cyan);
  border-color: var(--border-cyan);
}
.btn-primary:hover {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: var(--shadow-cyan);
  color: var(--cyan);
}

.btn-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: var(--border-gold);
}
.btn-gold:hover {
  background: rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-gold);
  color: var(--gold);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--t-med);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-cyan);
  box-shadow: var(--shadow-card), var(--shadow-cyan);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

/* Gold shimmer border animation */
.card-gold {
  border-color: var(--border-gold);
}
.card-gold::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(201, 168, 76, 0.4) 30%,
    transparent 60%,
    rgba(201, 168, 76, 0.4) 90%,
    transparent 100%
  );
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: shimmer 3s linear infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

/* --- Section Headers --- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.section-label::before {
  content: '//';
  color: var(--text-muted);
}

.section-title {
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: var(--space-8);
  max-width: 540px;
}

/* --- Tags / Badges --- */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid var(--border-cyan);
}

.tag-gold {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: var(--border-gold);
}

.tag-green {
  background: rgba(57, 255, 20, 0.1);
  color: var(--green);
  border-color: rgba(57, 255, 20, 0.25);
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-2) 0;
}

/* --- Scroll Fade-in Animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* --- Glow Pulse (on interactive elements) --- */
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 229, 255, 0.2); }
  50%       { box-shadow: 0 0 22px rgba(0, 229, 255, 0.45); }
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Hero */
.hero {
  padding: calc(var(--space-24) + var(--header-h)) 0 var(--space-24);
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.hero-eyebrow::before {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--cyan);
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero h1 .name-highlight {
  color: var(--gold);
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.65;
  margin-bottom: var(--space-8);
  font-family: var(--font-body);
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* Floating glowing orb decorations */
.hero::after {
  content: '';
  position: absolute;
  top: 20%;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.06) 0%, transparent 70%);
  pointer-events: none;
  border-radius: 50%;
}

/* Working On Cards */
.working-on-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.working-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.working-card-icon svg { width: 20px; height: 20px; }

.working-card-stack {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  font-weight: 500;
  margin-bottom: var(--space-2);
  line-height: 1.5;
}

.working-card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Care About */
.care-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  list-style: none;
}

.care-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--t-med);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.care-item:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.care-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--gold);
}

/* Architecture & Security */
.arch-bullets {
  list-style: none;
  display: grid;
  gap: var(--space-3);
}

.arch-bullets li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: var(--space-3) var(--space-4);
  border-left: 2px solid var(--border-cyan);
  background: var(--cyan-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: all var(--t-med);
}
.arch-bullets li:hover {
  color: var(--text-primary);
  border-left-color: var(--cyan);
}
.arch-bullets li::before {
  content: '›';
  color: var(--cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: var(--space-8) 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--text-primary); }
.footer-links svg { width: 18px; height: 18px; }

/* ============================================================
   GAME PAGE
   ============================================================ */

.game-page { padding-top: calc(var(--header-h) + var(--space-8)); }

.game-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.game-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.score-bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cyan);
  min-width: 3ch;
  text-align: center;
}

.game-canvas-wrap {
  position: relative;
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  box-shadow: var(--shadow-cyan), inset 0 0 40px rgba(0, 229, 255, 0.03);
  overflow: hidden;
}

#gameCanvas {
  display: block;
  background: #07091a;
}

/* Scanline overlay on canvas */
.game-canvas-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.015) 2px,
    rgba(0, 229, 255, 0.015) 4px
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Touch controls */
.touch-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.touch-row {
  display: flex;
  gap: var(--space-2);
}

.touch-btn {
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius);
  color: var(--cyan);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.touch-btn:active {
  background: var(--cyan-dim);
  transform: scale(0.93);
}

.game-status {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Game overlay (start/game-over) */
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 15, 0.88);
  border-radius: inherit;
  gap: var(--space-4);
  z-index: 10;
  transition: opacity var(--t-med);
}
.game-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--cyan);
  text-align: center;
}
.overlay-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 260px;
}

/* Contact Locked / Unlocked Section */
.contact-gate {
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  text-align: center;
}

.contact-locked-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.lock-icon-large {
  width: 52px;
  height: 52px;
  color: var(--text-muted);
  animation: glow-pulse 2.5s ease-in-out infinite;
}

.locked-text {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.score-progress {
  width: 240px;
  height: 6px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.score-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  border-radius: 6px;
  transition: width var(--t-slow);
  width: 0%;
}

/* Contact form section — hidden until unlocked */
.contact-form-section {
  display: none;
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}
.contact-form-section.visible {
  display: block;
  animation: unlock-reveal 0.6s var(--t-slow) both;
}

@keyframes unlock-reveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CONTACT FORM
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: var(--space-3) var(--space-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--border-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.form-input.error,
.form-textarea.error {
  border-color: rgba(255, 107, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.form-textarea { min-height: 130px; resize: vertical; }

.form-error {
  font-size: 0.75rem;
  color: #ff6b6b;
  font-family: var(--font-mono);
  display: none;
}
.form-error.visible { display: block; }

.form-success {
  display: none;
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-align: center;
}
.form-success.visible { display: block; }

/* ============================================================
   CONTACT PAGE (standalone)
   ============================================================ */

.contact-page {
  padding-top: calc(var(--header-h) + var(--space-16));
  padding-bottom: var(--space-16);
}

.contact-wrap {
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  :root {
    --space-16: 1.25rem;
    --space-24: 2rem;
  }

  .nav-links {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0;
    background: rgba(5, 7, 15, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 1.1rem; }

  .nav-toggle { display: flex; }

  .hero { padding-top: calc(var(--space-16) + var(--header-h)); }

  .hero-actions { flex-direction: column; }

  .working-on-grid,
  .care-list {
    grid-template-columns: 1fr;
  }

  .touch-controls { display: flex; }

  .footer-inner { flex-direction: column; align-items: flex-start; }

  #gameCanvas {
    width: 320px !important;
    height: 320px !important;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--space-4); }
}

/* ============================================================
   PAGE TRANSITION
   ============================================================ */
.page-enter {
  animation: page-in 0.35s ease both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
