/* ===== Tokens ===== */
:root {
  --bg: #08090d;
  --bg-soft: #0c0e15;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #f3f5f9;
  --text-dim: #9aa3b5;
  --text-dimmer: #626b7d;
  --accent-1: #818cf8;
  --accent-2: #22d3ee;
  --accent-3: #a78bfa;
  --gradient: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --container: 1160px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }

.skip-link {
  position: absolute; top: -100px; left: 1rem;
  background: var(--accent-1); color: #08090d;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  z-index: 200; transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient);
  color: #06070a;
  box-shadow: 0 0 0 0 rgba(129, 140, 248, 0);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px rgba(129, 140, 248, 0.55);
}
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  backdrop-filter: blur(12px);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  background: var(--surface-strong);
}
.btn-sm { padding: 0.55rem 1.15rem; font-size: 0.875rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; margin-top: 2rem; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8, 9, 13, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--border);
  background: rgba(8, 9, 13, 0.8);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo-mark { display: inline-flex; }
.main-nav ul { display: flex; gap: 2.25rem; }
.main-nav a {
  font-size: 0.925rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
  position: relative;
}
.main-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 1rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none;
}
.nav-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); margin: 0 auto;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 168px 0 120px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
  animation: drift 16s ease-in-out infinite alternate;
}
.hero-glow-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--accent-1), transparent 70%);
  top: -180px; left: -120px;
}
.hero-glow-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--accent-2), transparent 70%);
  top: 40px; right: -140px;
  animation-delay: -8s;
}
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, 40px) scale(1.08); }
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
  z-index: 0;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.75rem;
}
.eyebrow-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px 1px var(--accent-2);
}
.hero-content h1 {
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  margin-bottom: 1.5rem;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 2.25rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ===== 404 ===== */
.error-section {
  position: relative;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 80px 0;
}
.error-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  text-align: center;
  margin: 0 auto;
}
.error-code {
  font-family: var(--mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1rem;
}
.error-inner h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}
.error-inner .hero-lead { margin-left: auto; margin-right: auto; }
.error-inner .hero-cta { justify-content: center; }

/* Terminal card */
.terminal-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
  transform: rotate(-1.2deg);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }
.terminal-title {
  margin-left: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-dimmer);
}
.terminal-body {
  padding: 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.t-prompt { color: var(--accent-2); margin-right: 0.5rem; }
.t-ok { color: #6ee7b7; }
.t-info { color: var(--text-dim); }
.t-online { color: var(--accent-2); font-weight: 600; }
.blink { animation: blink 1.1s steps(1) infinite; color: var(--text); }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Section shared ===== */
section { position: relative; padding: 120px 0; }
.section-head { max-width: 640px; margin-bottom: 3.5rem; }
.section-tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.85rem;
}
.section-head h2, .about-text h2, .contact-content h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 1rem;
}
.section-lead { color: var(--text-dim); font-size: 1.05rem; }

/* ===== Services / Bento ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(14px);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.bento-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  background: var(--surface-strong);
  box-shadow: 0 24px 48px -24px rgba(129, 140, 248, 0.25);
}
.card-icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(129,140,248,0.15), rgba(34,211,238,0.15));
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}
.bento-card h3 { font-size: 1.2rem; margin-bottom: 0.65rem; }
.bento-card p { color: var(--text-dim); font-size: 0.95rem; margin-bottom: 1.25rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list li {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}

/* ===== Process / Timeline ===== */
.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}
.timeline-item {
  position: relative;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 32px; height: 1px;
  background: var(--gradient);
}
.timeline-num {
  display: block;
  font-family: var(--mono);
  color: var(--accent-1);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.timeline-item h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.timeline-item p { color: var(--text-dim); font-size: 0.9rem; }

/* ===== About ===== */
.about-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: start;
}
.about-text p { color: var(--text-dim); margin-bottom: 1rem; font-size: 1.02rem; }
.about-points { display: flex; flex-direction: column; gap: 1.75rem; }
.point { display: flex; gap: 1rem; align-items: flex-start; }
.point-mark {
  color: var(--accent-2);
  font-family: var(--mono);
  font-weight: 600;
  margin-top: 0.15rem;
}
.point h4 { font-size: 1rem; margin-bottom: 0.3rem; }
.point p { color: var(--text-dim); font-size: 0.92rem; }

/* ===== Contact ===== */
.contact-box {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 4rem 2.5rem;
  text-align: center;
  overflow: hidden;
  background: var(--bg-soft);
}
.contact-glow {
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(129,140,248,0.18), transparent 70%);
  top: -300px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.contact-content { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; }
.contact-content .section-tag { justify-content: center; }
.contact-cards {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 2.25rem 0 0.5rem;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
  text-align: left;
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  background: var(--surface-strong);
}
.contact-icon {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(129,140,248,0.18), rgba(34,211,238,0.18));
  color: var(--accent-2);
  flex-shrink: 0;
}
.contact-card > span:last-child { display: flex; flex-direction: column; gap: 0.15rem; }
.contact-label { font-size: 0.75rem; color: var(--text-dimmer); }
.contact-value { font-size: 0.92rem; font-weight: 600; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 3.5rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.6rem; }
.footer-nav { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.footer-nav a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.footer-nav a:hover { color: var(--text); }
.footer-contact { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.footer-contact a { color: var(--text-dim); font-size: 0.9rem; transition: color 0.2s var(--ease); }
.footer-contact a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}
.footer-bottom p { color: var(--text-dimmer); font-size: 0.82rem; }

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 480px; }
  .about-inner { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .bento-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: rgba(8,9,13,0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .main-nav.open { max-height: 320px; }
  .main-nav ul { flex-direction: column; padding: 1.5rem; gap: 1.25rem; }
  .nav-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }
  section { padding: 80px 0; }
  .hero { padding-top: 140px; }
  .timeline { grid-template-columns: 1fr; }
  .timeline-item { padding-top: 1.25rem; }
  .footer-inner { flex-direction: column; }
  .footer-contact { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-glow { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .blink { animation: none; }
}
