/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --navy: #10172a;
  --surface: #1c2740;
  --lilac: #c4b5fd;
  --ice: #f0f4ff;
  --blue-grey: #a6b4cc;

  --border: #2b3654;
  --border-strong: #3e4b6e;
  --lilac-strong: #5b3fd0;
  --text-on-light: #10172a;
  --text-2-on-light: #44506b;
  --border-on-light: #d5dcec;

  --font-display: "Cal Sans", "Figtree", system-ui, sans-serif;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --s1: 0.5rem;
  --s2: 1rem;
  --s3: 1.5rem;
  --s4: 2rem;
  --s5: 3rem;
  --s6: 4.5rem;

  --section-y: clamp(4rem, 8vw, 7rem);
  --head-gap: clamp(2rem, 4.5vw, 3.5rem);
  --card-pad: clamp(1.25rem, 4vw, 3rem);
  --gutter: clamp(1.25rem, 5vw, 2.5rem);

  --radius: 20px;
  --radius-sm: 12px;
  --header-h: 72px;
  --max: 1160px;
  --handle-bg: var(--navy);
}

/* =========================================================
   Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
body {
  margin: 0;
  background: var(--navy);
  color: var(--ice);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
img,
video,
svg {
  max-width: 100%;
}
img,
video {
  height: auto;
  display: block;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ice);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
p {
  margin: 0 0 var(--s2);
}
p:last-child {
  margin-bottom: 0;
}
strong {
  font-weight: 700;
  color: var(--ice);
}
a {
  color: var(--lilac);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: #fff;
}
ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
  list-style: none;
}
:focus-visible {
  outline: 2px solid var(--lilac);
  outline-offset: 4px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}
[id] {
  scroll-margin-top: calc(var(--header-h) + 8px);
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 100;
  background: var(--lilac);
  color: var(--navy);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
}
.skip-link:focus {
  top: 12px;
}

.eyebrow {
  margin: 0 0 var(--s3);
  color: var(--lilac);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* =========================================================
   Section header: big title, hairline with selection handles, meta
   ========================================================= */
.sec-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--head-gap);
}
.sec-head h2 {
  flex: 0 1 auto;
  min-width: 0;
  font-size: clamp(2.1rem, 7vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sec-line {
  position: relative;
  flex: 1 1 auto;
  min-width: 1.5rem;
  height: 1px;
  background: var(--border-strong);
}
.sec-line::before,
.sec-line::after {
  content: "";
  position: absolute;
  top: -3.5px;
  width: 8px;
  height: 8px;
  background: var(--handle-bg);
  border: 1px solid var(--lilac);
}
.sec-line::before {
  left: 0;
}
.sec-line::after {
  right: 0;
}
.sec-meta {
  flex: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-grey);
  white-space: nowrap;
}
@media (max-width: 540px) {
  .sec-meta {
    display: none;
  }
}

/* =========================================================
   Header / navigation
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 23, 42, 0.96);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--header-h);
  position: relative;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: var(--ice);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  text-decoration: none;
  padding: 12px 0;
}
.brand:hover {
  color: var(--lilac);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s1);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--ice);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
}
.menu-toggle:hover {
  border-color: var(--lilac);
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}
.menu-toggle-bars {
  position: relative;
}
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}
.menu-toggle-bars::before {
  top: -5px;
}
.menu-toggle-bars::after {
  top: 5px;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars {
  background: transparent;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before {
  transform: translateY(5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after {
  transform: translateY(-5px) rotate(-45deg);
}

.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  padding: var(--s1) var(--gutter) var(--s3);
  display: none;
}
.site-nav.is-open {
  display: block;
}
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  color: var(--blue-grey);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.site-nav li:last-child a {
  border-bottom: 0;
}
.site-nav a:hover {
  color: var(--ice);
}
.site-nav a[aria-current] {
  color: var(--lilac);
}
/* mobile menu: arrow marker on the active link (same arrow as the banners) */
.site-nav a[aria-current]::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4b5fd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E")
    center / contain no-repeat;
}

@media (min-width: 820px) {
  .menu-toggle {
    display: none;
  }
  .site-nav {
    position: static;
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
    order: 2;
  }
  .header-actions {
    order: 3;
    margin-left: var(--s2);
  }
  .site-nav ul {
    display: flex;
    gap: var(--s1);
    align-items: center;
  }
  .site-nav a {
    border: 0;
    padding: 0 var(--s2);
    font-size: 0.95rem;
    min-height: 44px;
    border-radius: 999px;
  }
  .site-nav a[aria-current]::before {
    display: none;
  }
  .site-nav a[aria-current] {
    color: var(--ice);
    background: var(--surface);
  }
  .site-nav .nav-resume {
    border: 1px solid var(--border-strong);
    color: var(--lilac);
    margin-left: var(--s1);
  }
}

/* =========================================================
   Buttons
   ========================================================= */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--s4);
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}
.btn-sm {
  min-height: 44px;
  padding: 0 var(--s3);
  font-size: 0.92rem;
  white-space: nowrap;
}
.btn-primary {
  background: var(--lilac);
  color: var(--navy);
}
.btn-primary:hover {
  background: #d9cffe;
  color: var(--navy);
}
.btn-secondary {
  background: transparent;
  color: var(--ice);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--lilac);
  color: var(--ice);
}

/* =========================================================
   Hero (homepage) and case-study hero: shared styles
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3.5rem, 9vw, 7rem);
  background: var(--navy);
  border-bottom: 1px solid var(--border);
}
.case-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--border);
}

/* grid-paper background */
.hero-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(196, 181, 253, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 181, 253, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(196, 181, 253, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 181, 253, 0.06) 1px, transparent 1px);
  background-size:
    160px 160px,
    160px 160px,
    32px 32px,
    32px 32px;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}

.hero-inner,
.case-hero-inner {
  position: relative;
  z-index: 1;
}

.hero h1,
.case-hero h1 {
  font-size: clamp(3.25rem, 12vw, 7rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: var(--s2);
}
.case-sub {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3.6vw, 1.9rem);
  letter-spacing: 0.03em;
  color: var(--ice);
  margin-bottom: var(--s4);
}
.hero .hero-sub {
  max-width: 38rem;
  margin-bottom: var(--s4);
}
.hero .btn-secondary {
  border-color: rgba(240, 244, 255, 0.5);
}

.hero-photo {
  margin: 0;
}

@media (min-width: 1100px) {
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--s5);
    align-items: start; /* photo sits at the top of the row */
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center; /* text group centered against the photo */
    align-self: stretch;
  }
}

/* =========================================================
   Sections
   ========================================================= */
.section {
  padding: var(--section-y) 0;
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  --handle-bg: var(--surface);
}
.section-light {
  background: var(--ice);
  color: var(--text-on-light);
  --handle-bg: var(--ice);
}
.section-light h2,
.section-light h3,
.section-light h4 {
  color: var(--text-on-light);
}
.section-light a {
  color: var(--lilac-strong);
}
.section-light a:hover {
  color: var(--text-on-light);
}
.section-light :focus-visible {
  outline-color: var(--lilac-strong);
}
.section-light .sec-line {
  background: #b7c1da;
}
.section-light .sec-line::before,
.section-light .sec-line::after {
  border-color: var(--lilac-strong);
}
.section-light .sec-meta {
  color: var(--text-2-on-light);
}

/* =========================================================
   Projects (shared by the homepage cards and the Praevi page)
   ========================================================= */
.project {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
  margin-bottom: var(--s5);
  position: relative;
  overflow: hidden;
}
.project:last-child {
  margin-bottom: 0;
}
.project-head {
  margin-bottom: var(--s4);
}
.project-category {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: 0 0 var(--s3);
}
.project h3 {
  font-size: clamp(2rem, 5.5vw, 3rem);
  margin-bottom: var(--s2);
}
.project-summary {
  color: var(--blue-grey);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 44rem;
  margin: 0;
}
.project h4 {
  font-size: 1.2rem;
  letter-spacing: 0;
  color: var(--lilac);
  margin: 0 0 var(--s2);
}
.project-col > * + h4 {
  margin-top: var(--s4);
}

/* card backgrounds: indigo glow (Praevi left, Nightshift and Sunny right) */
.project-code,
.project-design {
  background:
    radial-gradient(
      60rem 28rem at 100% 0%,
      rgba(91, 82, 196, 0.28),
      rgba(91, 82, 196, 0) 60%
    ),
    linear-gradient(180deg, #17203a 0%, var(--surface) 100%);
  border-color: var(--border-strong);
}
.project-code {
  background:
    radial-gradient(
      60rem 28rem at 0% 0%,
      rgba(91, 82, 196, 0.28),
      rgba(91, 82, 196, 0) 60%
    ),
    linear-gradient(180deg, #17203a 0%, var(--surface) 100%);
}
.project-body {
  display: grid;
  gap: var(--s5);
  margin-top: var(--s4);
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(196, 181, 253, 0.14);
  color: var(--lilac);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.tag-outline {
  background: transparent;
  color: var(--blue-grey);
  border: 1px solid var(--border-strong);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
}
.chips-inline {
  margin-top: var(--s3);
}
.chip {
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
}
.chips-inline .chip {
  background: rgba(16, 23, 42, 0.5);
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: var(--s4) 0 0;
}
.project-links:empty {
  display: none;
}
.disclaimer {
  margin: var(--s4) 0 0;
  padding-top: var(--s3);
  border-top: 1px solid var(--border);
  color: var(--blue-grey);
  font-size: 0.88rem;
  line-height: 1.7;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: var(--s3);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  line-height: 1.65;
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--lilac);
  letter-spacing: 0.04em;
}
.steps-2col {
  gap: var(--s3) var(--s5);
}
.steps-lg li {
  font-size: 1.1rem;
}

/* ---- Praevi page: video ---- */
.media-frame {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--navy);
  border: 1px solid var(--border);
}
.video-frame {
  aspect-ratio: 16 / 9;
  position: relative;
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.media-caption {
  margin: var(--s2) 0 0;
  color: var(--blue-grey);
  font-size: 0.92rem;
  line-height: 1.6;
}
.video-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin-top: var(--s2);
}
.video-tools-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-grey);
  margin-right: var(--s1);
}
.speed-btn {
  min-height: 44px;
  min-width: 56px;
  padding: 0 var(--s2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ice);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.speed-btn:hover {
  border-color: var(--lilac);
}
.speed-btn[aria-pressed="true"] {
  background: var(--lilac);
  border-color: var(--lilac);
  color: var(--navy);
}
.media-placeholder {
  display: grid;
  place-content: center;
  text-align: center;
  gap: var(--s1);
  padding: var(--s4);
  width: 100%;
  height: 100%;
  min-height: 200px;
  color: var(--blue-grey);
  background: var(--navy);
}
.media-placeholder strong {
  color: var(--ice);
  font-weight: 500;
}
.video-frame .media-placeholder {
  border: 0;
  border-radius: 0;
}

/* =========================================================
   Homepage project cards: banner, screenshot, Nightshift preview
   ========================================================= */

/* Big, solid call to action */
.cta-banner {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: 0 0 var(--s4);
  padding: var(--s3);
  background: var(--lilac);
  color: var(--navy);
  text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 34px rgba(91, 82, 196, 0.35);
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.cta-banner:hover {
  background: #d9cffe;
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(91, 82, 196, 0.45);
}
.cta-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--lilac);
}
.cta-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cta-text {
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
}
.cta-text strong {
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  line-height: 1.2;
}
.cta-text span {
  color: #2b2358;
  font-size: 0.95rem;
  font-weight: 500;
}
.cta-arrow {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--lilac);
  transition: transform 0.2s ease;
}
.cta-arrow svg,
.ic-arrow {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cta-banner:hover .cta-arrow {
  transform: translateX(4px);
}

/* Project screenshot: fills its box, centered */
.project-shot {
  position: relative;
  display: block;
  min-height: 220px;
  aspect-ratio: 16 / 10; /* sets the height when the cards stack */
  margin: 0 0 var(--s3);
  background: var(--navy);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(5, 8, 20, 0.35);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.project-shot:hover,
.project-shot:focus-visible {
  border-color: var(--lilac);
  transform: translateY(-2px);
}
.project-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Nightshift preview: desktop frame + phone */
.stage {
  display: grid;
  gap: var(--s2);
  padding: var(--s2);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    rgba(196, 181, 253, 0.1),
    rgba(59, 47, 143, 0.18) 55%,
    rgba(16, 23, 42, 0.4)
  );
  border: 1px solid var(--border);
}
.stage figure {
  margin: 0;
}
.frame-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue-grey);
  margin-bottom: var(--s2);
}

.browser-frame {
  display: flex;
  flex-direction: column;
  background: var(--navy);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(5, 8, 20, 0.45);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: linear-gradient(180deg, #2a3452 0%, #232f4d 100%);
  border-bottom: 1px solid var(--border-strong);
}
.browser-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.3);
}
.browser-bar i:nth-child(1) {
  background: #ff5f57;
}
.browser-bar i:nth-child(2) {
  background: #febc2e;
}
.browser-bar i:nth-child(3) {
  background: #28c840;
}
.shots {
  display: grid;
  gap: var(--s2);
}
.browser-body img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  object-position: top; /* keeps the top section, crops the bottom */
}
.shot-placeholder {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 220px;
  padding: var(--s4) var(--s3);
  text-align: center;
  color: var(--blue-grey);
  background: var(--navy);
}
.shot-placeholder strong {
  color: var(--ice);
  font-weight: 500;
}

.phones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
}
.phone-frame {
  display: block;
  width: min(100%, 150px);
  flex: 0 1 150px;
  padding: 8px;
  background: var(--navy);
  border: 2px solid var(--border-strong);
  border-radius: 26px;
  box-shadow: 0 24px 50px rgba(5, 8, 20, 0.45);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.phone-frame img {
  width: 100%;
  border-radius: 18px;
}
.phone-frame .shot-placeholder {
  aspect-ratio: 9 / 18;
  min-height: 0;
  border-radius: 18px;
  border: 1px dashed var(--border-strong);
  padding: var(--s2);
  font-size: 0.9rem;
}

/* both previews link to design.html */
.browser-frame:hover,
.browser-frame:focus-visible,
.phone-frame:hover,
.phone-frame:focus-visible {
  border-color: var(--lilac);
  transform: translateY(-2px);
}

/* =========================================================
   Work: projects grid (Praevi and Nightshift side by side)
   ========================================================= */
.work-grid {
  display: grid;
  gap: var(--s4);
}
.work-grid .project {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
}
.work-grid .project-head {
  margin-bottom: var(--s3);
}
.work-grid .project h3 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}
.work-grid .project-summary {
  font-size: 1rem;
}
.work-grid .cta-banner {
  margin-bottom: var(--s3);
}
.work-grid .project-links {
  margin-top: auto;
  padding-top: var(--s3);
}
/* only the first desktop and mobile screen on the homepage */
.work-grid .shots > :nth-child(n + 2),
.work-grid .phones > :nth-child(n + 2) {
  display: none;
}

@media (min-width: 1000px) {
  .work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    row-gap: 0;
  }
  /* rows (header, banner, media, button) line up across both cards */
  .work-grid .project {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
  }
  .work-grid .project-links {
    margin-top: 0;
    align-self: end;
  }
}

/* =========================================================
   Sunny Inc card: full width, banner + image left, text + button right
   (must stay after the .work-grid rules above)
   ========================================================= */
.project-wide .project-shot img {
  object-fit: contain;
  object-position: center;
  padding: var(--s1);
}

/* under 1000px the wrapper dissolves and the card stacks:
   text, banner, image, then the button */
.project-side {
  display: contents;
}
.project-wide .project-links {
  order: 1;
}

@media (min-width: 1000px) {
  .work-grid .project-wide {
    grid-column: 1 / -1;
    grid-row: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto;
    align-content: start;
    column-gap: var(--s5);
    margin-top: var(--s4);
  }

  /* left column: banner, then image */
  .work-grid .project-wide .cta-banner {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-bottom: var(--s3);
  }
  .work-grid .project-wide .project-shot {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 0;
  }

  /* right column: text and button as one group, centered vertically */
  .work-grid .project-wide .project-side {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
  .work-grid .project-wide .project-head {
    margin-bottom: var(--s3);
  }
  .work-grid .project-wide .project-links {
    order: 0;
    align-self: flex-start;
    margin-top: 0;
    padding-top: 0;
  }
}

/* =========================================================
   About
   ========================================================= */
.about-grid {
  display: grid;
  gap: var(--s5);
}
.about-text p {
  max-width: 40rem;
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: var(--s3);
}
.facts {
  display: grid;
  border-top: 1px solid var(--border-strong);
  align-self: start;
}
.facts div {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
}
.facts dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac);
  margin-bottom: 2px;
}
.facts dd {
  color: var(--ice);
  line-height: 1.55;
}

/* =========================================================
   Contact
   ========================================================= */
.contact-lead {
  max-width: 38rem;
  margin-bottom: var(--s4);
  color: var(--text-2-on-light);
  font-size: 1.125rem;
  line-height: 1.75;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.contact-links {
  display: contents;
}
.contact-links li {
  display: flex;
  flex: 1 1 280px;
}

/* cards (email + LinkedIn, GitHub and resume when supplied) */
.mail-cta,
.contact-links a {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex: 1 1 280px;
  width: 100%;
  min-height: 96px;
  padding: var(--s2) calc(var(--s3) + 56px) var(--s2) var(--s3);
  background: linear-gradient(135deg, #ffffff 0%, #f4f1ff 100%);
  border: 1px solid var(--border-on-light);
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow:
    0 1px 0 rgba(16, 23, 42, 0.04),
    0 10px 24px rgba(91, 63, 208, 0.08);
  transition:
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* accent bar that draws in along the top on hover */
.mail-cta::before,
.contact-links a::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--lilac-strong), var(--lilac));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.contact-links a[href*="linkedin"]::before {
  background: linear-gradient(90deg, #0a66c2, #5aa9f0);
}

/* icon as a tinted badge */
.mail-cta svg,
.contact-links a svg {
  flex: none;
  box-sizing: content-box;
  width: 28px;
  height: 28px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(91, 63, 208, 0.1);
  fill: none;
  stroke: var(--lilac-strong);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    background-color 0.25s ease,
    stroke 0.25s ease,
    transform 0.25s ease;
}
.contact-links a[href*="linkedin"] svg {
  stroke: #0a66c2;
  background: rgba(10, 102, 194, 0.1);
}

/* arrow chip on the right */
.mail-cta::after,
.contact-links a::after {
  content: "";
  position: absolute;
  right: var(--s3);
  top: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border-radius: 50%;
  background-color: rgba(91, 63, 208, 0.1);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b3fd0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  transition:
    transform 0.25s ease,
    background-color 0.25s ease;
}

/* hover / focus */
.mail-cta:hover,
.contact-links a:hover {
  border-color: var(--lilac-strong);
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(91, 63, 208, 0.2);
}
.contact-links a[href*="linkedin"]:hover {
  border-color: #0a66c2;
  box-shadow: 0 18px 38px rgba(10, 102, 194, 0.2);
}
.mail-cta:hover::before,
.contact-links a:hover::before,
.mail-cta:focus-visible::before,
.contact-links a:focus-visible::before {
  transform: scaleX(1);
}
.mail-cta:hover svg {
  background: var(--lilac-strong);
  stroke: #fff;
  transform: rotate(-6deg) scale(1.05);
}
.contact-links a[href*="linkedin"]:hover svg {
  background: #0a66c2;
  stroke: #fff;
  transform: rotate(-6deg) scale(1.05);
}
.mail-cta:hover::after,
.contact-links a:hover::after {
  background-color: var(--lilac-strong);
  transform: translateX(4px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}
.contact-links a[href*="linkedin"]:hover::after {
  background-color: #0a66c2;
}
@media (prefers-reduced-motion: reduce) {
  .mail-cta:hover,
  .contact-links a:hover {
    transform: none;
  }
}

.contact-text {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.3;
}
.contact-text strong {
  color: var(--text-on-light);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.45rem;
}
.contact-text small {
  color: var(--text-2-on-light);
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.contact-empty {
  padding: var(--s3);
  border: 1px dashed #b7c1da;
  border-radius: var(--radius);
  color: var(--text-2-on-light);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s4) 0 calc(var(--s4) + env(safe-area-inset-bottom));
  color: var(--blue-grey);
  font-size: 0.9rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  justify-content: space-between;
  align-items: center;
}
.footer-inner p {
  margin: 0;
}
.footer-inner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* =========================================================
   Case-study pages (design.html, kenoxis.html, sunny.html)
   ========================================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: var(--s2);
  color: var(--blue-grey);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover {
  color: var(--lilac);
}
.back-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0 var(--s4);
  border-top: 1px solid var(--border-strong);
  max-width: 52rem;
}
.case-meta div {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--border);
}
.case-meta dt {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac);
  margin-bottom: 2px;
}
.case-meta dd {
  line-height: 1.5;
}

/* ---- Screens gallery ---- */
.gallery-mobile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6);
}
.shot {
  margin: 0;
}
.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--navy);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  text-align: left;
  box-shadow: 0 24px 50px rgba(5, 8, 20, 0.35);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.shot-btn:hover {
  border-color: var(--lilac);
  transform: translateY(-2px);
}
.shot-btn img {
  width: 100%;
}
.shot figcaption {
  margin-top: var(--s2);
  color: var(--blue-grey);
  font-size: 0.95rem;
  line-height: 1.6;
}
.shot-group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4) var(--s3);
  align-items: start; /* tall full-page shots don't stretch their neighbours */
}
/* spacing between groups: roomy when open, tight when closed */
.shot-group {
  margin-bottom: var(--s6);
}
.shot-group:not(.is-open) {
  margin-bottom: var(--s1);
}
.shot-group:last-child {
  margin-bottom: 0;
}
@media (min-width: 640px) {
  .shot-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .shot-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---- Accordion groups ---- */
.shot-group-heading {
  margin: 0;
  font-size: inherit;
}
.shot-group-head {
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  min-height: 56px;
  padding: var(--s2) 0;
  background: transparent;
  color: var(--ice);
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.shot-group-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.2;
  color: var(--lilac);
}
.shot-group-head:hover .shot-group-title {
  color: #fff;
}
.shot-group-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-grey);
  white-space: nowrap;
}
.shot-group-chevron {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 4px;
  border-right: 2px solid var(--lilac);
  border-bottom: 2px solid var(--lilac);
  transform: rotate(225deg); /* points up when open */
  transition: transform 0.2s ease;
}
.shot-group-head[aria-expanded="false"] .shot-group-chevron {
  transform: rotate(45deg) translate(-2px, -2px); /* points down when closed */
}
.shot-group-body {
  padding-top: var(--s4);
}
.shot-group-more {
  display: flex;
  justify-content: center;
  margin-top: var(--s4);
}

/* collapsed: remove the content and its space, the title row stays */
.shot-group:not(.is-open) .shot-group-body {
  display: none;
}
/* default: only the first 3 screens; "Show all" reveals the rest */
.shot-group:not(.is-all) .shot.is-extra {
  display: none;
}

/* Compact group: small screens, all in one row */
.shot-group-compact .shot-group-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3) var(--s2);
}
.shot-group-compact .shot figcaption {
  margin-top: var(--s1);
  font-size: 0.82rem;
}
@media (min-width: 820px) {
  .shot-group-compact .shot-group-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ---- Mobile gallery (Nightshift) ---- */
.gallery-mobile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.gallery-mobile .shot {
  width: min(100%, 260px);
}
.gallery-mobile .shot-btn {
  padding: 10px;
  border: 2px solid var(--border-strong);
  border-radius: 36px;
}
.gallery-mobile .shot-btn img {
  border-radius: 26px;
}
.gallery-mobile .shot figcaption {
  text-align: center;
}
.gallery-empty {
  display: grid;
  place-content: center;
  gap: 4px;
  min-height: 260px;
  padding: var(--s4);
  text-align: center;
  color: var(--blue-grey);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: rgba(16, 23, 42, 0.5);
  width: 100%;
}
.gallery-empty strong {
  color: var(--ice);
  font-weight: 500;
  font-size: 1.1rem;
}

/* ---- Color palette strip ---- */
.palette {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(5, 8, 20, 0.35);
}
.swatch {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-width: 0;
  min-height: 92px;
  padding: var(--s2) var(--s3);
  background: var(--swatch);
  color: var(--ice);
  overflow: hidden;
}
.swatch-light {
  color: var(--navy);
}
.swatch-hex {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.swatch-name {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.palette-note {
  margin-top: var(--s2);
  color: var(--blue-grey);
  font-size: 0.9rem;
  max-width: 44rem;
}
/* small version (Praevi, Nightshift, Sunny Inc) */
.palette-sm .swatch {
  min-height: 72px;
}
@media (min-width: 820px) {
  .palette {
    flex-direction: row;
    height: 380px;
  }
  .palette-sm {
    height: 220px;
  }
  .swatch {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 0;
    padding: var(--s3);
    transition: flex-grow 0.4s ease;
  }
  .swatch-hex {
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
  }
}
@media (min-width: 820px) and (hover: hover) {
  .swatch:hover {
    flex-grow: 2.6;
  }
}
/* tighter spacing around the palette section */
#palette {
  padding-bottom: var(--s3);
}
#palette + section {
  padding-top: var(--s4);
}

/* ---- Desktop vs mobile table: minimal and dark ---- */
.compare-grid {
  display: grid;
  border-top: 1px solid var(--border-strong);
}
.compare-header {
  display: none;
}
.compare-row {
  display: grid;
  gap: var(--s1);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}
.compare-aspect {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ice);
}
.compare-cell {
  color: var(--blue-grey);
  font-size: 0.98rem;
  line-height: 1.6;
}
.compare-cell::before {
  content: attr(data-label);
  display: block;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--lilac);
  margin-bottom: 2px;
}

/* ---- "Next project" / "Back to home" card ---- */
.next {
  padding: 0 0 var(--section-y);
}
.section-alt + .next {
  padding-top: var(--s6);
}
.next-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  padding-right: calc(clamp(1.5rem, 4vw, 2.5rem) + 64px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ice);
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}
.next-card:hover {
  border-color: var(--lilac);
  transform: translateY(-2px);
  color: var(--ice);
}
.next-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lilac);
}
.next-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.75rem);
  line-height: 1.1;
}
.next-sub {
  color: var(--blue-grey);
}
.next-card .cta-arrow {
  position: absolute;
  right: clamp(1.25rem, 4vw, 2.5rem);
  top: 50%;
  margin-top: -22px;
  background: var(--lilac);
  color: var(--navy);
}
.next-card:hover .cta-arrow {
  transform: translateX(4px);
}

/* ---- Lightbox ---- */
.lightbox {
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--ice);
  max-width: min(96vw, 1500px);
  max-height: 94vh;
  overflow: auto;
}
.lightbox::backdrop {
  background: rgba(8, 12, 24, 0.86);
}
.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: calc(94vh - 4rem);
  margin: 0 auto;
}
.lightbox-bar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s2);
  padding: 6px 6px 6px var(--s3);
  background: var(--navy);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--blue-grey);
}
.lightbox-close {
  min-height: 44px;
  padding: 0 var(--s3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ice);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.lightbox-close:hover {
  border-color: var(--lilac);
}

/* =========================================================
   Larger screens (820px and up)
   ========================================================= */
@media (min-width: 820px) {
  body {
    font-size: 1.125rem;
  }
  .project-body {
    grid-template-columns: 5fr 7fr;
    gap: var(--s6);
  }
  .steps-2col {
    grid-template-columns: 1fr 1fr;
  }
  .stage {
    grid-template-columns: 1.7fr 1fr;
    align-items: end;
  }
  .about-grid {
    grid-template-columns: 1.3fr 1fr;
    gap: var(--s6);
  }
  .compare-grid {
    border-top: 0;
  }
  .compare-header {
    display: grid;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lilac);
    border-bottom: 1px solid var(--border-strong);
    padding: 0 var(--s2) var(--s2);
  }
  .compare-row {
    grid-template-columns: 0.8fr 1.1fr 1.1fr;
    gap: var(--s4);
    padding: var(--s3) var(--s2);
    align-items: start;
  }
  .compare-row:not(.compare-header):hover {
    background: rgba(196, 181, 253, 0.06);
  }
  .compare-cell::before {
    display: none;
  }
}

/* =========================================================
   Mobile and tablet
   ========================================================= */

/* Hero photo stacked under the text (below 1100px) */
@media (max-width: 1099px) {
  .hero-photo {
    margin: var(--s5) 0 0;
    max-width: 460px;
  }
  .hero-photo img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 15%; /* keeps your face, trims the bottom */
    border: 1px solid var(--border-strong);
    border-radius: 0;
  }
}

/* Phones */
@media (max-width: 479px) {
  .hero .button-row .btn {
    flex: 1 1 100%;
  }

  /* big titles: stop long words like "Nightshift" overflowing */
  .hero h1,
  .case-hero h1 {
    font-size: clamp(2.5rem, 13vw, 3.25rem);
    overflow-wrap: break-word;
  }
  .hero-sub,
  .case-sub {
    margin-bottom: var(--s3);
  }
  .case-sub {
    letter-spacing: 0.015em;
  }

  .project {
    border-radius: 16px;
  }
  .steps li {
    padding-left: 2.5rem;
  }

  /* banners */
  .cta-icon {
    display: none;
  }
  .cta-banner {
    padding: var(--s2) var(--s2) var(--s2) var(--s3);
  }

  /* Nightshift card: label above the phone matches the centered phone */
  .work-grid .phone-stack .frame-label {
    text-align: center;
  }

  /* chips and speed buttons: more compact */
  .chip {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  .speed-btn {
    min-width: 48px;
    padding: 0 var(--s1);
  }

  /* contact cards: smaller icon badge and arrow so the email fits */
  .mail-cta,
  .contact-links a {
    gap: var(--s1);
    min-height: 84px;
    padding: var(--s2) 64px var(--s2) var(--s2);
  }
  .mail-cta svg,
  .contact-links a svg {
    width: 22px;
    height: 22px;
    padding: 11px;
    border-radius: 14px;
  }
  .mail-cta::after,
  .contact-links a::after {
    right: var(--s2);
    width: 34px;
    height: 34px;
    margin-top: -17px;
    background-size: 16px;
  }
  .contact-text strong {
    font-size: 1.25rem;
  }

  /* next-project card: arrow chip no longer crowds the text */
  .next-card {
    padding-right: calc(var(--s3) + 56px);
  }
  .next-card .cta-arrow {
    width: 40px;
    height: 40px;
    margin-top: -20px;
  }
}

/* Small phones: keep the name visible but compact */
@media (max-width: 399px) {
  .brand {
    font-size: 1rem;
  }
  .header-cta {
    padding: 0 var(--s2);
  }
}

/* Very small phones */
@media (max-width: 359px) {
  .hero h1,
  .case-hero h1 {
    font-size: 2.4rem;
  }
}

/* Touch screens: no sticky "hover" lift after a tap */
@media (hover: none) {
  .project-shot:hover,
  .cta-banner:hover,
  .mail-cta:hover,
  .contact-links a:hover,
  .next-card:hover,
  .shot-btn:hover,
  .browser-frame:hover,
  .phone-frame:hover {
    transform: none;
  }
}
.mobile-video {
  max-width: 960px;
  margin: 0 auto var(--s6);
}

.gallery-mobile {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s6);
}
.gallery-mobile .shot-group-grid {
  justify-items: center;
}
/* Highlighted group (add to cart and shopping cart) */
.shot-group-highlight .shot-group-head {
  border-bottom-color: var(--lilac);
}
.shot-group-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---- Desktop / Mobile tabs (design page) ---- */
.view-switch-wrap {
  position: sticky;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  z-index: 40;
  padding: var(--s2) 0;
  background: rgba(16, 23, 42, 0.96);
  border-bottom: 1px solid var(--border);
}
.view-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
  max-width: 420px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.view-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 var(--s2);
  background: transparent;
  color: var(--blue-grey);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.view-tab svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.view-tab:hover {
  color: var(--ice);
}
.view-tab[aria-selected="true"] {
  background: var(--lilac);
  color: var(--navy);
}
.view-tab-count {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(196, 181, 253, 0.16);
}
.view-tab-count:empty {
  display: none;
}
.view-tab[aria-selected="true"] .view-tab-count {
  background: rgba(16, 23, 42, 0.14);
}

/* suggestion line under the tabs */
.view-hint-row {
  padding-top: var(--s3);
}
.view-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--s1);
  margin: 0;
  padding: var(--s2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(196, 181, 253, 0.08);
  color: var(--blue-grey);
  font-size: 0.95rem;
  line-height: 1.5;
}
.view-hint-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lilac);
  animation: hint-pulse 2s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 181, 253, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(196, 181, 253, 0); }
}
.view-hint-btn {
  min-height: 44px;
  padding: 0 var(--s2);
  background: transparent;
  color: var(--lilac);
  border: 1px solid var(--lilac);
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.view-hint-btn:hover {
  background: var(--lilac);
  color: var(--navy);
}
.view-next {
  display: flex;
  justify-content: center;
  margin-top: var(--s5);
}

/* the panels sit right under the tabs, so trim their top padding */
#desktop,
#mobile {
  padding-top: var(--s5);
}

@media (min-width: 720px) {
  .view-hint {
    flex-wrap: nowrap;
  }
  .view-hint-btn {
    margin-left: auto;
    white-space: nowrap;
  }
}
@media (max-width: 479px) {
  .view-switch-wrap {
    padding: var(--s1) 0;
  }
  .view-switch {
    max-width: none;
  }
  .view-tab {
    min-height: 46px;
    padding: 0 var(--s1);
    font-size: 0.95rem;
  }
  .view-hint {
    padding: var(--s2) var(--s2) var(--s2) var(--s2);
  }
  .view-hint-text,
  #view-hint-text {
    flex: 1 1 calc(100% - 28px);
  }
  .view-hint-btn {
    width: 100%;
    margin-top: var(--s1);
  }
  .view-next .btn {
    width: 100%;
  }
}
/* ---- More visible hint card ---- */
.view-hint {
  position: relative;
  gap: var(--s1) var(--s2);
  padding: var(--s3);
  padding-left: calc(var(--s3) + 6px);
  background: linear-gradient(
    135deg,
    rgba(196, 181, 253, 0.22),
    rgba(91, 82, 196, 0.16)
  );
  border: 1px solid var(--lilac);
  border-radius: var(--radius-sm);
  color: var(--ice);
  font-size: 1.05rem;
  font-weight: 500;
  box-shadow: 0 12px 30px rgba(91, 82, 196, 0.25);
  overflow: hidden;
}
/* solid accent bar on the left edge */
.view-hint::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--lilac);
}
.view-hint strong {
  color: var(--lilac);
}
.view-hint-dot {
  width: 12px;
  height: 12px;
}
.view-hint-btn {
  background: var(--lilac);
  color: var(--navy);
  font-size: 1rem;
  box-shadow: 0 6px 16px rgba(91, 82, 196, 0.35);
}
.view-hint-btn:hover {
  background: #d9cffe;
  color: var(--navy);
}

/* ---- Calm 3s pulse on the Mobile tab (2 slow beats) ---- */
.view-tab.is-nudging {
  color: var(--ice);
  animation: tab-nudge 1.5s ease-in-out 2;
}
@keyframes tab-nudge {
  0%, 100% {
    background-color: transparent;
    box-shadow: 0 0 0 0 rgba(196, 181, 253, 0);
  }
  50% {
    background-color: rgba(196, 181, 253, 0.22);
    box-shadow: 0 0 0 6px rgba(196, 181, 253, 0.28);
  }
}

@media (max-width: 479px) {
  .view-hint {
    padding: var(--s2) var(--s2) var(--s2) calc(var(--s2) + 6px);
    font-size: 1rem;
  }
}
/* in-page anchor just above the sticky tabs */
.anchor[id] {
  display: block;
  scroll-margin-top: var(--header-h);
}

/* five meta items fit on one row */
.case-meta:has(> div:nth-child(5)) {
  max-width: 64rem;
}
/* "Jump to the screens": filled lilac button with an arrow chip */
.btn-jump {
  gap: var(--s2);
  padding: 0 8px 0 var(--s4);
  box-shadow: 0 14px 34px rgba(91, 82, 196, 0.35);
}
.btn-jump:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(91, 82, 196, 0.45);
}
.btn-jump-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--lilac);
  transition: transform 0.2s ease;
}
.btn-jump-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-jump:hover .btn-jump-icon {
  transform: translateY(3px);
}
@media (hover: none) {
  .btn-jump:hover {
    transform: none;
  }
}
#project {
  scroll-margin-top: 80px; /* match your header height */
}

/* ---------- Page loader ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: #10172a;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.page-loader-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #fff;
  animation: page-loader-spin 0.8s linear infinite;
}
@keyframes page-loader-spin {
  to { transform: rotate(360deg); }
}
html.is-loading body > *:not(.page-loader) {
  visibility: hidden;
}
html:not(.is-loading) .page-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .page-loader-spinner { animation-duration: 2s; }
  .page-loader { transition: none; }
}

