/* ═══ THEME TOKENS ═══ */
:root,
[data-theme="dark"] {
  --bg:            #0a0a0f;
  --surface:       #13131f;
  --surface-hover: #1a1a2e;
  --border:        rgba(120,100,220,0.16);
  --accent:        #7b5ea7;
  --accent-hover:  #8f6fc0;
  --accent-soft:   #a07cd4;
  --accent-pale:   #c8a8f0;
  --glow:          rgba(123,94,167,0.28);
  --text:          #e8e4f0;
  --text-strong:   #f5f2fc;
  --muted:         #8c87a0;
  --grid-line:     rgba(120,100,220,0.13);
  --orb-a:         rgba(123,94,167,0.15);
  --orb-b:         rgba(160,124,212,0.08);
  --toggle-track:  #1a1a2e;
  --toggle-thumb:  #a07cd4;
  --toggle-icon:   #f5f2fc;
}

[data-theme="light"] {
  --bg:            #f0f4fa;
  --surface:       #ffffff;
  --surface-hover: #e8eff8;
  --border:        rgba(40,90,180,0.16);
  --accent:        #2563b1;
  --accent-hover:  #3b7ad4;
  --accent-soft:   #4a8de0;
  --accent-pale:   #2563b1;
  --glow:          rgba(37,99,177,0.16);
  --text:          #141c2b;
  --text-strong:   #0a1120;
  --muted:         #546380;
  --grid-line:     rgba(40,90,180,0.08);
  --orb-a:         rgba(37,99,177,0.06);
  --orb-b:         rgba(74,141,224,0.04);
  --toggle-track:  #dce4f0;
  --toggle-thumb:  #2563b1;
  --toggle-icon:   #ffffff;
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ═══ BACKGROUND LAYERS ═══ */
.grid-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
}

.orb {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  contain: layout paint style;
}

.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--orb-a) 0%, transparent 65%);
  top: -200px; right: -150px;
}

.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--orb-b) 0%, transparent 65%);
  bottom: 10%; left: -150px;
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .orb { will-change: transform; }
  .orb-1 {
    width: 800px; height: 800px;
    top: -300px; right: -200px;
    animation: drift 13s ease-in-out infinite alternate;
  }
  .orb-2 {
    width: 600px; height: 600px;
    left: -250px;
    animation: drift 18s ease-in-out infinite alternate-reverse;
  }
}

@keyframes drift {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(40px,30px,0); }
}

/* ═══ MAIN LAYOUT ═══ */
.page {
  position: relative; z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px 40px;
  text-align: center;
}

/* ═══ THEME TOGGLE ═══ */
.theme-toggle {
  position: fixed; top: 20px; right: 20px; z-index: 100;
  width: 52px; height: 28px;
  background: var(--toggle-track);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.3s ease;
}
.theme-toggle:hover { border-color: var(--accent); }

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  display: grid;
  place-items: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
[data-theme="light"] .toggle-thumb {
  transform: translateX(24px);
}
.toggle-thumb svg {
  width: 12px; height: 12px;
  color: var(--toggle-icon);
  display: block;
}

/* ═══ TAG ═══ */
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-soft);
  text-transform: uppercase;
  margin-bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.tag::before, .tag::after {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--accent-soft);
  animation: lineExpand 0.8s ease forwards;
}
.tag::before { animation-delay: 0.3s; transform-origin: right; }
.tag::after  { animation-delay: 0.3s; transform-origin: left; }
@keyframes lineExpand {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ═══ TYPOGRAPHY ═══ */
h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(34px, 5.5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  margin-bottom: 20px;
}
h1 em {
  font-style: italic;
  color: var(--accent-pale);
}
[data-theme="light"] h1 em { color: var(--accent); }

.sub {
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 44px;
}

/* ═══ SERVICES ═══ */
.services {
  display: flex;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 44px;
  max-width: 440px;
  width: 100%;
  overflow: hidden;
}
.svc {
  flex: 1;
  background: var(--bg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.svc::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.35s ease;
  will-change: transform;
}
.svc:hover { background: var(--surface-hover); color: var(--text); }
.svc:hover::after { transform: scaleX(1); }
.svc-icon {
  color: var(--accent-soft);
  line-height: 1;
  transition: transform 0.3s ease;
}
.svc:hover .svc-icon { transform: scale(1.08); }

/* ═══ CTA BUTTON ═══ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--accent);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 24px var(--glow);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 32px var(--glow);
}
.btn-primary:active {
  box-shadow: 0 0 16px var(--glow);
  transform: translateY(1px);
}
.btn-primary .btn-arrow {
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.btn-primary:hover .btn-arrow { transform: translateX(2px); }

/* ═══ FOOTER ═══ */
.site-footer {
  margin-top: auto;
  padding-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a, .footer-links span {
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--accent-soft); }
.footer-links svg { transition: transform 0.2s ease; }
.footer-links a:hover svg { transform: translateY(-1px); }
.footer-copy { opacity: 0.6; }

/* ═══ ANIMATIONS ═══ */
.fade-up {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  animation: fadeIn 0.7s ease forwards;
}
.fade-d1 { animation-delay: 0.08s; }
.fade-d2 { animation-delay: 0.18s; }
.fade-d3 { animation-delay: 0.28s; }
.fade-d4 { animation-delay: 0.38s; }
.fade-d5 { animation-delay: 0.48s; }
@keyframes fadeIn {
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .page { padding: 72px 24px 36px; }
  .services { max-width: 360px; }
  .svc { padding: 20px 16px; font-size: 10px; }
  .footer-links { gap: 16px; }
}

@media (max-width: 480px) {
  .page { padding: 64px 20px 28px; }
  .tag { font-size: 10px; letter-spacing: 0.1em; gap: 8px; }
  .tag::before, .tag::after { width: 16px; }
  .sub { margin-bottom: 36px; }
  .services { max-width: 100%; }
  .svc { padding: 18px 12px; font-size: 10px; letter-spacing: 0.04em; }
  .btn-primary { padding: 13px 24px; font-size: 11px; width: 100%; justify-content: center; }
  .theme-toggle { top: 12px; right: 12px; }
  .site-footer { padding-top: 36px; font-size: 10px; }
  .footer-links { gap: 12px; font-size: 10px; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .page { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}
