/* ==========================================================================
   Splendense — Base styles: reset, tokens, typography, layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, picture, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---- Design tokens (light default) ---- */
:root {
  --navy-950: #05070d;
  --navy-900: #0b1220;
  --navy-800: #111a2e;
  --navy-700: #1a2540;
  --navy-600: #253352;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-100: #f1f5f9;
  --white: #ffffff;

  --cyan: #22d3ee;
  --blue: #3b82f6;
  --mint: #34d399;
  --violet: #8b5cf6;

  --bg: #f7f9fc;
  --bg-elev: #ffffff;
  --bg-soft: #eef2f8;
  --fg: #0b1220;
  --fg-muted: #475569;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --card: #ffffff;
  --card-fg: #0b1220;
  --accent: #0ea5e9;
  --accent-fg: #ffffff;
  --brand: #0369a1;
  --brand-fg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
  --gradient-hero: radial-gradient(ellipse at top, rgba(59,130,246,0.20), transparent 60%),
                   radial-gradient(ellipse at bottom right, rgba(34,211,238,0.18), transparent 55%),
                   linear-gradient(180deg, #f7f9fc 0%, #eaf1fb 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #22d3ee 100%);
  --gradient-mint: linear-gradient(135deg, #22d3ee 0%, #34d399 100%);
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(15,23,42,0.08);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --container: 1200px;
  --container-wide: 1360px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --step--1: clamp(0.83rem, 0.80rem + 0.15vw, 0.90rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.20vw, 1.05rem);
  --step-1:  clamp(1.10rem, 1.05rem + 0.30vw, 1.25rem);
  --step-2:  clamp(1.32rem, 1.20rem + 0.60vw, 1.55rem);
  --step-3:  clamp(1.60rem, 1.40rem + 1.00vw, 2.00rem);
  --step-4:  clamp(2.00rem, 1.60rem + 2.00vw, 2.80rem);
  --step-5:  clamp(2.60rem, 2.00rem + 3.00vw, 3.80rem);
  --step-6:  clamp(3.20rem, 2.20rem + 5.00vw, 5.20rem);
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #05070d;
  --bg-elev: #0b1220;
  --bg-soft: #111a2e;
  --fg: #e6edf7;
  --fg-muted: #94a3b8;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --card: #0f172a;
  --card-fg: #e6edf7;
  --accent: #22d3ee;
  --accent-fg: #05070d;
  --brand: #38bdf8;
  --brand-fg: #05070d;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 30px rgba(0,0,0,0.45);
  --shadow-lg: 0 30px 80px rgba(0,0,0,0.55);
  --gradient-hero: radial-gradient(ellipse at top, rgba(59,130,246,0.30), transparent 60%),
                   radial-gradient(ellipse at bottom right, rgba(34,211,238,0.22), transparent 55%),
                   linear-gradient(180deg, #05070d 0%, #0b1220 100%);
  --glass-bg: rgba(11,18,32,0.65);
  --glass-border: rgba(255,255,255,0.08);
}

html, body {
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--fg);
}
h1 { font-size: var(--step-6); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
p  { color: var(--fg-muted); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1rem, 2vw, 1.5rem); }
.container-wide { max-width: var(--container-wide); }
section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
  padding: .35rem .7rem; border: 1px solid var(--border-strong);
  border-radius: 999px; background: var(--glass-bg); backdrop-filter: blur(10px);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-muted { color: var(--fg-muted); }
.text-center { text-align: center; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Small-screen typography guard */
@media (max-width: 480px) {
  h1 { font-size: var(--step-4); }
  h2 { font-size: var(--step-3); }
  .hero-visual .code-window { font-size: .72rem; padding: .75rem .85rem; }
  .hero-visual .code-window pre { white-space: pre-wrap; word-break: break-word; }
}

.flow > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.stack-lg > * + * { margin-top: 2rem; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--fg); color: var(--bg); padding: .75rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-visual, .bg-particles, .marquee-track { animation: none !important; transform: none !important; }
  .hero-visual, .bg-particles { display: none !important; }
}

/* User-toggled reduce-motion (mirrors the OS preference). */
html.reduce-motion *,
html.reduce-motion *::before,
html.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}
html.reduce-motion .reveal { opacity: 1; transform: none; }
html.reduce-motion .marquee-track { animation: none !important; transform: none !important; }
html.reduce-motion .hero-visual, html.reduce-motion .bg-particles { display: none !important; }

/* Inline form errors and error summary (contact form). */
.field-error {
  color: #b91c1c; font-size: .9rem; margin-top: .35rem; line-height: 1.4;
}
[data-theme="dark"] .field-error { color: #fca5a5; }
.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: #b91c1c !important; outline-color: #b91c1c;
}
.form-summary {
  border: 1px solid #b91c1c; background: rgba(185,28,28,0.08);
  color: #7f1d1d; padding: 1rem 1.25rem; border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.form-summary ul { margin: .5rem 0 0 1.25rem; }
.form-summary a { color: inherit; text-decoration: underline; }
[data-theme="dark"] .form-summary { color: #fecaca; background: rgba(185,28,28,0.18); }

/* Honeypot: visually and interactively hidden but still in the accessibility
   tree as aria-hidden. Screen readers will skip it; bots that blindly fill
   every input will trip it. Do NOT use display:none — some bots detect that
   and skip the field. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  top: auto; width: 1px; height: 1px; overflow: hidden;
}

/* Success screen after a successful contact submission. */
#contact-success { padding: 2rem; text-align: left; max-width: 640px; }
#contact-success .success-icon { color: #16a34a; margin-bottom: 1rem; }
[data-theme="dark"] #contact-success .success-icon { color: #4ade80; }
#contact-success h2 { margin-bottom: .75rem; }
#contact-success .cta-row { margin-top: 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; }
#contact-success code { padding: .15rem .4rem; border-radius: 4px; background: var(--bg-soft); font-family: var(--font-mono); }

/* Required-consent checkbox on the contact form. */
.form-field-check .check-label {
  display: flex; align-items: flex-start; gap: .65rem;
  font-size: .95rem; line-height: 1.45; cursor: pointer;
}
.form-field-check input[type="checkbox"] {
  flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin-top: .15rem;
  accent-color: var(--accent); cursor: pointer;
}
.form-field-check input[aria-invalid="true"] { outline: 2px solid #b91c1c; outline-offset: 2px; }
.form-field-check a { color: var(--accent); text-decoration: underline; }

/* ============ components.css ============ */
/* ==========================================================================
   Splendense — Components: header, buttons, cards, badges, forms, modal
   ========================================================================== */

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass-bg); backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, border-color .3s ease;
}
.site-header.scrolled { border-bottom-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  padding-block: .9rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .65rem; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em;
  font-size: 1.15rem; color: var(--fg);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--gradient-accent);
  position: relative; box-shadow: 0 6px 20px rgba(34,211,238,0.35);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 6px; border-radius: 4px;
  background: linear-gradient(135deg, rgba(255,255,255,.6), transparent);
}
.primary-nav { display: none; margin-inline-start: auto; gap: .25rem; align-items: center; }
.primary-nav a {
  padding: .55rem .85rem; border-radius: 999px; color: var(--fg-muted);
  font-weight: 500; font-size: .95rem; transition: color .2s ease, background .2s ease;
}
.primary-nav a:hover { color: var(--fg); background: var(--bg-soft); }
.primary-nav a.active { color: var(--fg); background: var(--bg-soft); }

.header-actions { display: inline-flex; align-items: center; gap: .5rem; margin-inline-start: auto; }
@media (min-width: 960px) { .primary-nav { display: inline-flex; } .header-actions { margin-inline-start: 0; } }

.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--border); color: var(--fg); background: var(--bg-elev);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch button.trigger {
  height: 40px; padding: 0 .85rem; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--fg); font-weight: 500; display: inline-flex; align-items: center; gap: .5rem;
}
.lang-switch button.trigger:hover { border-color: var(--border-strong); }
.lang-switch .flag { width: 18px; height: 12px; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lang-switch ul {
  position: absolute; right: 0; top: calc(100% + .5rem); min-width: 180px;
  background: var(--bg-elev); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: .35rem; box-shadow: var(--shadow-lg); list-style: none; margin: 0;
  opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .18s ease, transform .18s ease; z-index: 60;
}
.lang-switch.open ul { opacity: 1; pointer-events: auto; transform: none; }
.lang-switch li button {
  width: 100%; text-align: left; padding: .55rem .7rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: .6rem; color: var(--fg);
}
.lang-switch li button:hover { background: var(--bg-soft); }
.lang-switch li button[aria-current="true"] { background: var(--bg-soft); font-weight: 600; }

/* Mobile menu */
.menu-toggle { display: inline-flex; }
@media (min-width: 960px) { .menu-toggle { display: none; } }
.mobile-nav {
  position: fixed; inset: 0; z-index: 100; background: rgba(5,7,13,.6); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(360px, 88vw);
  background: var(--bg-elev); padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem;
  transform: translateX(100%); transition: transform .3s ease;
}
.mobile-nav.open .mobile-nav-panel { transform: none; }
.mobile-nav a {
  padding: .85rem 1rem; border-radius: var(--radius-sm); color: var(--fg); font-weight: 500;
}
.mobile-nav a:hover, .mobile-nav a.active { background: var(--bg-soft); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.35rem; border-radius: 999px; font-weight: 600; font-size: .96rem;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--gradient-accent); color: #fff; box-shadow: 0 12px 32px rgba(59,130,246,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(59,130,246,.45); }
.btn-ghost { background: var(--bg-elev); color: var(--fg); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-lg { padding: 1rem 1.6rem; font-size: 1rem; }

/* ---- Cards ---- */
.card {
  background: var(--card); color: var(--card-fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  position: relative; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gradient-accent); color: #fff; margin-bottom: 1rem;
  box-shadow: 0 10px 24px rgba(34,211,238,.28);
}
.card-icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.card p { font-size: .95rem; }

.card-link {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: 1rem;
  color: var(--accent); font-weight: 600; font-size: .92rem;
}
.card-link::after { content: "→"; transition: transform .2s ease; }
.card:hover .card-link::after { transform: translateX(4px); }

/* Badges / tags */
.tag {
  display: inline-flex; align-items: center; padding: .28rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--bg-soft); color: var(--fg-muted);
  border: 1px solid var(--border);
}
.tag-accent { background: color-mix(in oklab, var(--accent) 15%, transparent); color: var(--accent); border-color: transparent; }

/* Forms */
.form-field { display: flex; flex-direction: column; gap: .4rem; }
.form-field label { font-weight: 600; font-size: .9rem; color: var(--fg); }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: .85rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--fg);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 20%, transparent);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-error { color: #ef4444; font-size: .85rem; }
.form-success {
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  background: color-mix(in oklab, var(--mint) 20%, transparent);
  color: var(--fg); border: 1px solid color-mix(in oklab, var(--mint) 45%, transparent);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(5,7,13,.72); backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem 2rem;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
  overflow-y: auto;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-elev); color: var(--fg); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); width: min(880px, 100%);
  box-shadow: var(--shadow-lg); transform: translateY(20px); transition: transform .25s ease;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 1.5rem 1.75rem 1rem; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.5rem 1.75rem 2rem; }
.modal-close {
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; color: var(--fg);
}
.modal-close:hover { background: var(--bg-soft); }

/* Footer */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding-block: 4rem 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1.4fr repeat(3, 1fr);
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: .95rem; margin-bottom: 1rem; font-family: var(--font-sans); letter-spacing: 0; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer a { color: var(--fg-muted); font-size: .92rem; }
.footer a:hover { color: var(--fg); }
.footer-meta {
  margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  color: var(--fg-muted); font-size: .85rem;
}

/* Marquee (skills carousel) */
.marquee { overflow: hidden; position: relative; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 1rem; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  padding: .8rem 1.2rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); font-family: var(--font-mono); font-size: .88rem; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .55rem;
}
.marquee-item::before {
  content: ""; width: 8px; height: 8px; border-radius: 999px;
  background: var(--gradient-accent);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Testimonial */
.testimonial {
  padding: 2rem; border-radius: var(--radius-xl); border: 1px solid var(--border);
  background: var(--card); box-shadow: var(--shadow-sm); position: relative;
}
.testimonial::before {
  content: "\201C"; position: absolute; top: -.25rem; left: 1.25rem; font-family: var(--font-display);
  font-size: 5rem; color: var(--accent); opacity: .35; line-height: 1;
}
.testimonial p { font-size: 1.05rem; color: var(--fg); line-height: 1.6; }
.testimonial cite {
  display: block; margin-top: 1.25rem; font-style: normal; color: var(--fg-muted); font-size: .9rem;
}

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--fg); font-size: .85rem; font-weight: 500;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.chip:hover { background: var(--bg-soft); }
.chip.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft), var(--bg-elev), var(--bg-soft));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============ pages.css ============ */
/* ==========================================================================
   Splendense — Page-specific styles: hero, sections, case studies
   ========================================================================== */

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--gradient-hero);
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--border);
}
.hero-inner { position: relative; z-index: 1; }
.hero-grid {
  display: grid; gap: 1.75rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 3rem; } }

.hero h1 { margin-top: 1rem; }
.hero .lead { font-size: var(--step-1); color: var(--fg-muted); margin-top: 1rem; max-width: 46ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1.75rem;
  padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.hero-meta .stat { display: flex; flex-direction: column; gap: .1rem; }
.hero-meta .stat strong { font-family: var(--font-display); font-size: var(--step-2); color: var(--fg); }
.hero-meta .stat span { font-size: .85rem; color: var(--fg-muted); }

.hero-visual {
  position: relative; aspect-ratio: 5 / 4; border-radius: var(--radius-xl);
  background: var(--gradient-accent); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong); display: none;
}
@media (min-width: 720px) { .hero-visual { display: block; } }
@media (min-width: 960px) { .hero-visual { aspect-ratio: 4 / 5; } }
.hero-visual::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,.15), transparent 40%);
}
.hero-visual .code-window {
  position: absolute; inset: auto 1.5rem 1.5rem; top: 1.5rem;
  background: rgba(5,7,13,.85); backdrop-filter: blur(12px); border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,.12); padding: 1rem 1.25rem;
  font-family: var(--font-mono); font-size: .78rem; color: #e5e7eb; overflow: hidden;
}
.hero-visual .code-window .dots { display: flex; gap: .35rem; margin-bottom: .75rem; }
.hero-visual .code-window .dots span { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.25); }
.hero-visual .code-window pre { margin: 0; white-space: pre-wrap; line-height: 1.55; color: #cbd5e1; }
.hero-visual .code-window .k { color: #22d3ee; }
.hero-visual .code-window .s { color: #34d399; }
.hero-visual .code-window .c { color: #94a3b8; }

/* Section header */
.section-head { max-width: 720px; margin-inline: auto; text-align: center; margin-bottom: 2rem; }
.section-head h2 { margin-top: .75rem; }
.section-head p { margin-top: .75rem; font-size: var(--step-1); }

/* Feature cards grid */
.feature-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* CTA band */
.cta-band {
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 5vw, 4rem);
  background: linear-gradient(135deg, #0b1220 0%, #111a2e 60%, #1a2540 100%);
  color: #f1f5f9; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(34,211,238,.28), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(59,130,246,.28), transparent 45%);
}
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cbd5e1; margin-top: 1rem; max-width: 60ch; }
.cta-band .cta-row { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .75rem; }
.cta-band .btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.18); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,.15); }

/* Page header (non-hero pages) */
.page-header {
  padding-block: clamp(2.25rem, 4vw, 3.25rem) clamp(1.5rem, 3vw, 2.25rem);
  background: var(--gradient-hero); border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-top: .75rem; font-size: var(--step-4); }
.page-header p { margin-top: .75rem; max-width: 60ch; font-size: var(--step-1); }

/* Project card */
.project-card {
  padding: 0; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
}
.project-card .thumb {
  aspect-ratio: 16 / 10; background: var(--gradient-accent); position: relative; overflow: hidden;
}
.project-card .thumb::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.3), transparent 50%),
    linear-gradient(135deg, transparent, rgba(0,0,0,.35));
}
.project-card .thumb .badge {
  position: absolute; top: 1rem; left: 1rem;
  background: rgba(5,7,13,.55); color: #fff; font-size: .75rem;
  padding: .3rem .65rem; border-radius: 999px; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
}
.project-card .body { padding: 1.5rem; }
.project-card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.project-card .stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.project-card .stack .tag { font-size: .7rem; }

/* Skill category card */
.skill-cat {
  padding: 1.75rem; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--card); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  display: flex; flex-direction: column; gap: 1rem;
}
.skill-cat:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.skill-cat h3 { font-size: 1.2rem; }
.skill-cat .items { display: flex; flex-wrap: wrap; gap: .35rem; }
.skill-cat .items .tag { font-size: .72rem; }

/* News list */
.news-list { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.news-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; }
.news-card .cover { aspect-ratio: 16 / 9; background: var(--gradient-mint); }
.news-card .body { padding: 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.news-card .meta { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: var(--fg-muted); }
.news-card h3 { font-size: 1.1rem; }
.news-card p { font-size: .93rem; }

/* Contact split */
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.2fr 1fr; gap: 4rem; } }
.contact-info dl { display: grid; gap: 1rem; margin: 0; }
.contact-info dt { font-weight: 600; color: var(--fg); font-size: .95rem; }
.contact-info dd { margin: 0; color: var(--fg-muted); }
.contact-info a { color: var(--accent); font-weight: 500; }

/* Article body */
.article-body { max-width: 720px; margin-inline: auto; }
.article-body h2 { margin-top: 2.5rem; font-size: var(--step-3); }
.article-body h3 { margin-top: 2rem; font-size: var(--step-2); }
.article-body p { margin-top: 1rem; color: var(--fg); font-size: var(--step-1); line-height: 1.75; }
.article-body ul, .article-body ol { margin-top: 1rem; padding-left: 1.5rem; color: var(--fg); }
.article-body li { margin-top: .35rem; }
.article-body pre {
  margin-top: 1.5rem; background: var(--navy-900); color: #e5e7eb; padding: 1.25rem;
  border-radius: var(--radius-md); overflow: auto; font-family: var(--font-mono); font-size: .88rem;
}

/* Case study modal content */
.case { display: grid; gap: 1.5rem; }
.case .case-hero { aspect-ratio: 16 / 8; background: var(--gradient-accent); border-radius: var(--radius-md); }
.case h3 { font-size: 1.1rem; margin-top: .5rem; }
.case .stack { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.case .kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.case .kpi div { padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-soft); }
.case .kpi strong { display: block; font-family: var(--font-display); font-size: 1.4rem; color: var(--fg); }
.case .kpi span { color: var(--fg-muted); font-size: .82rem; }

/* Skill page hero variant */
.skill-hero {
  padding-block: clamp(2.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(ellipse at 20% 0%, rgba(34,211,238,.20), transparent 55%),
    radial-gradient(ellipse at 100% 100%, rgba(59,130,246,.18), transparent 55%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.skill-hero h1 { font-size: var(--step-4); margin-top: .75rem; }
.skill-hero p.lead { margin-top: 1rem; font-size: var(--step-1); max-width: 60ch; color: var(--fg-muted); }
.skill-body { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 960px) { .skill-body { grid-template-columns: 1.4fr .6fr; gap: 3rem; } }
.skill-sidebar {
  position: sticky; top: 100px; align-self: start;
  padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card);
}
.skill-sidebar h4 { font-size: .95rem; margin-bottom: .75rem; }
.skill-sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.skill-sidebar li { color: var(--fg-muted); font-size: .9rem; display: flex; gap: .5rem; }
.skill-sidebar li::before { content: "→"; color: var(--accent); }

/* Code snippet block reused */
.code-block {
  background: #05070d; color: #e5e7eb; padding: 1.25rem; border-radius: var(--radius-md);
  overflow: auto; font-family: var(--font-mono); font-size: .85rem; line-height: 1.6;
  border: 1px solid rgba(255,255,255,.08);
}
.code-block .k { color: #22d3ee; }
.code-block .s { color: #34d399; }
.code-block .c { color: #64748b; }

/* Loading placeholder */
.load-placeholder { padding: 4rem 0; text-align: center; color: var(--fg-muted); }

/* Utility */
.hidden { display: none !important; }

/* ==========================================================================
   Own platforms page
   ========================================================================== */
.platforms-list { display: grid; gap: 2rem; }
.platform-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: 1fr;
}
@media (min-width: 900px) { .platform-card { grid-template-columns: 320px 1fr; } }
.platform-cover { min-height: 200px; position: relative; }
.platform-status {
  position: absolute; top: 1rem; left: 1rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: rgba(5,7,13,.55); color: #fff; border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(8px);
}
.platform-status.beta { background: rgba(245,158,11,.85); }
.platform-body { padding: clamp(1.5rem, 3vw, 2rem); display: grid; gap: 1.25rem; }
.platform-eyebrow { color: var(--accent); font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .35rem; }
.platform-tagline { font-size: var(--step-1); color: var(--fg-muted); margin-top: .35rem; }
.platform-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.platform-metrics div { padding: .85rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-soft); }
.platform-metrics strong { display: block; font-family: var(--font-display); font-size: 1.35rem; color: var(--fg); }
.platform-metrics span { color: var(--fg-muted); font-size: .78rem; }
.platform-cols { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .platform-cols { grid-template-columns: 1.3fr 1fr; gap: 2rem; } }
.platform-features { margin: 0; padding-left: 1.1rem; color: var(--fg); }
.platform-features li { margin-top: .35rem; }
.platform-cols .stack { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ==========================================================================
   FAQ (accordion)
   ========================================================================== */
.faq { display: grid; gap: .75rem; max-width: 820px; margin-inline: auto; }
.faq details {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1rem 1.25rem; transition: border-color .2s ease, box-shadow .2s ease;
}
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--fg); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; transition: transform .2s ease; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: .75rem; color: var(--fg-muted); }