/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink: #0b0c0a;
  --ink-soft: #131510;
  --ink-card: #171a14;
  --line: rgba(238, 232, 213, 0.14);
  --line-strong: rgba(238, 232, 213, 0.28);
  --paper: #f2efe4;
  --text: #eae5d4;
  --text-mute: #9b9a8c;
  --accent: #d7ff3f;
  --accent-ink: #17190c;
  --accent-2: #6fb4ff;
  --danger: #ff6a4d;

  --display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --container: 1280px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@view-transition { navigation: auto; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.05; letter-spacing: -0.02em; font-family: var(--display); font-weight: 600; }
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  border-radius: 4px; font-weight: 600; font-family: var(--mono); font-size: .8rem;
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0;
}

.mono { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5em;
}
.eyebrow::before { content: "◆"; font-size: .6em; }

.rule {
  border: 0; border-top: 1px solid var(--line);
}

[data-reveal] {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-reveal][data-split] { opacity: 1; transform: none; }

.split-word, .split-char {
  display: inline-block;
  will-change: transform, opacity;
}

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.section-head .index {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-mute);
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text);
  max-width: 62ch;
  line-height: 1.55;
}

.pull-quote em { color: var(--accent); font-style: normal; }
.pull-quote {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.35;
  color: var(--paper);
  max-width: 46ch;
  border-left: 2px solid var(--accent);
  padding-left: 1.4rem;
}

/* =============================================================
   5. Components
   ============================================================= */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  padding: .85rem 1.5rem;
  font-family: var(--mono);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: transform .45s var(--ease-soft), box-shadow .45s var(--ease-soft), background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-primary:hover { box-shadow: 0 18px 40px rgba(215,255,63,.22); }
.btn-ghost {
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-arrow { transition: transform .3s var(--ease-out); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* --- Chips / tags --- */
.chip {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-mute);
}
.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-accent { border-color: var(--accent); color: var(--accent); }

/* --- Nav --- */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease-out), border-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out);
}
.nav.is-scrolled {
  background: rgba(11,12,10,0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 1.1rem;
}
.nav-right { display: flex; align-items: center; gap: 1.4rem; }

.lang-switch { display: flex; align-items: center; gap: .4rem; }
.lang-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0;
  border: 1px solid transparent; border-radius: 6px;
  opacity: .5;
  transition: opacity .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-soft);
}
.lang-btn:hover { opacity: .85; transform: translateY(-1px); }
.lang-btn.is-active { opacity: 1; border-color: var(--accent); }
.lang-btn .flag {
  width: 20px; height: 14px; display: block; border-radius: 2px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
}
.nav-logo {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link { position: relative; padding-block: .3rem; color: var(--text-mute); transition: color .3s var(--ease-out); }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav-link:hover, .nav-link.is-active { color: var(--text); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px; padding: .5rem;
}
@media (min-width: 960px) { .nav-toggle { display: none; } }
.nav-toggle span { width: 22px; height: 1.5px; background: var(--text); transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 90;
  background: var(--ink);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--gutter);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile.is-open { clip-path: inset(0); }
.nav-mobile ul { display: flex; flex-direction: column; gap: 1.4rem; }
.nav-mobile a { font-family: var(--display); font-weight: 600; font-size: 2rem; }
.nav-mobile .eyebrow { margin-bottom: 2rem; }

/* --- Progress bar --- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200;
  background: rgba(238,232,213,0.06); pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; background: var(--accent);
  transform-origin: 0 0; transform: scaleX(0);
}

/* --- Cursor coordinate readout --- */
.cursor-coord {
  position: fixed; z-index: 9998; pointer-events: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent);
  padding: 3px 7px; border-radius: 3px;
  transform: translate(16px, 16px);
  opacity: 0; transition: opacity .2s var(--ease-out);
  display: none;
}
@media (hover: hover) and (pointer: fine) { .cursor-coord { display: block; } }
.cursor-coord.is-active { opacity: .92; }

/* --- Cards --- */
.card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink-card);
  padding: clamp(1.4rem, 3vw, 2rem);
  transition: border-color .35s var(--ease-out), transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
}

.spec-card { position: relative; }
.spec-card .spec-num {
  font-family: var(--mono); font-size: .8rem; color: var(--accent); display: block; margin-bottom: 1rem;
}

/* --- Diagram panel (procedural placeholder visual) --- */
.diagram {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--ink-soft);
  border: 1px solid var(--line);
}
.diagram::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at var(--dx, 20%) var(--dy, 20%), rgba(215,255,63,.16), transparent 55%);
}
.diagram-tag {
  position: absolute; top: .85rem; left: .85rem;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-mute); background: rgba(11,12,10,.65);
  padding: .3rem .55rem; border-radius: 3px; border: 1px solid var(--line);
}
.diagram-glyph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: clamp(2.2rem, 8vw, 3.6rem);
  color: rgba(238,232,213,.14);
  letter-spacing: -.02em;
}

/* --- Placeholder badge --- */
.badge-placeholder {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--mono); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--danger); border: 1px dashed rgba(255,106,77,.5);
  padding: .25rem .55rem; border-radius: 999px;
}

/* --- Timeline (process) --- */
.timeline {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.timeline-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.2rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 720px) {
  .timeline-row { grid-template-columns: 4.5rem 10rem 1fr; }
}
.timeline-row .step { font-family: var(--mono); color: var(--accent); font-size: .9rem; }
.timeline-row h3 { margin: 0; }

/* --- Form --- */
.form { display: grid; gap: 1.1rem; max-width: 560px; }
.field { position: relative; }
.field label {
  display: block; font-family: var(--mono); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-mute); margin-bottom: .5rem;
}
.field input, .field textarea, .field select {
  width: 100%; padding: .85rem 1rem; background: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 4px; color: var(--text);
  font-family: var(--sans); font-size: .95rem;
  transition: border-color .3s var(--ease-out);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .form-row.cols-2 { grid-template-columns: 1fr 1fr; } }

.cta-form { transition: opacity .55s var(--ease-out), transform .55s var(--ease-soft); }
.cta-form.is-sent { opacity: 0; transform: translateY(-12px); pointer-events: none; position: absolute; }
.form-wrap { position: relative; }
.cta-form-spinner {
  display: none; width: 16px; height: 16px; border: 1.5px solid rgba(23,25,12,.3);
  border-top-color: var(--accent-ink); border-radius: 50%; animation: spin .8s linear infinite;
}
.is-sending .cta-form-label { opacity: 0; }
.is-sending .cta-form-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.cta-success {
  position: absolute; inset: 0; display: none;
  flex-direction: column; gap: .6rem; justify-content: center;
  opacity: 0; transform: translateY(10px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-soft);
}
.cta-success.is-visible { display: flex; opacity: 1; transform: none; }

/* =============================================================
   6. Sections
   ============================================================= */
.section { padding-block: clamp(4rem, 9vw, 7.5rem); position: relative; }
.section-tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section-border-top { border-top: 1px solid var(--line); }

/* --- Hero --- */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  position: relative;
  overflow: clip;
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 30%, black, transparent);
  opacity: .7;
}
.hero-content { max-width: 920px; }
.hero-kicker { margin-bottom: 1.6rem; }
.hero-title { margin-bottom: 1.6rem; }
.hero-title em { color: var(--accent); font-style: normal; }
.hero-desc { margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }
.hero-meta {
  display: grid; grid-template-columns: repeat(2,1fr); gap: 1.2rem;
  border-top: 1px solid var(--line); padding-top: 1.4rem;
  font-family: var(--mono); font-size: .78rem; color: var(--text-mute);
}
@media (min-width: 720px) { .hero-meta { grid-template-columns: repeat(4,1fr); } }
.hero-meta strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: .2rem; font-family: var(--sans); }

/* --- Pillars grid --- */
.pillars-grid {
  display: grid; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
@media (min-width: 720px) { .pillars-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1080px) { .pillars-grid { grid-template-columns: repeat(3,1fr); } }
.pillar {
  background: var(--ink);
  padding: clamp(1.6rem, 3vw, 2.2rem);
}
.pillar .spec-num { font-family: var(--mono); color: var(--accent); font-size: .8rem; }
.pillar h3 { margin-block: .8rem .6rem; }
.pillar p { color: var(--text-mute); font-size: .95rem; }

/* --- Project preview cards (home) --- */
.projects-grid { display: grid; gap: 1.5rem; }
@media (min-width: 860px) { .projects-grid { grid-template-columns: repeat(3,1fr); } }
.project-card { display: flex; flex-direction: column; gap: 1rem; }
.project-card .diagram { margin-bottom: .2rem; }
.project-card h3 { font-size: 1.15rem; }
.project-card .meta { font-family: var(--mono); font-size: .75rem; color: var(--text-mute); }

/* --- Project full cases (proyectos.html) --- */
.case {
  display: grid; gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}
@media (min-width: 960px) { .case { grid-template-columns: 1.9fr 1fr; align-items: start; } }
.case-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.case-fields { display: grid; gap: 1.1rem; margin-top: 1.6rem; }
.case-field h4 {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .4rem; font-weight: 500;
}
.case-field p { color: var(--text-mute); font-size: .95rem; }

/* --- Tools grid --- */
.tools-grid { display: grid; gap: 1.5rem; }
@media (min-width: 720px) { .tools-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1180px) { .tools-grid { grid-template-columns: repeat(3,1fr); } }
.tool-card { display: flex; flex-direction: column; gap: .9rem; }
.tool-card .tool-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tool-status { font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-2); }
.tool-card .tagline { color: var(--text-mute); font-size: .9rem; }
.tool-card .desc { font-size: .92rem; color: var(--text-mute); }

/* --- About --- */
.about-hero { max-width: 780px; }
.founder-block { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 720px) { .founder-block { grid-template-columns: 260px 1fr; gap: 3rem; } }
.founder-photo {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  aspect-ratio: 4 / 5; max-width: 260px;
}
.founder-photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.founder-text h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.approach-grid { display: grid; gap: 1.2rem; }
@media (min-width: 860px) { .approach-grid { grid-template-columns: repeat(3,1fr); } }
.stack-grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
@media (min-width: 720px) { .stack-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1080px) { .stack-grid { grid-template-columns: repeat(3,1fr); } }
.stack-group { background: var(--ink); padding: 1.4rem 1.6rem; }
.stack-group h4 { font-family: var(--mono); font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.stack-group ul { display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; color: var(--text-mute); }

/* --- Contact --- */
.contact-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-side { display: flex; flex-direction: column; gap: 1.6rem; }
.contact-direct { display: flex; flex-direction: column; gap: .3rem; }
.contact-direct a { font-family: var(--display); font-weight: 600; font-size: 1.6rem; }
.contact-direct a:hover { color: var(--accent); }
.social-list { display: flex; flex-direction: column; gap: .6rem; font-family: var(--mono); font-size: .85rem; }
.social-list a { color: var(--text-mute); transition: color .3s var(--ease-out); }
.social-list a:hover { color: var(--accent); }
.intent-list { display: flex; flex-wrap: wrap; gap: .5rem; }

/* --- CTA band --- */
.cta-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.cta-band-inner {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  align-items: center; justify-content: space-between;
}

/* --- Footer --- */
.footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: .78rem; color: var(--text-mute); }
.footer-links a:hover { color: var(--accent); }
.footer-note { font-family: var(--mono); font-size: .72rem; color: var(--text-mute); }
.back-to-top { font-family: var(--mono); font-size: .78rem; color: var(--text-mute); }
.back-to-top:hover { color: var(--accent); }

/* --- Grain overlay --- */
.has-grain { position: relative; }
.has-grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .05; mix-blend-mode: overlay; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}

/* =============================================================
   6b. Interactive micro-effects (tilt, magnetic, halo, gallery)
   ============================================================= */

/* --- Tilt 3D on cards --- */
.has-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease-soft), border-color .35s var(--ease-out), box-shadow .5s var(--ease-soft);
}
.has-tilt:hover { transition-duration: .15s; }

/* --- Mouse-reactive halo on cards --- */
.card, .pillar { position: relative; isolation: isolate; }
.card::before, .pillar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(215,255,63,.14), transparent 60%);
  opacity: 0; transition: opacity .4s var(--ease-out);
  pointer-events: none;
}
.card:hover::before, .pillar:hover::before { opacity: 1; }

/* --- Magnetic buttons --- */
.has-magnetic { display: inline-flex; position: relative; isolation: isolate; }
.magnetic-inner {
  display: inline-flex; align-items: center; justify-content: center; gap: inherit;
  will-change: transform;
  transition: transform .8s var(--ease-soft);
}

/* --- Scramble (nav / logo) --- */
[data-scramble] { display: inline-block; }

/* --- Case gallery: full-bleed horizontal scroll-snap carousel --- */
.case-visual { display: flex; flex-direction: column; gap: .7rem; }
.case-gallery {
  display: flex;
  overflow: auto hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: 8px;
  border: 1px solid var(--line);
  aspect-ratio: 16 / 10;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.case-gallery.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.case-gallery::-webkit-scrollbar { height: 6px; }
.case-gallery::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.case-gallery::-webkit-scrollbar-track { background: transparent; }
.case-gallery .gallery-item {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: auto;
  border-radius: 0;
  border-width: 0;
}

.gallery-footer { display: flex; align-items: center; justify-content: space-between; }
.gallery-dots { display: flex; gap: .45rem; }
.gallery-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: background .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-out);
}
.gallery-dot:hover { border-color: var(--accent); transform: scale(1.2); }
.gallery-dot.is-active { background: var(--accent); border-color: var(--accent); }
.gallery-hint {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-mute);
}

/* =============================================================
   7. Effects (keyframes)
   ============================================================= */
@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-12px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } }
::view-transition-old(root) { animation: .5s var(--ease-out) both fadeOutUp; }
::view-transition-new(root) { animation: .5s var(--ease-out) both fadeInUp; }

/* =============================================================
   8. Responsive tweaks
   ============================================================= */
@media (max-width: 539px) {
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .case-head { flex-direction: column; }
}

/* =============================================================
   9. Reduced motion — only truly intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor-coord { display: none !important; }
}
