/* ===== Theme ===== */
:root {
  --bg: #121212;
  --bg-2: #181818;
  --card: #1b1b1b;          /* same charcoal as the logo background */
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f2f2;
  --muted: #8e8e8e;
  --accent: #4a78ba;        /* Ferinlab blue (from the logo) */
  --accent-hover: #6a95d3;
  --accent-ink: #ffffff;
  --font: "Switzer", system-ui, sans-serif;              /* same as the Framer site */
  --brand-font: "all-round-gothic", "Varela Round", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pad: clamp(16px, 5vw, 64px);
  --radius: 6px;            /* cards / panels */
  --r-sm: 4px;              /* buttons, chips, pills */
}

/* FERINLAB wordmark: All Round Gothic Oblique */
.brand { font-family: var(--brand-font); font-style: italic; font-weight: 400; letter-spacing: .06em; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.loading { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* subtle film grain */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== Loader ===== */
.loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: grid; place-content: center; gap: 18px; justify-items: center;
  transition: clip-path 1s var(--ease) .1s; clip-path: inset(0 0 0 0);
}
.loader-mark { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; font-size: 18px; color: var(--text); }
.loader-bar { z-index: 1; }

/* tiny "lab" sketches behind the loader: 25% lighter than the background */
.loader-art { --sketch: color-mix(in srgb, var(--bg), #fff 25%); position: absolute; inset: 0; pointer-events: none; color: var(--sketch); }
.loader-art > * { position: absolute; }
.loader-art svg { overflow: visible; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.loader-art .draw { stroke-dasharray: 260; stroke-dashoffset: 260; animation: sketch 1.6s var(--ease) forwards; }
.loader-art .d2 { animation-delay: .25s; } .loader-art .d3 { animation-delay: .5s; }
@keyframes sketch { to { stroke-dashoffset: 0; } }
.loader-art .node { fill: currentColor; stroke: none; opacity: 0; animation: blip 1.4s ease-in-out .9s infinite; }
@keyframes blip { 50% { opacity: 1; } }
.la-1 { top: 18%; left: 12%; width: 96px; }
.la-2 { top: 20%; right: 12%; width: 120px; }
.la-3 { bottom: 20%; left: 14%; width: 110px; }
.la-4 { bottom: 18%; right: 14%; width: 70px; }
.la-tc { top: calc(20% + 34px); right: 12%; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; color: var(--sketch); }
.la-3 .wave { animation: wave 1.2s linear infinite; }
@keyframes wave { to { transform: translateX(-40px); } }
.la-2 .playhead { animation: play 1.8s cubic-bezier(.45,0,.55,1) forwards; }
@keyframes play { from { transform: translateX(0); } to { transform: translateX(112px); } }
@media (max-width: 600px) { .la-1, .la-3 { left: 6%; } .la-2, .la-4, .la-tc { right: 6%; } }
.loader-bar { width: 140px; height: 2px; background: var(--line); position: relative; overflow: hidden; border-radius: 2px; }
.loader-bar::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateX(-100%); animation: load 1s var(--ease) forwards; }
@keyframes load { to { transform: translateX(0); } }
body.loaded .loader { clip-path: inset(0 0 100% 0); }

/* ===== Cursor glow (desktop only) ===== */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 480px; height: 480px; margin: -240px 0 0 -240px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(74,120,186,.14), transparent 60%);
  transform: translate3d(-500px,-500px,0); transition: opacity .4s;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ===== Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--pad);
  transition: background .4s, backdrop-filter .4s, transform .5s var(--ease), padding .4s;
}
.nav.scrolled { background: rgba(18,18,18,.75); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-block: 12px; border-bottom: 1px solid var(--line); }
.nav.hide { transform: translateY(-100%); }
.nav-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; }
.nav-logo img { width: 22px; height: auto; transition: transform .5s var(--ease); }
.nav-logo:hover img { transform: translateY(2px); }
.nav-links { display: flex; gap: 32px; align-items: center; font-size: 15px; }
.nav-links a { position: relative; color: var(--muted); transition: color .3s; }
.nav-links a:hover { color: var(--text); }
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { color: var(--text) !important; border: 1px solid var(--line); padding: 8px 18px; border-radius: var(--r-sm); transition: background .3s, color .3s, border-color .3s !important; }
.nav-cta:hover { background: var(--accent); color: var(--accent-ink) !important; border-color: var(--accent); }
.nav-toggle { display: none; width: 40px; height: 40px; position: relative; }
.nav-toggle span { position: absolute; left: 9px; right: 9px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .4s var(--ease), top .4s var(--ease); }
.nav-toggle span:first-child { top: 15px; } .nav-toggle span:last-child { top: 23px; }
.nav.open .nav-toggle span:first-child { top: 19px; transform: rotate(45deg); }
.nav.open .nav-toggle span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; z-index: 2; }
  .nav-links {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 28px;
    background: var(--bg); font-size: 28px; clip-path: circle(0 at calc(100% - 40px) 38px);
    transition: clip-path .7s var(--ease);
  }
  .nav.open .nav-links { clip-path: circle(150% at calc(100% - 40px) 38px); }
  .nav-links a { color: var(--text); }
}

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100svh; display: flex; align-items: center;
  padding: 120px var(--pad) 80px; overflow: hidden;
}
.hero-inner { position: relative; z-index: 1; max-width: 1100px; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 6px 14px; border-radius: var(--r-sm); margin: 0 0 28px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(74,120,186,.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(74,120,186,0); } 100% { box-shadow: 0 0 0 0 rgba(74,120,186,0); } }

.hero-title { font-weight: 500; font-size: clamp(34px, 5vw, 76px); line-height: .98; letter-spacing: -.03em; margin: 0 0 28px; }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); }
.hero-title .line:nth-child(2) > span { transition-delay: .1s; }
.hero-title .line:nth-child(3) > span { transition-delay: .2s; }
.loaded .hero-title .line > span { transform: none; }
.hero-title .muted { color: var(--muted); }
.hero-sub { max-width: 560px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); margin: 0 0 32px; }
.hero-sub strong { color: var(--text); font-weight: 400; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.scroll-hint { position: absolute; bottom: 32px; left: 50%; width: 24px; height: 40px; margin-left: -12px; border: 1px solid var(--line); border-radius: 4px; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); animation: scrolly 1.8s var(--ease) infinite; }
@keyframes scrolly { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 26px; border-radius: var(--r-sm); font-size: 15px; transition: background .3s, color .3s, border-color .3s, transform .4s var(--ease); will-change: transform; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--text); }

/* ===== Sections ===== */
.section { position: relative; padding: clamp(80px, 12vw, 160px) var(--pad); max-width: 1400px; margin: 0 auto; }
.section-head { margin-bottom: 48px; }
.label { font-family: var(--mono); font-size: 13px; color: var(--accent-hover); letter-spacing: .04em; margin: 0 0 14px; text-transform: uppercase; }
h2 { font-weight: 500; font-size: clamp(34px, 5.5vw, 72px); line-height: 1.05; letter-spacing: -.02em; margin: 0; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Filters ===== */
.filters, .side-switch { position: relative; display: inline-flex; gap: 4px; padding: 5px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 40px; background: var(--bg-2); }
.filter { position: relative; z-index: 1; padding: 9px 20px; border-radius: var(--r-sm); font-size: 15px; color: var(--muted); transition: color .4s; }
.filter.active { color: var(--accent-ink); }
.filter-pill { position: absolute; top: 5px; bottom: 5px; left: 0; border-radius: var(--r-sm); background: var(--accent); transition: transform .5s var(--ease), width .5s var(--ease); }

/* ===== Project grid ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 24px; }
.card {
  position: relative; display: flex; flex-direction: column; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .6s var(--ease), border-color .4s, opacity .5s var(--ease);
}
.card:hover { border-color: rgba(74,120,186,.35); }
.card.hidden { display: none; }
.card.fade { opacity: 0; transform: scale(.96); }
.card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-2); }
.card-media img, .card-media video { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.05); }
.ph { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.ph svg { width: 70%; height: 70%; opacity: .55; transition: transform 1s var(--ease), opacity .5s; }
.card:hover .ph svg { transform: scale(1.08) rotate(-2deg); opacity: .9; }
.ph.content { background: radial-gradient(120% 120% at 100% 0%, rgba(74,120,186,.12), transparent 50%), var(--bg-2); }
.ph.engineering { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; background-color: var(--bg-2); }
.card-body { padding: 22px 24px 26px; display: grid; gap: 8px; }
.card-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.card-meta .tag { color: var(--accent); }
.card h3 { margin: 0; font-weight: 400; font-size: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card h3 .arrow { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 16px; transition: background .4s, color .4s, transform .5s var(--ease); }
.card:hover h3 .arrow { background: var(--accent); color: var(--accent-ink); transform: rotate(45deg); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ===== Logo animations ===== */
.logos { margin-top: clamp(64px, 9vw, 112px); }
.logos.hidden { display: none; }
.logos-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.logos-head h3 { margin: 0; font-weight: 500; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.01em; }
.logos-head .label { margin: 0; }
.logo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.logo-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: opacity .9s var(--ease), transform .9s var(--ease), border-color .4s; }
.logo-tile.wide { grid-column: span 3; aspect-ratio: auto; }
.logo-tile.wide video { object-fit: contain; }
.logo-tile video { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.logo-tile:hover { border-color: rgba(74,120,186,.6); }
.logo-tile:hover video { transform: scale(1.04); }
.logo-name {
  position: absolute; left: 8px; bottom: 8px; font-size: 12px; padding: 4px 9px; border-radius: var(--r-sm);
  background: rgba(18,18,18,.82); color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .45s var(--ease);
}
.logo-tile:hover .logo-name, .logo-tile:focus-visible .logo-name { opacity: 1; transform: none; }
@media (hover: none) { .logo-name { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .logo-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad); gap: 10px; margin-inline: calc(var(--pad) * -1); padding: 0 var(--pad) 8px; scrollbar-width: none; }
  .logo-grid::-webkit-scrollbar { display: none; }
  .logo-tile { flex: 0 0 44vw; height: 44vw; aspect-ratio: auto; scroll-snap-align: start; }
  .logo-tile.wide { flex-basis: 88vw; }
}

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-text p { font-size: clamp(17px, 1.6vw, 21px); color: var(--muted); margin: 0 0 20px; }
.about-text strong { color: var(--text); font-weight: 400; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stats li { background: var(--bg); padding: 24px 28px; display: grid; grid-template-columns: auto 1fr; align-items: baseline; }
.stat-num, .stat-plus { font-size: 52px; line-height: 1; color: var(--text); }
.stat-plus { color: var(--accent); }
.stat-label { grid-column: 1 / -1; color: var(--muted); font-size: 14px; margin-top: 6px; }
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); }
.skills h3 { font-weight: 400; font-size: 20px; margin: 0 0 16px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { font-size: 14px; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--muted); transition: color .3s, border-color .3s; }
.chips li:hover { color: var(--text); border-color: var(--accent); }
@media (max-width: 860px) { .about-grid, .skills { grid-template-columns: 1fr; } }

/* ===== Services ===== */
.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.services li {
  position: relative; display: grid; grid-template-columns: 70px 1fr 1fr; align-items: center; gap: 16px;
  padding: 28px 0; border-bottom: 1px solid var(--line); overflow: hidden;
}
.services li::before { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease); z-index: -1; }
.services li:hover::before { transform: scaleY(1); }
.services li > * { transition: color .4s, transform .5s var(--ease); }
.services li:hover > * { color: var(--accent-ink); }
.services li:hover .name { transform: translateX(14px); }
.services .num { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-left: 8px; }
.services .name { font-size: clamp(22px, 3vw, 38px); }
.services .desc { color: var(--muted); font-size: 15px; text-align: right; padding-right: 8px; }
@media (max-width: 700px) {
  .services li { grid-template-columns: 44px 1fr; }
  .services .desc { grid-column: 2; text-align: left; padding: 0; }
}
.clients { margin-top: 72px; }
.clients ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: clamp(20px, 2.6vw, 30px); color: var(--muted); }
.clients li { transition: color .3s; }
.clients li:hover { color: var(--text); }

/* ===== Contact ===== */
.contact { text-align: center; padding-bottom: 120px; }
.contact-title { font-size: clamp(64px, 16vw, 220px); line-height: .9; letter-spacing: -.04em; margin: 8px 0 36px; }
.contact-mail { display: inline-block; font-size: clamp(20px, 3.4vw, 40px); border-bottom: 1px solid var(--line); padding-bottom: 6px; transition: color .3s, border-color .3s; }
.contact-mail:hover { color: var(--accent); border-color: var(--accent); }
.socials { list-style: none; padding: 0; margin: 48px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.socials a { display: inline-block; padding: 10px 20px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 15px; color: var(--muted); transition: color .3s, border-color .3s; }
.socials a:hover { color: var(--text); border-color: var(--text); }

.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 28px var(--pad); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer a:hover { color: var(--accent); }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transition: opacity .5s var(--ease); }
.modal-panel {
  position: relative; width: min(820px, 100%); max-height: 90svh; overflow: auto; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  opacity: 0; transform: translateY(40px) scale(.97); transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-panel { opacity: 1; transform: none; }
.modal-media { position: relative; background: #000; display: grid; place-items: center; min-height: 200px; }
.modal-media .ph { position: relative; width: 100%; aspect-ratio: 16/9; }
.modal-media img, .modal-media video { width: 100%; height: auto; max-height: 68svh; object-fit: contain; }
.modal-body { padding: 28px clamp(20px, 4vw, 40px) 36px; display: grid; gap: 14px; justify-items: start; }
.modal-body h3 { font-weight: 400; font-size: clamp(26px, 4vw, 40px); margin: 0; line-height: 1.1; }
.modal-body p { margin: 0; color: var(--muted); white-space: pre-line; }
.modal-media img { transition: opacity .25s; }
.modal-thumbs { display: flex; gap: 8px; padding: 12px clamp(20px, 4vw, 40px) 0; }
.modal-thumbs[hidden] { display: none; }
.thumb { width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); opacity: .55; transition: opacity .3s, border-color .3s; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { opacity: .85; }
.thumb.active { opacity: 1; border-color: var(--accent); }
.modal-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: var(--r-sm); background: rgba(18,18,18,.7); border: 1px solid var(--line); font-size: 24px; line-height: 1; transition: transform .4s var(--ease), background .3s; }
.modal-close:hover { transform: rotate(90deg); background: var(--accent); color: var(--accent-ink); }

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* popup media swap + video thumbnail badge */
.modal-media > img, .modal-media > video { transition: opacity .2s; animation: mediaIn .35s var(--ease); }
@keyframes mediaIn { from { opacity: 0; } }
.thumb { position: relative; }
.thumb.is-video::after {
  content: ""; position: absolute; left: 50%; top: 50%; margin: -7px 0 0 -5px;
  border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}

/* ===== Service: content system ===== */
.service-intro { max-width: 760px; margin: -12px 0 48px; }
.service-intro p { margin: 0 0 10px; font-size: clamp(18px, 1.8vw, 22px); color: var(--muted); }
.service-intro .muted-line { color: var(--accent-hover); font-size: 16px; }
.perks { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.perks li { display: grid; gap: 6px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); transition: border-color .4s, transform .6s var(--ease), opacity .9s var(--ease); }
.perks li:hover { border-color: rgba(74,120,186,.5); }
.perk-title { font-size: 19px; color: var(--text); }
.perk-desc { font-size: 15px; color: var(--muted); }
.service-cta { margin-top: 36px; }
@media (max-width: 760px) { .perks { grid-template-columns: 1fr; } }

/* ===== Two sides: home chooser, engineering, content ===== */
[hidden] { display: none !important; }
main { transition: opacity .3s var(--ease), transform .4s var(--ease); }
main.switching { opacity: 0; transform: translateY(14px); }
.hero-inner { width: 100%; max-width: 1400px; }

/* the two doors */
.doors { display: flex; gap: 12px; height: clamp(240px, 38vh, 400px); }
.door {
  position: relative; flex: 1; min-width: 0; overflow: hidden; display: flex; align-items: flex-end;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  transition: flex .7s var(--ease), border-color .4s;
}
.doors:hover .door { flex: .8; }
.doors .door:hover, .doors .door:focus-visible { flex: 1.35; border-color: rgba(74,120,186,.6); }
.door video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.42) saturate(.6); transform: scale(1.02); transition: filter .7s var(--ease), transform 1.2s var(--ease); }
.door:hover video, .door:focus-visible video { filter: brightness(.62) saturate(1); transform: scale(1.06); }
.door-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(18,18,18,.92) 0%, rgba(18,18,18,.35) 55%, rgba(18,18,18,.1) 100%); }
.door-body { position: relative; display: grid; gap: 8px; padding: clamp(20px, 3vw, 32px); }
.door-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-hover); }
.door-title { font-size: clamp(24px, 2.8vw, 38px); line-height: 1.08; letter-spacing: -.01em; font-weight: 500; }
.door-desc { color: var(--muted); font-size: 15px; max-width: 420px; }
.door-cta { margin-top: 6px; font-size: 15px; display: inline-flex; gap: 8px; align-items: center; }
.door-cta span { transition: transform .5s var(--ease); }
.door:hover .door-cta span { transform: translateX(6px); }
@media (max-width: 760px) {
  .doors { flex-direction: column; height: auto; }
  .door, .doors:hover .door, .doors .door:hover { flex: none; height: 230px; }
}

/* top of each side */
.side-top { padding-top: clamp(110px, 14vw, 150px); }
.side-switch { margin-bottom: 40px; }
.side-switch .filter { display: inline-block; }
.side-intro { max-width: 620px; color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); margin: 16px 0 0; }

/* nav: current side */
.nav-links a.current { color: var(--text); }
.nav-links a.current::after { transform: scaleX(1); }

/* cross-link to the other side */
.crosslink { padding-block: 24px; }
.crosslink-card {
  display: grid; gap: 10px; padding: clamp(28px, 5vw, 56px); border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); transition: border-color .4s, background .4s, opacity .9s var(--ease), transform .9s var(--ease);
}
.crosslink-card .label { margin: 0; }
.crosslink-title { font-size: clamp(26px, 4vw, 52px); letter-spacing: -.02em; font-weight: 500; }
.crosslink-title span { display: inline-block; transition: transform .5s var(--ease); }
.crosslink-card:hover { border-color: rgba(74,120,186,.6); background: #1d2430; }
.crosslink-card:hover .crosslink-title span { transform: translateX(10px); }

/* footer back-to-top button */
.to-top { color: var(--muted); font-size: 14px; transition: color .3s; }
.to-top:hover { color: var(--accent); }
