/*
 * NILOSI homepage.
 *
 * Loaded on the front page only, after tokens, base and chrome. Every shared
 * component -- .nd-label, .nd-tile*, .nd-plate*, .nd-head*, .nd-btn*,
 * .nd-video* -- is defined in base.css and only USED here; this file carries
 * the per-section layout and nothing that another page would need.
 *
 * Running order (front-page.php):
 *   hero -> trust -> categories -> shelf -> routine -> film -> stage
 *   -> story -> faq -> signup -> closer
 *
 * Mobile first. Breakpoints are the documented set: 429 (buttons go full
 * width below it), 600, 768, 1024. Every grid uses minmax(0, 1fr) so a long
 * word can never widen a column; every bleed is a negative margin equal to
 * the gutter inside a section that clips its own x overflow.
 *
 * Motion: the hero settle and rise, once per page load, inside the
 * reduced-motion guard. Tile hover lives in base.css. Nothing else moves and
 * nothing scroll-drives: every rule rests drawn.
 */

/* ================================================================= hero === */
/*
 * Photo first on a phone (edge to edge, 4:5), copy beneath it. From 1024 the
 * copy takes the left five columns and the photo the right seven, bleeding to
 * the viewport edge with its inner corners rounded. One button. The product
 * is credited in a solid paper chip on the photo, which is the chip's link.
 */

.nd-hero {
  position: relative;
  padding-block: 0;
  background: var(--nd-paper);
  overflow-x: clip;
}

.nd-hero__inner {
  display: grid;
  gap: 0;
}

.nd-hero__media {
  order: -1;
  position: relative;
  min-width: 0;
  margin-inline: calc(-1 * var(--nd-gutter));
}

.nd-hero__tile { border-radius: 0; }

.nd-hero__tile .nd-tile__media,
.nd-hero__tile .nd-tile__plate { aspect-ratio: 4 / 5; }

.nd-hero__tile .nd-tile__plate { font-size: var(--nd-fs-2xl); }

/* A lifestyle shot is usually taller than its subject; favour the top. */
.nd-hero__img { object-position: 50% 35%; }

.nd-hero__copy {
  display: grid;
  gap: var(--nd-s-4);
  align-content: end;
  padding: var(--nd-s-6) 0 var(--nd-s-2);
}

.nd-hero__state {
  font-size: var(--nd-fs-xs);
  font-weight: var(--nd-fw-medium);
  line-height: 1.5;
  color: var(--nd-ink-700);
}

.nd-hero__heading {
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-display);
  font-weight: var(--nd-fw-regular);
  line-height: var(--nd-lh-display);
  letter-spacing: var(--nd-track-display);
  color: var(--nd-ink-900);
  max-width: 11ch;
  text-wrap: balance;
  margin: 0;
}

.nd-hero__text {
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-700);
  max-width: var(--nd-measure-short);
  margin: 0;
}

.nd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nd-s-3);
  margin-top: var(--nd-s-1);
}

@media (max-width: 429px) {
  .nd-hero__actions .nd-btn { width: 100%; }
}

/* The caption chip: solid paper, no blur, no thumbnail. Label, name, price. */
.nd-hero__caption {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-end: 12px;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: var(--nd-tap-min);
  max-width: calc(100% - 24px);
  padding: 10px 14px;
  border-radius: var(--nd-r-md);
  background: var(--nd-paper);
  color: var(--nd-ink-900);
  font-size: var(--nd-fs-xs);
  line-height: 1.5;
  text-decoration: none;
}

.nd-hero__caption-k { flex: 0 0 auto; }

.nd-hero__caption-v {
  min-width: 0;
  font-weight: var(--nd-fw-medium);
  color: var(--nd-ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nd-hero__caption-p {
  flex: 0 0 auto;
  color: var(--nd-ink-700);
}

.nd-hero__caption-p del { color: var(--nd-ink-500); }
.nd-hero__caption-p ins { color: var(--nd-ink-900); text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .nd-hero__caption:hover { color: var(--nd-ink-900); }
  .nd-hero__caption:hover .nd-hero__caption-v {
    text-decoration: underline;
    text-decoration-color: var(--nd-accent);
    text-underline-offset: .2em;
  }
}

@media (min-width: 1024px) {
  .nd-hero { padding-block: var(--nd-s-6) 0; }

  .nd-hero__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--nd-s-6);
    align-items: end;
    min-height: min(82vh, 760px);
  }

  .nd-hero__copy {
    grid-column: 1 / 6;
    gap: 20px;
    padding: 0 0 var(--nd-s-8);
  }

  .nd-hero__text { font-size: var(--nd-fs-md); line-height: var(--nd-lh-title); }

  /*
   * The photo runs to the right edge of the viewport. The distance from the
   * container's content edge to the viewport edge is the gutter when the
   * viewport is narrower than the container, and half the leftover plus the
   * gutter when it is wider: max() picks the right one at every width. The
   * section clips its x overflow, so a scrollbar's width can never leak.
   */
  .nd-hero__media {
    order: 0;
    grid-column: 6 / -1;
    margin-inline: 0;
    margin-inline-end: calc(-1 * max(var(--nd-gutter), (100vw - var(--nd-container)) / 2 + var(--nd-gutter)));
  }

  .nd-hero__tile { border-radius: var(--nd-r-xl) 0 0 var(--nd-r-xl); }

  .nd-hero__tile .nd-tile__media,
  .nd-hero__tile .nd-tile__plate {
    aspect-ratio: 5 / 4;
    max-height: 760px;
  }

  .nd-hero__caption {
    inset-inline-start: 20px;
    inset-block-end: 20px;
    max-width: calc(100% - 40px);
  }
}

/* ========================================================== trust strip === */
/*
 * Four facts as a ruled index row: label over value. Two by two on a phone,
 * four across from 768. No icons, no motion.
 */

.nd-trust {
  list-style: none;
  margin: 0;
  padding: 20px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 20px;
  column-gap: var(--nd-s-4);
  border-block: 1px solid var(--nd-rule);
}

.nd-trust__item {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.nd-trust__v {
  font-size: .875rem;
  line-height: 1.5;
  color: var(--nd-ink-900);
}

@media (min-width: 768px) {
  .nd-trust {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--nd-s-5);
  }

  .nd-trust__v { font-size: var(--nd-fs-sm); }
}

/* =========================================================== categories === */
/*
 * One lead plate and up to eight small tiles. On a phone the lead is a full
 * width 4:3 picture and the rest are two-up squares; from 768 it is a four
 * column grid where the lead spans two columns and two rows, so nine terms
 * fill twelve cells exactly. The tile is a real link here: it has text in it.
 *
 * The four tints appear only on the small tiles, by position; the lead stays
 * oat. On sage, clay and slate the count steps up to ink-700 for contrast.
 */

.nd-cats__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 12px;
}

.nd-cats__item { min-width: 0; }

.nd-cats__item--lead { grid-column: span 2; }

.nd-cats__tile {
  height: 100%;
  color: var(--nd-ink-900);
}

.nd-cats__tile .nd-tile__media,
.nd-cats__tile .nd-tile__plate { aspect-ratio: 1 / 1; }

.nd-cats__item--lead .nd-cats__tile .nd-tile__media,
.nd-cats__item--lead .nd-cats__tile .nd-tile__plate {
  aspect-ratio: 4 / 3;
  flex: none;
}

.nd-cats__cap {
  display: grid;
  gap: 2px;
  padding: 0 14px 14px;
  min-width: 0;
}

.nd-cats__name {
  font-family: var(--nd-font-display);
  font-size: 1.0625rem;
  font-weight: var(--nd-fw-medium);
  line-height: var(--nd-lh-snug);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-ink-900);
}

.nd-cats__count {
  font-size: var(--nd-fs-xs);
  line-height: 1.5;
  color: var(--nd-ink-500);
}

/* Tints by position among the small tiles. The lead is child 1 and is
   excluded, so 4n+1 lands on children 5 and 9. */
.nd-cats__item:not(.nd-cats__item--lead):nth-child(4n+2) {
  --nd-cat-tint: var(--nd-tint-oat);
  --nd-cat-tint-deep: var(--nd-tint-deep);
  --nd-cat-count: var(--nd-ink-500);
}

.nd-cats__item:not(.nd-cats__item--lead):nth-child(4n+3) {
  --nd-cat-tint: var(--nd-tint-sage);
  --nd-cat-tint-deep: color-mix(in srgb, var(--nd-tint-sage) 90%, var(--nd-ink-900));
  --nd-cat-count: var(--nd-ink-700);
}

.nd-cats__item:not(.nd-cats__item--lead):nth-child(4n+4) {
  --nd-cat-tint: var(--nd-tint-clay);
  --nd-cat-tint-deep: color-mix(in srgb, var(--nd-tint-clay) 90%, var(--nd-ink-900));
  --nd-cat-count: var(--nd-ink-700);
}

.nd-cats__item:not(.nd-cats__item--lead):nth-child(4n+1) {
  --nd-cat-tint: var(--nd-tint-slate);
  --nd-cat-tint-deep: color-mix(in srgb, var(--nd-tint-slate) 90%, var(--nd-ink-900));
  --nd-cat-count: var(--nd-ink-700);
}

.nd-cats__item:not(.nd-cats__item--lead) .nd-cats__tile {
  background: var(--nd-cat-tint, var(--nd-tint));
}

.nd-cats__item:not(.nd-cats__item--lead) .nd-cats__count {
  color: var(--nd-cat-count, var(--nd-ink-500));
}

@media (hover: hover) and (pointer: fine) {
  .nd-cats__item:not(.nd-cats__item--lead) .nd-cats__tile:hover {
    background: var(--nd-cat-tint-deep, var(--nd-tint-deep));
  }
}

@media (min-width: 768px) {
  .nd-cats__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: var(--nd-s-4);
  }

  .nd-cats__item--lead {
    grid-column: span 2;
    grid-row: span 2;
  }

  /* The lead picture fills whatever height two rows give it: cover crops,
     contain centres. */
  .nd-cats__item--lead .nd-cats__tile .nd-tile__media,
  .nd-cats__item--lead .nd-cats__tile .nd-tile__plate {
    aspect-ratio: auto;
    flex: 1 1 0;
    min-height: 0;
  }

  .nd-cats__cap { padding: 0 16px 16px; }
}

@media (min-width: 1024px) {
  .nd-cats__grid { gap: var(--nd-s-5); }

  .nd-cats__cap { padding: 0 20px 18px; }

  .nd-cats__name { font-size: var(--nd-fs-md); }

  .nd-cats__item--lead .nd-cats__name { font-size: var(--nd-fs-lg); }
}

/* ================================================================ shelf === */
/*
 * Six plates: two-up on a phone, three across from 768. The card anatomy
 * (tile, brand, name, price) is base.css's .nd-plate. The phone gets its own
 * "Shop all" button under the grid; the desktop uses the head link.
 */

.nd-shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: var(--nd-s-6);
}

.nd-shelf__item { min-width: 0; }

.nd-shelf__more {
  display: none;
  margin: var(--nd-s-6) 0 0;
  max-width: none;
}

@media (max-width: 767px) {
  .nd-shelf__more { display: block; }
}

@media (min-width: 768px) {
  .nd-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--nd-s-6);
    row-gap: 56px;
  }
}

/* ============================================================== routine === */
/*
 * Three tools, each on its own oat tile with a serif numeral in the corner.
 * On a phone the three are a snap row that scrolls on its own axis: 78%
 * cards, gutter bleed with matching padding so the first card aligns to the
 * gutter, scrollbar hidden. From 768 they are three columns.
 */

.nd-routine { overflow-x: clip; }

.nd-routine__list {
  list-style: none;
  margin: 0 calc(-1 * var(--nd-gutter));
  /* 6px below: room for the focus ring on the last link in each card. */
  padding: 0 var(--nd-gutter) 6px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--nd-gutter);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nd-routine__list::-webkit-scrollbar { display: none; }

.nd-routine__item {
  position: relative;
  flex: 0 0 78%;
  min-width: 0;
  scroll-snap-align: start;
  display: grid;
  gap: 6px;
  align-content: start;
}

.nd-routine__tile { margin-bottom: 8px; }

.nd-routine__num {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 1;
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-2xl);
  font-weight: var(--nd-fw-regular);
  line-height: 1;
  color: var(--nd-ink-500);
  color: color-mix(in srgb, var(--nd-ink-900) 56%, transparent);
  pointer-events: none;
}

.nd-routine__key { margin-top: 14px; }

.nd-routine__title {
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-lg);
  font-weight: var(--nd-fw-medium);
  line-height: var(--nd-lh-snug);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-ink-900);
  margin: 0;
}

.nd-routine__text {
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-500);
  max-width: var(--nd-measure-short);
  margin: 0;
}

.nd-routine__with {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 6px 0 0;
  font-size: var(--nd-fs-sm);
  font-weight: var(--nd-fw-medium);
  line-height: 1.5;
}

.nd-routine__with a {
  color: var(--nd-ink-900);
  text-decoration: none;
}

.nd-routine__price {
  font-weight: var(--nd-fw-regular);
  color: var(--nd-ink-500);
}

.nd-routine__price del { color: var(--nd-ink-500); }
.nd-routine__price ins { color: var(--nd-ink-900); text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .nd-routine__with a:hover {
    color: var(--nd-ink-900);
    text-decoration: underline;
    text-decoration-color: var(--nd-accent);
    text-underline-offset: .2em;
  }
}

@media (min-width: 768px) {
  .nd-routine__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--nd-s-6);
    margin: 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .nd-routine__item { flex: none; }
}

/* ================================================================= film === */
/*
 * The .nd-video component is base.css's. Here it is allowed its full width,
 * and on a phone the frame runs edge to edge with the caption on its own
 * line and the two controls beneath it.
 */

.nd-film__frame .nd-video { max-width: none; }

@media (max-width: 767px) {
  .nd-film__frame { margin-inline: calc(-1 * var(--nd-gutter)); }

  .nd-film__frame .nd-video__frame { border-radius: 0; }

  .nd-film__frame .nd-video__bar {
    flex-wrap: wrap;
    padding-inline: var(--nd-gutter);
  }

  .nd-film__frame .nd-video__caption {
    flex: 1 1 100%;
    margin-right: 0;
  }
}

/* The optional button under the film, from the Nilosi screen. It starts on
   the same edge as the heading above, and goes full width where every other
   homepage button does. */
.nd-film__cta {
  display: flex;
  margin: var(--nd-s-6) 0 0;
  max-width: none;
}

@media (max-width: 429px) {
  .nd-film__cta .nd-btn { width: 100%; }
}

/* ================================================================ stage === */
/*
 * The one charcoal band. Its subtree re-points the tokens that the head,
 * links and focus ring read, so base.css components recolour themselves.
 *
 * With a photo (`nd-stage--photo`): photo left, head and three ruled rows
 * right from 1024; stacked photo -> head -> rows beneath. Without: the three
 * facts run as three columns under one rule from 768.
 */

.nd-stage {
  background: var(--nd-stage);
  color: var(--nd-stage-ink);
  border-block: 0;
  --nd-heading-ink: var(--nd-stage-ink);
  --nd-text-muted: var(--nd-stage-ink-2);
  --nd-rule: var(--nd-stage-rule);
  --nd-rule-strong: var(--nd-stage-rule-strong);
  --nd-focus: var(--nd-stage-ink);
  --nd-focus-halo: var(--nd-stage);
  --nd-link: var(--nd-stage-ink);
  --nd-link-hover: var(--nd-stage-ink);
}

.nd-stage__inner { display: grid; gap: var(--nd-s-7); }

/* The head stacks inside the copy column: no 3/9 rail here. */
.nd-stage .nd-head { grid-template-columns: minmax(0, 1fr); }

.nd-stage .nd-head__eyebrow,
.nd-stage .nd-head__title,
.nd-stage .nd-head__lede {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
}

.nd-stage__media { min-width: 0; }

.nd-stage__tile { background: var(--nd-tint); }

.nd-stage__tile .nd-tile__media { aspect-ratio: 4 / 3; }

.nd-stage__caption {
  margin: 12px 0 0;
  font-size: var(--nd-fs-xs);
  line-height: 1.5;
  color: var(--nd-stage-ink-2);
}

.nd-stage__caption a {
  color: var(--nd-stage-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

.nd-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.nd-steps__item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: var(--nd-s-4);
  align-items: start;
  padding-block: var(--nd-s-5);
  border-top: 1px solid var(--nd-stage-rule-strong);
}

.nd-steps__num {
  grid-column: 1;
  grid-row: 1 / span 2;
  font-family: var(--nd-font-display);
  font-size: 2rem;
  font-weight: var(--nd-fw-regular);
  line-height: 1;
  color: var(--nd-stage-accent);
}

.nd-steps__title {
  grid-column: 2;
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-xl);
  font-weight: var(--nd-fw-regular);
  line-height: var(--nd-lh-snug-title);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-stage-ink);
  margin: 0;
}

.nd-steps__text {
  grid-column: 2;
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-stage-ink-2);
  max-width: var(--nd-measure-short);
  margin: 8px 0 0;
}

@media (min-width: 768px) {
  /* Text-only variant: three columns under one rule, numerals above titles. */
  .nd-stage:not(.nd-stage--photo) .nd-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--nd-s-7);
    padding-top: 28px;
    border-top: 1px solid var(--nd-stage-rule-strong);
  }

  .nd-stage:not(.nd-stage--photo) .nd-steps__item {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0;
    border-top: 0;
  }

  .nd-stage:not(.nd-stage--photo) .nd-steps__num {
    grid-row: auto;
    font-size: var(--nd-fs-2xl);
  }

  .nd-stage:not(.nd-stage--photo) .nd-steps__title,
  .nd-stage:not(.nd-stage--photo) .nd-steps__text { grid-column: 1; }

  .nd-stage:not(.nd-stage--photo) .nd-steps__title { margin-top: 12px; }
}

@media (min-width: 1024px) {
  .nd-stage--photo .nd-stage__inner {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: var(--nd-s-8);
    align-items: start;
  }

  .nd-stage__tile .nd-tile__media { aspect-ratio: 4 / 5; }

  .nd-stage--photo .nd-steps__item {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: var(--nd-s-5);
    padding-block: 28px;
  }

  .nd-stage--photo .nd-steps__num { font-size: var(--nd-fs-2xl); }
}

/* ================================================================ story === */
/*
 * About Nilosi. Copy left, photo right from 1024 (photo first beneath that).
 * Without a photo the copy sits at the narrow measure.
 */

.nd-story__inner {
  display: grid;
  gap: var(--nd-s-7);
}

.nd-story__copy {
  max-width: var(--nd-narrow);
  min-width: 0;
}

.nd-story__eyebrow { margin-bottom: 12px; }

.nd-story__title {
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-2xl);
  font-weight: var(--nd-fw-regular);
  line-height: var(--nd-lh-tight);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-ink-900);
  text-wrap: balance;
  margin: 0 0 20px;
}

.nd-story__text {
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-700);
  max-width: var(--nd-measure);
  margin: 0;
}

.nd-story__text + .nd-story__text { margin-top: var(--nd-s-4); }

.nd-story__brands {
  font-size: var(--nd-fs-xs);
  line-height: 1.6;
  color: var(--nd-ink-500);
  max-width: var(--nd-measure);
  margin: var(--nd-s-5) 0 0;
}

.nd-story__media {
  order: -1;
  min-width: 0;
  margin: 0;
}

.nd-story__tile { background: var(--nd-tint); }

.nd-story__tile .nd-tile__media { aspect-ratio: 4 / 3; }

.nd-story__caption {
  margin: 12px 0 0;
  font-size: var(--nd-fs-xs);
  line-height: 1.5;
  color: var(--nd-ink-500);
}

.nd-story__caption a {
  color: var(--nd-ink-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

@media (min-width: 1024px) {
  .nd-story__inner--media {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--nd-s-8);
    align-items: center;
  }

  .nd-story__inner--media .nd-story__copy { max-width: none; }

  .nd-story__media { order: 0; }

  .nd-story__tile .nd-tile__media { aspect-ratio: 4 / 5; }
}

/* ================================================================== faq === */
/*
 * <details> rows under a strong rule. A plus glyph of two 1px lines turns
 * into a cross when the row opens; the open row carries a 2px accent
 * keyline on its left. From 1024 the head sits sticky in a 4/8 rail.
 */

#nd-faq > .nd-container.nd-narrow { max-width: var(--nd-container); }

#nd-faq .nd-head { grid-template-columns: minmax(0, 1fr); }

#nd-faq .nd-head__eyebrow,
#nd-faq .nd-head__title,
#nd-faq .nd-head__lede {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
}

.nd-faq { border-top: 1px solid var(--nd-rule-strong); }

.nd-faq__item {
  padding-left: var(--nd-s-4);
  border-bottom: 1px solid var(--nd-rule);
  box-shadow: inset 2px 0 0 transparent;
  transition: box-shadow var(--nd-dur-snap) var(--nd-ease-mech);
}

.nd-faq__item[open] { box-shadow: inset 2px 0 0 var(--nd-accent); }

.nd-faq__q {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--nd-s-4);
  min-height: 56px;
  padding: 12px 44px 12px 0;
  cursor: pointer;
  list-style: none;
  font-size: var(--nd-fs-base);
  font-weight: var(--nd-fw-medium);
  line-height: 1.4;
  color: var(--nd-ink-900);
}

.nd-faq__q::-webkit-details-marker { display: none; }

.nd-faq__q::before,
.nd-faq__q::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 14px;
  height: 1px;
  background: var(--nd-ink-900);
  transform: translateY(-50%) rotate(0deg);
  transition: transform var(--nd-dur-snap) var(--nd-ease-mech);
}

.nd-faq__q::after { transform: translateY(-50%) rotate(90deg); }

.nd-faq__item[open] .nd-faq__q::before { transform: translateY(-50%) rotate(45deg); }
.nd-faq__item[open] .nd-faq__q::after { transform: translateY(-50%) rotate(135deg); }

.nd-faq__a { padding: 0 var(--nd-s-4) var(--nd-s-5) 0; }

.nd-faq__a p {
  margin: 0;
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-700);
}

@media (hover: hover) and (pointer: fine) {
  .nd-faq__q:hover { color: var(--nd-accent-deep); }
}

@media (min-width: 1024px) {
  #nd-faq > .nd-container {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--nd-s-7);
    align-items: start;
  }

  #nd-faq .nd-head {
    position: sticky;
    top: calc(var(--nd-header-h) + var(--nd-s-5));
    margin-bottom: 0;
  }

  .nd-faq { margin-top: calc(var(--nd-s-5) + var(--nd-hair)); }

  .nd-faq__q { min-height: 64px; }
}

/*
 * The panel moves with its own glyph. interpolate-size is scoped to the
 * FAQ rather than set at :root: at root it makes `auto` interpolable for
 * every length transition on the page.
 */
@supports (interpolate-size: allow-keywords) {
  .nd-faq { interpolate-size: allow-keywords; }

  .nd-faq__item::details-content {
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size var(--nd-dur-travel) var(--nd-ease-mech),
                opacity 120ms linear 40ms,
                content-visibility var(--nd-dur-travel) allow-discrete;
  }

  .nd-faq__item[open]::details-content { block-size: auto; opacity: 1; }
}

/* =============================================================== signup === */
/*
 * One oat panel: copy left, form right from 768; stacked beneath. Renders
 * only once an endpoint is configured (signup.php).
 */

.nd-signup__panel {
  display: grid;
  gap: var(--nd-s-6);
  padding: var(--nd-s-6) 20px;
  background: var(--nd-tint);
  border-radius: var(--nd-r-lg);
}

.nd-signup__say {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.nd-signup__title {
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-xl);
  font-weight: var(--nd-fw-regular);
  line-height: var(--nd-lh-snug-title);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-ink-900);
  margin: 0;
}

.nd-signup__text {
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-700);
  max-width: var(--nd-measure-short);
  margin: 0;
}

.nd-signup__form {
  display: grid;
  gap: var(--nd-s-2);
  align-items: start;
  min-width: 0;
}

.nd-signup__input {
  width: 100%;
  min-height: var(--nd-control-h-lg);
  padding: 0 var(--nd-s-4);
  background: var(--nd-white);
  color: var(--nd-ink-900);
  border: 1px solid var(--nd-border-control);
  border-radius: var(--nd-r-md);
  font-size: 16px;
  line-height: 1.5;
}

.nd-signup__input::placeholder {
  color: var(--nd-ink-500);
  opacity: 1;
}

.nd-signup__btn {
  width: 100%;
  min-height: var(--nd-control-h-lg);
}

.nd-signup__fine {
  grid-column: 1 / -1;
  margin: var(--nd-s-1) 0 0;
  font-size: var(--nd-fs-xs);
  line-height: 1.5;
  color: var(--nd-ink-500);
}

.nd-signup__fine a { color: var(--nd-ink-900); }

@media (min-width: 768px) {
  .nd-signup__panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--nd-s-8);
    padding: var(--nd-s-8);
  }

  .nd-signup__form { grid-template-columns: minmax(0, 1fr) auto; }

  .nd-signup__btn { width: auto; }
}

/* =============================================================== closer === */
/*
 * The last screen: one serif line and the page's last button on the left,
 * three ruled facts on the right. Stacked beneath 1024. No motion.
 */

.nd-closer { border-top: 1px solid var(--nd-rule-strong); }

.nd-closer__inner {
  display: grid;
  gap: var(--nd-s-7);
}

.nd-closer__lead { min-width: 0; }

.nd-closer__line {
  font-family: var(--nd-font-display);
  font-size: var(--nd-fs-2xl);
  font-weight: var(--nd-fw-regular);
  line-height: var(--nd-lh-tight);
  letter-spacing: var(--nd-track-title);
  color: var(--nd-ink-900);
  max-width: 14ch;
  text-wrap: balance;
  margin: 0;
}

.nd-closer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nd-s-3);
  margin-top: var(--nd-s-6);
}

@media (max-width: 429px) {
  .nd-closer__actions .nd-btn { width: 100%; }
}

.nd-spec {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.nd-spec__row {
  display: grid;
  gap: 6px;
  padding-block: 20px;
  border-top: 1px solid var(--nd-rule);
}

.nd-spec__row:last-child { border-bottom: 1px solid var(--nd-rule); }

.nd-spec__v {
  font-size: var(--nd-fs-base);
  line-height: var(--nd-lh-base);
  color: var(--nd-ink-700);
}

@media (min-width: 1024px) {
  .nd-closer__inner {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--nd-s-8);
    align-items: start;
  }
}

/* =============================================================== motion === */
/*
 * The only animation on the homepage: the hero photo settles and the copy
 * rises once, on load. Both live inside the reduced-motion guard, both fill
 * backwards only (so the resting state is the ordinary one and the tile's
 * hover scale still applies afterwards), and tokens.css zeroes the duration
 * for anyone who asked for less motion.
 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes nd-settle {
    from { transform: scale(1.04); opacity: .001; }
    to   { transform: none; opacity: 1; }
  }

  @keyframes nd-rise {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }

  .nd-hero__img {
    animation: nd-settle var(--nd-dur-reveal) var(--nd-ease-out) backwards;
  }

  .nd-hero__copy > * {
    animation: nd-rise var(--nd-dur-reveal) var(--nd-ease-out) backwards;
  }

  .nd-hero__copy > :nth-child(2) { animation-delay: 60ms; }
  .nd-hero__copy > :nth-child(3) { animation-delay: 120ms; }
  .nd-hero__copy > :nth-child(4) { animation-delay: 180ms; }
  .nd-hero__copy > :nth-child(5) { animation-delay: 240ms; }
}
