/* ================================================================
  ABOUT PAGE (about.html)
  Titles, text, buttons and the create-store form come from base.css;
  this file only holds the blocks that exist on this page.
================================================================ */

/* Photo collages (Hero / How We Work).
  Hero: one wide tile on top, two square tiles below.
  --vertical: one tall tile on the left, two square tiles on the right.
  Each tile stacks 3 photos that crossfade in a 12s loop (4s each,
  1s overlap); tiles are phase-shifted so they don't change together.
  Hovering or the toggle button pauses the loop; the inline script in
  about.html lets a running crossfade finish so it stops on a full photo. */
.about-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--js-padding) * 1.5);
  width: 100%;
  max-width: 560px;
}

.about-collage__tile {
  display: grid;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: var(--js-radius-xl);
  background: var(--color-border);
}

.about-collage__tile--wide {
  grid-column: 1 / -1;
  aspect-ratio: 2 / 1;
}

.about-collage__tile--tall {
  grid-row: 1 / 3;
  aspect-ratio: auto;
}

.about-collage__tile:nth-child(2) { --about-tile-shift: 1.3s; }
.about-collage__tile:nth-child(3) { --about-tile-shift: 2.6s; }

.about-collage__tile img {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: about-collage-fade 12s linear infinite;
}

.about-collage__tile img:nth-child(1) { animation-delay: calc(-1s - var(--about-tile-shift, 0s)); }
.about-collage__tile img:nth-child(2) { animation-delay: calc(-9s - var(--about-tile-shift, 0s)); }
.about-collage__tile img:nth-child(3) { animation-delay: calc(-5s - var(--about-tile-shift, 0s)); }

.about-collage__toggle {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 15px;
  color: var(--color-main);
  background: var(--color-background-op5);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: var(--js-transition);
}

.about-collage__toggle:hover {
  background: var(--color-background-op8);
}

.about-collage__toggle:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@keyframes about-collage-fade {
  0% { opacity: 0; }
  8.33% { opacity: 1; }
  33.33% { opacity: 1; }
  41.66% { opacity: 0; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .about-collage__tile img { animation: none; }
  .about-collage__tile img:first-child { opacity: 1; }
  .about-collage__toggle { display: none; }
}

/* Stats: three cards with an icon, above History + Present */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(var(--js-padding) * 1.5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-stats__item {
  display: flex;
  align-items: center;
  gap: calc(var(--js-padding) * 1.75);
  padding: calc(var(--js-padding) * 2.25);
  border: 1px solid var(--color-border);
  border-radius: var(--js-radius-xl);
  background: var(--color-background);
}

.about-stats__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  aspect-ratio: 1 / 1;
  border-radius: var(--js-radius-lg);
  font-size: 38px;
  color: var(--color-accent-contrast);
  background: var(--color-accent);
}

.about-stats__body {
  display: flex;
  flex-direction: column-reverse;
  gap: calc(var(--js-padding) * 0.5);
  min-width: 0;
}

.about-stats__value {
  margin: 0;
  font-family: var(--font-main);
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.about-stats__label {
  font-weight: 500;
  color: var(--color-main);
}

/* Paragraphs: avoid a single word on the last line */
.js-section__text {
  text-wrap: pretty;
}

/* Hero link down to Meet the Team; the anchor clears the solid header */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.about-team-section {
  scroll-margin-top: 80px;
}

.about-hero__button {
  display: inline-flex;
}

.about-hero__button > .ph-arrow-down {
  transition: var(--js-transition);
}

.about-hero__button:is(:hover, :focus-visible) > .ph-arrow-down {
  transform: translateY(3px);
}

/* History / Present: a rule across both columns and the year on each
  heading's line, so the two blocks read as a timeline */
.about-era {
  position: relative;
  padding-top: calc(var(--js-padding) * 2);
}

/* Rule inset by the column padding so it matches the text width */
.about-era::before {
  content: "";
  position: absolute;
  top: 0;
  right: var(--js-padding);
  left: var(--js-padding);
  border-top: 1px solid var(--color-border);
}

.about-era__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--js-padding);
}

.about-era__year {
  font-family: var(--font-main);
  font-size: clamp(40px, 4.5vw, 64px);
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-main-op5);
}

/* How We Work: the first paragraph leads, the second stays muted */
.about-lead {
  font-size: calc(var(--font-base-size) * 1.375);
  line-height: 1.5;
  color: var(--color-main);
}

/* Meet the Team: one block per area. --about-team-cols is shared by the
  area grids and the row of small areas so every avatar lines up. */
.about-team {
  --about-team-cols: 6;
  --about-team-gap: calc(var(--js-padding) * 2);
  width: 100%;
}

/* Small areas side by side; each spans one column per person */
.about-team__shared {
  display: grid;
  grid-template-columns: repeat(var(--about-team-cols), minmax(0, 1fr));
  column-gap: var(--about-team-gap);
}

.about-team__shared .about-team__group {
  grid-column: span var(--about-team-span);
}

.about-team__shared .about-team__grid {
  grid-template-columns: repeat(var(--about-team-span), minmax(0, 1fr));
}

.about-team__group {
  padding: calc(var(--js-padding) * 2.5) 0 calc(var(--js-padding) * 3);
  border-top: 1px solid var(--color-border);
}

.about-team__heading {
  display: flex;
  align-items: baseline;
  gap: calc(var(--js-padding) * 0.75);
  margin: 0 0 calc(var(--js-padding) * 2.5);
  font-family: var(--font-main);
  font-size: calc(var(--font-base-size) * 1.375);
  font-weight: 500;
}

.about-team__count {
  font-size: calc(var(--font-base-size) * 0.9375);
  color: var(--color-secondary-op7);
}

/* 6 → 4 → 3 → 4 (smaller) columns, set through --about-team-cols */
.about-team__grid {
  display: grid;
  grid-template-columns: repeat(var(--about-team-cols), minmax(0, 1fr));
  gap: calc(var(--js-padding) * 2.5) var(--about-team-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.about-team__member {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.about-team__photo {
  width: 100%;
  max-width: 148px;
  height: auto;
  aspect-ratio: 1 / 1;
  margin-bottom: var(--js-padding);
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  background: var(--color-border);
}

.about-team__name {
  font-family: var(--font-main);
  font-weight: 500;
}

.about-team__role {
  font-size: calc(var(--font-base-size) * 0.875);
  color: var(--color-secondary-op7);
}

/* Careers: horizontal card closing Meet the Team, same shape as the shipping-methods banner */
.about-careers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--js-padding) * 2.25);
  padding: calc(var(--js-padding) * 2.5);
  border: 1px solid var(--color-border);
  border-radius: var(--js-radius-xl);
  background: var(--color-background);
}

.about-careers__title {
  margin: 0;
  font-family: var(--font-main);
  font-size: calc(var(--font-base-size) * 1.375);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-main);
}

/* Get in Touch cards */
.about-contact {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: calc(var(--js-padding) * 0.75);
  height: 100%;
  padding: calc(var(--js-padding) * 2.5) calc(var(--js-padding) * 2.25);
  border: 1px solid var(--color-border);
  border-radius: var(--js-radius-xl);
  background: var(--color-surface);
  transition: var(--js-transition);
}

/* The link inside the text covers the whole card ("stretched link") */
.about-contact:hover,
.about-contact:focus-within {
  border-color: var(--color-accent);
}

.about-contact a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.about-contact a:focus-visible {
  outline: none;
}

.about-contact:has(a:focus-visible) {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.about-contact__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: calc(var(--js-padding) * 0.5);
  border-radius: 50%;
  font-size: 26px;
  color: var(--color-accent-contrast);
  background: var(--color-accent);
}

.about-contact__title {
  margin: 0;
  font-family: var(--font-main);
  font-size: calc(var(--font-base-size) * 1.25);
  font-weight: 500;
}

.about-contact .js-cards__text {
  margin: 0;
}

.about-contact a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 1199px) {
  .about-team {
    --about-team-cols: 4;
  }
}

/* Get in Touch: one card per row below lg, icon beside the text */
@media (max-width: 991px) {
  .about-contact {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: calc(var(--js-padding) * 1.5);
    row-gap: calc(var(--js-padding) * 0.5);
    padding: calc(var(--js-padding) * 2);
  }

  .about-contact__icon {
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  .about-team-section {
    scroll-margin-top: 60px;
  }

  .about-lead {
    font-size: calc(var(--font-base-size) * 1.125);
  }

  /* Stats: 2 columns (icon on top, text centered below); the last
    card spans both columns with the icon beside the text */
  .about-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: calc(var(--js-padding) * 0.75);
  }

  .about-stats__item {
    flex-direction: column;
    gap: calc(var(--js-padding) * 1.25);
    padding: calc(var(--js-padding) * 1.5);
    text-align: center;
  }

  .about-stats__item:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: center;
    gap: calc(var(--js-padding) * 1.5);
    text-align: left;
  }

  .about-stats__icon {
    align-self: center;
    width: 72px;
    font-size: 32px;
  }

  .about-stats__body {
    align-items: center;
  }

  .about-stats__item:last-child .about-stats__body {
    align-items: flex-start;
  }

  .about-stats__value {
    font-size: 36px;
  }

  .about-team {
    --about-team-cols: 3;
  }

  .about-team__shared .about-team__group {
    grid-column: span var(--about-team-span-md);
  }

  .about-team__shared .about-team__grid {
    grid-template-columns: repeat(var(--about-team-span-md), minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .about-careers {
    padding: calc(var(--js-padding) * 1.875);
  }

  .about-team {
    --about-team-cols: 4;
    --about-team-gap: calc(var(--js-padding) * 0.75);
  }

  .about-team__grid {
    row-gap: calc(var(--js-padding) * 1.75);
  }

  .about-team__photo {
    margin-bottom: calc(var(--js-padding) * 0.5);
  }

  .about-team__name {
    font-size: calc(var(--font-base-size) * 0.75);
    line-height: 1.25;
  }

  /* One column is too narrow for an area heading: one-person areas
    take two and keep their avatar in the first one */
  .about-team__shared .about-team__group {
    grid-column: span var(--about-team-span-sm);
  }

  .about-team__shared .about-team__grid {
    grid-template-columns: repeat(var(--about-team-span-sm), minmax(0, 1fr));
  }

  .about-team__role {
    font-size: calc(var(--font-base-size) * 0.6875);
  }
}
