/* Esso base + chrome + sections.
   Order: reset, primitives, header, footer, reusable blocks, sections. */

@import url("/css/tokens.css");

/* ---------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--t-base);
  font-weight: 350;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, svg { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Components set display, which outranks the UA [hidden] rule. Without this,
   anything the JS hides (the countdown before a date is announced, the mailto
   fallback) stays on screen. */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 380;
  font-variation-settings: "SOFT" 20, "WONK" 0;
  line-height: var(--lh-snug);
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

::selection { background: var(--gold-pale); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -4rem;
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--ink);
  color: var(--pearl);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); }

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

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: calc(var(--maxw-text) + var(--gutter) * 2); }

.eyebrow {
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--stone);
  margin: 0;
}

.lede {
  font-size: var(--t-md);
  color: var(--ink-soft);
  max-width: var(--maxw-text);
}
.lede--short { max-width: 26rem; }

/* Target for the header's IntersectionObserver. */
.scroll-sentinel {
  position: absolute;
  top: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.rule { height: 1px; background: var(--rule-soft); border: 0; margin: 0; }

/* Buttons. Two only: a solid one and a line one. More than that stops
   reading as a single considered brand. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.95rem var(--s-6);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--pearl);
  font-size: var(--t-sm);
  font-weight: 450;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: transparent; color: var(--ink); }

.btn--line {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--line:hover { border-color: var(--ink); background: var(--ink); color: var(--pearl); }

.btn--wide { width: 100%; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* Underline-on-hover text link, drawn from the left.
   Also applied to <button>, so the UA border and background must go. Not
   `background: none`, which would wipe the underline gradient. */
.link {
  display: inline-block;
  border: 0;
  padding-inline: 0;
  background-color: transparent;
  font-family: inherit;
  font-size: var(--t-sm);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size var(--dur) var(--ease-out);
}
.link:hover { background-size: 0% 1px; }

.link--rev { background-size: 0% 1px; }
.link--rev:hover { background-size: 100% 1px; }

/* --------------------------------------------------------------- header -- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--shell) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out),
              background var(--dur) var(--ease-out);
}
.header[data-scrolled="true"] { border-bottom-color: var(--rule-soft); }

.header__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-4);
  min-height: 4.5rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: var(--t-lg);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  letter-spacing: 0.34em;
  text-indent: 0.34em;   /* optical: cancels the trailing letterspace */
  text-transform: uppercase;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: var(--s-6); }
.nav--end { justify-content: flex-end; }

/* Some nav items are buttons (the mega trigger, the bag), so reset the UA chrome. */
.nav__link {
  border: 0;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: var(--t-sm);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--ink); }

@media (max-width: 60rem) {
  .nav--desktop { display: none; }
}

/* --------------------------------------------------------------- footer -- */

.footer {
  padding-block: var(--s-8) var(--s-6);
  border-top: 1px solid var(--rule-soft);
  background: var(--linen);
}
.footer__grid {
  display: grid;
  gap: var(--s-7);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}
.footer__col h3 {
  font-family: var(--sans);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: var(--track-eyebrow);
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: var(--s-4);
}
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.footer__col a { font-size: var(--t-sm); color: var(--ink-soft); }
.footer__col a:hover { color: var(--ink); }

.footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-5);
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--rule-soft);
  font-size: var(--t-xs);
  color: var(--stone);
}

/* ------------------------------------------------------- reveal on scroll */

[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
[data-reveal].is-in { opacity: 1; transform: none; }

.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------- sections -- */

.section { padding-block: var(--section); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--linen { background: var(--linen); }

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-7);
}
.section__title { font-size: var(--t-2xl); }

/* Promise strip: the positioning, stated once, high on the page. */

.promise {
  border-block: 1px solid var(--rule-soft);
  background: var(--pearl);
}
.promise__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}
.promise__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-5) var(--s-4);
  font-size: var(--t-sm);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-left: 1px solid var(--rule-soft);
}
.promise__item:first-child { border-left: 0; }
.promise__item svg { flex: none; width: 1.15rem; height: 1.15rem; color: var(--gold); }
.promise__item--tide svg { color: var(--tide); }

@media (max-width: 52rem) {
  .promise__item { border-left: 0; border-top: 1px solid var(--rule-soft); }
  .promise__item:first-child { border-top: 0; }
}

/* Water-safe badge, reused on cards and PDP.
   justify-self matters: inside a grid, an inline-flex item still stretches to
   the column unless told not to, which turns the badge into a full-width bar. */
.badge-tide {
  display: inline-flex;
  justify-self: start;
  align-self: start;
  width: fit-content;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  background: var(--tide-pale);
  color: var(--tide);
  font-size: var(--t-xs);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  border-radius: var(--radius);
}
.badge-tide svg { width: 0.85rem; height: 0.85rem; }
