/*
  Soft Edge -- base layer.

  Direction: colourway-led warm DTC. Ribbon colour is the design system. The
  page is cream, the type is a friendly geometric sans in sentence case, the
  geometry is soft (pill buttons, big rounded blocks), and every accent comes
  from the colourway the shopper has chosen rather than from a fixed brand
  hue. No uppercase letterspaced labels, no hairline spec rules.

  Section and page skins live in soft-edge-shop.css.
*/

:root {
  --ink: var(--color-foreground);
  --cream: var(--color-background);
  --accent: var(--color-accent);

  /* Warm neutral ramp derived from the cream and ink, so tints stay in family. */
  --cream-deep: color-mix(in srgb, var(--ink) 6%, var(--cream));
  --cream-deeper: color-mix(in srgb, var(--ink) 11%, var(--cream));
  --white: #fffdfa;
  /* 70% is the floor that keeps small muted text at 4.5:1 against the lightest
     surface it lands on (--cream-deeper chips). At the previous 58% it measured
     3.1-4.0 and failed AA on cards, labels, and the length note. */
  --muted: color-mix(in srgb, var(--ink) 70%, var(--cream));
  --soft: color-mix(in srgb, var(--ink) 80%, var(--cream));

  /* The raw accent is a fill colour. As small text it measures 4.26:1 on cream
     and 3.76:1 on the warm callout tint, so text uses this darker cut. */
  --accent-text: color-mix(in srgb, var(--accent) 85%, black);
  --hairline: color-mix(in srgb, var(--ink) 12%, transparent);

  /* The colourway currently being shown. Every tinted surface reads these,
     and JavaScript rewrites them when a swatch is chosen. */
  --way: #16283f;
  --way-tint: color-mix(in srgb, var(--way) 18%, var(--cream));
  --way-deep: color-mix(in srgb, var(--way) 82%, black);
  --way-contrast: #fffdfa;

  --radius: 26px;
  --radius-lg: 40px;
  --radius-sm: 16px;
  --pill: 999px;

  /* Ceiling for the product gallery on the hero and product page. The shot is
     4:5, so this is also what bounds its height. */
  --gallery-max: 25rem;
  --shadow: 0 1.4rem 3rem color-mix(in srgb, var(--ink) 12%, transparent);
  --shadow-soft: 0 0.7rem 1.8rem color-mix(in srgb, var(--ink) 8%, transparent);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --content-max: min(
    calc(100vw - var(--page-margin) * 2),
    max(var(--page-width), 72vw)
  );
  --gutter: max(var(--page-margin), calc((100vw - var(--content-max)) / 2));
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  background: var(--cream);
}

body {
  min-width: 20rem;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-style: var(--font-body-style);
  font-weight: var(--font-body-weight);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

input,
select,
textarea {
  min-width: 0;
}

button {
  cursor: pointer;
}

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

::selection {
  color: var(--way-contrast);
  background: var(--way);
}

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

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 1rem;
  left: 1rem;
  padding: 0.8rem 1.2rem;
  border-radius: var(--pill);
  color: var(--white);
  background: var(--ink);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* --- Type roles ----------------------------------------------------------- */
/* Sentence case throughout. Labels are small and warm, never letterspaced
   uppercase, which is what made the old specimen-sheet voice. */

.display {
  font-family: var(--font-display);
  font-weight: var(--font-display-weight);
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.label--way {
  color: var(--way-deep);
}

/* --- Announcement --------------------------------------------------------- */

.announcement {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem var(--gutter);
  background: var(--way-tint);
  color: var(--way-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  transition: background 500ms var(--ease-out), color 500ms var(--ease-out);
}

.announcement p {
  margin: 0;
}

.announcement p + p::before {
  content: "\00b7";
  margin-right: 0.6rem;
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  background: var(--cream);
}

.wordmark {
  display: flex;
  align-items: center;
  justify-self: start;
  gap: 0.7rem;
  text-decoration: none;
}

/* The old letterpress "S" tile does not belong in the rounded system. */
.wordmark__mark {
  display: none;
}

.wordmark > span {
  display: grid;
  gap: 0.05rem;
}

.wordmark strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--font-display-weight);
  letter-spacing: -0.035em;
  line-height: 1;
}

.wordmark small {
  color: var(--muted);
  font-size: 0.82rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.9rem, 2.4vw, 2rem);
}

.site-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: var(--pill);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 200ms ease, color 200ms ease;
}

.site-nav a:hover {
  background: var(--cream-deep);
}

.site-nav a[aria-current="page"] {
  color: var(--way-contrast);
  background: var(--way);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.6rem;
}

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.7rem;
  padding: 0.5rem 1.1rem;
  border: 0;
  border-radius: var(--pill);
  background: var(--cream-deep);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 200ms ease, color 200ms ease;
}

.header-action:hover {
  color: var(--way-contrast);
  background: var(--way);
}

.header-action svg {
  width: 1rem;
}

.site-main {
  display: block;
}

/* --- Buttons -------------------------------------------------------------- */

.button {
  display: inline-flex;
  min-height: 3.4rem;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  border: 2px solid var(--ink);
  border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition:
    color 200ms ease,
    background 200ms ease,
    border-color 200ms ease,
    transform 200ms var(--ease-out);
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button--primary {
  color: var(--white);
  background: var(--ink);
}

.button--way {
  color: var(--way-contrast);
  background: var(--way);
  border-color: var(--way);
}

.button--quiet {
  border-color: transparent;
  background: var(--cream-deep);
}

.button:disabled,
.button.is-disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

/* --- Colourway swatches --------------------------------------------------- */
/* The merchandising system: one control that recolours the real 3D ribbon,
   the page tint, and every accent at once. */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent);
  transition: transform 220ms var(--ease-out);
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch[aria-pressed="true"] {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--ink) 14%, transparent),
    0 0 0 3px var(--cream),
    0 0 0 5px var(--ink);
}

.swatch-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.swatch-name {
  font-size: 1rem;
  font-weight: 700;
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3.5rem, 7vw, 6rem) var(--gutter) 2rem;
  margin-top: clamp(3rem, 6vw, 5rem);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--way-tint);
  transition: background 500ms var(--ease-out);
}

.footer-word p:last-child {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: var(--font-display-weight);
  letter-spacing: -0.04em;
  line-height: 1;
}

.footer-heading {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: var(--font-display-weight);
  letter-spacing: -0.02em;
}

.footer-copy {
  max-width: 30rem;
  margin: 0;
  color: var(--soft);
}

.footer-links {
  display: grid;
  gap: 0.5rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0.4rem 0.4rem 1.2rem;
  border-radius: var(--pill);
  background: var(--white);
}

.footer-form input {
  flex: 1;
  border: 0;
  background: transparent;
}

.footer-form input:focus-visible {
  outline: none;
}

.footer-form button {
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}

/* --soft rather than --muted: the footer sits on --way-tint, which darkens with
   the chosen colourway, so muted small text there measured below 4.5:1. */
.footer-base {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.6rem;
  margin-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--hairline);
  color: var(--soft);
  font-size: 0.9rem;
}

.footer-base p {
  margin: 0;
}

.payment-icons {
  display: flex;
  gap: 0.35rem;
}

.payment-icons svg {
  width: 2rem;
}

/* --- Motion --------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(1rem);
  transition:
    opacity 700ms var(--ease-out),
    transform 700ms var(--ease-out);
}

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

@media (max-width: 900px) {
  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .site-header {
    grid-template-columns: auto 1fr;
    gap: 0.6rem 1rem;
    padding-top: 0.9rem;
  }

  .wordmark {
    grid-row: 1;
  }

  .header-actions {
    grid-row: 1;
  }

  .site-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 0.3rem;
    overflow-x: auto;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

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