/* =================================================================
   Marlowe Restaurant & Café Web Design Portfolio
   -----------------------------------------------------------------
   Aesthetic: warm editorial. Cream "paper" background, espresso ink,
   confident terracotta accent. Fraunces (display) + Manrope (body).
   ================================================================= */

/* -----------------------------------------------------------------
   Design tokens
   ----------------------------------------------------------------- */
:root {
  /* Color */
  --paper:      #ffffff;   /* white background             */
  --paper-2:    #f4f4f4;   /* faint gray for section rhythm*/
  --card:       #ffffff;   /* white surfaces               */
  --ink:        #141414;   /* near-black text              */
  --ink-soft:   #444444;   /* dark gray body text          */
  --line:       #e6e6e6;   /* light gray hairlines         */
  --accent:     #e63946;   /* confident red                */
  --accent-deep:#c1121f;   /* hover / pressed red          */
  --olive:      #1a1a1a;   /* neutral near-black           */
  --focus:      #1c66c9;   /* high-contrast focus ring     */

  /* Type */
  --font-display: "Montserrat", system-ui, -apple-system, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --nav-h: 72px;
  --radius: 18px;
  --radius-lg: 26px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* -----------------------------------------------------------------
   Reset & base
   ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  /* subtle paper texture using layered radial gradients */
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(230, 57, 70, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 255, 255, 0.05), transparent 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

/* -----------------------------------------------------------------
   Accessibility: focus + skip link
   ----------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-150%);
  top: 8px;
  z-index: 1000;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus { transform: translateX(-50%) translateY(0); }

/* -----------------------------------------------------------------
   Shared layout helpers
   ----------------------------------------------------------------- */
.section-eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.5rem);
  max-width: 16ch;
}

/* Generic section padding */
.about,
.work,
.contact {
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 4rem);
  scroll-margin-top: var(--nav-h);
}

/* -----------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.95rem 1.6rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.25s var(--ease),
              box-shadow 0.25s var(--ease),
              background 0.2s ease;
  will-change: transform;
}

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  box-shadow: 0 10px 24px -12px rgba(230, 57, 70, 0.7);
}
.btn--primary:hover {
  --btn-bg: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px rgba(230, 57, 70, 0.8);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  transform: translateY(-2px);
}

.btn--full { width: 100%; }

.btn:active { transform: translateY(0); }

/* -----------------------------------------------------------------
   1. Navigation
   ----------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  /* frosted, becomes opaque on scroll via .is-scrolled */
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(34, 28, 23, 0.6);
}

.nav__inner {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}
.nav__brand-dot { color: var(--accent); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
}

.nav__link {
  position: relative;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0.25rem 0;
  color: var(--ink);
  transition: color 0.2s ease;
}
/* animated underline */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav__link:hover::after,
.nav__link.is-active::after { transform: scaleX(1); }
.nav__link.is-active { color: var(--accent); }

.nav__cta {
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.6rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: transform 0.2s var(--ease), background 0.2s ease;
}
.nav__cta:hover { background: var(--accent); transform: translateY(-1px); }

/* hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.nav__bar {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] .nav__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -----------------------------------------------------------------
   2. Hero
   ----------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 2rem) clamp(1.25rem, 5vw, 4rem) 4rem;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

.hero__eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--olive);
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  margin-bottom: 1.75rem;
}

.hero__title {
  font-size: clamp(2.35rem, 1.2rem + 4.7vw, 4.85rem);
  max-width: 20ch;
  margin: 0 auto 1.75rem;
}
.hero__title-accent {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.hero__lead {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 0.5rem;
}

/* Big rotating statement line under the hero lead */
.hero__rotator {
  margin: 0.5rem 0 3.5rem;
  line-height: 1;
}

/* Rotating phrase animation (vertical slot-machine reveal) */
.rotating-phrase {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.85rem);
  letter-spacing: -0.02em;
  height: 1.15em;
  min-width: 10em;       /* reserves room for the widest phrase  */
  vertical-align: bottom;
  overflow: hidden;       /* clips words as they slide in/out     */
}

.rotating-phrase__word {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  white-space: nowrap;
  color: var(--accent);
  opacity: 0;
  transform: translateY(110%);   /* parked just below the line    */
  transition: opacity 0.45s ease, transform 0.55s var(--ease);
}

/* the word currently on screen */
.rotating-phrase__word.is-active {
  opacity: 1;
  transform: translateY(0);
}

/* the word sliding up and out of view */
.rotating-phrase__word.is-leaving {
  opacity: 0;
  transform: translateY(-110%);
}

@media (prefers-reduced-motion: reduce) {
  .rotating-phrase { overflow: visible; }
  .rotating-phrase__word { transition: none; }
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

/* atmospheric background */
.hero__glow {
  position: absolute;
  top: -10%;
  right: -10%;
  width: 70vw;
  height: 70vw;
  max-width: 820px;
  max-height: 820px;
  background:
    radial-gradient(circle at 50% 50%, rgba(230, 57, 70, 0.22), transparent 62%),
    radial-gradient(circle at 70% 40%, rgba(232, 160, 74, 0.18), transparent 55%);
  filter: blur(8px);
  z-index: 1;
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  to { transform: translate(-3%, 4%) scale(1.06); }
}

.hero__grid-lines {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(34, 28, 23, 0.035) 1px, transparent 1px);
  background-size: clamp(60px, 8vw, 110px) 100%;
  mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
}

/* -----------------------------------------------------------------
   3. About
   ----------------------------------------------------------------- */
.about { background: var(--paper-2); }

.about__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about__media { position: relative; }
.about__photo {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -34px rgba(34, 28, 23, 0.55);
}
.about__photo-note {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: rgba(255, 255, 255, 0.92);
  text-align: center;
  line-height: 1.3;
}
.about__text {
  color: var(--ink-soft);
  margin-top: 1.25rem;
  max-width: 56ch;
}

/* -----------------------------------------------------------------
   3b. Mission: dark statement band that grounds the work
   ----------------------------------------------------------------- */
.mission {
  background: var(--card);
  color: var(--ink);
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 4rem);
  scroll-margin-top: var(--nav-h);
}
.mission__inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.mission__title {
  color: var(--ink);
  max-width: 22ch;
  margin: 0.35rem auto 1.6rem;
}
.mission__text {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 auto 1.15rem;
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.75;
}
.mission__text:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------
   3c. Services / What I do (icon grid)
   ----------------------------------------------------------------- */
.services {
  background: var(--paper-2);
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 4rem);
  scroll-margin-top: var(--nav-h);
  --svc-line: rgba(34, 28, 23, 0.12);
}
.services__inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
.services__head {
  max-width: 44ch;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.services__title {
  margin: 0.35rem 0 1rem;
}
.services__sub {
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.6;
  max-width: 46ch;
}
.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--svc-line);
  border-left: 1px solid var(--svc-line);
}
.service {
  padding: clamp(1.6rem, 3vw, 2.6rem);
  border-right: 1px solid var(--svc-line);
  border-bottom: 1px solid var(--svc-line);
}
.service__icon {
  display: block;
  color: var(--accent);
  margin-bottom: 1.35rem;
}
.service__icon svg {
  width: 34px;
  height: 34px;
}
.service__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.6rem;
}
.service__text {
  color: var(--ink-soft);
  font-size: 0.97rem;
  line-height: 1.6;
  margin-bottom: 1.1rem;
}
.service__tag {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
@media (max-width: 860px) {
  .services__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .services__grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------
   4. Work / case studies
   ----------------------------------------------------------------- */
.work__head {
  max-width: var(--maxw);
  margin: 0 auto clamp(0.5rem, 1.5vw, 1rem);
}
.work__title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
}
.work__link {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.work__link:hover { border-bottom-color: var(--accent); }
.work__sub {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.work__sub em { color: var(--accent); font-style: italic; }

.work__grid {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: clamp(2rem, 4vw, 3.25rem);
}

/* Case study card */
.case {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: 1.5rem;
  align-items: center;
  box-shadow: 0 24px 50px -38px rgba(34, 28, 23, 0.5);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
/* alternate to a two-column editorial layout on wider screens */
@media (min-width: 860px) {
  .case {
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(1.75rem, 3vw, 3rem);
  }
  .case:nth-child(even) .ba { order: 2; }
}
.case:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 64px -40px rgba(34, 28, 23, 0.6);
}

.case__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  grid-column: 1 / -1;
}
.case__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem);
  color: var(--logo, var(--ink));
  letter-spacing: -0.025em;
}
.case__type {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.case__body { display: grid; gap: 1.25rem; align-content: center; }
.case__problem { color: var(--ink-soft); }

.case__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--ink);
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
}
.case__quote cite {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.case__result {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  align-self: start;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.case__result-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--olive);
}

/* ---- Before / After slider (the signature interaction) ---------- */
.ba {
  position: relative;
  container-type: inline-size;     /* enables 100cqw sizing below   */
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
  user-select: none;
  touch-action: pan-y;             /* allow vertical page scroll    */
  box-shadow: 0 18px 40px -28px rgba(34, 28, 23, 0.55);
  cursor: ew-resize;
}

.ba__pane { position: absolute; inset: 0; }
.ba__inner {
  /* full slider width regardless of the clipping wrapper's width,
     so the "before" image is never squished */
  width: 100cqw;
  height: 100%;
}
.ba__inner svg,
.ba__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;       /* fill the frame; crop overflow      */
  object-position: top;    /* keep the header/top of the page    */
  display: block;
}

/* "after" sits underneath, full width */
.ba__after { z-index: 1; }

/* "before" sits on top, clipped to the handle position from the left */
.ba__before {
  z-index: 2;
  width: var(--pos, 50%);
  overflow: hidden;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
}

/* labels */
.ba__label {
  position: absolute;
  top: 12px;
  z-index: 3;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.ba__label--before { left: 12px; background: rgba(34, 28, 23, 0.78); }
.ba__label--after  { right: 12px; background: rgba(230, 57, 70, 0.85); }

/* draggable divider + handle */
.ba__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  z-index: 3;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
}

.ba__handle {
  position: absolute;
  top: 50%;
  left: var(--pos, 50%);
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent);
  color: #fff;
  cursor: grab;
  box-shadow: 0 6px 18px -4px rgba(34, 28, 23, 0.5);
  transition: transform 0.15s var(--ease), background 0.2s ease;
}
.ba__handle:hover { background: var(--accent-deep); }
.ba__handle:active { cursor: grabbing; transform: translate(-50%, -50%) scale(0.94); }
.ba__handle svg { width: 22px; height: 22px; }
/* keep focus ring fully visible around the round handle */
.ba__handle:focus-visible { outline-offset: 4px; }

/* ---- Circular 3D gallery (spins on scroll) ---------------------- */
/* Tall outer wrapper gives the scroll distance that drives rotation */
.cgal-scroll {
  position: relative;
  height: 360vh;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

/* Pinned viewport while the wrapper scrolls past */
.cgal-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;        /* heading at top, rings below   */
  padding-top: calc(var(--nav-h) + clamp(1rem, 4vh, 2.5rem));
  overflow: hidden;
}
/* heading travels with the pinned rings (no gap above the rings) */
.cgal-sticky .work__head {
  text-align: left;
  width: 100%;
  margin: 0 0 clamp(0.5rem, 2vh, 1.25rem);
}
/* Portfolio reads as a real section header, not a tiny eyebrow */
.cgal-sticky .work__head .section-eyebrow {
  font-family: var(--font-display, var(--font-body));
  font-size: clamp(2rem, 1.6rem + 1.8vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  text-transform: none;
  line-height: 1.02;
  color: var(--ink, #1a1a1a);
  margin-bottom: 0.5rem;
}

.cgal-hint {
  position: absolute;
  top: calc(var(--nav-h) + 1.25rem);
  z-index: 3;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.45rem 1rem;
  border-radius: 999px;
}

/* Two rings side by side */
.cgal-pair {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;            /* rings rise to just under the heading */
  justify-content: center;
  gap: clamp(1rem, 4vw, 4rem);
}

.cgal-side {
  position: relative;
  flex: 1 1 0;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cgal-side-label {
  position: absolute;
  top: 3%;
  z-index: 5;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.cgal-side-label--before,
.cgal-side-label--after { background: transparent; }

/* 3D stage */
.cgal-stage {
  position: relative;
  width: 100%;
  height: clamp(280px, 38vh, 400px);  /* only as tall as the rings need */
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1700px;
}

.cgal-ring {
  position: relative;
  width: 300px;
  height: 169px;              /* 16:9, matches the screenshots   */
  transform-style: preserve-3d;
  /* --cgal-rot is updated by script.js */
  transform: rotateY(var(--cgal-rot, 0deg));
  will-change: transform;
  --cgal-radius: 300px;
}

.cgal-item {
  position: absolute;
  width: 300px;
  height: 169px;
  left: 50%;
  top: 50%;
  margin: -84px 0 0 -150px;
  /* per-item angle on the ring is set inline by script.js */
  transform: rotateY(var(--a, 0deg)) translateZ(var(--cgal-radius, 300px));
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: 0 30px 60px -28px rgba(34, 28, 23, 0.7);
  backface-visibility: hidden;
}

.cgal-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;          /* fill the card edge to edge, no bars */
  object-position: top center;
}

.cgal-item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), transparent);
}

.cgal-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}
.cgal-tag--before { background: rgba(255, 255, 255, 0.9); color: #221c17; }
.cgal-tag--after  { background: var(--accent); color: #fff; }

/* Tablet: shrink rings a touch so both still fit side by side */
@media (max-width: 900px) {
  .cgal-ring,
  .cgal-item { width: 230px; height: 130px; }
  .cgal-item { margin: -65px 0 0 -115px; }
  .cgal-ring { --cgal-radius: 240px; }
}

/* Phones: stack the two rings vertically */
@media (max-width: 640px) {
  .cgal-pair { flex-direction: column; gap: 2rem; }
  .cgal-side { height: 50%; }
  .cgal-ring,
  .cgal-item { width: 260px; height: 146px; }
  .cgal-item { margin: -73px 0 0 -130px; }
  .cgal-ring { --cgal-radius: 250px; }
  .cgal-side-label { top: 3%; }
}

/* Reduced motion: drop the 3D spin, show simple grids instead */
@media (prefers-reduced-motion: reduce) {
  .cgal-scroll { height: auto; margin-top: 2rem; }
  .cgal-sticky { position: static; height: auto; display: block; overflow: visible; }
  .cgal-hint { display: none; }
  .cgal-pair { flex-direction: column; gap: 2.5rem; }
  .cgal-side { height: auto; display: block; }
  .cgal-side-label { position: static; display: inline-block; margin-bottom: 1rem; }
  .cgal-stage { perspective: none; display: block; height: auto; }
  .cgal-ring {
    transform: none;
    width: 100%;
    height: auto;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
  .cgal-item {
    position: static;
    width: 100%;
    height: auto;
    margin: 0;
    transform: none;
    aspect-ratio: 16 / 10;
  }
}

/* -----------------------------------------------------------------
   4b. Testimonials
   ----------------------------------------------------------------- */
.tst {
  padding: clamp(4.5rem, 8vw, 8rem) clamp(1.25rem, 5vw, 4rem);
  background: var(--paper-2);
  scroll-margin-top: var(--nav-h);
}
.tst__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.tst__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(230, 57, 70, 0.1);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1.25rem;
}
.tst__sub {
  margin-top: 1rem;
  color: var(--ink-soft);
  max-width: 46ch;
  font-size: 1.05rem;
}

/* dot navigation */
.tst__dots {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
}
.tst__dot {
  height: 10px;
  width: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(34, 28, 23, 0.22);
  cursor: pointer;
  transition: width 0.3s var(--ease), background 0.3s var(--ease);
}
.tst__dot.is-active {
  width: 40px;
  background: var(--accent);
}

/* rotating cards */
.tst__stage {
  position: relative;
  min-height: 340px;
}
.tst__card {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 30px 60px -38px rgba(34, 28, 23, 0.6);
  opacity: 0;
  transform: translateX(40px) scale(0.96);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  pointer-events: none;
}
.tst__card.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  position: relative;   /* the visible card sets the stage height */
}
.tst__stars {
  color: var(--accent);
  letter-spacing: 0.15em;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}
.tst__quote {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  line-height: 1.5;
  font-weight: 500;
  color: var(--ink);
  flex: 1;
}
.tst__quote::before { content: "\201C"; }
.tst__quote::after  { content: "\201D"; }

.tst__author {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.tst__avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--olive);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}
.tst__author strong { display: block; font-weight: 700; }
.tst__author em {
  font-style: normal;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

@media (max-width: 820px) {
  .tst__inner { grid-template-columns: 1fr; }
}

/* Reduced motion: no slide, instant swap */
@media (prefers-reduced-motion: reduce) {
  .tst__card { transition: opacity 0.001ms; transform: none; }
}

/* -----------------------------------------------------------------
   5. Contact
   ----------------------------------------------------------------- */
.contact { background: var(--ink); color: var(--paper); }
.contact .section-eyebrow { color: var(--accent); }
.contact .section-title { color: var(--paper); }

.contact__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contact__text {
  color: rgba(255, 255, 255, 0.75);
  margin-top: 1.25rem;
  max-width: 46ch;
}

.contact__perks {
  list-style: none;
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.contact__perks li {
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}
.contact__perks li::before { content: "✓ "; color: var(--accent); }

/* form */
.contact__form {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: grid;
  gap: 1.1rem;
}
.field { display: grid; gap: 0.45rem; }
.field label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 255, 255, 0.4); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
}
.field input:focus-visible,
.field textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* native validation feedback after a submit attempt */
.contact__form.was-validated :invalid {
  border-color: #ff8a6b;
}

.contact__success {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
/* stay hidden until JS reveals it on a successful submit */
.contact__success[hidden] { display: none; }
/* once sent, the whole form disappears and only the confirmation remains */
.contact__form.is-sent {
  background: transparent;
  border-color: transparent;
  padding: 0;
}
.contact__form.is-sent .field,
.contact__form.is-sent > button { display: none; }
.contact__success:focus-visible { outline: none; }
.contact__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.contact__success-icon svg { width: 26px; height: 26px; }
.contact__success-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.1;
  color: var(--paper);
}
.contact__success-text {
  color: rgba(255, 255, 255, 0.72);
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 400;
  max-width: 42ch;
}

/* -----------------------------------------------------------------
   6. Footer
   ----------------------------------------------------------------- */
.footer {
  background: var(--paper);
  padding: 3rem clamp(1.25rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
}
.footer__social { display: flex; gap: 1.5rem; }
.footer__link {
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
}
.footer__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.footer__link:hover::after { transform: scaleX(1); }
.footer__copy {
  width: 100%;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
}

/* -----------------------------------------------------------------
   Scroll-triggered reveal animation
   ----------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* -----------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------- */
@media (max-width: 860px) {
  .about__inner { grid-template-columns: 1fr; }
  .about__media { max-width: 380px; margin: 0 auto 1.5rem; width: 100%; }
  .contact__inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  /* nav collapses to a slide-down panel */
  .nav__toggle { display: flex; }

  .nav__menu {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1rem clamp(1.25rem, 5vw, 4rem) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -28px rgba(34, 28, 23, 0.6);
    transform: translateY(-130%);
    transition: transform 0.35s var(--ease);
  }
  .nav__menu.is-open { transform: translateY(0); }

  .nav__link {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.1rem;
  }
  .nav__link::after { display: none; }
  .nav__cta {
    margin-top: 1rem;
    text-align: center;
    padding: 0.9rem;
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .case__head { flex-direction: column; }
}

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