/* ==========================================================================
   base.css — design system and site shell
   --------------------------------------------------------------------------
   Loaded on every page, before motion.css, panel.css and the page CSS.
   Contains: design tokens, reset, typography, layout helpers, buttons,
   links, header, footer and the shared product card.

   Owner, safe to edit:
   - Colours, font, spacing and timing in the :root block below.
     (Everything else on the site reads these values, so change them here.)
   - Header height (--header-h) and page side padding (--gutter).
   Hover effects exist only on .btn, .cart-toggle and the quick add on
   product cards (by design).
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --color-bg: #FFFFFF;
  --color-text: #111111;
  --color-muted: #6E6E6B;        /* secondary text */
  --color-line: #E6E6E3;         /* hairlines, borders */
  --color-placeholder: #EFEFED;  /* empty image placeholder gray */
  --color-accent: #C8CEC2;       /* sage — small details only */
  --color-accent-ink: #5F6B58;   /* darker sage for tiny text on white if ever needed */

  --font-sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;          /* the only other weight */

  --tracking-head: 0.08em;       /* uppercase headings */
  --tracking-eyebrow: 0.16em;    /* tiny uppercase labels */

  --ease: cubic-bezier(0.22, 1, 0.36, 1);      /* soft ease-out, no overshoot */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 400ms;
  --dur-2: 600ms;
  --dur-3: 800ms;

  --radius: 2px;
  --header-h: 60px;
  --gutter: clamp(16px, 4vw, 56px);  /* page side padding */
  --max-w: 1440px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px; --space-10: 144px;
  --z-header: 50; --z-overlay: 90; --z-panel: 100;
}


/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-5));
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: var(--weight-regular);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 0;
}

button:disabled {
  cursor: not-allowed;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-medium);
  line-height: 1.15;
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--color-accent);
  color: var(--color-text);
}

@media (min-width: 900px) {
  body {
    font-size: 16px;
  }
}


/* --------------------------------------------------------------------------
   3. Focus (keyboard only — focus is not hover, and is always visible)
   -------------------------------------------------------------------------- */
:focus {
  outline: none;
}

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


/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-8);
}

@media (min-width: 900px) {
  .section {
    padding-block: var(--space-10);
  }
}


/* --------------------------------------------------------------------------
   5. Typography
   -------------------------------------------------------------------------- */
.title-xl,
.title-l,
.title-m {
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-head);
}

.title-xl {
  font-size: clamp(2.5rem, 6.4vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: 0.06em;
}

.title-l {
  font-size: clamp(1.625rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.title-m {
  font-size: clamp(0.9375rem, 1.2vw, 1.0625rem);
  line-height: 1.3;
}

.eyebrow {
  font-size: 11px;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-muted);
}

.text-muted {
  color: var(--color-muted);
}

.measure {
  max-width: 34em;
}

/* Inline text link: a fixed hairline underline, no hover change.
   Also usable on <button> for text-style actions ("Size guide", "Remove"). */
.link {
  display: inline;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: currentColor;
}

button.link {
  font-size: inherit;
  line-height: inherit;
  text-align: inherit;
}

.rule {
  border: 0;
  border-top: 1px solid var(--color-line);
}


/* --------------------------------------------------------------------------
   6. Buttons
   Black fill by default (.btn--light: white). On hover a sage accent fill
   slowly wipes across from the left and the label turns black.
   Only .btn and .cart-toggle react to hover.
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--color-text);
  --btn-fg: var(--color-bg);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: 14px 32px;
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 12px;
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--dur-2) var(--ease-in-out),
    border-color var(--dur-2) var(--ease-in-out);
}

/* The hover fill layer (sits behind the label). */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur-2) var(--ease-in-out);
}

.btn--light {
  --btn-bg: var(--color-bg);
  --btn-fg: var(--color-text);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* Light button focus: a black ring framed by white on both sides, so it
   reads on the light-gray placeholder and on dark photos alike.
   (Flat rings drawn with box-shadow; not a drop shadow.) */
.btn--light:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--color-bg), 0 0 0 7px var(--color-bg);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  --btn-bg: var(--color-line);
  --btn-fg: var(--color-muted);
  border-color: var(--color-line);
  cursor: not-allowed;
}

@media (hover: hover) {
  .btn:not(:disabled):not([aria-disabled="true"]):hover {
    color: var(--color-text);
    border-color: var(--color-accent);
  }

  .btn:not(:disabled):not([aria-disabled="true"]):hover::before {
    transform: scaleX(1);
    transform-origin: left center;
  }
}


/* --------------------------------------------------------------------------
   7. Accessibility helpers
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: calc(var(--z-panel) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 12px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  transform: translateY(calc(-100% - var(--space-5)));
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--color-text);
}


/* --------------------------------------------------------------------------
   8. Header
   Thin and sticky. The hairline underneath fades in once the page scrolls
   (site.js adds .is-scrolled). Brand left, menu centred, cart right.
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}

.no-js .site-header,
.site-header.is-scrolled {
  border-bottom-color: var(--color-line);
}

.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
  column-gap: var(--space-4);
}

/* The logo is an SVG file (logo.svg). */
.site-header__brand {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.site-header__name {
  font-size: 15px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.site-header__brand img {
  display: block;
  width: auto;
  height: 28px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-7);
}

.site-nav__link,
.cart-toggle {
  font-size: 12px;
  font-weight: var(--weight-regular);
  line-height: 1;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  white-space: nowrap;
}

.site-nav__link {
  padding-block: var(--space-2);
}

/* Current page: a fixed hairline underneath. Not a hover state. */
.site-nav__link[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.6em;
}

.cart-toggle {
  position: relative;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 44px;
  padding: 0;
}

.cart-toggle__count {
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
  transition: color var(--dur-2) var(--ease);
}

/* Cart hover: a hairline draws in slowly beneath the label. */
.cart-toggle::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 1px;
  background: var(--color-accent-ink);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur-2) var(--ease-in-out);
}

@media (hover: hover) {
  .cart-toggle:hover .cart-toggle__count {
    color: var(--color-text);
  }

  .cart-toggle:hover::after {
    transform: scaleX(1);
    transform-origin: left center;
  }
}

/* Small phones: tighten spacing so everything fits on one line at 320px. */
@media (max-width: 420px) {
  .site-header__inner {
    column-gap: var(--space-3);
  }

  .site-header__brand img {
    height: 24px;
  }

  .site-nav {
    gap: var(--space-4);
  }

  .site-nav__link,
  .cart-toggle {
    font-size: 11px;
    letter-spacing: 0.1em;
  }
}


/* --------------------------------------------------------------------------
   9. Footer
   Minimal and airy. No hover on any footer element.
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-7); /* pages end with a .section, which adds its own space */
  border-top: 1px solid var(--color-line);
  font-size: 13px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: var(--space-8);
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.site-footer__newsletter .eyebrow {
  margin-bottom: var(--space-4);
}

.site-footer__lede {
  margin-bottom: var(--space-6);
  font-size: 15px;
}

.newsletter {
  display: flex;
  align-items: stretch;
  max-width: 420px;
  border-bottom: 1px solid var(--color-line);
  transition: border-color var(--dur-1) var(--ease);
}

.newsletter:focus-within {
  border-bottom-color: var(--color-text);
}

.newsletter__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}

.newsletter__input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.newsletter__input:focus-visible {
  outline: none; /* the form's bottom line turns black instead */
}

.newsletter__input[aria-invalid="true"] {
  /* Keep layout identical; the message below explains the problem. */
  color: var(--color-text);
}

.newsletter__submit {
  flex: 0 0 auto;
  min-height: 48px;
  padding-left: var(--space-5);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.newsletter__submit:focus-visible {
  outline-offset: -2px;
}

.newsletter__message {
  min-height: 1.6em;
  margin-top: var(--space-3);
  font-size: 13px;
  color: var(--color-muted);
}

.newsletter__message[data-state="error"] {
  color: var(--color-text);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: 12px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.site-footer__links a {
  padding-block: var(--space-1);
}

/* Currency selector: a quiet select with a hairline underneath. No hover. */
.site-footer__currency {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.currency-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  padding: 0 22px 0 0;
  border: 0;
  border-bottom: 1px solid var(--color-line);
  border-radius: 0;
  background-color: transparent;
  /* small chevron drawn with two gradients */
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 9px) 50%, calc(100% - 5px) 50%;
  background-size: 4px 4px;
  background-repeat: no-repeat;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.currency-select:focus-visible {
  outline: none;
  border-bottom-color: var(--color-text);
}

.site-footer__legal {
  font-size: 11px;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-muted);
}

@media (min-width: 760px) {
  .site-footer__inner {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-5);
    row-gap: var(--space-9);
    padding-top: var(--space-9);
  }

  .site-footer__newsletter {
    grid-column: 1 / span 6;
  }

  .site-footer__links {
    grid-column: 9 / span 4;
    padding-top: 1px;
  }

  .site-footer__legal {
    grid-row: 2;
    align-self: center;
  }

  .site-footer__currency {
    grid-column: 7 / -1;
    grid-row: 2;
    justify-self: end;
  }

  /* No newsletter yet: links move to the left column */
  .site-footer__inner:has(.site-footer__newsletter[hidden]) .site-footer__links {
    grid-column: 1 / span 6;
  }

  .site-footer__legal {
    grid-column: 1 / span 6;
  }
}


/* --------------------------------------------------------------------------
   10. Product card (homepage drop grid + "Also in Drop 01" on product pages)
   No hover effect of any kind, by design.
   -------------------------------------------------------------------------- */
.product-card {
  min-width: 0;
}

.product-card__visual {
  position: relative;
}

.product-card__image,
.product-card__link {
  display: block;
}

.product-card__link:focus-visible {
  outline-offset: 6px;
}

.product-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.product-card__name {
  font-size: 13px;
  font-weight: var(--weight-medium);
  line-height: 1.4;
  letter-spacing: var(--tracking-head);
  text-transform: uppercase;
}

.product-card__price {
  flex: 0 0 auto;
  font-size: 13px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Colour circles under the card, with the name of the colour shown.
   Clicking one shows that colour on the card (js/card.js); the chosen one
   gets a thin ring. */
.product-card__colors {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.product-card__swatches {
  display: flex;
  gap: 12px;
}

.product-card__swatch {
  position: relative;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--color-placeholder);
  /* hairline so off-white still shows on white */
  box-shadow: inset 0 0 0 1px var(--color-line);
  cursor: pointer;
}

/* bigger invisible tap area */
.product-card__swatch::after {
  content: "";
  position: absolute;
  inset: -6px;
}

.product-card__swatch[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--color-line), 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-text);
}

.product-card__swatch:focus-visible {
  outline-offset: 4px;
}

.product-card__color-name {
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-muted);
}

/* Quick add: sizes over the bottom of the card image (js/card.js).
   Computer: shown while the pointer is over the image (or a size has
   keyboard focus). Phone: the round + button opens it. */
.quick-add {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.quick-add__panel {
  margin: 10px;
  padding: var(--space-3);
  background: var(--color-bg);
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  pointer-events: none; /* the hidden sizes must not catch clicks on the image */
  transition:
    opacity var(--dur-1) var(--ease),
    transform var(--dur-1) var(--ease);
}

.quick-add.is-open .quick-add__panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .product-card__visual:hover .quick-add__panel,
  .quick-add:focus-within .quick-add__panel {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
}

.quick-add__label {
  margin: 0 0 var(--space-3);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  text-align: center;
}

.quick-add__sizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 4px;
}

.quick-add__size {
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-line);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 12px;
  cursor: pointer;
  transition:
    background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease);
}

.quick-add__size:not(:disabled):hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: var(--color-bg);
}

.quick-add__size:disabled {
  color: var(--color-muted);
  text-decoration: line-through;
  cursor: default;
}

.quick-add__toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.quick-add.is-open .quick-add__toggle {
  display: none;
}

/* The concept label would peek out under the open sizes. */
.product-card__visual:has(.quick-add.is-open) .media::after {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .quick-add__toggle {
    display: none;
  }
}


/* --------------------------------------------------------------------------
   11. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Hover fills fade instead of sliding. */
  .btn::before,
  .cart-toggle::after {
    transform: none;
    opacity: 0;
    transition: opacity var(--dur-1) linear;
  }

  @media (hover: hover) {
    .btn:not(:disabled):not([aria-disabled="true"]):hover::before,
    .cart-toggle:hover::after {
      transform: none;
      opacity: 1;
    }
  }
}
