/* =========================================================
   Instaclot
   Palette, fonts and rules come from assets/style-guide/brand-style-guide.png
   and the build brief. Do not add colors or fonts that are not in the style
   guide; tints of palette colors are fine.
   ========================================================= */

/* ---------- Fonts ----------
   Primary: MADE Tommy Soft (Regular + Medium). The supplied files are marked
   PERSONAL USE: a commercial license is needed before the public launch
   (see assets/fonts/MADE-TOMMY-SOFT-LICENSE.txt).
   Secondary: Roboto, self-hosted (Latin, variable 300-500). */
@font-face {
  font-family: "MADE Tommy Soft";
  src: url("../assets/fonts/made-tommy-soft-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MADE Tommy Soft";
  src: url("../assets/fonts/made-tommy-soft-medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("../assets/fonts/roboto-latin-variable.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Style guide palette */
  --navy: #0b2645;        /* dark blue: primary brand color */
  --blue: #247ea8;        /* Cerulean: check marks, arrows, buttons */
  --baby-blue: #93d0f0;   /* Baby Blue: water, focus ring on dark */
  --light-blue: #bce2f0;  /* Light Blue: soft background blue */
  --red: #db1a1a;         /* Primary Scarlet: X marks, drop, patent dot */
  --white: #ffffff;
  /* Tints of palette colors */
  --pale-blue: #eaf6fa;   /* light tint of Light Blue */
  --navy-80: #3c516a;     /* navy at 80% on white (hero description) */
  --line: #dadee3;        /* navy at 15% on white (borders) */

  --font-primary: "MADE Tommy Soft", system-ui, sans-serif;
  --font-secondary: "Roboto", system-ui, sans-serif;

  /* 8px spacing grid */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s8: 64px;
  --gutter: 24px;
  --section-pad: clamp(72px, 10vw, 128px);
  --title-gap: var(--s5);     /* one gap between a title and its content */
  --card-gap: var(--s3);      /* one gap between cards */
  --group-gap: var(--s6);     /* larger gap between groups */
  --bar-h: 72px;
  --radius: 24px;
  --radius-sm: 12px;
  --stage-h: max(580px, calc(100vh - var(--bar-h)));
  --edge: max(24px, 7vw);                       /* one shared left edge: top bar logo and every line of hero text */
}
@supports (height: 100svh) {
  :root { --stage-h: max(580px, calc(100svh - var(--bar-h))); }
}
@media (min-width: 768px) {
  :root { --gutter: 48px; }
}

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

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  padding-top: var(--bar-h);
  font-family: var(--font-secondary);
  font-weight: 300;
  font-size: clamp(18px, 0.4vw + 16.5px, 20px);
  line-height: 1.6;
  color: var(--navy);
  background: var(--white);
  overflow-x: hidden;
}

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

h1, h2, h3, h4, p, ul, ol { margin-top: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}
.topbar :focus-visible,
.updates :focus-visible {
  outline-color: var(--baby-blue);
}

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

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

.skip-link {
  position: absolute;
  left: var(--s2);
  top: -80px;
  z-index: 100;
  padding: var(--s1) var(--s2);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-weight: 500;
}
.skip-link:focus { top: var(--s2); }

/* Primary-font roles: logo, hero slogan, buttons, section titles */
.section-title {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.1;
  color: var(--navy);
}
.section-lede {
  margin: var(--s2) 0 0;
  font-size: clamp(18px, 0.4vw + 16.5px, 20px);
  max-width: 65ch;
}

section[id] { scroll-margin-top: var(--bar-h); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: var(--blue);
  color: var(--white);
}
.btn--primary:hover { background: #1d6a8e; }
.btn--outline {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}
.btn--outline:hover { background: var(--navy); color: var(--white); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- Logo ---------- */
.logo {
  display: inline-flex;
  align-items: baseline;
  color: var(--white);
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}
.logo--dark { color: var(--navy); }
.topbar .logo { margin-left: -0.06em; }
.logo--small { font-size: 28px; }
.logo__i {
  position: relative;
  display: inline-block;
}
.logo__drop {
  position: absolute;
  left: 50%;
  /* Sits half a stroke (0.064em) above the top of the dotless i, like the dot of a normal i */
  bottom: 0.712em;
  width: 0.23em;
  height: 0.34em;
  transform: translateX(-50%);
  fill: var(--red);
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--bar-h);
  background: var(--navy);
  transition: box-shadow 0.2s ease;
}
.topbar.is-scrolled { box-shadow: 0 6px 20px rgba(11, 38, 69, 0.28); }
.topbar__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-inline: var(--edge) var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

/* ---------- Section 1: Hero ---------- */
.hero { position: relative; }
.hero__stage {
  position: relative;
  min-height: var(--stage-h);
  overflow: hidden;
  display: flex;
  align-items: center;
  isolation: isolate;
}
/* Pinned stage: JS adds .js; the extra scroll length is the animation runway */
.js .hero { height: calc(var(--stage-h) + 150vh); }
.js .hero__stage {
  position: sticky;
  top: var(--bar-h);
  height: var(--stage-h);
}
@media (prefers-reduced-motion: reduce) {
  .js .hero { height: auto; }
  .js .hero__stage { position: relative; top: auto; height: auto; min-height: var(--stage-h); }
}

/* Portrait-mode backdrop: soft bright centre, light blue-grey edges, blurred shapes */
.hero__backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(38vmax 38vmax at 90% 14%, rgba(147, 208, 240, 0.42), rgba(147, 208, 240, 0) 70%),
    radial-gradient(34vmax 34vmax at 52% 108%, rgba(188, 226, 240, 0.7), rgba(188, 226, 240, 0) 70%),
    radial-gradient(30vmax 30vmax at 4% 70%, rgba(11, 38, 69, 0.07), rgba(11, 38, 69, 0) 70%),
    radial-gradient(ellipse 62% 78% at 76% 56%, #ffffff 0%, #f4f9fc 42%, #dde9f1 100%);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(88px, 26vw, 120px);
  grid-template-rows: auto minmax(0, 1fr);
  height: var(--stage-h);
  align-items: center;
  column-gap: var(--s2);
  row-gap: var(--s3);
  width: 100%;
  margin: 0;
  padding: var(--s3) max(var(--gutter), calc((100% - 1200px) / 2)) var(--s3) var(--edge);
}
/* Phones: the headline spans the full width above; the copy and the device share the row below */
.hero__text { display: contents; }
.hero__titlebox { grid-column: 1 / -1; min-width: 0; container-type: inline-size; }
.hero__copy {
  min-width: 0;
  align-self: start;
  max-width: 65ch;
  font-size: calc(1.1 * clamp(18px, 0.4vw + 16.5px, 20px));            /* 10% larger than the body text */
}
.hero__device { grid-column: 2; grid-row: 2; height: 100%; align-self: stretch; }
@media (min-width: 768px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) clamp(140px, 20vw, 240px);
    grid-template-rows: none;
    column-gap: var(--s4);
  }
  .hero__copy { align-self: auto; }
  .hero__text { display: block; }
  .hero__device { grid-column: auto; grid-row: auto; height: calc(var(--stage-h) - 2 * var(--s3)); align-self: center; }
}

/* Two lines, never broken. About 17% larger than before, but never wider than its own column. */
.hero__title {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: clamp(36px, 5.6vw, 112px);                                   /* fallback without container units */
  font-size: min(calc(1.17 * clamp(44px, min(7vw, 12vh), 104px)), 12.8cqw);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-left: -0.031em;                       /* cancels the side bearing of the S so the ink starts on the shared edge */
  color: var(--navy);
}
.hero__title span { display: block; white-space: nowrap; }
.hero__title span:nth-child(2) { margin-left: -0.034em; }      /* the F has a larger side bearing than the S: bring line two's ink onto the same edge */

.hero__lede {
  margin: var(--s3) 0 0 -0.103em;             /* cancels the side bearing of the I */
  color: var(--navy-80);
}
/* The same Patent pending line as the footer, kept small, centred on the paragraph above it */
.patent.hero__patent {
  justify-content: flex-start;
  margin: 12px 0 0;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: 20px;
}
.hero__actions .btn { white-space: nowrap; }
@media (max-width: 767px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
}

.hero__device { min-height: 0; }
.hero__svg {
  width: 100%;
  height: 100%;
}
/* No-JS fallback: show the finished state */
.no-js #stem-g { transform: translate(0, 0); }
.no-js #cotton-g { transform: translate(0, -187px) translate(130px, 330px) scale(1.08) translate(-130px, -330px); }

/* ---------- Section 2: How it works ---------- */
.section { padding-block: var(--section-pad); }
.how { background: var(--white); }

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--group-gap) var(--s4);
  margin-top: var(--title-gap);
}
/* Panel and card widths follow the drawing widths (190 / 230 / 290 / 190 px, all in an equal 520px-tall area) so each
   drawing shows at 1:1 and its labels stay at least 16px. Step 3 is about 1.6x a normal box. Below 1280px the groups stack. */
@media (min-width: 1280px) {
  .steps { grid-template-columns: 484fr 342fr 214fr; }
}
.step-group { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.step-group__label {
  margin: 0;
  padding-bottom: var(--s1);
  border-bottom: 2px solid var(--navy);
  font-family: var(--font-secondary);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}
.step-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--card-gap);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  flex: 1;
}
@media (min-width: 1280px) {
  .step-group__list { grid-template-columns: var(--cards, 1fr 1fr); gap: var(--s2); }
  .step-group--prepare { --cards: 214fr 254fr; }
  .step-group--use { --cards: 1fr; }
  .step-group--clean { --cards: 1fr; }
  .step-card { padding-inline: 12px; }
}
.step-card {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  padding: var(--s3) var(--s2) var(--s2);
  border-radius: var(--radius);
  background: var(--light-blue);
}
.step-card__num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  font-weight: 500;
  font-size: 20px;
  line-height: 1;
}
.step-card__title {
  margin: 0;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  color: var(--navy);
}
.step-card__text { margin: 0; color: var(--navy); }
.step-card__art {
  margin-top: auto;
  padding-top: var(--s2);
}
.step-card__art img { max-width: 100%; height: auto; margin-inline: auto; }

/* ---------- Section 3: What it solves ---------- */
.solves { background: var(--pale-blue); }

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1) var(--s2);
  margin: var(--title-gap) 0 0;
  padding: 0;
  list-style: none;
}
.chips__label { font-weight: 500; margin-right: var(--s1); }
.chip {
  padding: var(--s1) var(--s2);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.3;
}

.compare { margin-top: var(--title-gap); }
.compare--table { display: none; }
.compare--cards { display: grid; gap: var(--card-gap); }
@media (min-width: 768px) {
  .compare--table { display: block; }
  .compare--cards { display: none; }
}

.compare-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.compare-table th, .compare-table td { padding: var(--s2) var(--s1); text-align: center; }
.compare-table thead th { vertical-align: bottom; padding-bottom: var(--s2); font-weight: 500; }
.compare-table thead th:first-child { width: 22%; }
.compare-table tbody th {
  text-align: left;
  padding-left: 0;
  font-weight: 500;
  font-size: 20px;
  color: var(--navy);
}
.compare-table tbody tr > * { border-top: 1px solid rgba(11, 38, 69, 0.15); }
.compare-table .col-instaclot { background: var(--light-blue); }
.compare-table thead .col-instaclot { border-radius: var(--radius) var(--radius) 0 0; padding-top: var(--s2); }
.compare-table tbody tr:last-child .col-instaclot { border-radius: 0 0 var(--radius) var(--radius); }

.compare-head { display: grid; gap: var(--s1); justify-items: center; padding-inline: var(--s1); }
.compare-head img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}
.compare-head img.kid,
.compare-card img.kid { object-fit: contain; border-radius: 0; background: none; }
.compare-head__name { font-size: 22px; line-height: 1.2; color: var(--navy); }

.mark { display: inline-grid; place-items: center; width: 40px; height: 40px; }
.mark svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.mark--yes { color: var(--blue); }
.mark--no { color: var(--red); }

.compare-card {
  padding: var(--s3);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.compare-card--highlight { background: var(--light-blue); border-color: var(--light-blue); }
.compare-card h3 { margin: var(--s2) 0 var(--s2); font-weight: 500; font-size: 24px; color: var(--navy); }
.compare-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.compare-card ul { list-style: none; margin: 0; padding: 0; }
.compare-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s1) 0;
  border-top: 1px solid rgba(11, 38, 69, 0.15);
  font-weight: 500;
}

/* ---------- Section 4: Get updates ---------- */
.updates { background: var(--navy); color: var(--white); }
.updates .section-title { color: var(--white); }
.updates__grid {
  display: grid;
  gap: var(--s6);
  align-items: center;
}
@media (min-width: 900px) {
  .updates__grid { grid-template-columns: 1fr 1.1fr; }
}
.updates__helper { margin: var(--s2) 0 0; max-width: 24em; color: var(--white); }

.form-card {
  padding: var(--s4);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
}
@media (max-width: 479px) {
  .form-card { padding: var(--s3); }
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}
@media (min-width: 560px) {
  .form-row { grid-template-columns: 1fr 1fr; gap: var(--s2); }
}
.field { display: block; margin-bottom: var(--s3); }
.form-row .field { margin-bottom: 0; }
.form-row { margin-bottom: var(--s3); }
.field__label {
  display: block;
  margin-bottom: var(--s1);
  font-weight: 500;
  color: var(--white);
}
.field__input {
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s2);
  border: 2px solid var(--white);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-secondary);
  font-weight: 400;
  font-size: 18px;
}
.field__input[aria-invalid="true"] { border-color: var(--baby-blue); border-width: 3px; }
.field__error {
  display: flex;
  gap: var(--s1);
  align-items: flex-start;
  margin: var(--s1) 0 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: var(--white);
}
.field__error[hidden] { display: none; }
.field__error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  font-weight: 500;
  font-size: 14px;
  line-height: 1;
}
.form-card .btn { width: 100%; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-message { margin: var(--s3) 0 0; font-size: 18px; color: var(--white); }
.form-message:empty { display: none; }
.form-message--error { padding: var(--s2); border: 2px solid var(--white); border-radius: var(--radius-sm); }
.form-success {
  padding: var(--s2) 0;
  text-align: left;
}
.form-success h3 {
  margin: 0 0 var(--s1);
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.15;
  color: var(--white);
}
.form-success p { margin: 0; color: var(--white); }
.form-success:focus { outline: none; }

/* ---------- Section 5: Footer ---------- */
.footer {
  padding-block: var(--s6);
  border-top: 1px solid var(--light-blue);
  background: var(--white);
}
.footer__inner {
  --footer-margin: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  align-items: center;
  justify-items: start;
  width: calc(100% - 2 * var(--footer-margin));
  margin-inline: auto;
}
@media (min-width: 768px) {
  .footer__inner { --footer-margin: 24px; grid-template-columns: 1fr auto 1fr; }
  .footer__sketch { justify-self: end; }
  .footer__nav { justify-self: center; }
}
.patent {
  display: flex;
  align-items: center;
  gap: var(--s1);
  margin: var(--s1) 0 0;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.2;
  color: var(--navy);
}
.patent__dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
}
.footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) clamp(36px, 7.5vw, 96px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__nav a {
  color: var(--navy);
  font-weight: 400;
  font-size: 18px;
  text-decoration: none;
}
.footer__nav a:hover, .footer__nav a:focus-visible {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}
.footer__sketch img { height: 96px; width: auto; }

/* ---------- Our Story page ---------- */
.story-page { padding-block: clamp(48px, 8vw, 96px) var(--section-pad); }
.story {
  display: grid;
  gap: var(--s5);
  margin-top: var(--title-gap);
  align-items: start;
}
@media (min-width: 768px) {
  .story { grid-template-columns: minmax(240px, 0.8fr) 1.4fr; gap: var(--s8); }
}
.story__figure { margin: 0; width: 100%; max-width: 420px; }
.story__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 0%;                       /* the face sits in the upper part of the portrait */
  border-radius: var(--radius);
}
.story__caption {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--navy);
}
.story__text p { max-width: 65ch; color: var(--navy); }
.story__text p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  .story__text p:first-child { margin-top: -0.4em; }    /* cap height of the first line meets the top edge of the photo */
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}
