:root {
  --bg: #0a0e13;
  --bg-elevated: #0f1520;
  --border: rgba(148, 197, 224, 0.14);
  --border-strong: rgba(14, 165, 233, 0.35);
  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.12);
  --text: #e6edf3;
  --text-dim: #8a97a5;
  --text-faint: #5c6773;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --container: 1120px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
}

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

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

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

/* Preloader */
body.is-loading { overflow: hidden; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner { text-align: center; }

.preloader-logo {
  width: 64px;
  height: 64px;
  max-width: 64px;
  max-height: 64px;
  margin: 0 auto 24px;
  display: block;
  opacity: 0;
  transform: scale(0.7);
  animation: plLogoIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, plPulse 1.8s ease-in-out infinite 0.6s;
}

@keyframes plLogoIn {
  to { opacity: 1; transform: scale(1); }
}

@keyframes plPulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(14, 165, 233, 0)); }
  50% { filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.55)); }
}

@keyframes plFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.preloader-name {
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--text);
  opacity: 0;
  animation: plFadeUp 0.5s ease forwards 1s;
}

.preloader-status {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0;
  animation: plFadeUp 0.5s ease forwards 1.3s;
}

/* Blueprint grid overlay */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 30%, transparent 75%);
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(10, 14, 19, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  max-width: 100vw;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.logo-full-img {
  height: 34px;
  width: auto;
  max-width: 180px;
}

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

.nav-desktop a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s ease;
}

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

.nav-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  width: 100%;
  max-width: 100vw;
}

.nav-mobile a {
  padding: 12px 0;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.nav-mobile.open { display: flex; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #04101a;
}

.btn-primary:hover {
  background: #38bdf8;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.4);
}

.btn-outline {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover { background: var(--accent-soft); }

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

.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }

/* Section basics */
section { position: relative; z-index: 1; padding: 120px 0; max-width: 100vw; overflow-x: hidden; }

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-label.center { text-align: center; }

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

h2.center { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }

.lead { color: var(--text-dim); font-size: 1.05rem; max-width: 480px; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 72px;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero-glow {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: 100vw;
  height: 600px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.hero-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.hero-emblem {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.emblem-ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  animation: spin 12s linear infinite;
}

.emblem-ring::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px 2px var(--accent);
  transform: translateX(-50%);
}

.emblem-icon {
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero-tagline {
  margin-top: 20px;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--text-dim);
}

.hero-status {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.2em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px 1px var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.cursor { animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: 0; } }

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.scroll-cue {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
}

.scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scrollDown 1.6s ease-in-out infinite;
}

@keyframes scrollDown {
  0% { opacity: 1; top: 6px; }
  100% { opacity: 0; top: 18px; }
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
}

.mini-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.mini-card h3 {
  font-size: 0.95rem;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.mini-card p { font-size: 0.85rem; color: var(--text-dim); }

.link-arrow {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
}

.link-arrow:hover { text-decoration: underline; }

.about-visual { position: relative; max-width: 100%; }

.visual-card { position: relative; max-width: 100%; }

.visual-terminal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  max-width: 100%;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.terminal-bar span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-faint);
}
.terminal-bar span:nth-child(1) { background: #f87171; }
.terminal-bar span:nth-child(2) { background: #fbbf24; }
.terminal-bar span:nth-child(3) { background: #34d399; }

.terminal-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: hidden;
  max-width: 100%;
}

.terminal-body code { color: var(--accent); }

.experience-badge {
  position: absolute;
  bottom: -24px;
  right: -24px;
  background: var(--accent);
  color: #04101a;
  border-radius: 12px;
  padding: 16px 20px;
  text-align: center;
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.35);
}

.exp-number { display: block; font-size: 1.6rem; font-weight: 700; font-family: var(--font-mono); }
.exp-label { display: block; font-size: 0.72rem; line-height: 1.2; margin-top: 2px; }

/* Services */
.services-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.service-card {
  position: relative;
  padding: 28px 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.service-icon {
  display: inline-block;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.service-card h3 { font-size: 1rem; margin-bottom: 10px; }
.service-card p { font-size: 0.85rem; color: var(--text-dim); }

.service-index {
  display: block;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* Projects */
.projects-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.project-card {
  position: relative;
  display: block;
  padding: 28px 26px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-4px);
}

.project-index {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.project-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.project-card p { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 16px; }

.project-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* FAQ */
.faq-list {
  max-width: 720px;
  margin: 56px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  padding: 20px 22px;
  cursor: pointer;
}

.faq-toggle {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-toggle { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.faq-answer p {
  padding: 0 22px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.faq-cta {
  text-align: center;
  margin-top: 40px;
  color: var(--text-dim);
}

.faq-cta a { color: var(--accent); font-weight: 500; }

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 64px;
}

.contact-meta {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.meta-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.meta-value { font-size: 0.95rem; }
.meta-value a:hover { color: var(--accent); }

.social-links {
  display: flex;
  gap: 20px;
}

.social-links a {
  font-size: 0.85rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
}

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

.contact-form {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 100%;
}

.form-row { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }

.form-row label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.form-row input,
.form-row select,
.form-row textarea {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
  max-width: 100%;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
}

.form-submit { margin-top: 6px; }

.form-note {
  font-size: 0.82rem;
  color: var(--accent);
  min-height: 1.2em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  position: relative;
  z-index: 1;
  max-width: 100vw;
  overflow-x: hidden;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-faint);
  text-align: center;
}

/* Responsive */
@media (max-width: 860px) {
  .nav-desktop, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .about-cards { grid-template-columns: 1fr; }
  .experience-badge { position: static; margin-top: 20px; display: inline-flex; gap: 10px; align-items: center; text-align: left; }
}

@media (max-width: 520px) {
  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  section { padding: 80px 0; }
  .logo-full-img { height: 26px; max-width: 150px; }
  .hero-glow { width: 100vw; height: 100vw; }
  h1 { word-break: break-word; }
}
