/* ---------------------------------------------------------------
   ABDULLAH JAN — SSTR-inspired industrial design
   Mobile-first column layout, blue accent, live canvas hero,
   SVG graphs, floating background elements, GSAP reveals.
---------------------------------------------------------------- */

:root {
  --bg: #0a0a0c;
  --bg-2: #0e0e12;
  --surface: #121217;
  --surface-2: #16161c;
  --border: #23232b;
  --border-soft: #1a1a21;
  --text: #f2f2f3;
  --muted: #909099;
  --faint: #595961;
  --accent: #4da3ff;
  --accent-soft: rgba(77, 163, 255, 0.22);
  --accent-ink: #06121f;
  --maxw: 960px;
  --font-display: "Space Grotesk", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: auto; }

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

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: #7cbcff; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Shared ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }

.sec-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.sec-index { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.74rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: "// "; color: var(--faint); }
.annotation-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }

.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4.4vw, 2.7rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.12;
  margin-bottom: 16px;
}
.sec-lede { color: var(--muted); max-width: 620px; margin-bottom: 36px; font-size: 1rem; }
.sec-lede strong { color: var(--text); font-weight: 600; }
.sec-lede a { color: var(--accent); }

/* Marker: highlight that paints in on scroll */
.marker {
  position: relative; z-index: 0;
  background: linear-gradient(180deg, transparent 58%, var(--accent-soft) 58%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}
.marker.is-painted { background-size: 100% 100%; }

.link-more { font-family: var(--font-mono); font-size: 0.88rem; }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex;
}
.preloader-grid {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  width: 100%; height: 100%;
}
.preloader-cell {
  position: relative; overflow: hidden;
  border-right: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px;
}
.preloader-accent { background: var(--accent); color: var(--accent-ink); border-color: rgba(0,0,0,0.15); }
.preloader-accent .preloader-head { display: flex; justify-content: space-between; align-items: flex-start; }
.preloader-accent .preloader-logo,
.preloader-accent .preloader-status { color: var(--accent-ink); }
.preloader-logo { font-family: var(--font-mono); font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; }
.preloader-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; }
.preloader-pattern { background: var(--surface); }
.preloader-fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(77,163,255,0.14), rgba(77,163,255,0.02));
  width: 0%;
  transition: width 0.15s linear;
}
.preloader-progress { position: relative; z-index: 1; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.preloader-square { width: 14px; height: 14px; background: var(--accent); }
.preloader-percent { font-family: var(--font-mono); font-size: 1.8rem; font-weight: 700; color: var(--text); }
.preloader-card { background: var(--surface-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-head-left { display: flex; align-items: center; gap: 8px; }
.annotation { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.card-illu { display: flex; align-items: flex-end; gap: 12px; min-height: 80px; }
.shape, .shape-service { display: block; background: var(--accent); opacity: 0.35; width: 30px; height: 30px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.shape-service { clip-path: circle(50% at 50% 50%); width: 26px; height: 26px; }
.shape.is-1 { width: 24px; height: 24px; }
.shape.is-2 { width: 34px; height: 34px; }
.shape.is-3 { width: 20px; height: 20px; }
.shape.is-4 { width: 42px; height: 42px; }
.shape.is-5 { width: 28px; height: 28px; }
.shape-service.is-1 { width: 36px; height: 36px; }
.shape-service.is-2 { width: 24px; height: 24px; }
.shape-service.is-3 { width: 44px; height: 44px; }
.shape-service.is-4 { width: 30px; height: 30px; }

.preloader-dots { animation: blinkDots 1.2s steps(1) infinite; }
@keyframes blinkDots { 50% { opacity: 0; } }

/* Overlay reveal */
.preloader-overlay {
  position: absolute; inset: 0; z-index: 5;
  background: var(--accent);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.7s cubic-bezier(0.77, 0, 0.18, 1);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 24px;
}
.preloader-overlay.is-show { transform: translateY(0); visibility: visible; }
.preloader-overlay.is-leave { transform: translateY(-101%); transition-duration: 1s; visibility: visible; }
.preloader-overlay-fill { position: absolute; inset: 0; background: var(--accent); }
.preloader-overlay-progress { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.preloader-overlay .preloader-percent { color: var(--accent-ink); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-container { display: flex; }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; width: 100%; }
.nav-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.nav-logo:hover { color: var(--text); }
.logo-img { height: 24px; width: 24px; object-fit: contain; border-radius: 4px; }
.logo-text { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 700; letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 26px; margin-left: auto; margin-right: 26px; }
.nav-link { display: inline-flex; gap: 7px; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }
.nav-link:hover { color: var(--accent); }
.nav-num { color: var(--faint); font-size: 0.66rem; }
.nav-side { display: flex; align-items: center; gap: 0; }
.nav-contact {
  padding: 0 16px; color: var(--text);
  font-family: var(--font-mono); font-size: 0.78rem;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 9px 16px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-contact:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); color: var(--text);
  cursor: pointer; border-radius: 4px; padding: 9px 14px;
  font-family: var(--font-mono); font-size: 0.78rem;
  margin-left: 10px;
}
.nav-toggle-x { display: none; }
.nav[data-open] .nav-toggle-label { display: none; }
.nav[data-open] .nav-toggle-x { display: inline; }

.nav-menu {
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border-soft);
  background: rgba(10, 10, 12, 0.97);
  padding: 4px 24px 16px;
}
.nav[data-open] .nav-menu { display: flex; }
.nav-menu-item {
  display: flex; gap: 14px; align-items: baseline;
  padding: 14px 0; color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-display); font-size: 1.2rem; font-weight: 500;
}
.nav-menu-item:last-child { border-bottom: 0; }
.nav-menu-item:hover { color: var(--accent); }
.nav-menu-num { font-family: var(--font-mono); font-size: 0.7rem; color: var(--faint); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 150px 0 70px; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
#bg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: 0.9; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(700px 420px at 75% 20%, rgba(77,163,255,0.08), transparent 60%);
}
.hero-content { position: relative; z-index: 2; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7.4vw, 4.6rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.04;
  margin: 12px 0 24px;
}
.hero-title .line { display: block; overflow: hidden; padding: 0.06em 0; }
.hero-title .line-inner { display: inline-block; transform: translateY(112%); }
.hero-lede { color: var(--muted); max-width: 560px; font-size: 1.04rem; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-mono); font-size: 0.8rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn-primary:hover { background: #7cbcff; border-color: #7cbcff; color: var(--accent-ink); }

/* Terminal */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  max-width: 680px;
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.term-bar span { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-bar .r { background: #ff5f56; }
.term-bar .y { background: #ffbd2e; }
.term-bar .g { background: #27c93f; }
.term-bar .title { margin-left: 8px; color: var(--faint); font-size: 0.72rem; }
.term-body { padding: 16px 18px; white-space: pre-wrap; word-wrap: break-word; }
.term-body .c1 { color: var(--accent); }
.term-body .c2 { color: var(--muted); }
.term-body .c3 { color: var(--text); }
.term-body .blk { color: var(--faint); }

.hero-scroll { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-scroll-text { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }
.hero-scroll-line { width: 1px; height: 44px; background: linear-gradient(var(--accent), transparent); animation: scrollPulse 2s ease-in-out infinite; }
@keyframes scrollPulse { 0%,100% { opacity: 0.4; transform: scaleY(0.6); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }

/* ---------- Background floating shapes ---------- */
.bg-shapes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bg-shape { position: absolute; }
.bg-plus {
  width: 22px; height: 22px;
  background:
    linear-gradient(var(--accent), var(--accent)),
    linear-gradient(var(--accent), var(--accent));
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 2px, 2px 100%;
  opacity: 0.35;
}
.bg-plus.is-1 { top: 18%; left: 7%; animation: floatY 9s ease-in-out infinite; }
.bg-plus.is-2 { top: 62%; left: 12%; width: 14px; height: 14px; opacity: 0.22; animation: floatY 11s ease-in-out 1.5s infinite; }
.bg-plus.is-3 { top: 30%; right: 9%; animation: floatY 10s ease-in-out 0.8s infinite; }
.bg-blob {
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(77,163,255,0.16), transparent 70%);
  filter: blur(6px);
}
.bg-blob.is-1 { width: 340px; height: 340px; top: 6%; right: 4%; animation: floatY 14s ease-in-out infinite; }
.bg-blob.is-2 { width: 260px; height: 260px; bottom: 4%; left: 2%; animation: floatY 16s ease-in-out 2s infinite; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }

/* ---------- About / features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 40px; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.feature-num { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 0.92rem; }

.skills { display: flex; flex-wrap: wrap; gap: 8px; }
.skills .skill {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 11px;
  background: var(--surface);
  transition: border-color 0.2s, color 0.2s;
}
.skills .skill:hover { border-color: var(--accent); color: var(--accent); }
.skills .skill::before { content: "$ "; color: var(--accent); }
.skills .skill .tag-type { color: var(--muted); }

/* ---------- Numbers ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border-soft);
  border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden;
}
.stat { background: var(--bg-2); padding: 30px 24px; display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-display); font-size: clamp(2.4rem, 4.6vw, 3.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--accent); margin-bottom: 12px; }
.stat-unit { font-size: 0.5em; color: var(--muted); }
.stat-desc { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); line-height: 1.5; flex: 1; }
.stat-delta { display: block; color: var(--faint); font-size: 0.68rem; margin-top: 3px; }
.stat-link { font-family: var(--font-mono); font-size: 0.72rem; margin-top: 14px; color: var(--accent); }

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; padding-top: 32px; border-top: 1px solid var(--border); }
.step-num { position: absolute; top: 11px; left: 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent); }
.step h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.88rem; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 100%; display: block; }
.chart .grid line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; }
.chart .line-ghost { stroke: var(--faint); opacity: 0.5; stroke-width: 1.5; }
.chart .area { opacity: 0; transition: opacity 0.6s ease; }
.chart.is-drawn .line { animation: drawLine 1.6s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.chart.is-drawn .area { opacity: 1; }
.chart.is-drawn .dot { opacity: 1; transform: scale(1); }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2; opacity: 0; transform: scale(0); transform-origin: center; transform-box: fill-box; }
.chart-label { font-family: var(--font-mono); font-size: 9px; fill: var(--faint); }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.chart-bars .bars rect { fill: var(--accent); opacity: 0; }
.chart-bars.is-drawn .bars rect { animation: barGrow 0.7s cubic-bezier(0.65, 0, 0.35, 1) forwards; }
.chart-bars .bars rect:nth-child(1) { transform-origin: bottom; animation-delay: 0.1s; }
.chart-bars .bars rect:nth-child(2) { transform-origin: bottom; animation-delay: 0.22s; }
.chart-bars .bars rect:nth-child(3) { transform-origin: bottom; animation-delay: 0.34s; }
.chart-bars .bars rect:nth-child(4) { transform-origin: bottom; animation-delay: 0.46s; }
.chart-bars .bars rect:nth-child(5) { transform-origin: bottom; animation-delay: 0.58s; }
@keyframes barGrow { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }

/* ---------- Projects ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.proj-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.proj-visual { position: relative; height: 160px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); padding: 18px; }
.proj-visual-tag {
  position: absolute; top: 10px; left: 12px;
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.1em; color: var(--muted);
  border: 1px solid var(--border); padding: 3px 7px; border-radius: 3px;
  background: rgba(10,10,12,0.75);
}
.proj-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-tag { font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); margin-bottom: 8px; letter-spacing: 0.04em; }
.card-tag::before { content: "// "; }
.proj-body h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; margin-bottom: 14px; }
.proj-list { list-style: none; margin-bottom: 16px; flex: 1; }
.proj-list li { display: flex; gap: 12px; align-items: baseline; color: var(--muted); font-size: 0.84rem; padding: 8px 0; border-top: 1px solid var(--border-soft); }
.proj-list li span { font-family: var(--font-mono); font-size: 0.68rem; color: var(--accent); min-width: 20px; }
.proj-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.proj-meta .metric { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); }
.proj-meta .repo { font-family: var(--font-mono); font-size: 0.76rem; }
.more-repos { margin-top: 24px; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }
.more-repos a { color: var(--accent); }

/* ---------- Case studies ---------- */
.case-list { display: flex; flex-direction: column; gap: 12px; }
.case-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 6px; padding: 20px; transition: border-color 0.2s; }
.case-card:hover { border-color: var(--accent); }
.case-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.case-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--faint); }
.case-main { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.case-info h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.case-info p { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.case-info p strong { color: var(--text); font-weight: 600; }
.case-link { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }
.case-chart { height: 120px; padding: 8px 4px; }
.chart-sm { height: 100%; }

/* ---------- Experience ---------- */
.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 30px 28px; border-left: 1px solid var(--border); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(77, 163, 255, 0.14); }
.timeline .when { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); display: block; margin-bottom: 4px; }
.timeline .role { font-weight: 600; color: var(--text); font-size: 1.02rem; }
.timeline .org { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); }
.timeline p { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
.timeline .tags { margin-top: 10px; }
.tag { display: inline-block; margin: 0 8px 0 0; font-size: 0.68rem; font-family: var(--font-mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 3px 8px; }

/* ---------- Cards ---------- */
.list-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 6px; padding: 20px 22px; transition: border-color 0.2s; }
.mini-card:hover { border-color: var(--accent); }
.mini-card h3 { font-size: 1.02rem; font-weight: 600; margin: 2px 0 6px; }
.mini-card .sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--faint); display: block; margin-bottom: 8px; }
.mini-card p { color: var(--muted); font-size: 0.86rem; }

/* ---------- Certifications ---------- */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.cert-card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 6px; padding: 10px; text-align: center; transition: border-color 0.2s; }
.cert-card:hover { border-color: var(--accent); }
.cert-card img { width: 100%; height: 160px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--border-soft); }
.cert-card .cert-name { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 9px; line-height: 1.4; }
.badge { display: inline-block; margin: 4px 6px 0 0; font-size: 0.7rem; font-family: var(--font-mono); color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 4px 9px; }
.badge b { color: var(--text); font-weight: 500; }

/* ---------- Partners ---------- */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border-soft); border-radius: 6px; overflow: hidden; }
.partner { background: var(--bg-2); display: flex; align-items: center; gap: 14px; padding: 26px 22px; }
.partner-mark { width: 44px; height: 44px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.88rem; color: var(--accent); }
.partner-name { font-weight: 500; font-size: 0.92rem; }

/* ---------- Contact ---------- */
.contact-wrap { max-width: 680px; }
.contact-form { display: flex; flex-direction: column; gap: 14px; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 14px 48px 14px 15px; color: var(--text);
  font-family: var(--font-display); font-size: 1rem;
  outline: none; transition: border-color 0.2s;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field-num { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-family: var(--font-mono); font-size: 0.68rem; color: var(--faint); }
.field textarea ~ .field-num { top: 17px; transform: none; }
.consent { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 0.78rem; line-height: 1.5; cursor: pointer; }
.consent input { margin-top: 3px; accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.contact-form .btn-primary { align-self: flex-start; margin-top: 2px; cursor: pointer; }
.form-status { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); }

/* ---------- Footer ---------- */
footer { background: var(--bg-2); border-top: 1px solid var(--border-soft); padding: 48px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 38px; }
.footer-brand p { color: var(--muted); font-size: 0.86rem; margin-top: 12px; max-width: 240px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.footer-col a { color: var(--muted); font-size: 0.88rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border-soft); padding-top: 20px; color: var(--faint); font-family: var(--font-mono); font-size: 0.72rem; }
.footer-bottom .s { color: var(--accent); }

/* ---------- Chat widget ---------- */
#chat-toggle { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 54px; height: 54px; border-radius: 50%; border: none; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-size: 1.4rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); transition: transform 0.15s ease; }
#chat-toggle:hover { transform: scale(1.06); }
#chat-window { position: fixed; right: 20px; bottom: 86px; z-index: 80; width: min(360px, calc(100vw - 40px)); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7); display: flex; flex-direction: column; max-height: 500px; }
#chat-header { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.82rem; }
#chat-close { background: none; border: none; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
#chat-close:hover { color: var(--text); }
#chat-messages { flex: 1; overflow-y: auto; padding: 13px 15px; display: flex; flex-direction: column; gap: 9px; min-height: 120px; }
.msg { max-width: 86%; padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; white-space: pre-wrap; word-wrap: break-word; }
.msg.agent { background: var(--surface); border: 1px solid var(--border); align-self: flex-start; }
.msg.user { background: var(--accent); color: var(--accent-ink); align-self: flex-end; }
.msg.error { background: #1f1210; border: 1px solid #7f1d1d; color: #f2a8a0; align-self: flex-start; }
#chat-form { display: flex; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--border); }
#chat-input { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 9px 13px; color: var(--text); outline: none; font-family: var(--font-mono); font-size: 0.82rem; }
#chat-input:focus { border-color: var(--accent); }
#chat-form button { background: var(--accent); color: var(--accent-ink); border: none; border-radius: 6px; padding: 9px 15px; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
#chat-form button:disabled { opacity: 0.5; cursor: not-allowed; }

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

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.65, 0, 0.35, 1); }

/* ---------- No-GSAP fallback (CDN blocked) ---------- */
body.no-anim .hero-title .line-inner { transform: none; }
body.no-anim .marker { background-size: 100% 100%; }
body.no-anim .chart .line { stroke-dashoffset: 0; }
body.no-anim .chart .area { opacity: 1; }
body.no-anim .chart .dot { opacity: 1; transform: scale(1); }
body.no-anim .chart-bars .bars rect { opacity: 1; transform: scaleY(1); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .proj-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .nav-links { display: none; }
  .nav-contact { display: none; }
  .nav-toggle { display: inline-block; }
  .hero { padding: 120px 0 54px; }
  .hero-title { font-size: clamp(2.2rem, 10.5vw, 3.1rem); }
  .feature-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .list-grid { grid-template-columns: 1fr; }
  .case-main { grid-template-columns: 1fr; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .preloader-cell { padding: 16px; }
  .preloader-logo { font-size: 0.82rem; }
  .preloader-percent { font-size: 1.4rem; }
  .preloader-card { display: none; }
  .preloader-grid { grid-template-rows: 1fr 1fr; }
}