/* Raniraj: the brand's tokens and the page's own rules.
   The kit's system.css, cards.css, motion.css, backgrounds.css, layout.css and icon.css are linked
   from the root layout, in that order. This file comes last: layout.css resets --ly-scale. */

:root {
  --p-bg: #f9f8f6; --p-surface: #f5f3ef; --p-ink: #221e1c; --p-muted: #5a5049;
  --p-accent: #d99726; --p-accent-ink: #111111; --p-action: #d99726; --p-action-ink: #111111;
  --p-inv-bg: #221e1c; --p-inv-surface: #2e2b28; --p-inv-ink: #f9f8f6; --p-inv-muted: #a09d9b;
  --p-inv-accent: #d99726; --p-inv-accent-ink: #111111; --p-inv-action: #d99726; --p-inv-action-ink: #111111;
  --font-display: "EB Garamond", Georgia, serif;
  --font-text: "Jost", system-ui, sans-serif;
  --display-weight: 400;
  --display-tracking: -0.012em;
  --display-tracking-xl: -0.018em;
  --ly-scale: 1.12;
  /* the hero's own foot: the same 72px a section keeps under its content, so the air between the
     hero and the first section is the air between every two sections */
  --hpadb: 72px;
}

/* The kit's focus ring is the action colour, 2.35:1 on the page ground; the darker gold is 6.6:1 and
   keeps the ring visible on the gold buttons and the light panels alike. */
:is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: #7d4f0c;
}

/* ---------------------------------------------------------------- the logo
   The client's own mark: the blue banner with the white script on it. It stands where the kit's
   type lockup stood, in the nav and at the head of the footer's brand column. */
.nav__logo img { height: 34px; }
.footer .nav__logo img { height: 42px; }

/* ---------------------------------------------------------------- desktop: every section reaches its foot
   Each section is one screen; a section whose last block stops short leaves a band of ground above the
   next one, so the runs of air differ from section to section. Here the visual in each section takes
   what the heading leaves, and stops on the same line as the section's own padding. */
@media (min-width: 1024px) {
  main > .section > .wrap.grid.stretch { align-content: stretch; }

  /* the range: the three photographs take the screen under the heading */
  #range .grid { flex: 1 1 0; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  #range .tile { grid-template-rows: minmax(0, 1fr) auto auto; }
  #range .tile__media { aspect-ratio: auto; height: 100%; }

  /* the list and the enquiry: a second column of words with the photograph under it */
  #list .stretch > .span-5,
  #wholesale .stretch > .span-5 { display: flex; flex-direction: column; }
  #list .list-photo,
  #wholesale .enquiry-photo { --ratio: 0; flex: 1 1 0; min-height: 0; margin-top: var(--s-7); }

  /* the list and the form: the card runs down to the section's foot, so the section's content
     ends on its padding line and the air above the next section is the page's one width */
  #list .list-card, #wholesale .enquiry { height: 100%; }
  #list .range-packs { margin-top: auto; }
  /* eight rows at 16px of air overrun the screen by 26px: 14 keeps the section and its photograph
     on the padding line */
  #list .rows > li { padding-block: 14px; }
  #list .rows > li:first-child { padding-top: 0; }

  /* the grinding split: the mill down to the section's foot */
  #grind .frame--photo { --ratio: 0; height: 100%; }

  /* the Kashmir photograph: the widest frame on the page, down to the foot */
  #origins .origins-frame { --ratio: 0; flex: 1 1 0; min-height: 0; }

  /* the questions: five answers spread down the screen, each rule on its own line of air */
  #questions .faq { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
}

/* ---------------------------------------------------------------- the pieces */
/* The hero photograph keeps the page's line under it, edge to edge: the air below it is the air
   below every other section, so the runs of air down the page are one width. */
.hero--product .hero__stage:has(> img:not(.is-cutout), > picture) { margin-bottom: 0; }

/* The range: three square photographs of the three spices we sell most of. */
#range .tile__media { --tile-ratio: 1 / 1; }
#range .tile__head { display: block; }
#range .tile__origin { color: var(--muted); font-size: var(--t-small); }

/* A linked tile answers the pointer: the photograph grows inside its own mask. The kit's motion layer
   puts this behind (hover: hover), which a headless browser and a touch screen both answer no to;
   pointer: coarse is what a finger is, so the rule runs wherever there is no finger. */
@media not all and (pointer: coarse) {
  #range .tile .tile__media > img { transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  #range .tile:hover .tile__media > img { transform: scale(1.03); }
}

/* The list: the eight spices with their origin under the name. */
.rows__name small { display: block; font-weight: 400; color: var(--muted); font-size: var(--t-small); }
.range-packs { margin-top: var(--s-6); max-width: 56ch; }

/* The ground-to-order column: the paragraph sits under the head, the link under the rows. */
#grind .span-5 > p { max-width: 52ch; }
#grind .span-5 > .rows + p { margin-top: var(--s-6); }

/* The Kashmir photograph: a wide crop at 1440, a full one on a phone. */
.origins-frame { --ratio: 45%; }

/* The enquiry form is a card on the section's own ground, beside the photograph of the stock. */
.enquiry { height: 100%; }
.enquiry .form { height: 100%; align-content: space-between; }
.enquiry-photo { --ratio: 80%; margin-top: var(--s-7); }

/* The legal line is running text; its links keep the line's own spacing. */
.footer__legal-links { margin-left: var(--s-4); }
.footer__legal-links a + a { margin-left: var(--s-4); }

/* ---------------------------------------------------------------- a phone
   The kit's 96px of air over a section is a desktop measure; on a 844px screen it is a fifth of the
   section. 72 over and 40 under keeps the same rhythm on both, and leaves the content the room it
   needs to fill one screen. */
@media (max-width: 639px) {
  :root { --padt: 74px; --padb: 40px; --hpadb: 40px; }
  .nav__logo img { height: 30px; }
  .footer .nav__logo img { height: 38px; }

  /* the grind split's own content is 2px over a screen at this measure: it keeps 72 over */
  #grind { padding-top: 72px; }

  /* the hero photograph takes what the words leave and runs to the fold */
  .hero--product .hero__stage { flex: 1 1 0; min-height: 180px; aspect-ratio: auto; }

  /* the heading row stacks: the h2 and its link on two lines, never one squeezed line */
  .section-head--row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
  .section-head--row > div { max-width: none; }

  /* the form is one column on a phone: its fields stack, the button closes the card */
  #wholesale .form { grid-template-columns: minmax(0, 1fr); }
  #wholesale .enquiry-photo { margin-top: var(--s-6); }

  /* three tiles on one phone screen: a tenth off each photograph's height */
  #range .tile__media { --tile-ratio: 10 / 9; }
  #range .tile { gap: var(--s-3); }

  /* the list: eight rows a screen is tight, so each row keeps its origin and gives up its padding */
  .rows > li { padding-block: var(--s-3); }
  #list .list-photo { --ratio: 0; flex: 1 1 0; min-height: 160px; margin-top: var(--s-5); }
  /* two screens: the heading and its photograph, then the eight */
  #list .span-5, #wholesale .span-5 { display: flex; flex-direction: column; align-self: stretch; }
  #wholesale .enquiry-photo { --ratio: 0; flex: 1 1 0; min-height: 160px; margin-top: var(--s-6); }
  #wholesale .span-6, #wholesale .enquiry, #wholesale .form { height: 100%; }

  /* the card under the eight closes the second screen */
  #list .span-6, #list .list-card { height: 100%; }
  #list .range-packs { margin-top: auto; }

  /* the questions: five answers on one screen, the rules closer together */
  #questions .section-head { margin-bottom: var(--s-3); }
  #questions .faq__item { padding-block: var(--s-3); }
  #questions .faq__item:last-child { padding-bottom: 0; }

  /* the Kashmir photograph takes the rest of the screen */
  .origins-frame { --ratio: 0; flex: 1 1 0; min-height: 0; }

  /* the close and the links share the footer's screen: the links sit on its foot */
  footer.closing .wrap { align-content: space-between; }

  /* the footer's legal line starts on the page margin, not centred by space-between, and its two
     columns are enough on a phone: the origins and the questions are on the page above */
  .footer__legal { justify-content: flex-start; margin-top: var(--s-2); padding-top: var(--s-3); }
  /* the two links take their own line on the page margin: inline they land in the middle of the
     Trade column's edge */
  .footer__legal-links { display: block; margin-left: 0; margin-top: var(--s-2); }
  /* the legal line is running text: its two links stay inline (44px targets would break the line) */
  .footer__legal a:not(.btn) { display: inline; min-height: 0; min-width: 0; }
  .closing__cta { gap: var(--s-4); }
  .footer__col--desk { display: none; }
  .closing__links { gap: var(--s-4); }
  .footer__lede { display: none; }   /* the hero's line, said once */
}

/* The two legal pages. */
.legal { max-width: 68ch; margin-block: calc(var(--nav) + var(--s-8)) var(--s-9); }
.legal-logo { display: inline-block; margin-bottom: var(--s-6); }
.legal-logo img { height: 42px; width: auto; }
.legal h1 { font-size: var(--t-h2); line-height: 1.1; }
.legal h2 { margin-top: var(--s-6); font-size: var(--t-h3); }
.legal p { margin-top: var(--s-4); color: var(--ink); }
.legal a:not(.link) { text-decoration: underline; text-underline-offset: 3px; }
