/* Haven base: reset, structural tokens, typography, container. Geometry is Harvest's until C1-C20 measures it. */

:root,
[data-hvn-palette] {
  --hvn-radius: 18px;
  --hvn-radius-md: 14px;
  --hvn-radius-sm: 12px;
  --hvn-radius-pill: 999px;
  --hvn-radius-circle: 50%;

  --hvn-gap: 16px;
  --hvn-page-pad: 32px;
  --hvn-container: 1440px;

  --hvn-shadow-card: 0 6px 20px var(--hvn-shadow-tint);
}

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

body {
  margin: 0;
  font-family: var(--hvn-font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--hvn-text);
  background: var(--hvn-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Typography - Libre Caslon Text display, Work Sans body. ---- */
h1, h2, h3, h4, h5, h6,
.hvn-h1, .hvn-h2, .hvn-h3 {
  font-family: var(--hvn-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--hvn-text);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1, .hvn-h1 { font-size: 32px; }
h2, .hvn-h2 { font-size: 26px; }
h3, .hvn-h3 { font-size: 20px; }

p { margin: 0 0 1em; }

/* Link text uses the AA-safe accent (--hvn-accent-strong), not the raw --hvn-accent, per tokens/_derived.css. */
a { color: var(--hvn-accent-strong); text-decoration: none; }
a:hover { color: var(--hvn-accent-hover); }

/*
 * Specificity (0,2,1) each selector, above Luma's `._keyfocus *:focus` at (0,2,0)
 * (styles-m.css) - without the [data-hvn-palette] prefix a bare
 * `a:focus-visible, button:focus-visible` is only (0,1,1) and LOSES once a real
 * Tab keypress adds ._keyfocus to <body> (Harvest register #105).
 */
[data-hvn-palette] a:focus-visible,
[data-hvn-palette] button:focus-visible,
[data-hvn-palette] summary:focus-visible,
[data-hvn-palette] select:focus-visible,
[data-hvn-palette] [tabindex]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--hvn-focus-ring-light),
              0 0 0 4px var(--hvn-focus-ring-dark);
}

img { max-width: 100%; height: auto; display: block; }

/* Uppercase kicker / eyebrow label used across the comps. */
.hvn-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hvn-accent-2-text);
}

/* ---- Layout container + main column ---- */
.hvn-container,
.page-main,
.columns .column.main {
  width: 100%;
}
.hvn-container {
  max-width: var(--hvn-container);
  margin-inline: auto;
  padding-inline: var(--hvn-page-pad);
}

/* Magento core page frame: give .page-main the Haven gutter so real catalog/CMS pages line up with the header/footer once those are wired. */
.page-main {
  max-width: var(--hvn-container);
  margin-inline: auto;
  padding-inline: var(--hvn-page-pad);
  box-sizing: border-box;
}

/* Surface panel primitive (bordered card used by many sections). */
.hvn-panel {
  background: var(--hvn-surface);
  border: 1px solid var(--hvn-border);
  border-radius: var(--hvn-radius);
}

/* Accessible visually-hidden helper for icon-only controls. Page-specific selectors are added per page task, not enumerated here in advance. */
.hvn-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Striped placeholder primitive for media not yet wired; a real <img> replaces it as pages attach media. */
.hvn-ph {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--hvn-radius);
  background: repeating-linear-gradient(
    45deg,
    color-mix(in oklab, var(--hvn-accent) 10%, var(--hvn-surface)),
    color-mix(in oklab, var(--hvn-accent) 10%, var(--hvn-surface)) 12px,
    color-mix(in oklab, var(--hvn-accent) 4%, var(--hvn-surface)) 12px,
    color-mix(in oklab, var(--hvn-accent) 4%, var(--hvn-surface)) 24px
  );
}
.hvn-ph > span {
  font-family: var(--hvn-font-mono);
  font-size: 11px;
  color: var(--hvn-text-subtle);
  text-align: center;
  padding: 0 10px;
}

/* ---- Responsive gutters ---- */
@media (max-width: 1023px) {
  :root,
  [data-hvn-palette] { --hvn-page-pad: 24px; }
}
@media (max-width: 767px) {
  :root,
  [data-hvn-palette] { --hvn-page-pad: 16px; }
  h1, .hvn-h1 { font-size: 26px; }
  h2, .hvn-h2 { font-size: 22px; }
}

/* Blank paints placeholders #c2c2c2 (1.78:1); the subtle text token reads 4.69:1. */
body input[type]::placeholder,
body textarea::placeholder {
  color: var(--hvn-text-subtle);
  opacity: 1;
}

/* Blank paints crumbs #a3a3a3 via .breadcrumbs .items (0,2,0) and links #333 (1.37:1 on Terracotta); page-scoped crumb rules (0,3,x) still win. */
body .breadcrumbs .items {
  color: var(--hvn-text-subtle);
}
body .breadcrumbs .item a,
body .breadcrumbs .item a:visited,
body .breadcrumbs .item a:hover {
  color: inherit;
}
body .breadcrumbs .item strong {
  color: var(--hvn-text);
}
body .breadcrumbs .item:not(:last-child)::after {
  color: var(--hvn-text-subtle);
}

/* Blank paints .opc-block-summary .mark .value (the shipping method under "Shipping") #999 (0,3,0). */
body .opc-block-summary .mark .value {
  color: var(--hvn-text-subtle);
}

/* Global session messages: Luma paints error #e02b27 on #fae5e5 (3.83:1) and links #1979c3; `body` lifts these over Luma (0,2,0)/(0,3,1) and page-scoped rules (0,3,0+) still win. */
body .message.error,
body .message.success,
body .message.warning,
body .message.notice,
body .message.info {
  border: 1px solid var(--hvn-border-strong);
  border-radius: 4px;
  background: var(--hvn-accent-tint);
  color: var(--hvn-text);
  font-size: 14px;
}
body .message.error {
  border-color: var(--hvn-error);
  background: color-mix(in oklab, var(--hvn-error) 8%, var(--hvn-surface));
}
body .message.success {
  border-color: var(--hvn-success);
  background: color-mix(in oklab, var(--hvn-success) 8%, var(--hvn-surface));
}
body .message.warning {
  border-color: var(--hvn-warning);
  background: color-mix(in oklab, var(--hvn-warning) 10%, var(--hvn-surface));
}
body .message.error a,
body .message.error a:hover,
body .message.error a:active,
body .message.success a,
body .message.success a:hover,
body .message.success a:active,
body .message.warning a,
body .message.warning a:hover,
body .message.warning a:active,
body .message.notice a,
body .message.notice a:hover,
body .message.notice a:active,
body .message.info a,
body .message.info a:hover,
body .message.info a:active {
  color: var(--hvn-accent-strong);
  text-decoration: underline;
}
body .message.error > *:first-child::before { color: var(--hvn-error); }
body .message.success > *:first-child::before { color: var(--hvn-success); }
body .message.warning > *:first-child::before,
body .message.notice > *:first-child::before,
body .message.info > *:first-child::before { color: var(--hvn-text); }
