/* ============================================================
   Artinext — Premium Futuristic Dark Theme
   ============================================================ */

:root {
  --bg: #060912;
  --bg-2: #0a0f1e;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text: #e8edf7;
  --text-muted: #9aa6c2;
  --text-dim: #6b7794;

  --cyan: #22d3ee;
  --violet: #a855f7;
  --blue: #6366f1;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;

  --grad-main: linear-gradient(135deg, #22d3ee 0%, #6366f1 50%, #a855f7 100%);
  --grad-alt: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #22d3ee 100%);
  --grad-soft: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(168,85,247,0.15));

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, 0.45);

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --container: 1180px;
  --header-h: 72px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }
ul { list-style: none; }
img, svg { display: block; max-width: 100%; }

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

/* ---------- Animated background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(99,102,241,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}

.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
  animation: float 18s ease-in-out infinite;
}
.orb-cyan { width: 480px; height: 480px; background: #22d3ee; top: -120px; left: -100px; }
.orb-violet { width: 520px; height: 520px; background: #a855f7; top: 30%; right: -160px; animation-delay: -6s; }
.orb-blue { width: 420px; height: 420px; background: #6366f1; bottom: -120px; left: 30%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}

/* ---------- Glassmorphism ---------- */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  padding: 14px 26px; border-radius: 999px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--grad-main); color: #050810;
  box-shadow: 0 8px 30px -8px rgba(99, 102, 241, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -8px rgba(99, 102, 241, 0.8); }

.btn-ghost {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--cyan); transform: translateY(-2px); box-shadow: 0 0 24px -6px rgba(34,211,238,0.4); }

/* ---------- Gradient text ---------- */
.gradient-text {
  background: var(--grad-main); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.gradient-text-alt {
  background: var(--grad-alt); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(6, 9, 18, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border); background: rgba(6, 9, 18, 0.8); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; transition: transform 0.4s ease; }
.brand:hover .brand-mark { transform: rotate(180deg); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; }

.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
  position: relative; transition: color 0.2s ease;
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad-main); border-radius: 2px; transition: width 0.3s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.3s ease, opacity 0.3s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none; flex-direction: column; gap: 16px;
  padding: 20px 24px;
  background: rgba(6, 9, 18, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a { font-weight: 500; color: var(--text-muted); }
.mobile-nav .btn { margin-top: 6px; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }

.eyebrow {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); padding: 6px 14px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.08); border: 1px solid rgba(34, 211, 238, 0.2);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em;
  margin-bottom: 22px;
}
.hero-sub { font-size: 1.1rem; color: var(--text-muted); max-width: 560px; margin-bottom: 32px; }

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; }
.hero-stats span { font-size: 0.82rem; color: var(--text-dim); }

/* Hero terminal panel */
.hero-visual { perspective: 1200px; }
.hero-panel {
  padding: 0; overflow: hidden;
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.6s ease;
  box-shadow: var(--shadow), var(--shadow-glow);
}
.hero-panel:hover { transform: rotateY(0deg) rotateX(0deg); }

.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: var(--red); } .dot-amber { background: var(--amber); } .dot-green { background: var(--green); }
.panel-title { margin-left: 10px; font-size: 0.8rem; color: var(--text-dim); font-family: monospace; }

.panel-body { padding: 22px 20px; font-family: 'SF Mono', 'Monaco', monospace; font-size: 0.86rem; min-height: 200px; }
.term-line { margin-bottom: 10px; }
.term-line .prompt { color: var(--violet); }
.t-cyan { color: var(--cyan); }
.t-green { color: var(--green); }
.t-muted { color: var(--text-dim); }
.blink { animation: blink 1s steps(2) infinite; color: var(--cyan); }
@keyframes blink { 50% { opacity: 0; } }

.panel-foot { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.chip {
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); color: #b4bcf0;
}

.scroll-cue { display: flex; justify-content: center; margin-top: 60px; }
.scroll-cue span {
  width: 26px; height: 42px; border: 2px solid var(--border-strong); border-radius: 14px;
  position: relative;
}
.scroll-cue span::after {
  content: ''; position: absolute; top: 8px; left: 50%; width: 4px; height: 8px;
  background: var(--cyan); border-radius: 2px; transform: translateX(-50%);
  animation: scrollcue 1.6s ease-in-out infinite;
}
@keyframes scrollcue { 0% { opacity: 1; top: 8px; } 100% { opacity: 0; top: 24px; } }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem); line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-sub { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { padding: 32px; transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease; }
.card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow), 0 0 50px -20px rgba(99,102,241,0.5); }

.card-icon {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--cyan);
  margin-bottom: 22px; transition: color 0.3s ease, transform 0.3s ease;
}
.card:hover .card-icon { color: var(--violet); transform: scale(1.08); }
.card h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 14px; line-height: 1.3; }
.card-lead { color: var(--text-muted); margin-bottom: 14px; font-size: 0.96rem; }
.card-expertise { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 18px; }
.card-expertise em { color: var(--cyan); font-style: normal; font-weight: 600; }

.value-list { display: flex; flex-direction: column; gap: 10px; }
.value-list li { position: relative; padding-left: 26px; font-size: 0.92rem; color: var(--text); }
.value-list li::before {
  content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700;
}

/* ---------- Sandbox ---------- */
.sandbox-panel { overflow: hidden; }
.sandbox-tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); flex-wrap: wrap; }
.tab {
  padding: 10px 18px; border-radius: 10px; font-family: var(--font-display); font-weight: 600;
  font-size: 0.88rem; color: var(--text-muted); transition: all 0.25s ease;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.active { color: #050810; background: var(--grad-main); }

.sandbox-body { padding: 24px; }
.terminal {
  min-height: 320px; max-height: 420px; overflow-y: auto;
  font-family: 'SF Mono', 'Monaco', monospace; font-size: 0.88rem; line-height: 1.7;
  padding: 22px; border-radius: var(--radius-sm);
  background: rgba(2, 4, 10, 0.6); border: 1px solid var(--border);
}
.terminal::-webkit-scrollbar { width: 8px; }
.terminal::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.term-row { margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
.term-row .tag { color: var(--violet); font-weight: 600; }
.term-row .ok { color: var(--green); }
.term-row .warn { color: var(--amber); }
.term-row .info { color: var(--cyan); }
.term-row .dim { color: var(--text-dim); }
.term-row .cmd { color: var(--text); font-weight: 600; }
.term-row .arrow { color: var(--blue); }
.term-cursor::after { content: '▍'; color: var(--cyan); animation: blink 1s steps(2) infinite; }

.sandbox-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.sandbox-status { font-size: 0.82rem; color: var(--text-dim); font-family: monospace; }
.sandbox-status.done { color: var(--green); }

/* ---------- Case studies ---------- */
.cases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case { padding: 30px; transition: transform 0.35s ease, border-color 0.35s ease; }
.case:hover { transform: translateY(-6px); border-color: var(--border-strong); }
.case-tag {
  display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--violet); padding: 5px 12px; border-radius: 999px;
  background: rgba(168,85,247,0.1); border: 1px solid rgba(168,85,247,0.25); margin-bottom: 18px;
}
.case h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; }
.case p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 22px; }
.case-metrics { display: flex; gap: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.case-metrics div { display: flex; flex-direction: column; }
.case-metrics strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--cyan); }
.case-metrics span { font-size: 0.78rem; color: var(--text-dim); }

/* ---------- ROI Calculator ---------- */
.roi-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 36px; }
.roi-controls { display: flex; flex-direction: column; gap: 28px; }
.slider-group label { display: block; font-size: 0.9rem; font-weight: 500; margin-bottom: 12px; color: var(--text); }
.slider-row { display: flex; align-items: center; gap: 16px; }
.slider-val {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--cyan);
  min-width: 64px; text-align: center; padding: 6px 10px; border-radius: 10px;
  background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.2);
}

input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  background-size: var(--fill, 50%) 100%; background-repeat: no-repeat;
  background-color: rgba(255,255,255,0.08);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue); cursor: pointer;
  box-shadow: 0 0 14px -2px rgba(99,102,241,0.8); transition: transform 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--blue);
  cursor: pointer; box-shadow: 0 0 14px -2px rgba(99,102,241,0.8);
}

.roi-readout { display: flex; flex-direction: column; gap: 16px; }
.readout-card {
  padding: 22px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.readout-label { font-size: 0.82rem; color: var(--text-dim); }
.readout-card strong { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; }
.readout-hero { background: var(--grad-soft); border-color: var(--border-strong); }
.readout-hero strong { font-size: 2.2rem; }
.readout-note { font-size: 0.76rem; color: var(--text-dim); }

/* ---------- Contact info cards ---------- */
.contact-info {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 720px; margin: 28px auto 0;
}
.contact-info-card {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px; border-radius: var(--radius);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.contact-info-card:hover {
  transform: translateY(-4px); border-color: var(--border-strong);
  box-shadow: var(--shadow), 0 0 40px -16px rgba(99,102,241,0.5);
}
.contact-info-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--grad-soft); border: 1px solid var(--border); color: var(--cyan);
  transition: color 0.3s ease, transform 0.3s ease;
}
.contact-info-card:hover .contact-info-icon { color: var(--violet); transform: scale(1.08); }
.contact-info-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-info-label {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
}
.contact-info-text strong {
  font-family: var(--font-display); font-size: 1.02rem; font-weight: 700;
  color: var(--text); word-break: break-word;
}

/* ---------- Contact form ---------- */
.form-panel { padding: 40px; max-width: 720px; margin: 0 auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(2,4,10,0.5); border: 1px solid var(--border); color: var(--text);
  font-size: 0.95rem; transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.field.invalid input, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(248,113,113,0.15); }
.field textarea { resize: vertical; min-height: 110px; }

.form-success {
  margin-top: 18px; padding: 14px 18px; border-radius: var(--radius-sm);
  background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); color: var(--green);
  font-size: 0.92rem; font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 50px 0 40px; margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-brand .brand-name { font-size: 1.2rem; }
.footer-brand p { color: var(--text-dim); font-size: 0.88rem; margin-top: 6px; }
.footer-nav { display: flex; gap: 22px; }
.footer-nav a { font-size: 0.88rem; color: var(--text-muted); transition: color 0.2s ease; }
.footer-nav a:hover { color: var(--cyan); }
.footer-copy { font-size: 0.82rem; color: var(--text-dim); }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 520px; }
  .services-grid, .cases-grid { grid-template-columns: 1fr 1fr; }
  .roi-panel { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 760px) {
  .nav, .cta-audit { display: none; }
  .nav-toggle { display: flex; }
  .section { padding: 60px 0; }
  .hero { padding: 70px 0 60px; }
  .services-grid, .cases-grid { grid-template-columns: 1fr; }
  .contact-info { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .hero-stats { gap: 24px; }
  .hero-stats strong { font-size: 1.4rem; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; }
  .case-metrics { gap: 18px; }
  .readout-card strong { font-size: 1.5rem; }
  .readout-hero strong { font-size: 1.8rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}