/* ==========================================================================
   Reset, element defaults, layout primitives, utilities, motion
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Locked while a drawer or sheet owns the viewport. */
body.is-locked { overflow: hidden; }

a { color: var(--ink); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--sage); }

img, video { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--sage-tint); }

h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Components set display on classes, which outranks the UA's [hidden] rule —
   without this, hidden hero slides, quiz steps and checkout panels all show. */
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Pointer users don't get a ring; keyboard users always do. */
:focus:not(:focus-visible) { outline: none; }

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

.skip-link {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -110%);
  z-index: 200; background: var(--ink); color: var(--white);
  padding: 12px 22px; border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  font-size: var(--fs-2xs); letter-spacing: var(--ls-button); text-transform: uppercase;
  font-weight: 600; transition: transform var(--dur) var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); color: var(--white); }

/* ---------- layout primitives ---------- */

.page { min-height: 100vh; display: flex; flex-direction: column; background: var(--white); }
main { flex: 1; }

.container    { max-width: var(--container);    margin-inline: auto; padding-inline: var(--gutter); }
.container-md { max-width: var(--container-md); margin-inline: auto; padding-inline: var(--gutter); }
.container-sm { max-width: var(--container-sm); margin-inline: auto; padding-inline: var(--gutter); }
.container-xs { max-width: var(--container-xs); margin-inline: auto; padding-inline: var(--gutter); }

.section    { padding-block: var(--section-y); }
.section-t  { padding-top: var(--section-y); }
.section-b  { padding-bottom: var(--section-y); }
.section-sm { padding-block: var(--section-y-sm); }

.stack { display: flex; flex-direction: column; }
.stack-4  { gap: 4px; }  .stack-6  { gap: 6px; }  .stack-8  { gap: 8px; }
.stack-10 { gap: 10px; } .stack-12 { gap: 12px; } .stack-14 { gap: 14px; }
.stack-16 { gap: 16px; } .stack-20 { gap: 20px; } .stack-22 { gap: 22px; }
.stack-24 { gap: 24px; } .stack-28 { gap: 28px; }

.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.push { margin-left: auto; }

/* Responsive product/post grids. */
.grid { display: grid; gap: var(--gap-grid); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  /* Product grids stay two-up on phones — one-up wastes the fold. */
  .grid-products { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ---------- type utilities ---------- */

.display    { font-family: var(--font-display); font-weight: 200; line-height: var(--lh-tight); letter-spacing: var(--ls-display); text-wrap: balance; }
.display-3  { font-family: var(--font-display); font-weight: 300; line-height: var(--lh-snug); }
.t-xl  { font-size: var(--fs-display-xl); }
.t-lg  { font-size: var(--fs-display-lg); }
.t-md  { font-size: var(--fs-display-md); }
.t-sm  { font-size: var(--fs-display-sm); }
.t-h2  { font-size: var(--fs-h2); }
.t-h2xl{ font-size: var(--fs-h2-xl); }
.t-h2sm{ font-size: var(--fs-h2-sm); }
.t-h3  { font-size: var(--fs-h3); }
.t-h4  { font-size: var(--fs-h4); }
.t-h5  { font-size: var(--fs-h5); }

.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--mute); line-height: 1.4;
}
.eyebrow-sage { color: var(--sage-text); }
.eyebrow-sm { font-size: var(--fs-eyebrow-sm); letter-spacing: 0.16em; }

.mono { font-family: var(--font-mono); }
.lead { font-size: var(--fs-lead); line-height: var(--lh-relaxed); color: var(--body); text-wrap: pretty; }
.prose-p { font-size: var(--fs-body-lg); line-height: var(--lh-relaxed); color: var(--body); text-wrap: pretty; }
.muted { color: var(--body-soft); }
.faint { color: var(--mute); }
.strike { color: var(--mute-faint); text-decoration: line-through; }

/* ---------- controls ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap); padding: 15px 30px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-2xs); letter-spacing: var(--ls-button);
  text-transform: uppercase; font-weight: 600; text-align: center;
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-dark { background: var(--ink); color: var(--white); font-weight: 700; }
.btn-dark:hover { background: var(--sage); color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--sand); }
.btn-outline:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--sand); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { background: var(--white); color: var(--ink); font-weight: 700; }
.btn-light:hover { background: var(--sage); color: var(--white); }
.btn-on-dark { background: transparent; color: var(--white); border-color: #4A4A44; }
.btn-on-dark:hover { background: var(--white); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 34px; }
.btn-sm { padding: 11px 20px; min-height: 38px; font-size: 0.6875rem; }

.link-underline {
  display: inline-block; font-size: var(--fs-2xs); letter-spacing: var(--ls-button);
  text-transform: uppercase; font-weight: 600;
  border-bottom: 1px solid var(--sand); padding-bottom: 4px;
}
.link-underline:hover { border-color: var(--sage); }

.field {
  width: 100%; background: var(--white); border: 1px solid var(--line);
  padding: 15px 18px; font-size: var(--fs-body-sm); outline: none;
  border-radius: 0; min-height: var(--tap);
  transition: border-color var(--dur) var(--ease);
}
.field:focus { border-color: var(--ink); }
.field-pill { border-radius: var(--radius-pill); border-color: var(--sand); padding: 17px 24px; }
textarea.field { resize: vertical; min-height: 120px; }
select.field { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235A5A52' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; padding-right: 44px; }
.field-label { font-family: var(--font-mono); font-size: var(--fs-eyebrow-sm); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute); display: block; margin-bottom: 8px; }

/* ---------- media ---------- */

.media { position: relative; overflow: hidden; background: var(--bone); }
.media > img, .media > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-contain > img { object-fit: contain; padding: 8%; }
.ar-1  { aspect-ratio: 1 / 1; }
.ar-4-3 { aspect-ratio: 4 / 3; }
.ar-3-4 { aspect-ratio: 3 / 4; }
.ar-4-5 { aspect-ratio: 4 / 5; }
.ar-16-9 { aspect-ratio: 16 / 9; }
.ar-21-9 { aspect-ratio: 21 / 9; }

/* ---------- surfaces ---------- */

.panel-bone { background: var(--bone); }
.panel-dark { background: var(--ink); color: var(--white); }
.panel-dark h1, .panel-dark h2, .panel-dark h3 { color: var(--white); }
.panel-dark p { color: var(--dark-body); }
.rule-top { border-top: 1px solid var(--line); }
.rule-top-ink { border-top: 1px solid var(--ink); }
.rule-bottom { border-bottom: 1px solid var(--line); }

/* ---------- motion ---------- */

@keyframes bn-up     { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bn-drawer { from { transform: translateX(30px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes bn-sheet  { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bn-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .marquee__track { animation: none !important; transform: none !important; }
  .hero__slide img { transform: none !important; }
}
