/* ============================================================
   The Flow — Tutorial site

   Colour values are taken from the live Shopify theme's rendered
   custom properties, not guessed:

     scheme-1 (content sections)
       --color-background     249,249,249   (flat fallback)
       --gradient-background  linear-gradient(180deg,#e5d9c3,#f1ebe2)
       --color-foreground     2,1,1
       --color-button         210,153,167   (#d299a7)
       --color-button-text    249,249,249

     scheme-2 (hero fade target, footer)
       --color-background     229,216,196   (#e5d8c4)

   One continuous warm gradient covers the whole page, including the
   hub and footer. Layout and controls are mobile first.
   ============================================================ */

:root {
  /* surfaces */
  --flow-warm: #e5d8c4;               /* warm fallback and control surfaces */
  --flow-gradient: linear-gradient(180deg, #e5d9c3 0%, #f1ebe2 100%);
  --flow-gradient-top: #e5d9c3;       /* first stop, for seamless joins */
  --flow-gradient-bottom: #f1ebe2;    /* last stop */

  /* ink */
  --flow-text: #020101;               /* scheme foreground */
  --flow-text-rgb: 2, 1, 1;
  --flow-hero-ink: #2c2c2c;           /* overridden per hero by the build */

  /* brand */
  --flow-accent: #d299a7;
  --flow-accent-ink: #020101;

  --flow-radius: 12px;
  --flow-max: 1200px;
  --flow-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --flow-header-h: 64px;
  --flow-viewport-h: 100vh;

  /* hero height, set per page by the build */
  --flow-hero-h: 85vh;
  --flow-hero-h-sv: 85svh;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--flow-header-h) + 16px);
  background: var(--flow-warm);
}

@supports (height: 100svh) {
  :root { --flow-viewport-h: 100svh; }
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--flow-font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.006em;            /* theme body tracking */
  color: var(--flow-text);
  /* Size the gradient to the full document, not each individual section. */
  background: var(--flow-warm) var(--flow-gradient) no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--flow-text);
  color: var(--flow-gradient-bottom);
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--flow-text);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px var(--flow-gradient-bottom);
}

[hidden] { display: none !important; }
a, button { -webkit-tap-highlight-color: rgba(210, 153, 167, 0.25); }
button, a, video { scroll-margin-top: calc(var(--flow-header-h) + 16px); }

/* ---------- Top bar ---------- */

/* three columns so the logo is centred on the page, not between its
   neighbours - the two outer columns are equal width whatever they hold */
.flow-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: var(--flow-header-h);
  padding: 6px 24px;
  background: rgba(229, 217, 195, 0.88);   /* warm, matches the palette */
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(var(--flow-text-rgb), 0.07);
}

.flow-topbar__left {
  justify-self: start;
  min-width: 0;
}

.flow-topbar__brand {
  grid-column: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  color: var(--flow-text);
  transition: opacity 0.2s ease;
}
.flow-topbar__brand:hover { opacity: 0.8; }

/* Crop only the transparent canvas, preserving the original logo artwork. */
.flow-topbar__logo {
  width: 140px;
  height: auto;
  display: block;
}

.flow-topbar__logo-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.flow-topbar__back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--flow-text);
  text-decoration: none;
  opacity: 0.7;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.flow-topbar__back:hover { opacity: 1; }

@media (max-width: 767px) {
  .flow-topbar {
    padding: 6px 16px;
  }
  .flow-topbar__left { display: none; }
  .flow-topbar__logo { width: 108px; }
  .flow-topbar__back { display: none; }
}

/* ---------- Language switcher ---------- */

.flow-langswitch {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 100px;
  background: rgba(var(--flow-text-rgb), 0.07);
}

.flow-langswitch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--flow-text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.flow-langswitch__btn:hover { background: rgba(var(--flow-text-rgb), 0.09); }

.flow-langswitch__btn[aria-current="true"] {
  background: var(--flow-accent);
  color: var(--flow-accent-ink);
}

/* full names where there is room, two-letter codes where there is not */
.flow-langswitch__code { display: none; }

@media (max-width: 900px) {
  .flow-langswitch__label { display: none; }
  .flow-langswitch__code { display: inline; font-size: 12px; letter-spacing: 0.05em; }
  .flow-langswitch__btn { min-width: 40px; padding: 6px 8px; }
}

@media (max-width: 560px) {
  .flow-langswitch__btn { min-width: 36px; padding: 6px 6px; }
}

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

.flow-hero {
  --flow-video-width: min(var(--flow-video-w-mobile, 280px), 78vw);
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 24px;
  width: 100%;
  height: clamp(600px, calc(var(--flow-viewport-h) - var(--flow-header-h)), 860px);
  isolation: isolate;
}

.flow-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
  /* Reveal the page gradient itself so the hero cannot end in a hard seam. */
  -webkit-mask-image: linear-gradient(to bottom, #000 var(--flow-fade-start, 20%), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 var(--flow-fade-start, 20%), transparent 100%);
}
.flow-hero > picture { position: absolute; inset: 0; z-index: 1; }

.flow-hero__title {
  position: relative;
  grid-row: 2;
  align-self: end;
  z-index: 3;
  min-width: 0;
  max-width: 620px;
  text-shadow: 0 1px 24px rgba(255, 255, 255, 0.35);
}

.flow-hero__kit-name {
  margin: 0 0 8px;
  font-size: clamp(34px, 8vw, 48px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--flow-hero-ink);
}

.flow-hero__tagline {
  margin: 0;
  font-size: clamp(16px, 4vw, 20px);
  font-style: italic;
  line-height: 1.4;
  opacity: 0.9;
  color: var(--flow-hero-ink);
}

.flow-hero__video-wrap {
  position: relative;
  grid-row: 1;
  z-index: 4;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  min-width: 0;
}

.flow-hero__video-inner {
  /* One dimension stays automatic, so a short screen cannot crop the video. */
  height: 100%;
  max-height: calc(var(--flow-video-width) / var(--flow-video-ratio));
  width: auto;
  aspect-ratio: var(--flow-video-ratio, 9 / 16);
  flex: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.28);
  background: #000;
}

.flow-hero__video-inner video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.flow-hero__notice {
  max-width: 360px;
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(229, 216, 196, 0.94);
  border: 1px solid rgba(var(--flow-text-rgb), 0.12);
  color: var(--flow-text);
  font-size: 12px;
  line-height: 1.5;
  text-shadow: none;
}

@media (min-width: 768px) {
  .flow-hero { --flow-video-width: var(--flow-video-w-desktop, 300px); padding: 32px; }
  .flow-hero__kit-name { font-size: clamp(40px, 4.2vw, 60px); }
  .flow-hero__tagline { font-size: 22px; }
}

@media (min-width: 1024px) {
  .flow-hero {
    grid-template-columns: minmax(0, 1fr) var(--flow-video-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: max(580px, min(var(--flow-hero-h-sv), calc(var(--flow-viewport-h) - var(--flow-header-h))));
    gap: 32px;
  }
  .flow-hero__title { grid-column: 1; grid-row: 1; }
  .flow-hero__video-wrap { grid-column: 2; grid-row: 1; }
}

/* Keep the full portrait frame usable when a phone is rotated. */
@media (orientation: landscape) and (max-height: 620px) and (min-width: 600px) {
  .flow-hero {
    --flow-video-width: min(220px, calc((var(--flow-viewport-h) - var(--flow-header-h) - 32px) * 9 / 16));
    grid-template-columns: minmax(0, 1fr) var(--flow-video-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: max(256px, calc(var(--flow-viewport-h) - var(--flow-header-h)));
    padding: 16px 24px;
    gap: 20px;
  }
  .flow-hero__title { grid-column: 1; grid-row: 1; }
  .flow-hero__video-wrap { grid-column: 2; grid-row: 1; }
  .flow-hero__kit-name { font-size: clamp(26px, 4vw, 36px); }
  .flow-hero__tagline { font-size: 16px; }
  .flow-hero__notice { font-size: 11px; margin-top: 10px; padding: 8px 10px; }
}

/* ---------- Section shell ---------- */

.flow-section {
  width: 100%;
  padding: 64px 24px 48px;
}

.flow-section__inner { max-width: 720px; margin: 0 auto; }
.flow-section__inner--wide { max-width: 900px; }

.flow-heading {
  margin: 0 0 40px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--flow-text);
}

@media (min-width: 768px) {
  .flow-section { padding: 80px 32px 64px; }
  .flow-heading { font-size: 32px; }
}

/* ---------- Steps ---------- */

.flow-steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.flow-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
}

.flow-step__num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--flow-text);
  color: var(--flow-gradient-bottom);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  flex-shrink: 0;
}

.flow-step__body { padding-top: 10px; }

.flow-step__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.flow-step__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.75;
}

/* ---------- FAQ ---------- */

.flow-faq__list { border-top: 1px solid rgba(var(--flow-text-rgb), 0.12); }
.flow-faq__item { border-bottom: 1px solid rgba(var(--flow-text-rgb), 0.12); }
.flow-faq__heading { margin: 0; }

.flow-faq__trigger {
  width: 100%;
  padding: 20px 0;
  border: 0;
  background: none;
  font-family: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  cursor: pointer;
}

.flow-faq__question {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.flow-faq__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.5;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.flow-faq__item[data-open] .flow-faq__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.flow-faq__panel {
  /* Natural height also handles font swaps and rotation while a panel is open. */
  height: auto;
}

.flow-faq__answer {
  margin: 0;
  padding: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.75;
}

/* ---------- Gallery ---------- */

.flow-gallery__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.flow-gallery__item { margin: 0; }

.flow-gallery__item img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--flow-radius);
  background: rgba(var(--flow-text-rgb), 0.04);
}

@media (min-width: 768px) {
  .flow-gallery__grid { gap: 16px; }
  .flow-gallery__item img { border-radius: 16px; }
}

/* ---------- CTA ---------- */

.flow-cta { text-align: center; }

.flow-cta__heading {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.flow-btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 100px;
  background: var(--flow-text);
  color: var(--flow-gradient-bottom);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.flow-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.flow-btn--accent {
  background: var(--flow-accent);
  color: var(--flow-accent-ink);
}

/* ---------- Hub ---------- */

.flow-hub__header {
  padding: 64px 24px 40px;
  text-align: center;
}

.flow-hub__heading {
  margin: 0 0 14px;
  font-size: clamp(32px, 9vw, 60px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.flow-hub__sub {
  max-width: 620px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.78;
}

@media (min-width: 768px) {
  .flow-hub__header { padding: 88px 32px 56px; }
  .flow-hub__sub { font-size: 17px; }
}

.flow-feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: center;
  max-width: var(--flow-max);
  margin: 0 auto;
  padding: 48px 24px;
}

.flow-feature__media {
  border-radius: var(--flow-radius);
  overflow: hidden;
  background: #efeae0;
  aspect-ratio: 1 / 1;
}

.flow-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flow-feature__eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--flow-text);
}

.flow-feature__heading {
  margin: 0 0 14px;
  font-size: clamp(26px, 6vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.flow-feature__desc {
  margin: 0 0 26px;
  font-size: 15px;
  line-height: 1.65;
  opacity: 0.8;
}

@media (min-width: 900px) {
  .flow-feature {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    padding: 72px 32px;
  }
  .flow-feature--reverse .flow-feature__media { order: 2; }
  .flow-feature__desc { font-size: 16px; }
}

/* ---------- Footer ---------- */

.flow-footer {
  padding: 40px 24px 48px;
  text-align: center;
  font-size: 13px;
  color: rgba(var(--flow-text-rgb), 0.72);
}

/* ---------- Reveal on scroll ---------- */

@media (prefers-reduced-motion: no-preference) {
  .flow-reveal.is-pending {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .flow-reveal.is-visible { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Print ---------- */

@media print {
  .flow-topbar, .flow-hero__video-wrap { display: none; }
  .flow-reveal { opacity: 1 !important; transform: none !important; }
  .flow-faq__panel[hidden] { display: block !important; }
}
