/* ===== Einstein Web — "Everything Is Particles" =====
   Light, airy, brand blue + cyan over white. A fixed WebGL canvas sits
   behind the content; sections are glass cards floating above it.
   Logical properties throughout so RTL (he) and LTR (en) both work. */

:root {
  --blue: #1763aa;
  --cyan: #01a0c6;
  --ink: #0e2a47;
  --muted: #4f6783;
  --bg: #ffffff;
  --tint: #f2f8fc;
  --line: rgba(14, 42, 71, 0.12);
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 50px rgba(23, 99, 170, 0.12);
  --grad: linear-gradient(110deg, var(--blue), var(--cyan));
  --font-display: 'Secular One', sans-serif;
  --font-body: 'Heebo', sans-serif;
  --radius: 18px;
  --z-canvas: 0;
  --z-content: 1;
  --z-nav: 50;
  --z-progress: 60;
}

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

/* the hidden attribute must always win, whatever display we set */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

html { overflow-x: clip; }

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background:
    radial-gradient(ellipse 1000px 700px at 85% -5%, rgba(1, 160, 198, 0.08), transparent 60%),
    radial-gradient(ellipse 900px 700px at 5% 105%, rgba(23, 99, 170, 0.07), transparent 60%),
    var(--bg);
  overflow-x: hidden;
}

.container {
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

::selection { background: var(--cyan); color: #fff; }

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

/* ===== 3D canvas ===== */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-canvas);
  pointer-events: none;
}

/* Fallback for machines without WebGL (or with reduced motion): a soft
   field of brand-blue dots down the left/right edges, echoing the
   particles. Hidden once the live scene declares itself with .has-scene. */
.scene-fallback {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
  background-image: radial-gradient(rgba(1, 160, 198, 0.22) 1.1px, transparent 1.7px);
  background-size: 20px 20px;
  opacity: 0.6;
  -webkit-mask-image: linear-gradient(90deg, #000 0 13%, transparent 30% 70%, #000 87% 100%);
          mask-image: linear-gradient(90deg, #000 0 13%, transparent 30% 70%, #000 87% 100%);
}

html.has-scene .scene-fallback { display: none; }

/* Animated 2D particle fallback (no WebGL, motion allowed). Masked so the
   particles frame the content and stay clear of the central text. */
#scene2d {
  position: fixed;
  inset: 0;
  z-index: var(--z-canvas);
  pointer-events: none;
  display: none;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 45%, transparent 30%, #000 82%);
          mask-image: radial-gradient(ellipse 62% 58% at 50% 45%, transparent 30%, #000 82%);
}

html.has-fallback-2d #scene2d { display: block; }
html.has-fallback-2d .scene-fallback { display: none; }

main, .footer { position: relative; z-index: var(--z-content); }

/* ===== Scroll progress ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: var(--z-progress);
  background: transparent;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: var(--origin-start, right);
}

[dir="ltr"] .scroll-progress span { transform-origin: left; }
[dir="rtl"] .scroll-progress span { transform-origin: right; }

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 5rem;
}

.logo { display: inline-flex; align-items: center; }
.logo img { display: block; height: 3.1rem; width: auto; }

.nav-links { display: flex; gap: 1.75rem; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.97rem;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--blue); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-toggle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lang-toggle:hover { color: var(--blue); border-color: var(--blue); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--grad);
  border: none;
  border-radius: 12px;
  padding: 0.85rem 2rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(23, 99, 170, 0.25);
  transition: box-shadow 0.25s ease, filter 0.25s ease;
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(1, 160, 198, 0.35);
}

.btn-small { padding: 0.5rem 1.2rem; font-size: 0.9rem; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--blue);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 18px rgba(23, 99, 170, 0.12);
  filter: none;
}

.btn-big {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  padding: 1.1rem 2.5rem;
  direction: ltr;
}

/* ===== Type ===== */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.22;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-block-end: 1rem; }
h3 { font-size: 1.2rem; margin-block-end: 0.35rem; }

.kicker {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cyan);
  background: rgba(1, 160, 198, 0.1);
  border-radius: 100px;
  padding: 0.25rem 0.9rem;
  margin-block-end: 1.1rem;
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 36rem;
}

.hl {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Panels (full-height scroll sections) ===== */
.panel {
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-block: clamp(4rem, 8vw, 6rem);
  position: relative;
}

/* .container is a flex item inside .panel — keep it full width so
   side-layout justification actually has room to work */
.panel > .container { width: 100%; }

/* Hero */
.hero { min-height: calc(100vh - 5rem); }

.hero-inner { width: 100%; }

.hero-copy {
  max-width: 34rem;
  position: relative;
}

/* soft white halo keeps hero text readable over the particles */
.hero-copy::before {
  content: '';
  position: absolute;
  inset: -2.5rem;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.55) 60%, rgba(255, 255, 255, 0));
  z-index: -1;
  border-radius: 50%;
}

.hero-copy h1 { margin-block-end: 1.3rem; }
.hero-copy .lead { margin-block-end: 2.3rem; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.scroll-hint {
  position: absolute;
  bottom: 1.8rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

[dir="rtl"] .scroll-hint { transform: translateX(50%); }

.scroll-hint svg { width: 1.2rem; height: 1.2rem; animation: hint-bob 2s ease-in-out infinite; }

@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Content cards floating over the canvas */
.side-layout { display: flex; }

.side-layout.side-end { justify-content: flex-end; }

.content-card {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.8rem, 4vw, 3rem);
  max-width: 38rem;
}

.content-card.center {
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 1.8rem;
  margin-block-start: 1.4rem;
}

.mini h3 { color: var(--blue); }
.mini p { color: var(--muted); font-size: 0.95rem; }

/* ===== Projects ===== */
.projects .lead { margin-block-end: 2.4rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.project-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 6px 24px rgba(14, 42, 71, 0.07);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.project-card:hover {
  border-color: rgba(1, 160, 198, 0.5);
  box-shadow: 0 16px 44px rgba(23, 99, 170, 0.18);
  transform: translateY(-4px);
}

.project-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 880 / 550;
  object-fit: cover;
  border-block-end: 1px solid var(--line);
}

.project-meta { padding: 1rem 1.2rem 1.1rem; }

.project-meta h3 { font-size: 1.05rem; }

.project-meta p { color: var(--muted); font-size: 0.85rem; }

/* ===== Process steps ===== */
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem 1.8rem;
  margin-block-start: 1.4rem;
}

.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #fff;
  background: var(--grad);
  border-radius: 8px;
  padding: 0.1rem 0.6rem;
  margin-block-end: 0.6rem;
}

.steps p { color: var(--muted); font-size: 0.95rem; }

/* ===== Contact ===== */
.contact-inner { width: 100%; }
.contact .lead { margin-block-end: 2.2rem; }

/* Reviews — stacked column beside the star */
.reviews-col { width: 100%; max-width: none; }

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

@media (max-width: 62rem) { .review-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 40rem) { .review-grid { grid-template-columns: 1fr; } }

.review-card {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.review-stars {
  color: var(--cyan);
  letter-spacing: 0.15em;
  font-size: 1.05rem;
  margin-block-end: 0.8rem;
}

.review-card blockquote {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.65;
  flex: 1;
  margin-block-end: 1rem;
}

.review-card figcaption { color: var(--muted); font-size: 0.88rem; font-weight: 500; }

.reviews-more { margin-block-start: 1.8rem; }

.reviews-more a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.reviews-more a:hover { color: var(--cyan); }

/* ===== Technologies ===== */
/* Sized to its content (like the team section) so it stays tidy whether
   the grid is empty or full. Add .tech-card tiles in index.html. */
#tech.panel { min-height: auto; padding-block: clamp(5rem, 12vh, 9rem); }
#tech .container { text-align: center; }

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 1rem;
  max-width: 58rem;
  margin-inline: auto;
}

.tech-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(14, 42, 71, 0.06);
  padding: 1.5rem 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tech-card:hover {
  transform: translateY(-4px);
  border-color: rgba(1, 160, 198, 0.45);
  box-shadow: 0 18px 40px rgba(23, 99, 170, 0.14);
}

.tech-logo { width: 3rem; height: 3rem; object-fit: contain; }

.tech-name { font-weight: 600; font-size: 0.95rem; color: var(--ink); }

/* ===== Team ===== */
/* The team content is short (3 cards), so a full 92vh panel leaves large
   empty gaps above and below it. Size this section to its content with
   comfortable padding so the cards sit as the centered focus. */
#team.panel { min-height: auto; padding-block: clamp(5rem, 12vh, 9rem); }
#team .container { text-align: center; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
  max-width: 54rem;
  margin-inline: auto;
}

.team-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(14, 42, 71, 0.08);
  padding: 2.5rem 1.4rem 2.1rem;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.team-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 4px;
  background: var(--grad);
}

.team-card:hover {
  transform: translateY(-6px);
  border-color: rgba(1, 160, 198, 0.45);
  box-shadow: 0 22px 50px rgba(23, 99, 170, 0.16);
}

.team-avatar {
  display: inline-grid;
  place-items: center;
  width: 8.1rem;
  height: 8.1rem;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.45rem;
  letter-spacing: 0.03em;
  margin-block-end: 1.1rem;
  box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(1, 160, 198, 0.35);
}

/* Photo avatars: keep the same circular size + ring, fill with the image.
   Greyscale by default, full colour when the card is hovered. */
.team-avatar--photo {
  background-color: #fff;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  filter: grayscale(1);
  transition: filter 0.35s ease;
}

.team-card:hover .team-avatar--photo,
.team-card:focus-within .team-avatar--photo { filter: grayscale(0); }

.team-card h3 { font-size: 1.25rem; margin-block-end: 0.55rem; }

.team-card p {
  display: inline-block;
  background: rgba(1, 160, 198, 0.1);
  color: var(--blue);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.3rem 0.95rem;
  border-radius: 100px;
}

@media (max-width: 48rem) {
  .team-grid { grid-template-columns: 1fr; max-width: 22rem; }
}

/* ===== Contact form ===== */
.contact-form {
  width: 100%;
  max-width: 26rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: start;
}

.field { display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }

.field-row { display: flex; gap: 1rem; }

.field label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
}

.field input {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 99, 170, 0.15);
}

.btn-form { width: 100%; margin-block-start: 0.3rem; }

.contact-direct {
  margin-block-start: 1.4rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.contact-direct a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.contact-direct a:hover { color: var(--cyan); }

@media (max-width: 36rem) {
  .field-row { flex-direction: column; gap: 1rem; }
}

/* ===== Footer ===== */
.footer {
  border-block-start: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-block: 1.6rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-inner a:hover { color: var(--blue); }

/* ===== Scroll reveal (only when JS opts in) ===== */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js-reveal .reveal.in { opacity: 1; transform: none; }

.js-reveal .d1 { transition-delay: 0.1s; }
.js-reveal .d2 { transition-delay: 0.2s; }
.js-reveal .d3 { transition-delay: 0.3s; }

/* ===== Fancy entrances: project & review cards ===== */
.js-reveal .project-card.reveal,
.js-reveal .review-card.reveal {
  transform: none;
  transition: none;
}

.js-reveal .project-card.reveal.in {
  opacity: 1;
  animation: card-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.js-reveal .review-card.reveal.in {
  opacity: 1;
  animation: card-deal-a 0.7s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.js-reveal .review-card.reveal.in:nth-child(even) {
  animation-name: card-deal-b;
}

.js-reveal .project-card.reveal.in.d1,
.js-reveal .review-card.reveal.in.d1 { animation-delay: 0.14s; }
.js-reveal .project-card.reveal.in.d2,
.js-reveal .review-card.reveal.in.d2 { animation-delay: 0.28s; }
.js-reveal .project-card.reveal.in.d3,
.js-reveal .review-card.reveal.in.d3 { animation-delay: 0.42s; }

@keyframes card-rise {
  from {
    opacity: 0;
    transform: perspective(900px) rotateX(14deg) translateY(46px) scale(0.95);
    filter: blur(6px);
  }
  60% { filter: blur(0); }
  to {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes card-deal-a {
  from { opacity: 0; transform: translateY(44px) rotate(-3deg) scale(0.93); }
  to { opacity: 1; transform: none; }
}

@keyframes card-deal-b {
  from { opacity: 0; transform: translateY(44px) rotate(3deg) scale(0.93); }
  to { opacity: 1; transform: none; }
}

/* ===== Browser-in-browser preview modal ===== */
.browser-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(0.5rem, 3vw, 2.5rem);
}

.browser-modal[hidden] { display: none; }

.bm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(238, 246, 251, 0.55);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bm-window {
  position: relative;
  width: min(1200px, 100%);
  height: min(46rem, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 40px 120px rgba(23, 99, 170, 0.3), 0 8px 30px rgba(14, 42, 71, 0.15);
  overflow: hidden;
  opacity: 0;
  transform: translateY(34px) scale(0.95);
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.browser-modal.open .bm-backdrop { opacity: 1; }
.browser-modal.open .bm-window { opacity: 1; transform: none; }

/* chrome bar — physical layout; dots left in Hebrew, right in English */
.bm-chrome {
  direction: ltr;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 3.3rem;
  padding-inline: 1rem;
  background: linear-gradient(#ffffff, #f6fafd);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

html[dir="ltr"] .bm-chrome { flex-direction: row-reverse; }

.bm-dots { display: inline-flex; gap: 7px; }

.bm-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.bm-dots i:nth-child(1) { background: #ff5f57; }
.bm-dots i:nth-child(2) { background: #febc2e; }
.bm-dots i:nth-child(3) { background: #28c840; }

.bm-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
}

.bm-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

.bm-domain {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 30rem;
  margin-inline: auto;
  background: #eef4f9;
  border-radius: 100px;
  padding: 0.4rem 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.bm-domain svg { width: 0.85rem; height: 0.85rem; flex-shrink: 0; color: #16a34a; }

.bm-domain span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bm-actions { display: inline-flex; gap: 0.3rem; }

.bm-btn {
  display: inline-grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.bm-btn:hover { background: rgba(23, 99, 170, 0.08); color: var(--blue); }

.bm-btn svg { width: 1.15rem; height: 1.15rem; }

.bm-body { position: relative; flex: 1; background: #fff; }

.bm-body iframe {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  transform-origin: top left;
  background: #fff;
}

.bm-loading, .bm-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: #fff;
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.bm-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(23, 99, 170, 0.15);
  border-top-color: var(--cyan);
  animation: bm-spin 0.9s linear infinite;
}

@keyframes bm-spin { to { transform: rotate(360deg); } }

/* lock must sit on html: body overflow no longer propagates to the
   viewport because html has overflow-x: clip */
html.bm-lock, html.bm-lock body { overflow: hidden; }

@media (max-width: 48rem) {
  .browser-modal { padding: 0; }
  .bm-window { width: 100%; height: 100%; border-radius: 0; border: none; }
  .bm-live span:last-child { display: none; }
  .bm-domain { max-width: 14rem; }
}

/* ===== Accessibility menu ===== */
.a11y {
  position: fixed;
  bottom: 1.2rem;
  inset-inline-end: 1.2rem;
  z-index: 90;
}

.a11y-toggle {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: none;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(23, 99, 170, 0.35);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.a11y-toggle:hover { filter: brightness(1.1); box-shadow: 0 12px 30px rgba(1, 160, 198, 0.45); }

.a11y-toggle svg { width: 1.7rem; height: 1.7rem; }

.a11y-panel {
  position: absolute;
  bottom: calc(100% + 0.7rem);
  inset-inline-end: 0;
  width: 19rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(14, 42, 71, 0.25);
  padding: 1.1rem;
}

.a11y-title {
  font-weight: 700;
  color: var(--ink);
  margin-block-end: 0.8rem;
  font-size: 0.95rem;
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.a11y-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.4rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.a11y-grid button:hover { border-color: var(--blue); }

.a11y-grid button[aria-pressed="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.a11y-ico { font-size: 1.05rem; line-height: 1; }

.a11y-statement {
  display: block;
  margin-block-start: 0.8rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
}

.a11y-statement:hover { color: var(--cyan); }

/* --- accessibility modes (classes on <html>) --- */
html.a11y-fontsize { font-size: 125%; }

html.a11y-contrast {
  --ink: #000000;
  --muted: #1f2a37;
  --line: rgba(0, 0, 0, 0.4);
  --glass: #ffffff;
}

html.a11y-contrast body { background: #fff; }

/* filter the page containers, never body: a filter on body re-anchors
   all fixed-position elements and throws them off-screen */
html.a11y-grayscale main,
html.a11y-grayscale .nav,
html.a11y-grayscale .footer,
html.a11y-grayscale #scene,
html.a11y-grayscale .scroll-progress,
html.a11y-grayscale .browser-modal { filter: grayscale(1); }

html.a11y-links a { text-decoration: underline !important; }

html.a11y-readable body {
  letter-spacing: 0.035em;
  word-spacing: 0.12em;
}

html.a11y-readable p,
html.a11y-readable li { line-height: 1.95; }

html.a11y-nomotion *,
html.a11y-nomotion *::before,
html.a11y-nomotion *::after {
  animation: none !important;
  transition: none !important;
}

html.a11y-nomotion { scroll-behavior: auto; }
html.a11y-nomotion #scene { display: none; }
html.a11y-nomotion .reveal { opacity: 1 !important; transform: none !important; }

html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 24 24'><path d='M5 2l14 12-6 1 3.5 6-2.5 1.5L10.5 16 6 20z' fill='black' stroke='white' stroke-width='1.5'/></svg>") 4 2, auto !important;
}

@media (max-width: 36rem) {
  .a11y-panel { width: min(19rem, calc(100vw - 2.4rem)); }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #scene { display: none; }
  .scroll-hint svg { animation: none; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

/* ===== Responsive ===== */
@media (max-width: 64rem) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 48rem) {
  .nav-links { display: none; }
  .panel { min-height: 0; }
  .hero { min-height: 88vh; }
  .hero-copy {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
  }
  .mini-grid, .steps { grid-template-columns: 1fr; }
  .content-card { max-width: none; }
}

@media (max-width: 36rem) {
  .project-grid { grid-template-columns: 1fr; }
}
