:root {
  --bg: #fff;
  --ink: #14193a;
  --muted: #5d6379;
  --hair: #e2e4ec;
  --blue: #2b47a6;
  --blue-deep: #1d2a6b;
  --blue-tint: #e6ecfa;
  --green: #1f8a5b;
  --green-bright: #27a06a;
  --green-tint: #e1f3ea;
  --stone: #f4f3ef;
  --error: #b3261e;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section: clamp(4rem, 9vw, 7.5rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.4vw, 4.5rem);
}

h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
}

h3 {
  font-size: 1.35rem;
}

p {
  margin: 0;
}

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

.caps {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--blue);
}

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

.skip,
.sr {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: 0.5rem 1rem;
  background: #fff;
}

/* Header */

.ribbon,
.bar {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
}

.ribbon {
  background: #fff4c9;
  font-size: 0.85rem;
}

.bar {
  background: var(--blue-deep);
  color: #fff;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background: rgb(255 255 255 / 0.93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s,
    padding 0.3s var(--ease);
}

.site-header.is-scrolled {
  padding-block: 0.6rem;
  border-color: var(--hair);
}

.site-header nav {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.2rem);
}

.site-header nav:last-child {
  justify-content: flex-end;
}

/* Shop dropdown */

.menu {
  position: relative;
}

.menu button {
  position: relative;
  padding: 0.3rem 1rem 0.3rem 0;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

.menu button::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.4rem;
  height: 0.4rem;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  translate: 0 -75%;
  rotate: 45deg;
  transition: rotate 0.25s var(--ease);
}

.menu ul {
  position: absolute;
  top: 100%;
  left: -1.25rem;
  min-width: 15rem;
  margin: 0;
  padding: 0.6rem 0;
  background: #fff;
  border: 1px solid var(--hair);
  box-shadow: 0 20px 40px -20px rgb(20 25 58 / 0.25);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.25s,
    transform 0.25s var(--ease),
    visibility 0.25s;
}

.menu button[aria-expanded='true'] + ul {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.menu button[aria-expanded='true']::after {
  rotate: 225deg;
}

.site-header .menu li a {
  display: block;
  padding: 0.7rem 1.25rem;
}

.site-header .menu li a::after {
  display: none;
}

.menu li a:hover {
  background: var(--blue-tint);
}

.menu li:last-child {
  margin-top: 0.4rem;
  border-top: 1px solid var(--hair);
}

.site-header nav a,
.link {
  position: relative;
  padding-block: 0.3rem;
  text-decoration: none;
}

.site-header nav a::after,
.link::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.site-header nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.link {
  color: var(--blue);
}

.link::after {
  transform: scaleX(1);
}

.link:hover::after {
  transform: scaleX(0);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font: 500 1.35rem var(--serif);
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 36px;
}

/* Buttons */

.btn {
  display: inline-block;
  padding: 1rem 2.2rem;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 0;
  color: #fff;
  cursor: pointer;
  font: 500 0.78rem var(--sans);
  letter-spacing: 0.16em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    background 0.3s,
    border-color 0.3s;
}

.btn:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}

.btn[disabled] {
  cursor: progress;
  opacity: 0.6;
}

.btn-wide {
  width: 100%;
}

/* Photos */

.ph {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--stone);
  border-radius: 4px;
}

.ph img,
.ph video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease);
}

a:hover > .ph img {
  transform: scale(1.06);
}

/* A row of photos at their own proportions: each is as wide as its shape needs, so nothing is cropped */

.photo-row {
  display: flex;
  gap: 0.75rem;
}

.photo-row + .photo-row {
  margin-top: 0.75rem;
}

.photo-row .ph {
  flex: var(--r) 1 0;
  aspect-ratio: var(--r);
}

.tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1;
  padding: 0.35rem 0.8rem;
  background: var(--blue);
  border-radius: 99px;
  color: #fff;
}

/* Home hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: min(76vh, 48rem);
  background: var(--blue-tint);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1.6rem;
  padding: 4rem var(--gutter);
}

.hero-copy em {
  color: var(--blue);
}

.hero-photos {
  align-self: center;
  margin: 2rem var(--gutter) 2rem 0;
}

.hero-copy .lead {
  max-width: 28rem;
  font-size: 1.1rem;
  color: var(--muted);
}

/* Scrolling product ticker */

.ticker {
  overflow: hidden;
  background: var(--blue-deep);
  color: #fff;
  white-space: nowrap;
}

.ticker p {
  display: inline-block;
  padding: 1rem 0;
  font: italic 400 1.35rem var(--serif);
  animation: slide 40s linear infinite;
}

.ticker:hover p {
  animation-play-state: paused;
}

.ticker i {
  margin: 0 1.6rem;
  color: var(--green-bright);
  font-style: normal;
}

/* Sections */

.wrap {
  padding: var(--section) var(--gutter) 0;
}

.band {
  margin-top: var(--section);
  padding: clamp(3.5rem, 7vw, 6rem) var(--gutter);
  background: var(--blue-tint);
}

.band-green {
  background: var(--green-tint);
}

.title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.title .eyebrow {
  margin-bottom: 0.8rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid a {
  display: block;
  text-decoration: none;
}

.grid .ph {
  aspect-ratio: 4 / 5;
}

.grid-related {
  grid-template-columns: repeat(4, 1fr);
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.meta span:last-child {
  white-space: nowrap;
}

.meta span:first-child {
  font: 400 1.2rem var(--serif);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
}

.split .ph {
  aspect-ratio: 1;
}

.split .ph-video {
  aspect-ratio: 9 / 16;
  width: min(100%, 24rem);
  justify-self: center;
}

.split-copy {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  max-width: 30rem;
}

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

.chips li {
  padding: 0.45rem 1rem;
  background: #fff;
  border: 1px solid var(--blue);
  border-radius: 99px;
  color: var(--blue-deep);
}

.samples-note {
  max-width: 38rem;
  margin-top: 1.5rem;
}

.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.values div {
  padding: 2rem 1.5rem;
  background: var(--green-tint);
  border-radius: 4px;
}

.values div:nth-child(2) {
  background: var(--blue-tint);
}

.values h3 {
  margin-bottom: 0.5rem;
  color: var(--blue-deep);
}

.narrow {
  max-width: 46rem;
  margin-inline: auto;
}

.narrow > h2 {
  margin-bottom: 1.5rem;
}

.faq {
  border-bottom: 1px solid var(--hair);
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  cursor: pointer;
  font: 400 1.2rem/1.3 var(--serif);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  color: var(--green);
  font: 300 1.4rem/1 var(--sans);
  transition: rotate 0.3s var(--ease);
}

.faq[open] summary::after {
  rotate: 45deg;
}

.faq p,
.faq ul {
  margin: 0;
  padding-bottom: 1.3rem;
  color: var(--muted);
}

.faq ul {
  padding-left: 1.2rem;
}

/* Text pages */

.page {
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) 0;
}

.page h1 {
  margin-bottom: 1.5rem;
  font-size: clamp(2.2rem, 4.6vw, 3.6rem);
}

.prose {
  max-width: 44rem;
  margin-inline: auto;
}

.prose h2 {
  margin: 2.5rem 0 0.8rem;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
}

.prose p,
.prose ul,
.prose table {
  margin-bottom: 1rem;
}

.prose .lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.prose a:not(.btn) {
  color: var(--blue);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 0.8rem 0.5rem 0.8rem 0;
  border-bottom: 1px solid var(--hair);
  font-weight: 400;
}

thead th {
  color: var(--muted);
}

/* Product page */

.crumbs a {
  text-decoration: none;
}

.pdp {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  padding: 2rem var(--gutter) 0;
}

.gallery {
  align-self: start;
}

/* product photos are shown whole inside a fixed frame, so the page never jumps and nothing is cropped */

.gallery-main {
  aspect-ratio: 1;
  max-height: 72vh;
  width: 100%;
}

.gallery-main img,
.thumbs img,
.cart-line img {
  object-fit: contain;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.thumbs button {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.thumbs button:hover,
.thumbs button[aria-current] {
  opacity: 1;
}

.buybox {
  position: sticky;
  top: 6rem;
  align-self: start;
  display: grid;
  gap: 1.4rem;
}

.buybox h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.price {
  font-size: 1.3rem;
}

.buy {
  display: grid;
  gap: 1.4rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field label {
  display: block;
  margin-bottom: 0.6rem;
  padding: 0;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.swatches input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.swatches label {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  background: var(--c);
  border-radius: 50%;
  box-shadow: 0 0 0 1px #c9ccd6;
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.swatches input:checked + label {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 4.5px var(--ink);
}

.swatches input:focus-visible + label {
  outline: 2px solid var(--blue);
  outline-offset: 6px;
}

.customize {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--blue-tint);
  border-radius: 4px;
}

.customize legend {
  float: left;
  width: 100%;
  margin-bottom: 0;
  color: var(--blue);
}

.customize .fine {
  margin-top: 0.3rem;
}

input[type='file'] {
  padding: 0.55rem;
  font-size: 0.9rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.row > :only-child {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border: 1px solid #c9ccd6;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
}

.buy-status,
.form-status {
  min-height: 1.5em;
}

.buy-status a {
  color: var(--blue);
}

.is-error {
  color: var(--error);
}

.optional {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-block: 2rem;
}

.form > :is(button, p),
.field-wide {
  grid-column: 1 / -1;
}

.form button {
  justify-self: start;
}

.hp {
  position: absolute;
  left: -999rem;
}

/* Cart */

.cart {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
}

.cart[hidden],
.empty[hidden] {
  display: none;
}

.cart-lines {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hair);
  list-style: none;
}

.cart-line {
  display: grid;
  grid-template-columns: 6rem 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--hair);
}

.cart-line img {
  width: 6rem;
  height: 6rem;
  background: var(--stone);
  border-radius: 4px;
}

.cart-line a {
  font: 400 1.25rem var(--serif);
  text-decoration: none;
}

.cart-line-end {
  display: grid;
  justify-items: end;
  gap: 0.5rem;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.qty button {
  width: 2.2rem;
  height: 2.2rem;
  background: #fff;
  border: 1px solid #c9ccd6;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.remove {
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
}

.cart-summary {
  display: grid;
  gap: 1.2rem;
  padding: 2rem;
  background: var(--blue-tint);
  border-radius: 4px;
}

.totals {
  margin: 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}

.totals dd {
  margin: 0;
}

.totals .total {
  margin-top: 0.5rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--ink);
  font: 400 1.5rem var(--serif);
}

.fine {
  font-size: 0.88rem;
  color: var(--muted);
}

.empty {
  display: grid;
  justify-items: start;
  gap: 1.5rem;
}

/* Footer */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
  margin-top: var(--section);
  padding: 3.5rem var(--gutter) 2.5rem;
  background: var(--blue-deep);
  color: #fff;
}

.site-footer p {
  margin-bottom: 0.4rem;
  color: rgb(255 255 255 / 0.75);
}

.site-footer .footer-brand {
  color: #fff;
  font: 400 1.6rem var(--serif);
}

.site-footer nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  align-content: start;
  gap: 0.9rem 2.5rem;
}

.site-footer nav a {
  text-decoration: none;
}

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

.copyright {
  flex-basis: 100%;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 0.2);
  font-size: 0.88rem;
}

/* Motion: content is only hidden once the script has confirmed it can reveal it */

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

.js .wipe {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s var(--ease);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js .wipe.in {
  clip-path: inset(0);
}

@keyframes drift {
  to {
    transform: scale(1.1) translate(-1%, 1%);
  }
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .js .reveal,
  .js .wipe {
    opacity: 1;
    transform: none;
    clip-path: none;
  }
}

/* Small screens */

@media (max-width: 56rem) {
  .hero,
  .split,
  .pdp,
  .cart {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-block: 3rem 1rem;
  }

  .hero-photos {
    margin: 0 var(--gutter) 2.5rem;
  }

  .split .ph {
    width: min(100%, 30rem);
    justify-self: center;
  }

  .gallery-main {
    max-height: 60vh;
  }

  .values {
    grid-template-columns: 1fr;
  }

  .site-header nav {
    gap: 1rem;
  }

  .buybox {
    position: static;
  }
}

@media (max-width: 44rem) {
  /* phone header: Shop, logo and Cart on one row; the other links live in the footer */
  .wide-only {
    display: none;
  }

  .site-header {
    padding-block: 0.7rem;
  }

  .brand {
    gap: 0.5rem;
    font-size: 1.15rem;
  }

  .brand img {
    width: 28px;
    height: 30px;
  }

  .menu ul {
    left: 0;
  }

  .grid-related {
    grid-template-columns: 1fr 1fr;
  }

  /* two larger photos per hero row instead of three small ones */
  .hero-photos .ph:nth-child(3) {
    display: none;
  }
}

@media (max-width: 34rem) {
  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1rem;
  }

  .meta {
    flex-direction: column;
    gap: 0;
  }

  .form,
  .row {
    grid-template-columns: 1fr;
  }

  .cart-line {
    grid-template-columns: 4.5rem 1fr;
  }

  .cart-line img {
    width: 4.5rem;
    height: 4.5rem;
  }

  .cart-line-end {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: space-between;
    align-items: center;
  }
}
