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

:root {
  --bg: #0b0c10;
  --bg-soft: #111319;
  --fg: #f4f4f6;
  --fg-dim: #a6a8b3;
  --accent-1: #7c8cff;
  --accent-2: #ff7ac6;
  --border: rgba(255,255,255,0.08);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --nav-h: 72px;
  --max: 1180px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
section { position: relative; padding: clamp(4rem, 10vw, 8rem) 1.5rem; max-width: var(--max); margin: 0 auto; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }

/* ---------- skip link ---------- */
.skip-link {
  position: fixed; top: -60px; left: 1rem; z-index: 1000;
  background: var(--fg); color: var(--bg); padding: 0.7rem 1.2rem;
  border-radius: 8px; font-weight: 600; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* focus visibility */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent-1); outline-offset: 2px;
}

/* grain overlay for texture */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 3;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* custom cursor glow, desktop pointer only */
.cursor-glow {
  position: fixed; width: 240px; height: 240px; border-radius: 50%;
  pointer-events: none; z-index: 998;
  background: radial-gradient(circle, rgba(124,140,255,0.28), rgba(255,122,198,0.14) 45%, transparent 72%);
  transform: translate(-50%, -50%) scale(1); opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease-out;
  filter: blur(8px); will-change: transform;
}
@media (hover: hover) and (pointer: fine) {
  .cursor-glow { opacity: 1; }
}

.touch-glow {
  position: fixed; width: 150px; height: 150px; border-radius: 50%;
  pointer-events: none; z-index: 998; left: 0; top: 0;
  background: radial-gradient(circle, rgba(124,140,255,0.4), rgba(255,122,198,0.2) 45%, transparent 72%);
  transform: translate(-50%, -50%) scale(0.4); opacity: 0.9;
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
  filter: blur(5px);
}
.touch-glow.fade { transform: translate(-50%, -50%) scale(1.7); opacity: 0; }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(11,12,16,0.6);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.nav.scrolled { border-color: var(--border); background: rgba(11,12,16,0.85); }

.logo { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.logo-mark { width: 26px; height: 26px; }
.logo-dot { color: var(--accent-2); }

.nav-links { display: none; align-items: center; gap: 2.2rem; font-size: 0.95rem; }
.nav-links a { position: relative; color: var(--fg-dim); transition: color 0.2s ease; }
.nav-links a:hover { color: var(--fg); }
.nav-links a:not(.nav-cta)::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--accent-1); transition: width 0.25s ease;
}
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  color: var(--fg) !important; padding: 0.5rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--border); transition: border-color 0.2s ease, background 0.2s ease;
}
.nav-cta:hover { border-color: var(--accent-1); background: rgba(124,140,255,0.08); }

.nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: var(--fg); 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); }

@media (min-width: 820px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
}

/* mobile drawer */
@media (max-width: 819px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-soft); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height 0.35s ease;
  }
  .nav-links.open { max-height: 300px; }
  .nav-links a { width: 100%; padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); }
  .nav-cta { border-radius: 0; }
}

/* ---------- hero ---------- */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding-top: var(--nav-h);
}
.particles {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
}

.hero-blob {
  position: absolute; top: 10%; right: -10%; width: min(60vw, 620px); aspect-ratio: 1;
  background: radial-gradient(circle at 30% 30%, var(--accent-1), transparent 60%),
              radial-gradient(circle at 70% 70%, var(--accent-2), transparent 60%);
  filter: blur(80px); opacity: 0.35; z-index: -1;
  animation: blobMove 16s ease-in-out infinite alternate;
}
@keyframes blobMove {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(-6%, 8%) scale(1.1); }
  100% { transform: translate(4%, -6%) scale(0.95); }
}

.mascot-wrap {
  position: absolute; top: 12%; right: 10%; width: min(18vw, 190px);
  z-index: 1; filter: drop-shadow(0 16px 28px rgba(0,0,0,0.4));
  animation: mascotDrop 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both,
             mascotIdle 4s ease-in-out 1.4s infinite;
}
.mascot-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
@media (max-width: 700px) { .mascot-wrap { width: 100px; top: 7%; right: 5%; } }
@keyframes mascotDrop {
  0%   { transform: translateY(-160px) rotate(-10deg); opacity: 0; }
  60%  { transform: translateY(12px) rotate(5deg); opacity: 1; }
  78%  { transform: translateY(-10px) rotate(-2deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
@keyframes mascotIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* VHS glitch burst */
.mascot-wrap::after {
  content: ''; position: absolute; inset: -6%; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.5) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay; transition: opacity 0.08s ease;
}
.mascot-wrap.glitch::after { opacity: 0.55; }
.mascot-wrap.glitch .mascot-img { animation: mascotGlitch 0.4s steps(2, end); }
@keyframes mascotGlitch {
  0%   { transform: translate(0,0) skewX(0deg); filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35)); }
  12%  { transform: translate(-3px,1px) skewX(-3deg); filter: drop-shadow(3px 0 0 rgba(255,50,90,0.75)) drop-shadow(-3px 0 0 rgba(70,220,255,0.75)); }
  24%  { transform: translate(3px,-2px) skewX(2deg); filter: drop-shadow(-4px 0 0 rgba(255,50,90,0.6)) drop-shadow(4px 0 0 rgba(70,220,255,0.6)); }
  36%  { transform: translate(-2px,1px) skewX(-1deg); filter: drop-shadow(2px 0 0 rgba(255,50,90,0.5)) drop-shadow(-2px 0 0 rgba(70,220,255,0.5)); }
  48%  { transform: translate(2px,0) skewX(1deg); filter: drop-shadow(-1px 0 0 rgba(255,50,90,0.4)) drop-shadow(1px 0 0 rgba(70,220,255,0.4)); }
  60%  { transform: translate(0,-1px) skewX(0deg); filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35)); }
  100% { transform: translate(0,0) skewX(0deg); filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35)); }
}

.eyebrow { font-size: 0.9rem; color: var(--accent-1); letter-spacing: 0.04em; margin-bottom: 1.2rem; }
.hero-title { font-size: clamp(2.4rem, 7vw, 5rem); }
.hero-title .line { display: block; overflow: hidden; }
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 46ch; color: var(--fg-dim); font-size: clamp(1rem, 2vw, 1.15rem); margin: 1.6rem 0 2.2rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.9rem 1.7rem; border-radius: 999px; font-weight: 500; font-size: 0.95rem; transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease; }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -8px rgba(124,140,255,0.5); }
.btn-ghost { color: var(--fg-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--fg); border-color: var(--accent-1); }

.scroll-hint { position: absolute; bottom: 2.2rem; left: 1.5rem; display: flex; align-items: center; gap: 0.7rem; font-size: 0.75rem; color: var(--fg-dim); letter-spacing: 0.1em; text-transform: uppercase; }
.scroll-line { width: 1px; height: 34px; background: linear-gradient(var(--fg-dim), transparent); animation: scrollPulse 2s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
@media (max-width: 600px) { .scroll-hint { display: none; } }

/* ---------- section head ---------- */
.section-head { margin-bottom: 3rem; }
.tag { display: inline-block; font-size: 0.8rem; color: var(--accent-2); border: 1px solid var(--border); padding: 0.3rem 0.8rem; border-radius: 999px; margin-bottom: 1rem; }
.section-head h2, .contact h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }

/* ---------- about ---------- */
.about-copy { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 3.5rem; }
.about-text { max-width: 62ch; color: var(--fg-dim); font-size: clamp(1rem, 2vw, 1.15rem); }
@media (min-width: 720px) { .about-copy { margin-bottom: 3rem; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.stat { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.5rem 0; border-top: 1px solid var(--border); }
.stat-num { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); font-weight: 600; }
.stat-label { color: var(--fg-dim); font-size: 0.85rem; }

/* ---------- services ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .cards { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px;
  padding: 2rem; display: flex; flex-direction: column; gap: 0.9rem;
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); border-color: var(--accent-1); background: #14161d; }
}
.card-icon { width: 100%; max-width: 88px; height: auto; aspect-ratio: 1; padding: 0.5rem; }
.card-num { font-family: var(--font-display); color: var(--accent-1); font-size: 0.85rem; }
.card h3 { font-size: 1.3rem; }
.card p { color: var(--fg-dim); font-size: 0.95rem; flex-grow: 1; }
.card-link { color: var(--fg); font-size: 0.9rem; font-weight: 500; }
.card-link:hover { color: var(--accent-2); }

/* ---------- apps ---------- */
.app-case {
  display: flex; flex-direction: column; gap: 1.4rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px;
  padding: 2rem; margin-top: 1rem;
}
@media (min-width: 720px) { .app-case { flex-direction: row; align-items: flex-start; padding: 2.4rem; } }
.app-icon { width: 72px; height: 72px; border-radius: 18px; flex-shrink: 0; }
.app-body { display: flex; flex-direction: column; gap: 1rem; }
.app-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.app-head h3 { font-size: 1.5rem; }
.app-badge {
  font-size: 0.75rem; font-weight: 500; color: #8ef0b0;
  background: rgba(142,240,176,0.1); border: 1px solid rgba(142,240,176,0.25);
  padding: 0.25rem 0.7rem; border-radius: 999px; letter-spacing: 0.02em;
}
.app-desc { color: var(--fg-dim); font-size: 0.98rem; max-width: 64ch; }
.app-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.app-tags span {
  font-size: 0.8rem; color: var(--fg-dim); border: 1px solid var(--border);
  padding: 0.3rem 0.7rem; border-radius: 999px;
}

/* ---------- work / reference ---------- */
.clients-text { max-width: 62ch; color: var(--fg-dim); font-size: clamp(1rem, 2vw, 1.15rem); margin-bottom: 2.2rem; }
.clients-text strong { color: var(--fg); font-weight: 600; }

.ref-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.ref-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1rem;
  padding: 1.4rem 0; border-bottom: 1px solid var(--border);
  transition: opacity 0.2s ease;
}
@media (hover: hover) { .ref-item:hover { opacity: 0.7; } }
.ref-name { font-family: var(--font-display); font-size: clamp(1.15rem, 3vw, 1.5rem); color: var(--fg); }
.ref-desc { color: var(--fg-dim); font-size: 0.95rem; }
.ref-arrow { margin-left: auto; color: var(--accent-2); font-size: 1.2rem; }

/* ---------- contact ---------- */
.contact-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact .tag { align-self: center; }
.contact p { color: var(--fg-dim); margin: 1rem 0 2rem; font-size: 1.05rem; }
.mail-link { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2rem); }
.mail-link:hover { color: var(--accent-1); }
.contact-phone { margin: 0.6rem 0 2rem; font-size: 1rem; }
.contact-phone a:hover { color: var(--accent-2); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* ---------- footer ---------- */
.footer {
  display: flex; flex-direction: column; gap: 0.4rem; align-items: center; text-align: center;
  padding: 2.5rem 1.5rem; color: var(--fg-dim); font-size: 0.85rem; border-top: 1px solid var(--border);
}
@media (min-width: 600px) { .footer { flex-direction: row; justify-content: space-between; text-align: left; } }

/* ---------- contact form ---------- */
.contact-form {
  max-width: 640px; margin: 3rem auto 0; display: flex; flex-direction: column; gap: 1.3rem;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 20px; padding: 2rem;
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-row { display: flex; flex-direction: column; gap: 0.5rem; }
.form-row-split { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
@media (min-width: 560px) { .form-row-split { grid-template-columns: 1fr 1fr; } }
.form-row-split > div { display: flex; flex-direction: column; gap: 0.5rem; }
.contact-form label { font-size: 0.9rem; color: var(--fg-dim); }
.contact-form .optional { font-weight: 400; opacity: 0.7; }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.8rem 1rem; color: var(--fg); font-family: var(--font-body); font-size: 1rem;
  transition: border-color 0.2s ease;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  border-color: var(--accent-1);
}
.contact-form textarea { resize: vertical; min-height: 100px; }
.form-consent { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.85rem; color: var(--fg-dim); }
.form-consent input { margin-top: 0.2rem; }
.form-consent a { color: var(--fg); text-decoration: underline; }
.form-footer { display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-start; }
.form-status { font-size: 0.9rem; color: var(--fg-dim); }

/* ---------- service subpages ---------- */
.sub-hero {
  padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(2rem, 6vw, 4rem);
  position: relative;
}
.sub-hero .hero-blob { opacity: 0.28; }
.sub-hero .eyebrow-back {
  display: inline-flex; align-items: center; gap: 0.4rem; color: var(--fg-dim);
  font-size: 0.9rem; margin-bottom: 1.5rem;
}
.sub-hero .eyebrow-back:hover { color: var(--fg); }
.sub-hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: 18ch; }
.sub-hero h1 em {
  font-style: normal; background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub-hero .hero-sub { max-width: 56ch; margin: 1.4rem 0 2rem; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; gap: 4rem; } }

.check-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }
.check-list li { display: flex; gap: 0.8rem; color: var(--fg-dim); align-items: baseline; }
.check-list li::before { content: '→'; color: var(--accent-2); flex-shrink: 0; }

.persona-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .persona-grid { grid-template-columns: repeat(2, 1fr); } }
.persona-grid div {
  border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1.4rem;
  color: var(--fg-dim); font-size: 0.95rem; background: var(--bg-soft);
}
.persona-grid strong { display: block; color: var(--fg); margin-bottom: 0.3rem; font-family: var(--font-display); }

.process-steps { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1.5rem; }
@media (min-width: 780px) { .process-steps { grid-template-columns: repeat(4, 1fr); } }
.process-step { border-top: 1px solid var(--border); padding-top: 1rem; }
.process-step .step-num { font-family: var(--font-display); color: var(--accent-1); font-size: 0.85rem; }
.process-step h3 { font-size: 1.05rem; margin: 0.4rem 0 0.4rem; }
.process-step p { color: var(--fg-dim); font-size: 0.9rem; }

.faq-list { display: flex; flex-direction: column; margin-top: 1.5rem; }
.faq-item { border-bottom: 1px solid var(--border); padding: 1.4rem 0; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.faq-item p { color: var(--fg-dim); font-size: 0.95rem; }

.sub-proof {
  border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem 1.8rem;
  background: var(--bg-soft); margin-top: 1.5rem; color: var(--fg-dim); font-size: 0.95rem;
}
.sub-proof strong { color: var(--fg); }
.sub-proof a { color: var(--fg); text-decoration: underline; }

.sub-cta-band {
  text-align: center; padding: clamp(3rem, 8vw, 5rem) 1.5rem; max-width: var(--max); margin: 0 auto;
}
.sub-cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 1rem; }
.sub-cta-band p { color: var(--fg-dim); margin-bottom: 1.6rem; }
.form-status-error { color: var(--accent-2); }

/* ---------- reveal-on-scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.hero-title .line.reveal { transform: translateY(100%); }
.hero-title .line.reveal.in-view { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
