/* =========================================================================
   Flick Cards deck  ·  "Find your Tesla"
   ========================================================================= */

/* FONTS: self-hosted (SIL Open Font License, see fonts/). The standalone file loads them from Google Fonts instead. */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('fonts/space-grotesk-latin-wght-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/space-mono-latin-400-normal.woff2') format('woff2'); }
/* END FONTS */

/* ===== CUSTOMISE ==========================================================
   Every colour and size the deck uses lives here.                         */
:root {
  /* stage */
  --fd-stage-bg: #f4f4f4;                 /* full-viewport stage background   */
  --fd-text: #171a20;                     /* headings and stage text          */
  --fd-muted: #5c5e62;                    /* secondary text                   */
  --fd-line: #d0d1d2;                     /* hairlines and outlines           */
  --fd-hover-bg: #ffffff;                 /* hover fill for outline buttons   */
  --fd-outline: rgba(23, 26, 32, .35);    /* outline buttons                  */
  --fd-perspective: 1400px;               /* 3D depth of the fan              */

  /* cards */
  --fd-card-w: clamp(240px, min(42vw, 62vh), 600px);  /* card width        */
  --fd-card-ratio: 16 / 11;               /* landscape card aspect ratio      */
  --fd-card-h-ratio: .6875;               /* height ÷ width (keep in step)    */
  --fd-card-radius: 14px;
  --fd-card-bg: #d9dadb;                  /* shows while images load          */
  --fd-card-shadow: 0 30px 60px -28px rgba(23, 26, 32, .45);
  --fd-shade: #f4f4f4;                    /* back cards fade toward this      */

  /* product name on the front card */
  --fd-name-scale: .095;                  /* name size = card width × this    */
  --fd-name-weight: 500;
  --fd-name-color: #ffffff;               /* sits on the dark photo           */
  --fd-tag-color: rgba(255, 255, 255, .72);
  --fd-name-top: 6%;                      /* distance from the card top       */
  --fd-name-scale-tagged: .08;            /* when a make line sits under the name (.fd--tagged) */
  --fd-name-top-tagged: 4%;

  /* "Get this kit" pill */
  --fd-btn-bg: #ffffff;
  --fd-btn-text: #171a20;
  --fd-btn-border: #ffffff;
  --fd-btn-hover-bg: #171a20;
  --fd-btn-hover-text: #ffffff;
  --fd-btn-bottom: 5%;                    /* distance from the card bottom    */
  --fd-btn-h: 44px;                       /* pill height                      */

  /* prev / next arrows */
  --fd-arrow-size: 52px;
  --fd-arrow-bg: #ffffff;
  --fd-arrow-border: #d0d1d2;
  --fd-arrow-icon: #171a20;
  --fd-arrow-hover-border: #171a20;

  /* ambient glow behind the deck */
  --fd-glow-blur: 90px;
  --fd-glow-opacity: .12;
  --fd-glow-lift: 2.2;                    /* brightens the photo so the glow stays light */
  --fd-glow-blend: normal;

  /* keyboard focus ring */
  --fd-focus: #171a20;

  /* type */
  --fd-font-ui: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fd-font-btn: 'Space Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
@media (max-width: 700px) {
  :root {
    --fd-card-w: clamp(240px, 84vw, 420px);  /* wider cards on phones */
    --fd-arrow-size: 44px;
    --fd-btn-h: 34px;
    --fd-btn-bottom: 4%;
  }
}
/* ===== end CUSTOMISE ===================================================== */

.fd {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;            /* clip can't be scrolled by focus or scrollIntoView */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--fd-stage-bg);
  color: var(--fd-text);
  font-family: var(--fd-font-ui);
  -webkit-font-smoothing: antialiased;
}
.fd *, .fd *::before, .fd *::after { box-sizing: border-box; }

/* ambient glow: two layers that crossfade */
.fd-glow { position: absolute; inset: 0; z-index: -1; opacity: var(--fd-glow-opacity); mix-blend-mode: var(--fd-glow-blend); pointer-events: none; }
.fd-glow__layer {
  /* drawn at a quarter of the size and scaled up: same 90px-looking blur for a fraction of the paint cost */
  position: absolute; left: -14%; top: -14%; width: 32%; height: 32%;
  transform: scale(4); transform-origin: 0 0;
  background: center/cover no-repeat;
  filter: blur(calc(var(--fd-glow-blur) / 4)) brightness(var(--fd-glow-lift)) saturate(1.4);
  opacity: 0;
  will-change: opacity;
}
.fd-glow__layer:first-child { opacity: 1; }

/* heading row */
.fd-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: clamp(40px, 7vh, 88px) 24px 0;
}
.fd-kicker { display: block; margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--fd-muted); }
.fd-title { margin: 0; font-size: clamp(30px, 4.2vw, 52px); font-weight: 500; line-height: 1.04; letter-spacing: -.025em; text-wrap: balance; }
.fd-lede { margin: 12px 0 0; max-width: 46ch; font-size: 16px; line-height: 1.55; color: var(--fd-muted); }
.fd-all {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--fd-outline); border-radius: 999px;
  color: var(--fd-text); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background-color .25s, border-color .25s;
}
.fd-all:hover { background: var(--fd-hover-bg); border-color: var(--fd-text); }

/* stage + deck */
.fd-stage {
  position: relative; flex: 1;
  display: grid; place-items: center;
  perspective: var(--fd-perspective);
  padding: clamp(28px, 5vh, 56px) 0;
  min-height: calc(var(--fd-card-w) * var(--fd-card-h-ratio) + 72px);
}
.fd-deck { position: relative; width: var(--fd-card-w); aspect-ratio: var(--fd-card-ratio); transform-style: preserve-3d; }

.fd-card {
  position: absolute; inset: 0;
  border-radius: var(--fd-card-radius);
  overflow: hidden;
  background: var(--fd-card-bg);
  box-shadow: var(--fd-card-shadow);
  user-select: none; -webkit-user-select: none;
  touch-action: pan-y;
  backface-visibility: hidden;
  will-change: transform;
  cursor: grab;
}
.fd-card.is-dragging { cursor: grabbing; }
.fd-card:not(.is-front) { cursor: pointer; }
.fd-card img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.fd-shade { position: absolute; inset: 0; background: var(--fd-shade); opacity: 0; pointer-events: none; }

.fd-copy { position: absolute; left: 6%; right: 6%; top: var(--fd-name-top); text-align: center; pointer-events: none; }
.fd-name {
  margin: 0;
  font-size: calc(var(--fd-card-w) * var(--fd-name-scale));
  font-weight: var(--fd-name-weight);
  line-height: 1; letter-spacing: -.02em;
  color: var(--fd-name-color);
  white-space: nowrap;
}
.fd-tag { margin: .6em 0 0; line-height: 1.2; font-size: max(10px, calc(var(--fd-card-w) * .022)); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--fd-tag-color); }

.fd-cta-wrap { position: absolute; left: 0; right: 0; bottom: var(--fd-btn-bottom); display: flex; justify-content: center; }
.fd-cta {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--fd-btn-h); padding: 0 calc(var(--fd-btn-h) / 2);
  border: 1px solid var(--fd-btn-border); border-radius: 999px;
  background: var(--fd-btn-bg); color: var(--fd-btn-text);
  font-family: var(--fd-font-btn); font-size: max(12px, calc(var(--fd-card-w) * .024)); letter-spacing: .02em;
  text-decoration: none; white-space: nowrap;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  -webkit-user-drag: none;
  transition: background-color .25s, color .25s, border-color .25s;
}
.fd-cta:hover { background: var(--fd-btn-hover-bg); color: var(--fd-btn-hover-text); border-color: var(--fd-btn-hover-bg); }

/* arrows */
.fd-arrow {
  position: absolute; top: 50%; z-index: 40;
  width: var(--fd-arrow-size); height: var(--fd-arrow-size);
  display: grid; place-items: center;
  margin-top: calc(var(--fd-arrow-size) / -2);
  border: 1px solid var(--fd-arrow-border); border-radius: 50%;
  background: var(--fd-arrow-bg); color: var(--fd-arrow-icon);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .25s, border-color .25s, transform .25s;
}
.fd-arrow:hover { border-color: var(--fd-arrow-hover-border); }
.fd-arrow:active { transform: scale(.94); }
.fd-arrow svg { width: 40%; height: 40%; }
.fd-arrow--prev { left: clamp(12px, 4vw, 56px); }
.fd-arrow--next { right: clamp(12px, 4vw, 56px); }

/* bottom bar */
.fd-bar {
  display: flex; align-items: center; justify-content: center; gap: 12px 20px; flex-wrap: wrap;
  padding: 0 24px clamp(28px, 5vh, 56px);
  font-size: 13px; color: var(--fd-muted);
}
.fd-count { font-family: var(--fd-font-btn); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.fd-pause {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--fd-outline); border-radius: 999px; background: transparent;
  color: var(--fd-text); font: inherit; cursor: pointer;
}
.fd-pause:hover { color: var(--fd-text); border-color: var(--fd-text); background: var(--fd-hover-bg); }
.fd-pause svg { width: 10px; height: 10px; }
.fd-pause[hidden] { display: none; }
.fd-note { flex-basis: 100%; text-align: center; margin: 4px 0 0; }
.fd-note a { color: var(--fd-text); text-underline-offset: 3px; }

.fd :focus-visible { outline: 2px solid var(--fd-focus); outline-offset: 3px; }
.fd-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* phones: arrows move under the deck so they never cover a card */
@media (max-width: 700px) {
  .fd-stage { padding-bottom: calc(var(--fd-arrow-size) + 36px); }
  .fd-arrow { top: auto; bottom: 14px; margin-top: 0; }
  .fd-arrow--prev { left: calc(50% - var(--fd-arrow-size) - 10px); }
  .fd-arrow--next { right: calc(50% - var(--fd-arrow-size) - 10px); }
}

/* without the script (or before it loads) the cards sit in a swipeable row */
.fd:not(.is-ready) .fd-deck {
  display: flex; gap: 16px; width: 100%; aspect-ratio: auto;
  overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 24px;
}
.fd:not(.is-ready) .fd-card { position: relative; flex: 0 0 var(--fd-card-w); aspect-ratio: var(--fd-card-ratio); scroll-snap-align: center; }
.fd:not(.is-ready) .fd-arrow,
.fd:not(.is-ready) .fd-pause,
.fd:not(.is-ready) .fd-count { display: none; }

/* decks where every card carries a make line: slightly smaller name, set higher, so text stays clear of tall vehicles */
.fd--tagged .fd-copy { top: var(--fd-name-top-tagged); }
.fd--tagged .fd-name { font-size: calc(var(--fd-card-w) * var(--fd-name-scale-tagged)); }
.fd--tagged .fd-tag { margin-top: .35em; font-size: max(9px, calc(var(--fd-card-w) * .02)); }

/* =========================================================================
   Review cards  ·  a flick deck of customer reviews (.fd--reviews)
   ========================================================================= */

/* ===== CUSTOMISE (reviews) =============================================== */
.fd--reviews {
  --fd-stage-bg: #ffffff;                 /* section background                */
  --fd-card-w: clamp(260px, min(30vw, 56vh), 380px);
  --fd-card-ratio: 3 / 4.1;               /* portrait review cards             */
  --fd-card-h-ratio: 1.3667;              /* height ÷ width (keep in step)     */
  --fd-card-radius: 14px;
  --fd-card-bg: #ffffff;
  --fd-card-shadow: 0 26px 50px -28px rgba(23, 26, 32, .38), 0 0 0 1px #e4e5e6;
  --fd-shade: #ffffff;                    /* back cards fade into the stage    */
  --fd-font-ui: var(--font, 'Manrope', system-ui, sans-serif);
  --fd-font-btn: var(--font, 'Manrope', system-ui, sans-serif);
  --rv-ink: var(--ink, #171a20);          /* quote and names                   */
  --rv-muted: var(--muted, #5c5e62);      /* badge and product line            */
  --rv-line: var(--line, #d0d1d2);        /* divider and the big quote mark    */
  --rv-avatar-bg: var(--mist, #f4f4f4);   /* initial circle                    */
  --rv-pad: clamp(20px, calc(var(--fd-card-w) * .07), 28px);
}
@media (max-width: 700px) {
  .fd--reviews { --fd-card-w: clamp(250px, 80vw, 330px); }
}
/* ===== end CUSTOMISE (reviews) =========================================== */

.fd--reviews { min-height: 0; }
.fd--reviews .fd-stage { padding-top: clamp(20px, 4vh, 40px); }
.rv-card { display: flex; flex-direction: column; padding: var(--rv-pad); color: var(--rv-ink); font-family: var(--fd-font-ui); text-align: left; }
.rv-mark { position: absolute; top: calc(var(--rv-pad) * .2); right: calc(var(--rv-pad) * .9); font: 700 calc(var(--fd-card-w) * .3)/1 var(--fd-font-ui); color: var(--rv-line); opacity: .55; pointer-events: none; }
.rv-body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.rv-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--rv-muted); }
.rv-badge svg { width: 16px; height: 16px; flex: none; color: var(--rv-ink); }
.rv-quote { position: relative; margin: 0; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.rv-quote p { margin: 0; color: var(--rv-ink); font-weight: 500; line-height: 1.5; text-wrap: pretty; }
.rv-card--s .rv-quote p { font-size: calc(var(--fd-card-w) * .066); line-height: 1.28; font-weight: 600; letter-spacing: -.015em; }
.rv-card--m .rv-quote p { font-size: max(15px, calc(var(--fd-card-w) * .048)); line-height: 1.45; }
.rv-card--l .rv-quote p { font-size: max(14px, calc(var(--fd-card-w) * .041)); line-height: 1.5; }
/* a review that does not fit fades out and offers the full text */
.rv-card.is-clipped .rv-quote::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(rgba(255,255,255,0), var(--fd-card-bg)); }
.rv-more { display: none; align-self: flex-start; align-items: center; min-height: 44px; margin-top: 6px; padding: 0; border: 0; background: none; color: var(--rv-ink); font: 600 14px var(--fd-font-ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rv-card.is-clipped .rv-more { display: inline-flex; }
.rv-who { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--rv-line); }
.rv-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--rv-avatar-bg); font-weight: 700; font-size: 16px; color: var(--rv-ink); }
.rv-who b { display: block; font-size: 15px; font-weight: 700; }
.rv-who small { display: block; margin-top: 2px; font-size: 13px; color: var(--rv-muted); }
.fd--reviews .fd-shade { z-index: 3; }
.fd--reviews .fd-note { color: var(--rv-muted); font-size: 13px; }

/* full review dialog */
.rv-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 28px; border: 0; border-radius: 14px; background: #fff; color: var(--rv-ink, #171a20);
  font-family: var(--font, 'Manrope', system-ui, sans-serif); box-shadow: 0 40px 80px -30px rgba(23,26,32,.45); }
.rv-dialog::backdrop { background: rgba(23, 26, 32, .45); }
.rv-dialog blockquote { margin: 0 0 18px; font-size: 17px; line-height: 1.6; font-weight: 500; }
.rv-dialog blockquote p { margin: 0; }
.rv-dialog .rv-who { margin-top: 0; }
.rv-dialog__close { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 20px; padding: 0 20px; border: 1.5px solid var(--rv-line, #d0d1d2); border-radius: 999px; background: #fff; font: 600 14px var(--font, 'Manrope', sans-serif); color: inherit; cursor: pointer; }
.rv-dialog__close:hover { border-color: var(--rv-ink, #171a20); }

/* without the script the review cards grow to fit their text */
.fd--reviews:not(.is-ready) .fd-card { aspect-ratio: auto; min-height: calc(var(--fd-card-w) * 1.2); }
.fd--reviews:not(.is-ready) .rv-quote { overflow: visible; }
