/* Rafael Bashan portfolio
   Navy and blue to match the GitHub profile, LinkedIn cards and version 2.
   Green is reserved for "booked" / success moments only. */

:root {
  --navy-950: #081326;
  --navy-900: #0c1a33;
  --navy-800: #132648;
  --navy-700: #1d3561;
  --blue: #3b82f6;
  --blue-strong: #2563eb;
  --blue-soft: #a9c8ff;
  --mist: #9fb0cc;
  --white: #f7f9fd;
  --paper: #eef3fc;
  --ink: #0f1b33;
  --ink-soft: #46597a;
  --line-dark: rgba(169, 200, 255, 0.14);
  --line-light: #d6e0f2;
  --green: #34d399;

  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.375rem;
  --step-3: 1.75rem;
  --step-4: 2.375rem;
  --step-5: clamp(2.5rem, 5.2vw, 3.75rem);

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--navy-900);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

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

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  z-index: 100;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  background: rgba(8, 19, 38, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-dark);
}

.site-header .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Kept from the original portfolio: the bouncing name */
.logo-name {
  display: flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--white);
}

.name-letter {
  display: inline-block;
  animation: bounce 2s infinite both;
}
.name-letter:nth-child(1) { animation-delay: 0.1s; }
.name-letter:nth-child(2) { animation-delay: 0.2s; }
.name-letter:nth-child(3) { animation-delay: 0.3s; }
.name-letter:nth-child(4) { animation-delay: 0.4s; }
.name-letter:nth-child(5) { animation-delay: 0.5s; }
.name-letter:nth-child(6) { animation-delay: 0.6s; }
.name-letter:nth-child(7) { animation-delay: 0.7s; }
.name-letter:nth-child(8) { animation-delay: 0.8s; }
.name-letter:nth-child(9) { animation-delay: 0.9s; }
.name-letter:nth-child(10) { animation-delay: 1s; }
.name-letter:nth-child(11) { animation-delay: 1.1s; }
.name-letter:nth-child(12) { animation-delay: 1.2s; }
.name-letter:nth-child(13) { animation-delay: 1.3s; }

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--mist);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--white); background: rgba(169, 200, 255, 0.08); }

.site-nav .nav-cta {
  margin-left: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}
.site-nav .nav-cta:hover { background: var(--blue-strong); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-dark);
  color: var(--white);
  border-radius: 10px;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  margin: 0 auto;
  position: relative;
  content: "";
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); }
.btn-ghost { border-color: rgba(169, 200, 255, 0.35); color: var(--white); background: transparent; }
.btn-ghost:hover { border-color: var(--blue-soft); }

/* ---------- Hero ---------- */

.hero {
  padding: calc(var(--header-h) + clamp(40px, 7vw, 88px)) 0 clamp(56px, 8vw, 96px);
  background:
    radial-gradient(900px 480px at 88% 8%, rgba(59, 130, 246, 0.22), transparent 60%),
    var(--navy-900);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero-hello {
  margin: 0 0 14px;
  color: var(--blue-soft);
  font-size: var(--step-1);
  font-weight: 500;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 22px;
  max-width: 14ch;
}

.hero-intro {
  margin: 0 0 30px;
  max-width: 56ch;
  color: #d4def0;
  font-size: var(--step-1);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }

.hire {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0 0 34px;
  color: var(--mist);
  font-size: var(--step--1);
}
.hire a { color: var(--white); font-weight: 600; text-underline-offset: 4px; text-decoration-color: rgba(169, 200, 255, 0.4); }
.hire a:hover { text-decoration-color: var(--blue-soft); }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line-dark);
}
.stats div { display: flex; align-items: baseline; gap: 10px; }
.stats dt { order: 2; color: var(--mist); font-size: var(--step--1); }
.stats dd { order: 1; margin: 0; font-family: var(--font-display); font-weight: 700; font-size: var(--step-3); }

/* Portrait with the live flow */
.hero-visual { position: relative; }

/* The v2 photo is already a circle on black, so the frame is a circle too */
.portrait {
  width: 82%;
  margin-inline: auto;
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--navy-800);
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.18), 0 0 0 1px rgba(169, 200, 255, 0.35);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }

/* Sits below the photo, never over it */
.flow {
  position: relative;
  margin: 28px 0 0;
  padding: 18px 20px;
  list-style: none;
  background: rgba(12, 26, 51, 0.94);
  border: 1px solid rgba(169, 200, 255, 0.22);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(4, 10, 22, 0.55);
}

.flow-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 6px 0;
  opacity: 0;
  transform: translateY(6px);
  animation: step-in 0.5s ease-out forwards;
}
.flow-step:nth-child(1) { animation-delay: 0.6s; }
.flow-step:nth-child(2) { animation-delay: 1.5s; }
.flow-step:nth-child(3) { animation-delay: 2.4s; }

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 28px;
  bottom: -8px;
  width: 2px;
  background: rgba(169, 200, 255, 0.25);
}

.flow-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: var(--navy-900);
  margin-top: 2px;
}
.flow-step.is-booked .flow-dot {
  background: var(--green);
  border-color: var(--green);
  display: grid;
  place-items: center;
}
.flow-step.is-booked .flow-dot::before {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid var(--navy-950);
  border-bottom: 2px solid var(--navy-950);
  transform: rotate(-45deg) translate(1px, -1px);
}

.flow-text { font-size: 0.95rem; line-height: 1.35; }
.flow-text b { display: block; font-weight: 600; color: var(--white); }
.flow-text span { color: var(--mist); font-size: 0.85rem; }
.flow-step.is-booked b { color: var(--green); }

@keyframes step-in { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-paper { background: var(--paper); color: var(--ink); }
.section-deep { background: var(--navy-950); }

.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
}
.section-head p { margin: 0; color: var(--mist); font-size: var(--step-1); }
.section-paper .section-head p { color: var(--ink-soft); }

/* Services */
.services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.service {
  padding: 26px 0;
  border-top: 1px solid var(--line-light);
}
.service h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.service p { margin: 0; color: var(--ink-soft); max-width: 52ch; }

.tools { margin-top: 48px; }
.tools h3 { font-size: var(--step-1); margin: 0 0 14px; color: var(--ink); }
.tool-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tool-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-light);
  font-weight: 600;
  font-size: 0.92rem;
}
.tool-list img { width: 20px; height: 20px; object-fit: contain; }

/* Work */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(169, 200, 255, 0.3);
  background: transparent;
  color: var(--mist);
  cursor: pointer;
}
.filter:hover { color: var(--white); border-color: var(--blue-soft); }
.filter[aria-pressed="true"] { background: var(--white); color: var(--ink); border-color: var(--white); }

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.project {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--navy-800);
  border: 1px solid var(--line-dark);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project[hidden] { display: none; }
.project-thumb {
  aspect-ratio: 16 / 10;
  background: var(--navy-700);
  overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.35s ease; }
.project-thumb.is-empty {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--blue-soft);
  padding: 18px;
  text-align: center;
  background:
    radial-gradient(280px 160px at 80% 0%, rgba(59, 130, 246, 0.35), transparent 70%),
    var(--navy-700);
}
.project-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 20px; flex: 1; }
.project-cat { font-size: 0.82rem; font-weight: 600; color: var(--blue-soft); }
.project h3 { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; margin: 0; }
.project-tools { margin: 0; color: var(--mist); font-size: 0.88rem; }
.project-soon { margin: auto 0 0; padding-top: 8px; color: var(--mist); font-size: 0.88rem; font-style: italic; }
.project-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--white);
  text-underline-offset: 4px;
  text-decoration-color: rgba(169, 200, 255, 0.45);
}
.project-link:hover { text-decoration-color: var(--blue-soft); }
/* The link stretches over its whole card, so a click anywhere on the card follows it */
.project-link::after { content: ""; position: absolute; inset: 0; }
.project-link:focus-visible { outline: none; }
.project:has(.project-link:focus-visible) { outline: 3px solid var(--blue-soft); outline-offset: 3px; }
.project:has(.project-link):hover { border-color: var(--blue); }
.project:has(.project-link):hover .project-link { text-decoration-color: var(--blue-soft); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project:hover,
  .project:has(.project-link:focus-visible) {
    transform: scale(1.03);
    box-shadow: 0 18px 44px rgba(4, 10, 22, 0.55);
    z-index: 2;
  }
  .project:hover .project-thumb img { transform: scale(1.06); }
}
.show-all { margin-top: 28px; }
.show-all[hidden] { display: none; }

/* Engagement models */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 18px;
  padding: 28px 26px;
}
.plan.is-recommended { border: 2px solid var(--blue); box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14); }
.plan-flag {
  position: absolute;
  top: -13px;
  left: 26px;
  background: var(--blue);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}
.plan h3 { font-family: var(--font-display); font-size: var(--step-2); margin: 0 0 4px; }
.plan-tagline { margin: 0 0 14px; color: var(--blue-strong); font-weight: 600; }
.plan-desc { margin: 0 0 18px; color: var(--ink-soft); }
.plan ul { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 8px; }
.plan li { position: relative; padding-left: 24px; font-size: 0.95rem; }
.plan li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 10px;
  height: 5px;
  border-left: 2px solid var(--blue);
  border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg);
}
.plan dl { margin: auto 0 0; padding-top: 16px; border-top: 1px solid var(--line-light); display: grid; gap: 6px; font-size: 0.92rem; }
.plan dl div { display: flex; gap: 6px; flex-wrap: wrap; }
.plan dt { font-weight: 700; }
.plan dd { margin: 0; color: var(--ink-soft); }
.plan .plan-price dd { color: var(--blue-strong); font-weight: 700; }
.plans-note { margin: 28px 0 0; color: var(--ink-soft); }
.plans-note a { color: var(--blue-strong); font-weight: 600; }

/* Experience: a real sequence, so it gets a timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 860px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: rgba(169, 200, 255, 0.2);
}
.role { position: relative; padding: 0 0 40px 40px; }
.role:last-child { padding-bottom: 0; }
.role::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy-950);
  border: 3px solid var(--blue);
}
.role.is-current::before { background: var(--blue); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.role h3 { font-family: var(--font-display); font-size: var(--step-2); margin: 0; }
.role-where { margin: 2px 0 0; color: var(--blue-soft); font-weight: 600; }
.role-when { color: var(--mist); font-size: 0.92rem; white-space: nowrap; }
.role ul { margin: 0 0 12px; padding-left: 18px; color: #d4def0; }
.role li { margin-bottom: 4px; }
.role-tools { margin: 0; color: var(--mist); font-size: 0.88rem; }

/* Testimonials */
.quotes { columns: 2 340px; column-gap: 24px; }
.quote {
  break-inside: avoid;
  margin: 0 0 24px;
  padding: 26px 26px 22px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line-light);
}
.quote blockquote { margin: 0 0 16px; font-size: 1.02rem; line-height: 1.6; }
.quote figcaption { font-size: 0.92rem; color: var(--ink-soft); }
.quote figcaption b { display: block; color: var(--ink); font-size: 1rem; }

/* Certifications */
.certs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.cert {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--navy-800);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.cert-img { aspect-ratio: 4 / 3; background: #fff; overflow: hidden; }
.cert-img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.35s ease; }
.cert-img.is-empty { display: grid; place-items: center; background: var(--navy-700); color: var(--blue-soft); font-weight: 700; padding: 16px; text-align: center; }
.cert-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cert h3 { font-size: 0.98rem; line-height: 1.3; margin: 0; font-weight: 700; }
.cert-issuer { margin: 0; color: var(--mist); font-size: 0.86rem; }
.cert a { margin-top: auto; padding-top: 8px; font-weight: 600; font-size: 0.9rem; color: var(--blue-soft); text-underline-offset: 4px; }
/* Same as the project cards: the link covers the whole card, so a click anywhere opens the credential */
.cert-link::after { content: ""; position: absolute; inset: 0; }
.cert-link:focus-visible { outline: none; }
.cert:has(.cert-link:focus-visible) { outline: 3px solid var(--blue-soft); outline-offset: 3px; }
.cert:has(.cert-link):hover { border-color: var(--blue); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cert:has(.cert-link):hover,
  .cert:has(.cert-link:focus-visible) {
    transform: scale(1.03);
    box-shadow: 0 18px 44px rgba(4, 10, 22, 0.55);
    z-index: 2;
  }
  .cert:has(.cert-link):hover .cert-img img { transform: scale(1.06); }
}

/* GitHub activity */
.activity { background: #fff; border-radius: 18px; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line-light); overflow-x: auto; }
.activity img { min-width: 640px; width: 100%; height: auto; }
.activity-link { display: inline-block; margin-top: 16px; color: var(--blue-strong); font-weight: 600; }

/* Contact */
.contact { background: linear-gradient(160deg, var(--blue-strong), #1e40af 70%); }
.contact .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 40px; align-items: center; }
.contact h2 { font-family: var(--font-display); font-size: var(--step-4); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.015em; }
.contact p { margin: 0 0 24px; color: #dbe7ff; max-width: 50ch; font-size: var(--step-1); }
.contact .btn-primary { background: #fff; color: var(--blue-strong); }
.contact .btn-primary:hover { background: var(--paper); }
.contact .btn-ghost { border-color: rgba(255, 255, 255, 0.5); }
.contact-details { margin: 0; display: grid; gap: 16px; }
.contact-details div { padding: 16px 18px; border-radius: 14px; background: rgba(8, 19, 38, 0.22); }
.contact-details dt { font-size: 0.85rem; color: #c7d7fb; }
.contact-details dd { margin: 2px 0 0; font-weight: 600; font-size: 1.05rem; }
.contact-details a { text-decoration: none; }
.contact-details a:hover { text-decoration: underline; }

.site-footer { padding: 28px 0; background: var(--navy-950); color: var(--mist); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--mist); text-decoration: none; }
.site-footer a:hover { color: var(--white); }

/* ---------- Case studies ---------- */

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--mist);
  font-weight: 600;
  font-size: 0.95rem;
  text-underline-offset: 4px;
  text-decoration-color: rgba(169, 200, 255, 0.4);
}
.back-link:hover { color: var(--white); text-decoration-color: var(--blue-soft); }

.case-hero h1 { max-width: 16ch; }
.case-hero .flow { margin-top: 0; }

/* Columns follow each video's width-to-height ratio, so all three come out the same height */
.case-videos { display: grid; grid-template-columns: 1.778fr 0.5625fr 0.5625fr; gap: 18px; align-items: start; }
.case-video { margin: 0; }
.case-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--navy-800);
  border: 1px solid var(--line-dark);
  border-radius: 14px;
}
.case-video.is-wide video { aspect-ratio: 16 / 9; }
.case-video.is-tall video { aspect-ratio: 9 / 16; }
.case-video h3 { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.25; margin: 14px 0 6px; }
.case-video p { margin: 0 0 6px; color: var(--mist); font-size: 0.88rem; }

.role-text { margin: 6px 0 10px; color: #d4def0; max-width: 68ch; }

/* Rejected and kept pairs */
.compare-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.compare { padding: 18px 18px 22px; background: #fff; border: 1px solid var(--line-light); border-radius: 18px; }
.compare h3 { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.2; margin: 16px 0 6px; }
.compare p { margin: 0; color: var(--ink-soft); }
.compare-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.compare-shots figure { margin: 0; }
.compare-shots img { width: 100%; object-fit: cover; border-radius: 10px; }
.compare-shots.is-wide img { aspect-ratio: 16 / 9; }
.compare-shots.is-tall img { aspect-ratio: 4 / 5; }
.compare-shots figcaption { margin-top: 6px; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.compare-shots .is-kept figcaption { color: #047857; }

.case-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 56px; }
.case-results h3 { font-family: var(--font-display); font-size: var(--step-2); margin: 0 0 12px; }
.case-results ul { margin: 0; padding-left: 18px; color: #d4def0; }
.case-results li { margin-bottom: 8px; }
.case-held { margin: 14px 0 0; color: var(--mist); }
.case-takeaway {
  margin: clamp(32px, 4vw, 48px) 0 0;
  max-width: 34ch;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.case-shots { display: grid; gap: 32px; }
.case-shot { margin: 0; }
.case-shot img { width: 100%; height: auto; border: 1px solid var(--line-dark); border-radius: 14px; }
.case-shot figcaption { margin-top: 10px; max-width: 72ch; color: var(--mist); font-size: 0.92rem; }
/* Screens are exported about 900 px wide, so they stay sharp at this size */
.case-shots.is-screens { max-width: 900px; }

/* Before and after stacked beside a phone screenshot */
.case-redesign { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }

/* Workflow diagram: keeps a readable size and scrolls sideways on small screens */
.case-workflow { margin: 0 0 clamp(36px, 5vw, 56px); }
.case-workflow-scroll { overflow-x: auto; border: 1px solid var(--line-dark); border-radius: 14px; }
.case-workflow-scroll svg { display: block; width: 100%; min-width: 960px; height: auto; }
.case-workflow-hint { display: none; margin: 10px 0 0; color: var(--blue-soft); font-size: 0.88rem; font-weight: 600; }
.case-workflow figcaption { margin-top: 10px; max-width: 72ch; color: var(--mist); font-size: 0.92rem; }
.wf-line path { fill: none; stroke: rgba(169, 200, 255, 0.35); stroke-width: 2; }
.wf-branch { fill: var(--blue-soft); font-family: var(--font-body); font-size: 13px; font-weight: 600; }
.wf-node rect { fill: var(--navy-800); stroke: rgba(169, 200, 255, 0.3); stroke-width: 1.5; }
.wf-node use { fill: none; stroke: var(--blue-soft); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.wf-node text { fill: #d4def0; font-family: var(--font-body); font-size: 14px; font-weight: 500; text-anchor: middle; }
.wf-node.is-outlined rect { stroke: var(--blue); stroke-width: 2.5; }
.wf-node.is-filled rect { fill: var(--blue); stroke: var(--blue); }
.wf-node.is-filled use { stroke: #fff; }
/* Boxes that hold their own text, so the chart reads without icons */
.case-flowmap .wf-title { fill: #fff; font-weight: 700; }
.case-flowmap .wf-node.is-filled rect { fill: var(--blue-strong); stroke: var(--blue-strong); }
.case-flowmap .wf-node.is-filled text { fill: #fff; }
/* A wide screen keeps a readable size too, and a narrow one doesn't stretch */
.case-workflow-scroll img { display: block; width: 100%; min-width: 960px; height: auto; }
.case-shot.is-narrow img { max-width: 640px; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; max-width: 560px; }
  .case-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .case-video.is-wide { grid-column: 1 / -1; }
  .case-workflow-hint { display: block; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--navy-950);
    border-bottom: 1px solid var(--line-dark);
    padding: 12px var(--gutter) 20px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav a { display: block; padding: 12px; }
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }

  .hero .wrap { grid-template-columns: 1fr; }
  .hero-visual { max-width: 440px; width: 100%; margin-inline: auto; }
  .services { grid-template-columns: 1fr; }
  .contact .wrap { grid-template-columns: 1fr; }
  .compare-list { grid-template-columns: 1fr; }
  .case-results { grid-template-columns: 1fr; }
  .case-redesign { grid-template-columns: 1fr; }
  .case-phone { max-width: 300px; }
}

@media (max-width: 560px) {
  .projects { grid-template-columns: 1fr; }
  .logo-name { font-size: 1.2rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .role { padding-left: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .name-letter { animation: none; }
  .flow-step { animation: none; opacity: 1; transform: none; }
}

/* ---------- Case study: AI calls ---------- */

.section-head p + p { margin-top: 12px; }

.case-brief-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(28px, 4vw, 56px); align-items: start; margin-bottom: clamp(32px, 4vw, 52px); }
.case-brief-head .section-head { margin-bottom: 0; }
.case-demo { margin: 0; }
.case-demo img { width: 100%; height: auto; border: 1px solid var(--line-light); border-radius: 14px; }
.case-demo figcaption { margin-top: 10px; color: var(--ink-soft); font-size: 0.92rem; }
.case-demo figcaption a { color: var(--blue-strong); font-weight: 600; text-underline-offset: 3px; }

/* The click-through call. Green stays reserved for a connected or booked outcome. */
.call-demo { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.call-demo[hidden] { display: none; }
.call-panel { padding: 24px; background: var(--navy-800); border: 1px solid var(--line-dark); border-radius: 18px; }
.call-panel h3 { font-family: var(--font-display); font-size: var(--step-2); margin: 0 0 16px; }

.call-log { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.call-line { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; animation: call-in 0.25s ease-out; }
.call-who { padding-top: 2px; color: var(--blue-soft); font-size: 0.85rem; font-weight: 600; }
.call-line p { margin: 0; }
.call-line.is-lead p { color: var(--mist); }

.call-choices { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-dark); }
.call-prompt { margin: 0 0 10px; color: var(--mist); font-size: var(--step--1); }
.call-options { display: flex; flex-wrap: wrap; gap: 8px; }
.call-options .filter { text-align: left; }

.call-events { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.call-event { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; color: #d4def0; font-size: 0.92rem; line-height: 1.45; animation: call-in 0.25s ease-out; }
.call-event::before { content: ""; width: 12px; height: 12px; margin-top: 4px; border: 2px solid var(--blue); border-radius: 50%; }
.call-event.is-done { color: var(--green); font-weight: 600; }
.call-event.is-done::before { background: var(--green); border-color: var(--green); }

@keyframes call-in { from { opacity: 0; transform: translateY(4px); } }

/* Before and after code, in place of the rejected and kept images */
.compare-shots.is-code figure { display: flex; flex-direction: column; min-width: 0; }
.compare-shots.is-code pre { flex: 1; }
.compare-shots.is-code pre,
.case-code {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  background: var(--navy-900);
  color: #d4def0;
  border-radius: 10px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.55;
}

/* minmax(0, ...) so a wide table or code block scrolls inside its own box, not the page */
.case-shots { grid-template-columns: minmax(0, 1fr); }
.case-pair > * { min-width: 0; }

.case-table-wrap { overflow-x: auto; border: 1px solid var(--line-dark); border-radius: 14px; }
.case-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.92rem; }
.case-table th, .case-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-dark); }
.case-table th { color: var(--mist); font-weight: 600; }
.case-table tbody tr:last-child td { border-bottom: 0; }
.case-table td { color: var(--mist); }
.case-table td:first-child, .case-table .is-now { color: var(--white); }
.case-table .is-now { font-weight: 600; }

.case-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.case-code { padding: 18px 20px; background: var(--navy-800); border: 1px solid var(--line-dark); border-radius: 14px; font-size: 0.85rem; }

.lead-card { padding: 20px 22px; background: #fff; color: var(--ink); border-radius: 14px; }
.lead-card h3 { margin: 0 0 12px; font-size: var(--step-0); font-weight: 600; }
.lead-card-campaign { margin: 0; font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1.2; }
.lead-card-channel { margin: 4px 0 16px; color: var(--ink-soft); font-size: 0.88rem; }
.lead-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.lead-card dt { color: var(--ink-soft); font-size: 0.82rem; }
.lead-card dd { margin: 0; font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; }
.lead-card details { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-light); }
.lead-card summary { color: var(--blue-strong); font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.lead-card details dl { margin-top: 12px; }

@media (max-width: 860px) {
  .call-demo, .case-pair, .case-brief-head { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .compare-shots.is-code { grid-template-columns: 1fr; }
  .call-panel { padding: 18px; }
  .call-line { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .call-line, .call-event { animation: none; }
}
