/* ==========================================================================
   Vaughan Software — styles
   ========================================================================== */

:root {
  --bg: #0b0d12;
  --bg-alt: #10131a;
  --surface: #151923;
  --surface-2: #1b2030;
  --border: rgb(255 255 255 / 0.08);
  --border-strong: rgb(255 255 255 / 0.16);
  --text: #e8eaf0;
  --muted: #9aa3b5;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-contrast: #fff;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.5);
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --header-h: 68px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --bg-alt: #eef0f6;
    --surface: #ffffff;
    --surface-2: #f2f3f8;
    --border: rgb(15 20 40 / 0.08);
    --border-strong: rgb(15 20 40 / 0.16);
    --text: #121725;
    --muted: #5b6478;
    --accent: #5b3df5;
    --accent-2: #0891b2;
    --shadow: 0 10px 30px -14px rgb(20 30 60 / 0.25);
    color-scheme: light;
  }
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.075rem);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
ul[class], ol[class] { list-style: none; padding: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

/* Utilities --------------------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; padding: .6rem 1rem; background: var(--accent); color: #fff; border-radius: var(--radius-sm); }
.skip-link:focus { top: 1rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: .9rem;
}
.lead { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 62ch; }
h1 { font-size: clamp(2.4rem, 1.6rem + 4vw, 4.4rem); font-weight: 800; letter-spacing: -0.035em; }
h2, .h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem); font-weight: 750; }
h3, .h3 { font-size: 1.15rem; font-weight: 650; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  --_bg: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--_bg);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
  box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn:active { transform: translateY(0); }
.btn-ghost { --_bg: transparent; color: var(--text); border-color: var(--border-strong); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-sm { padding: .5rem 1rem; font-size: .92rem; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.05rem; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
}
.brand-name { font-size: 1.05rem; }
.brand-accent { color: var(--muted); font-weight: 500; margin-left: .3em; }

.site-nav ul { display: flex; align-items: center; gap: .35rem; list-style: none; padding: 0; }
.site-nav a:not(.btn) {
  display: block;
  padding: .5rem .85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color .2s, background-color .2s;
}
.site-nav a:not(.btn):hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"]:not(.btn) { color: var(--text); background: var(--surface-2); }
.site-nav li:last-child { margin-left: .5rem; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 50%;
  width: 18px; height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s;
}
.nav-toggle-bar { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; left: 0; }
.nav-toggle-bar::before { transform: translateY(-6px); }
.nav-toggle-bar::after { transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(45deg); background: var(--text); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: rotate(-45deg); background: var(--text); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .site-nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: .25rem; }
  .site-nav a:not(.btn) { padding: .8rem 1rem; font-size: 1.05rem; }
  .site-nav li:last-child { margin: .5rem 0 0; }
  .site-nav .btn { width: 100%; padding: .85rem; }
}

/* Sections ---------------------------------------------------------------- */
.section { padding-block: clamp(4rem, 3rem + 5vw, 7rem); }
.section-tight { padding-top: 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head h2 + p { margin-top: .8rem; }

.grid { display: grid; gap: clamp(1rem, .8rem + 1vw, 1.5rem); }

/* Hero -------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(4.5rem, 3rem + 8vw, 9rem) clamp(3.5rem, 2rem + 5vw, 6rem); }
.hero-glow {
  position: absolute;
  inset: -30% -10% auto;
  height: 120%;
  background:
    radial-gradient(40% 50% at 25% 30%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%),
    radial-gradient(35% 45% at 80% 20%, color-mix(in srgb, var(--accent-2) 25%, transparent), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero h1 { margin-bottom: 1.4rem; max-width: 16ch; }
.tech-strip { max-width: 820px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }
.tech-strip { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 3rem; }
.tech-strip li {
  padding: .35rem .8rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.page-hero { position: relative; padding-block: clamp(4rem, 3rem + 5vw, 7rem) clamp(2.5rem, 2rem + 3vw, 4rem); overflow: hidden; }
.page-hero::before {
  content: "";
  position: absolute; inset: -40% 20% auto -10%;
  height: 120%;
  background: radial-gradient(40% 50% at 30% 40%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 70%);
  filter: blur(40px);
  z-index: -1;
}
.page-hero h1 { font-size: clamp(2.2rem, 1.5rem + 3.4vw, 3.8rem); margin-bottom: 1.2rem; max-width: 18ch; }
.page-404 { min-height: 60vh; display: grid; align-items: center; }
.page-404 .hero-actions { margin-top: 2rem; }

/* Cards ------------------------------------------------------------------- */
.cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card {
  position: relative;
  padding: clamp(1.4rem, 1.2rem + 1vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.cards .card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); }

.card-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-2);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Steps ------------------------------------------------------------------- */
.steps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); counter-reset: step; }
.step { padding: 1.6rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step-num { display: block; font-family: var(--mono); font-size: .9rem; font-weight: 600; margin-bottom: 1rem; }
.step-num { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step h3 { margin-bottom: .4rem; }
.step p { color: var(--muted); font-size: .97rem; }

/* Split / checklist ------------------------------------------------------- */
.split { display: grid; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.split h2 { margin-bottom: 1rem; }
.checklist { display: grid; gap: 1rem; }
.checklist li { position: relative; padding-left: 2.1rem; color: var(--muted); }
.checklist li strong { color: var(--text); font-weight: 600; }
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: .2em;
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  background: var(--gradient);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.2l-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1.2 14.2l-4-4 1.4-1.4 2.6 2.6 5.6-5.6 1.4 1.4-7 7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.checklist-sm { gap: .6rem; font-size: .95rem; }
.checklist-sm li { padding-left: 1.8rem; }
.checklist-sm li::before { width: 1.1rem; height: 1.1rem; top: .25em; }

/* CTA band ---------------------------------------------------------------- */
.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 1.5rem + 3vw, 3.5rem);
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(60% 120% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    radial-gradient(60% 120% at 100% 100%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 60%),
    var(--surface);
}
.cta-band > div:first-child { flex: 1 1 380px; }
.cta-band h2 { margin-bottom: .6rem; }
.cta-band p { color: var(--muted); max-width: 55ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
@media (max-width: 480px) {
  .cta-actions, .hero-actions { flex-direction: column; width: 100%; }
  .cta-actions .btn, .hero-actions .btn { width: 100%; }
  .cta-actions .btn-ghost { white-space: normal; word-break: break-all; }
}

/* Services ---------------------------------------------------------------- */
.services-list { display: grid; gap: 1rem; }
.service {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 1rem 3rem;
  padding: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.service-head .card-icon { margin-bottom: 1rem; }
.service h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
.service-body p { color: var(--muted); margin-bottom: 1.2rem; }
@media (max-width: 760px) { .service { grid-template-columns: 1fr; } }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tags li {
  padding: .3rem .75rem;
  font-size: .85rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* About ------------------------------------------------------------------- */
.prose h2 { margin-bottom: 1.2rem; }
.prose p { color: var(--muted); margin-bottom: 1rem; max-width: 62ch; }
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; }
.value { padding: 1.4rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.value h3 { margin-bottom: .35rem; }
.value h3::before { content: ""; display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--gradient); margin-bottom: .9rem; }
.value p { color: var(--muted); font-size: .95rem; }
.stack { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.stack-group { padding: 1.5rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stack-group h3 { margin-bottom: 1rem; }

/* Contact ----------------------------------------------------------------- */
.contact-grid { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info { display: grid; gap: 1rem; }
.contact-info h2 { margin-bottom: .6rem; }
.contact-email { font-weight: 600; font-size: 1.05rem; word-break: break-all; }
.contact-info .btn { margin-top: 1rem; }

.contact-form { display: grid; gap: 1.2rem; }
.field-row { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.field { display: grid; gap: .45rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field [aria-invalid="true"] { border-color: #f43f5e; }
.contact-form .btn { justify-self: start; }
@media (max-width: 480px) { .contact-form .btn { justify-self: stretch; } }
.form-note { font-size: .9rem; }
.form-note.is-error { color: #f43f5e; }

/* FAQ --------------------------------------------------------------------- */
.faq { display: grid; gap: .75rem; max-width: 860px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform .25s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 1.4rem 1.3rem; color: var(--muted); }

/* Footer ------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-top: 3rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 2rem; }
.footer-brand p { margin-top: .75rem; font-size: .95rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-nav a, .footer-email { text-decoration: none; color: var(--muted); transition: color .2s; }
.footer-nav a:hover, .footer-email:hover { color: var(--text); }
.footer-email { font-weight: 600; color: var(--text); }
.footer-bottom { margin-top: 2.5rem; padding-block: 1.5rem; border-top: 1px solid var(--border); font-size: .88rem; }

/* Reveal animation -------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
