/* === Magicbox LLC — Tokens & Base === */
:root {
  --bg: #0a0a0c;
  --bg-2: #0f1014;
  --surface: #14151b;
  --surface-2: #1a1c24;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --fg: #f4f4f5;
  --fg-2: #b9bac3;
  --fg-3: #7e7f8a;
  --accent: oklch(0.68 0.22 295);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --accent-line: color-mix(in oklch, var(--accent) 35%, transparent);
  --warn: oklch(0.78 0.16 70);
  --ok: oklch(0.78 0.16 155);
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --body: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --maxw: 1280px;
  --pad: clamp(20px, 3vw, 40px);
}

[data-theme="light"] {
  --bg: #f6f6f4;
  --bg-2: #efefea;
  --surface: #ffffff;
  --surface-2: #f2f2ee;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --fg: #111114;
  --fg-2: #44454c;
  --fg-3: #74757e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

::selection { background: var(--accent); color: #000; }

/* === Layout === */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.row { display: flex; align-items: center; gap: 16px; }
.col { display: flex; flex-direction: column; }

/* === NAV === */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in oklch, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  max-width: var(--maxw); margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px; position: relative;
  display: inline-block;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0;
  border: 1.5px solid var(--fg);
  border-radius: 6px;
}
.brand-mark::after {
  background: var(--accent);
  border-color: var(--accent);
  inset: 6px;
  border-radius: 3px;
  box-shadow: 0 0 24px var(--accent-soft);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: 14px; color: var(--fg-2); transition: color .15s ease;
  position: relative;
}
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--fg); color: var(--bg);
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  border: none;
  transition: transform .15s ease, opacity .15s ease;
}
.nav-cta:hover { transform: translateY(-1px); }
.nav-cta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* === HERO === */
.hero {
  position: relative;
  padding: clamp(60px, 10vw, 140px) 0 clamp(60px, 8vw, 100px);
  overflow: hidden;
}
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 80% at 50% 30%, #000 30%, transparent 80%);
  pointer-events: none;
}
.hero-glow {
  position: absolute; top: -10%; left: 50%; transform: translateX(-50%);
  width: 60vw; height: 60vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.hero-inner { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-2);
  background: color-mix(in oklch, var(--surface) 60%, transparent);
}
.eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.hero h1 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(44px, 7vw, 96px);
  line-height: 0.98; letter-spacing: -0.035em;
  margin: 24px 0 28px;
  max-width: 14ch;
  text-wrap: balance;
}
.hero h1 .accent {
  font-style: italic; font-weight: 400;
  color: var(--accent);
}
.hero p.lead {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--fg-2);
  max-width: 56ch;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  border: 1px solid var(--line-strong);
  background: transparent; color: var(--fg);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface); transform: translateY(-1px); }
.btn.primary {
  background: var(--fg); color: var(--bg); border-color: var(--fg);
}
.btn.primary:hover { opacity: 0.9; }
.btn.accent {
  background: var(--accent); color: #08070d; border-color: var(--accent);
  box-shadow: 0 8px 30px -8px var(--accent);
}

.hero-meta {
  margin-top: 80px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.hero-meta .cell {
  padding: 24px 24px 24px 0;
  border-right: 1px solid var(--line);
}
.hero-meta .cell:last-child { border-right: none; padding-right: 0; }
.hero-meta .k {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-3); margin-bottom: 8px;
}
.hero-meta .v {
  font-family: var(--display); font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 500; letter-spacing: -0.02em;
}
.hero-meta .v .unit { color: var(--fg-3); font-size: 0.55em; margin-left: 4px; }

/* === Section heading === */
.section { padding: clamp(80px, 10vw, 140px) 0; position: relative; }
.section-head {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 60px;
  align-items: end; margin-bottom: 56px;
}
.section-tag {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--fg-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.section-tag::before {
  content: ""; width: 16px; height: 1px; background: var(--fg-3);
}
.section h2 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.02; letter-spacing: -0.03em;
  margin: 18px 0 0; text-wrap: balance;
}
.section-head p {
  color: var(--fg-2); font-size: 17px; max-width: 48ch; margin: 0;
  text-wrap: pretty;
}

/* === Services === */
.services-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
}
.service {
  background: var(--bg);
  padding: 36px;
  display: flex; flex-direction: column; gap: 20px;
  min-height: 360px;
  position: relative;
  transition: background .25s ease;
  cursor: pointer;
}
.service:hover { background: var(--surface); }
.service .num {
  font-family: var(--mono); font-size: 11px; color: var(--fg-3); letter-spacing: 0.1em;
}
.service .icon {
  width: 56px; height: 56px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 6%, transparent);
}
.service h3 {
  font-family: var(--display); font-weight: 500;
  font-size: 26px; letter-spacing: -0.02em; margin: 0;
}
.service p { margin: 0; color: var(--fg-2); font-size: 15px; }
.service-foot {
  margin-top: auto;
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 20px; border-top: 1px dashed var(--line);
}
.service-foot .tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.service-foot .tag {
  font-family: var(--mono); font-size: 10px;
  padding: 3px 8px; border-radius: 4px;
  background: var(--surface-2); color: var(--fg-2);
  letter-spacing: 0.05em;
}
.service-foot .arrow {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.service:hover .arrow { background: var(--accent); color: #000; border-color: var(--accent); transform: rotate(-45deg); }

/* === Infrastructure / status === */
.infra {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px;
  align-items: start;
}
.terminal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  font-family: var(--mono); font-size: 13px;
}
.terminal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.terminal-dot.r { background: oklch(0.7 0.18 25); }
.terminal-dot.y { background: oklch(0.82 0.16 85); }
.terminal-dot.g { background: oklch(0.75 0.16 155); }
.terminal-title { margin-left: 8px; color: var(--fg-3); font-size: 12px; }
.terminal-body { padding: 18px 20px; line-height: 1.7; }
.terminal-body .row-line { display: flex; gap: 10px; }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .dim { color: var(--fg-3); }
.terminal-body .ok { color: var(--ok); }
.terminal-body .key { color: var(--fg); }
.cursor::after {
  content: "▊"; color: var(--accent);
  animation: blink 1s steps(1) infinite;
  margin-left: 4px;
}
@keyframes blink { 50% { opacity: 0; } }

.status-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.status-row {
  background: var(--bg);
  padding: 18px 22px;
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 20px; align-items: center;
}
.status-row .name { font-family: var(--display); font-weight: 500; font-size: 15px; }
.status-row .name small { color: var(--fg-3); font-family: var(--mono); font-size: 11px; display: block; margin-top: 2px; }
.status-row .uptime { font-family: var(--mono); font-size: 13px; color: var(--fg-2); }
.bars { display: flex; gap: 2px; }
.bars span { width: 3px; height: 22px; border-radius: 1px; background: var(--ok); }
.bars span.d { background: var(--warn); opacity: 0.7; }
.bars span.x { background: var(--line-strong); }

/* === Features === */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.feature {
  border: 1px solid var(--line);
  border-radius: 14px; padding: 28px;
  background: var(--surface);
  transition: border-color .2s ease, transform .2s ease;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature .ic {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: 18px;
}
.feature h4 { margin: 0 0 8px; font-family: var(--display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--fg-2); font-size: 14px; }

/* === About / Region === */
.about {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.about-card {
  position: relative;
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
  display: flex; align-items: end; padding: 24px;
}
.about-map {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 30%;
  display: block;
}
.about-card .meta {
  display: flex; justify-content: space-between; width: 100%;
  font-family: var(--mono); font-size: 11px; color: var(--fg-3);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.about-card .coords {
  position: absolute; top: 24px; left: 24px;
  font-family: var(--mono); font-size: 11px; color: var(--fg-3);
}
.about-card .badge {
  position: absolute; top: 24px; right: 24px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 6px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.about h2 { margin-top: 0; }
.about-points { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 18px; }
.about-points li {
  display: grid; grid-template-columns: 28px 1fr; gap: 14px;
  padding-bottom: 18px; border-bottom: 1px dashed var(--line);
}
.about-points .n { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 3px; }
.about-points strong { font-family: var(--display); font-weight: 500; font-size: 16px; }
.about-points p { margin: 4px 0 0; color: var(--fg-2); font-size: 14px; }

/* === Contact CTA === */
.cta {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(36px, 5vw, 64px);
  background:
    radial-gradient(circle at 80% 20%, var(--accent-soft), transparent 50%),
    var(--surface);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center;
}
.cta h2 { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.03em; line-height: 1; }
.cta p { color: var(--fg-2); margin: 16px 0 0; font-size: 16px; max-width: 38ch; }

.form {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.form label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--fg-3);
}
.form input, .form select, .form textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--fg); font-family: var(--body); font-size: 14px;
  outline: none;
  transition: border-color .15s ease;
  width: 100%;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form .field { display: flex; flex-direction: column; gap: 6px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .submit {
  margin-top: 6px; padding: 14px;
  background: var(--accent); color: #0a0a0c;
  border: none; border-radius: 10px; font-weight: 600; font-size: 14px;
  letter-spacing: 0.02em;
}
.form .submit:disabled { opacity: 0.5; cursor: not-allowed; }
.form .err { color: oklch(0.72 0.18 25); font-family: var(--mono); font-size: 11px; }
.form .ok-msg {
  padding: 14px; border-radius: 10px;
  background: color-mix(in oklch, var(--ok) 14%, transparent);
  border: 1px solid color-mix(in oklch, var(--ok) 40%, transparent);
  color: var(--ok);
  font-family: var(--mono); font-size: 12px;
  text-align: center;
}

/* === Footer === */
footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 32px;
  margin-top: 80px;
}
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px;
}
.foot-grid h5 {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--fg-3); margin: 0 0 16px;
}
.foot-grid a {
  display: block; color: var(--fg-2); font-size: 14px; padding: 4px 0;
  transition: color .15s;
}
.foot-grid a:hover { color: var(--fg); }
.foot-grid p { color: var(--fg-2); font-size: 14px; max-width: 36ch; margin: 0; }
.foot-bottom {
  margin-top: 60px; padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.05em;
}

/* === Reveal === */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* === Modal === */
.modal-wrap {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in oklch, #000 60%, transparent);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.modal-wrap.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  width: 100%; max-width: 720px;
  max-height: 88vh; overflow: auto;
  padding: 36px;
  transform: scale(0.96);
  transition: transform .25s ease;
}
.modal-wrap.open .modal { transform: scale(1); }
.modal-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 16px; }
.modal h3 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 32px; letter-spacing: -0.02em; }
.modal .close {
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--fg);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.modal .close:hover { background: var(--surface-2); }
.modal .lead { color: var(--fg-2); font-size: 16px; margin: 0 0 28px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.modal-stat {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: var(--surface);
}
.modal-stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 6px; }
.modal-stat .v { font-family: var(--display); font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.modal-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.modal-list li {
  display: flex; gap: 12px; align-items: start;
  font-size: 14px; color: var(--fg-2);
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.modal-list li:last-child { border-bottom: none; }
.modal-list .check { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* === Responsive === */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .services-grid { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .infra { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .hero-meta .cell:nth-child(2) { border-right: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Hero variant: editorial */
[data-hero="editorial"] .hero h1 { font-size: clamp(60px, 12vw, 180px); max-width: none; }
[data-hero="editorial"] .hero h1 .accent { display: block; }
[data-hero="editorial"] .hero-glow { display: none; }
[data-hero="editorial"] .hero-grid-bg { mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 80%, transparent); }

/* Hero variant: split */
[data-hero="split"] .hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 60px; align-items: center; }
[data-hero="split"] .hero h1 { font-size: clamp(40px, 5.5vw, 72px); }
[data-hero="split"] .hero-visual {
  aspect-ratio: 1/1;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 50%, var(--accent-soft), transparent 60%),
    conic-gradient(from 0deg, transparent, var(--line) 25%, transparent 50%, var(--line) 75%, transparent),
    var(--surface);
  position: relative;
}
[data-hero="split"] .hero-visual::after {
  content: ""; position: absolute; inset: 20%;
  border-radius: 50%; border: 1px dashed var(--line-strong);
}
@media (max-width: 900px) {
  [data-hero="split"] .hero-inner { grid-template-columns: 1fr; }
}
