/* ============================================================
   AGQ — Alberto González · Design System
   Editorial premium-tech: neutral paper, ink, signature red.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Color ---- */
  --paper:   #FBFBF9;   /* warm near-white */
  --paper-2: #F4F4F1;   /* soft gray panel */
  --paper-3: #ECECE8;   /* deeper panel */
  --card:    #FFFFFF;

  --ink:      #14141A;  /* near-black text */
  --ink-2:    #3C3C44;  /* secondary text */
  --ink-soft: #6E6E78;  /* muted */
  --ink-faint:#9A9AA2;  /* faintest */

  --line:    rgba(20,20,26,.10);
  --line-2:  rgba(20,20,26,.06);

  --red:     #D62414;   /* signature accent */
  --red-600: #B3160E;   /* deeper / hover */
  --red-300: #F08075;   /* light */
  --red-tint: rgba(214,36,20,.08);

  --dark:    #0B0B10;   /* near-black sections */
  --dark-2:  #121219;
  --dark-card: #15151D;
  --dark-line: rgba(255,255,255,.10);
  --on-dark:   #EDEDF0;
  --on-dark-soft: #9C9CA8;

  /* ---- Type ---- */
  --display: 'Space Grotesk', sans-serif;
  --body:    'Manrope', sans-serif;
  --mono:    'JetBrains Mono', monospace;

  /* ---- Radius / shadow ---- */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --shadow-sm: 0 1px 2px rgba(20,20,26,.04), 0 2px 8px rgba(20,20,26,.04);
  --shadow:    0 4px 14px rgba(20,20,26,.06), 0 18px 40px rgba(20,20,26,.07);
  --shadow-lg: 0 12px 30px rgba(20,20,26,.10), 0 40px 80px rgba(20,20,26,.10);

  /* ---- Layout ---- */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 76px;

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ============================================================ Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--red); color: #fff; }

/* ============================================================ Type */
h1,h2,h3,h4 { font-family: var(--display); font-weight: 600; line-height: 1.04; letter-spacing: -.02em; color: var(--ink); }
.display { font-size: clamp(2.6rem, 6.2vw, 5.3rem); font-weight: 600; line-height: .98; letter-spacing: -.035em; }
.h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); letter-spacing: -.03em; }
.h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); letter-spacing: -.025em; }
.h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.02em; }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--ink-2); line-height: 1.55; font-weight: 400; }
.muted { color: var(--ink-soft); }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* eyebrow / mono labels */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--red);
  display: inline-block;
}
.eyebrow.no-dash::before { display: none; }
.accent { color: var(--red); }
.accent-ink { color: var(--red); }

/* ============================================================ Layout */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1340px; margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }
.section-pad { padding-block: clamp(72px, 11vw, 140px); }
.section-pad-sm { padding-block: clamp(56px, 8vw, 100px); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head .eyebrow { margin-bottom: 18px; }
.section-head p { margin-top: 16px; }

.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .cols-4 { grid-template-columns: repeat(2,1fr);} .cols-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 600px){ .cols-2,.cols-3,.cols-4{grid-template-columns:1fr;} }

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: .85em 1.4em;
  border-radius: 999px;
  font-family: var(--body); font-weight: 600; font-size: .95rem;
  letter-spacing: -.01em;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease), background .25s, color .25s, border-color .25s;
  will-change: transform;
  white-space: nowrap;
}
.btn .arr { transition: transform .35s var(--ease-out); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(20,20,26,.22); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-600); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(214,36,20,.32); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.btn-on-dark-ghost { background: transparent; color: var(--on-dark); border: 1px solid var(--dark-line); }
.btn-on-dark-ghost:hover { border-color: rgba(255,255,255,.4); transform: translateY(-2px); }
.btn-lg { padding: 1.02em 1.7em; font-size: 1rem; }
.link-arrow {
  display: inline-flex; align-items: center; gap: .45em; white-space: nowrap;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  letter-spacing: .02em; color: var(--ink);
}
.link-arrow .arr { transition: transform .35s var(--ease-out); color: var(--red); }
.link-arrow:hover .arr { transform: translateX(4px); }

/* ============================================================ Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 100;
  display: flex; align-items: center;
  transition: background .4s var(--ease), box-shadow .4s, border-color .4s, backdrop-filter .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(251,251,249,.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.nav { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 30px; width: auto; }
.brand .brand-name { font-family: var(--display); font-weight: 600; font-size: 1.02rem; letter-spacing: -.01em; }
.brand .brand-sub { font-family: var(--mono); font-size: .58rem; letter-spacing:.16em; text-transform:uppercase; color: var(--ink-soft); display:block; margin-top:-2px;}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 8px;
  font-size: .92rem; font-weight: 500; color: var(--ink-2);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content:""; position:absolute; left:14px; right:14px; bottom:2px; height:2px;
  background: var(--red); border-radius:2px;
}
.nav-right { display: flex; align-items: center; gap: 14px; }

/* lang toggle */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px;
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
}
.lang-toggle button { padding: 4px 10px; border-radius: 999px; color: var(--ink-soft); transition: color .2s, background .2s; }
.lang-toggle button.on { background: var(--ink); color: var(--paper); }
.site-header.on-dark .lang-toggle { border-color: var(--dark-line); }
.site-header.on-dark .lang-toggle button.on { background: var(--on-dark); color: var(--dark); }

/* hamburger */
.hamburger { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.hamburger span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.hamburger.open span:nth-child(1){ transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2){ opacity: 0; }
.hamburger.open span:nth-child(3){ transform: translateY(-6px) rotate(-45deg); }

/* mobile menu */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: var(--paper); padding: 28px var(--gutter);
  display: flex; flex-direction: column; gap: 4px;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.mobile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-menu a { font-family: var(--display); font-size: 1.7rem; font-weight: 500; padding: 12px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.mobile-menu .btn { margin-top: 20px; justify-content: center; }

@media (max-width: 940px){
  .nav-links { display: none; }
  .nav-right .btn-header { display: none; }
  .hamburger { display: flex; }
}

/* ============================================================ Cards */
.card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: clamp(22px, 2.4vw, 32px);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease), border-color .35s;
  position: relative; overflow: hidden;
}
.card-hover:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--line); }
.card-hover::after {
  content:""; position:absolute; left:0; right:0; top:0; height:3px;
  background: linear-gradient(90deg, var(--red), var(--red-300));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out);
}
.card-hover:hover::after { transform: scaleX(1); }

.icon-badge {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--paper-2); border: 1px solid var(--line-2);
  color: var(--ink); margin-bottom: 22px;
  transition: transform .45s var(--ease-out), background .3s, color .3s;
}
.card-hover:hover .icon-badge { transform: translateY(-3px); }
.icon-badge svg { width: 26px; height: 26px; }
.card.on-dark { background: var(--dark-card); border-color: var(--dark-line); color: var(--on-dark); }
.card.on-dark .icon-badge { background: rgba(255,255,255,.05); border-color: var(--dark-line); color: #fff; }
.card.on-dark p { color: var(--on-dark-soft); }

/* chips / tags */
.chip {
  display: inline-flex; align-items: center; gap: .4em; white-space: nowrap;
  font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .02em;
  padding: .42em .8em; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.chip.on-dark { background: rgba(255,255,255,.05); border-color: var(--dark-line); color: var(--on-dark-soft); }

/* metric */
.metric .num { font-family: var(--display); font-size: clamp(2rem, 3.4vw, 2.9rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.metric .num .accent { color: var(--red); }
.metric .lbl { font-size: .9rem; color: var(--ink-soft); margin-top: 8px; }

/* ============================================================ Dark section */
.section-dark { background: var(--dark); color: var(--on-dark); }
.section-dark h1,.section-dark h2,.section-dark h3 { color: #fff; }
.section-dark .lead, .section-dark p { color: var(--on-dark-soft); }
.section-dark .eyebrow { color: var(--on-dark-soft); }
.section-paper2 { background: var(--paper-2); }

/* ============================================================ Backgrounds / motifs */
.dotgrid {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(circle, rgba(20,20,26,.10) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000, transparent 75%);
}
.section-dark .dotgrid { background-image: radial-gradient(circle, rgba(255,255,255,.10) 1px, transparent 1px); }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; z-index: 0;
}
.glow-line { position:absolute; pointer-events:none; z-index:0; }

/* ============================================================ Footer */
.site-footer { background: var(--dark); color: var(--on-dark); padding-top: clamp(60px, 8vw, 96px); position: relative; overflow: hidden; }
.site-footer a { color: var(--on-dark-soft); transition: color .2s; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; position: relative; z-index: 1; }
@media (max-width: 820px){ .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px){ .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--on-dark-soft); font-weight: 500; margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col ul a { font-size: .95rem; }
.footer-bottom { margin-top: clamp(48px,6vw,72px); padding-block: 24px; border-top: 1px solid var(--dark-line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; font-family: var(--mono); font-size: .76rem; color: var(--on-dark-soft); }
.footer-brand img { height: 34px; margin-bottom: 18px; }
.footer-brand p { max-width: 30ch; }

/* ============================================================ Reveal animations */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-stagger] > * { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
[data-reveal-stagger].in > * { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto; }
  [data-reveal],[data-reveal-stagger] > *{ opacity:1 !important; transform:none !important; }
}

/* i18n: hide the inactive language */
[data-en]{ display: none; }
html[lang="en"] [data-es]{ display: none; }
html[lang="en"] [data-en]{ display: revert; }

/* placeholder visual */
.ph {
  position: relative; border-radius: var(--r); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(20,20,26,.035) 0 10px, transparent 10px 20px),
    var(--paper-2);
  border: 1px solid var(--line-2);
  display: grid; place-items: center;
}
.ph.on-dark {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 10px, transparent 10px 20px),
    var(--dark-2);
  border-color: var(--dark-line);
}
.ph .ph-label { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); padding: 6px 10px; border: 1px dashed var(--line); border-radius: 6px; background: var(--paper); }
.ph.on-dark .ph-label { color: var(--on-dark-soft); border-color: var(--dark-line); background: rgba(0,0,0,.3); }

.divider { height: 1px; background: var(--line); border: 0; }

/* ============================================================ Hero */
.hero { overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 5vw, 72px); align-items: center; position: relative; z-index: 1; }
@media (max-width: 980px){ .hero-inner { grid-template-columns: 1fr; } .hero-visual { order: -1; } }

.hero-visual { position: relative; min-height: 420px; }
@media (max-width: 980px){ .hero-visual { min-height: 340px; } }
.hero-wires { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-wires path { animation: dash 22s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -200; } }

.code-card {
  position: absolute; top: 28px; right: 0; width: min(92%, 430px); z-index: 2;
  background: var(--dark); border: 1px solid var(--dark-line); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  transition: transform .2s var(--ease);
}
.code-top { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--dark-line); background: #0e0e15; }
.code-top .dot { width: 11px; height: 11px; border-radius: 50%; background: #2a2a35; }
.code-top .dot:nth-child(1){ background:#ff5f57; } .code-top .dot:nth-child(2){ background:#febc2e; } .code-top .dot:nth-child(3){ background:#28c840; }
.code-file { font-family: var(--mono); font-size: .72rem; color: var(--on-dark-soft); margin-left: 8px; }
.code-body { font-family: var(--mono); font-size: .82rem; line-height: 1.85; padding: 18px 20px; color: #cfd2dc; white-space: pre; overflow-x: auto; }
.code-body .c-key { color: #ff7a6b; } .code-body .c-cls { color: #6fb7ff; } .code-body .c-fn { color: #c792ea; } .code-body .c-var { color: #82d6a5; }
.cursor { display: inline-block; width: 8px; height: 1.05em; background: var(--red); margin-left: 2px; vertical-align: -2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.mini-card {
  position: absolute; bottom: 10px; left: 0; width: min(58%, 230px); z-index: 3;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 16px 18px;
}
.mini-top { display: flex; justify-content: space-between; align-items: center; }
.mini-label { font-family: var(--mono); font-size: .72rem; color: var(--ink-soft); letter-spacing: .08em; }
.mini-ok { font-family: var(--mono); font-size: .66rem; color: #16a34a; background: rgba(22,163,74,.1); padding: 2px 8px; border-radius: 999px; }
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin: 14px 0 12px; }
.mini-bars i { flex: 1; background: linear-gradient(180deg, var(--red), var(--red-300)); border-radius: 4px 4px 0 0; opacity: .9; transform-origin: bottom; animation: barIn .9s var(--ease-out); }
.mini-bars i:nth-child(1){animation-delay:.1s}.mini-bars i:nth-child(2){animation-delay:.18s}.mini-bars i:nth-child(3){animation-delay:.26s}.mini-bars i:nth-child(4){animation-delay:.34s}.mini-bars i:nth-child(5){animation-delay:.42s}.mini-bars i:nth-child(6){animation-delay:.5s}
@keyframes barIn { from { transform: scaleY(0); } }
.mini-foot { font-size: .78rem; color: var(--ink-soft); } .mini-foot b { color: var(--ink); }

.float-chip {
  position: absolute; z-index: 4; font-family: var(--mono); font-size: .76rem; font-weight: 500;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; box-shadow: var(--shadow); color: var(--ink);
  animation: floaty 6s ease-in-out infinite;
}
.float-chip.fc1 { top: -6px; left: 6%; color: var(--red); }
.float-chip.fc2 { top: 42%; right: -8px; animation-delay: -2s; }
.float-chip.fc3 { bottom: 13%; right: 7%; animation-delay: -4s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.hero-trust .chip { background: var(--card); }

/* ============================================================ Metrics strip */
.metrics-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: clamp(20px,3vw,40px); }
.metrics-strip .metric { padding-left: 20px; border-left: 1px solid var(--line); }
@media (max-width: 640px){ .metrics-strip { grid-template-columns: repeat(2,1fr); gap: 28px 20px; } }

/* ============================================================ Marquee */
.marquee { position: relative; z-index: 1; margin-top: clamp(36px,5vw,56px); overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; animation: scrollx 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }
.tech-cap {
  font-family: var(--mono); font-size: .9rem; font-weight: 500; white-space: nowrap;
  padding: 12px 22px; border-radius: 999px;
  border: 1px solid var(--dark-line); background: rgba(255,255,255,.035); color: var(--on-dark);
  transition: border-color .3s, color .3s, background .3s;
}
.tech-cap:hover { border-color: var(--red); color: #fff; background: rgba(214,36,20,.12); }

/* ============================================================ Project thumbs */
.proj-thumb { aspect-ratio: 16/10; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; position: relative; }
.proj-card { overflow: hidden; }
.proj-card .ph-label { position: absolute; top: 14px; left: 14px; z-index: 3; }
.thumb-ui { position: absolute; inset: 0; opacity: .9; }
.thumb-ui::before, .thumb-ui::after { content: ""; position: absolute; }
/* a — dashboard */
.thumb-ui-a { background:
  linear-gradient(transparent 0, transparent 0),
  repeating-linear-gradient(90deg, rgba(20,20,26,.05) 0 1px, transparent 1px 64px); }
.thumb-ui-a::before { left:18px; right:18px; top:46px; bottom:18px; border-radius:8px; background: var(--card); box-shadow: var(--shadow-sm); }
.thumb-ui-a::after { left:30px; top:60px; width:40%; height:8px; border-radius:4px; background: var(--red); box-shadow: 0 24px 0 -2px var(--paper-3), 0 44px 0 -2px var(--paper-3), 70px 0 0 var(--paper-3); }
/* b — store grid */
.thumb-ui-b { background: var(--paper-3); }
.thumb-ui-b::before { left:18px; right:18px; top:18px; height:30%; border-radius:8px; background: linear-gradient(120deg, var(--ink), var(--dark-2)); }
.thumb-ui-b::after { left:18px; bottom:18px; width:calc(100% - 36px); height:38%; border-radius:8px; background:
  repeating-linear-gradient(90deg, var(--card) 0 30%, transparent 30% 33%); }
/* c — portal table */
.thumb-ui-c { background: var(--card); }
.thumb-ui-c::before { left:0; top:0; bottom:0; width:30%; background: var(--dark); }
.thumb-ui-c::after { left:36%; right:18px; top:24px; height:10px; border-radius:4px; background: var(--paper-3); box-shadow: 0 26px 0 var(--paper-3), 0 52px 0 var(--paper-3), 0 78px 0 var(--paper-3); }
/* d — AI dark */
.thumb-ui-d { background: var(--dark); }
.thumb-ui-d::before { left:50%; top:50%; width:120px; height:120px; transform: translate(-50%,-50%) rotate(45deg); border:1px solid rgba(255,255,255,.16); border-radius:18px; box-shadow: 0 0 60px rgba(214,36,20,.4) inset; }
.thumb-ui-d::after { left:50%; top:50%; width:56px; height:56px; transform: translate(-50%,-50%); border-radius:50%; background: radial-gradient(circle, var(--red), transparent 72%); }

/* ============================================================ About page */
.about-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px,5vw,64px); align-items: center; }
@media (max-width: 900px){ .about-hero { grid-template-columns: 1fr; } }
.about-photo { aspect-ratio: 4/5; border-radius: var(--r-lg); }
@media (max-width: 900px){ .about-photo { aspect-ratio: 16/11; } }

.history-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: clamp(36px,5vw,72px); align-items: start; }
@media (max-width: 860px){ .history-grid { grid-template-columns: 1fr; } }
.history-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; position: sticky; top: calc(var(--nav-h) + 20px); }
@media (max-width: 860px){ .history-metrics { position: static; } }
.hm-item { background: var(--card); padding: 26px 24px; }
.hm-item .num { font-family: var(--display); font-size: clamp(1.8rem,3vw,2.5rem); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.hm-item .num .accent { color: var(--red); }
.hm-item .lbl { font-size: .85rem; color: var(--ink-soft); margin-top: 8px; }

.timeline { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px,2.5vw,32px) clamp(24px,3vw,48px); counter-reset: step; position: relative; }
@media (max-width: 860px){ .timeline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px){ .timeline { grid-template-columns: 1fr; } }
.tl-step { position: relative; padding-top: 28px; border-top: 1px solid var(--line); }
.tl-step::before { content: ""; position: absolute; top: -1px; left: 0; width: 44px; height: 2px; background: var(--red); }
.tl-num { font-family: var(--mono); font-size: .8rem; color: var(--red); font-weight: 600; letter-spacing: .1em; }
.tl-title { font-size: 1.25rem; margin: 10px 0 8px; }
.tl-step p { color: var(--ink-soft); font-size: .95rem; max-width: 30ch; }

/* ============================================================ Service cards */
.service-card { display: flex; flex-direction: column; }
.service-card .h3 { margin-bottom: 10px; }
.service-card .muted { flex: 0 0 auto; }
.svc-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 22px; }
.svc-tags li { font-family: var(--mono); font-size: .7rem; letter-spacing: .03em; white-space: nowrap; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 999px; padding: .35em .7em; }
.service-card .link-arrow { margin-top: auto; }

/* ============================================================ Filters + cases */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(32px,4vw,52px); }
.filter-btn { font-family: var(--mono); font-size: .82rem; font-weight: 500; padding: .55em 1.05em; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); transition: color .2s, background .2s, border-color .2s; }
.filter-btn:hover { color: var(--ink); border-color: var(--ink); }
.filter-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.cases { display: flex; flex-direction: column; gap: clamp(20px,3vw,32px); }
.case-card { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px,3vw,44px); align-items: center; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: clamp(16px,1.6vw,20px); transition: box-shadow .45s var(--ease), transform .45s var(--ease-out), border-color .35s; }
.case-card:hover { box-shadow: var(--shadow); border-color: var(--line); }
.case-card.rev { grid-template-columns: 1fr 1.05fr; }
.case-card.rev .case-media { order: 2; }
@media (max-width: 760px){ .case-card, .case-card.rev { grid-template-columns: 1fr; } .case-card.rev .case-media { order: 0; } }
.case-media { aspect-ratio: 16/10; border-radius: var(--r-lg); position: relative; overflow: hidden; }
.case-media .ph-label { position: absolute; top: 14px; left: 14px; z-index: 3; }
.case-body { padding: clamp(8px,1.4vw,22px) clamp(8px,1.6vw,26px); }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.case-body .h3 { font-size: clamp(1.3rem,2vw,1.7rem); }
.case-body p { margin: 12px 0 22px; max-width: 46ch; }
.case-dark { background: var(--dark); border-color: var(--dark-line); }
.case-dark .h3 { color: #fff; }
.case-dark p { color: var(--on-dark-soft); }
.on-dark-link { color: #fff; }
.on-dark-link .arr { color: var(--red); }

/* ============================================================ Blog */
.featured-post { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px,3vw,48px); align-items: center; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-xl); padding: clamp(16px,1.6vw,20px); transition: box-shadow .45s var(--ease), border-color .35s; }
.featured-post:hover { box-shadow: var(--shadow); border-color: var(--line); }
@media (max-width: 800px){ .featured-post { grid-template-columns: 1fr; } }
.featured-media { aspect-ratio: 16/10; border-radius: var(--r-lg); position: relative; overflow: hidden; }
.featured-media .ph-label { position: absolute; top: 14px; left: 14px; z-index: 3; }
.featured-body { padding: clamp(8px,1.4vw,24px) clamp(8px,1.6vw,28px); }

.post-meta { display: flex; align-items: center; gap: 12px; }
.post-time { font-family: var(--mono); font-size: .72rem; white-space: nowrap; color: var(--ink-faint); letter-spacing: .04em; }

.post-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; transition: transform .45s var(--ease-out), box-shadow .45s var(--ease), border-color .35s; }
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--line); }
.post-thumb { aspect-ratio: 16/10; border: 0; border-radius: 0; position: relative; }
.post-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.post-title { font-size: 1.18rem; line-height: 1.25; }
.post-card .link-arrow { margin-top: auto; }

/* ============================================================ Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px,5vw,72px); align-items: start; }
@media (max-width: 900px){ .contact-grid { grid-template-columns: 1fr; } }

.contact-list { display: flex; flex-direction: column; gap: 4px; margin-top: 38px; }
.contact-list li { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.ci-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--paper-2); border: 1px solid var(--line-2); color: var(--red); }
.ci-icon svg { width: 22px; height: 22px; }
.ci-label { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 3px; }
.ci-value { font-size: 1.02rem; font-weight: 500; color: var(--ink); }
a.ci-value:hover { color: var(--red); }
.contact-social { display: flex; gap: 10px; margin-top: 30px; }
.social-link { font-family: var(--mono); font-size: .8rem; padding: .5em 1em; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); transition: border-color .2s, color .2s; }
.social-link:hover { border-color: var(--ink); color: var(--ink); }

.contact-form-wrap { position: relative; overflow: hidden; background: var(--dark); border: 1px solid var(--dark-line); border-radius: var(--r-xl); padding: clamp(26px,3vw,44px); }
.contact-form { display: flex; flex-direction: column; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 540px){ .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--on-dark-soft); }
.field .opt { text-transform: none; letter-spacing: 0; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  background: rgba(255,255,255,.04); border: 1px solid var(--dark-line); border-radius: 12px;
  padding: 13px 15px; color: #fff; font-size: .95rem; font-family: var(--body);
  transition: border-color .2s, background .2s, box-shadow .2s; width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder, .field textarea::placeholder { color: #5e5e6c; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239C9CA8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.field select option { background: var(--dark-2); color: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--red); background: rgba(255,255,255,.06); box-shadow: 0 0 0 3px rgba(214,36,20,.18); }
.form-submit { margin-top: 8px; justify-content: center; }
.form-submit.sending { opacity: .7; pointer-events: none; }

.form-success { display: none; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 30px 10px; }
.form-success.show { display: flex; }
.fs-check { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 1.8rem; font-weight: 700; }
