/* ── Our Roots — Editorial Layout ── */

/* HERO — side-by-side on desktop, stacked on mobile */
.roots-hero {
  display: flex;
  flex-direction: column;
  background: var(--color-ink);
  min-height: 70vh;
}
.roots-hero-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.roots-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roots-hero-text {
  padding: var(--space-12) var(--gutter-mobile) var(--space-16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.roots-eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-earth);
  margin-bottom: var(--space-3);
}
.roots-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: normal;
  color: var(--color-shell);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
}
.roots-hero p {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--color-shell);
  opacity: 0.85;
  line-height: var(--leading-relaxed);
  max-width: 560px;
}

@media (min-width: 768px) {
  .roots-hero {
    flex-direction: row;
    min-height: 80vh;
  }
  .roots-hero-media {
    width: 55%;
    aspect-ratio: auto;
  }
  .roots-hero-text {
    width: 45%;
    padding: var(--space-16) var(--space-12);
  }
  .roots-hero h1 {
    font-size: var(--text-3xl);
  }
}

@media (prefers-reduced-motion: reduce) {
  .roots-hero-video { display: none; }
  .roots-hero-media {
    background: var(--color-ink) url(/assets/video/scr-farm-loop-a-poster.jpg) center/cover no-repeat;
  }
}

/* ── SECTION ROWS — alternating layout ── */
.roots-section {
  padding: var(--space-16) var(--gutter-mobile);
  overflow: hidden;
}
.roots-section--shell { background: var(--color-shell); }
.roots-section--white { background: var(--color-white); }
.roots-section--ink {
  background: var(--color-ink);
  color: var(--color-shell);
}
.roots-section--ink h2,
.roots-section--ink p,
.roots-section--ink .roots-label { color: var(--color-shell); }
.roots-section--ink .roots-icon img { filter: brightness(0) invert(1); }

.roots-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  max-width: 1200px;
  margin: 0 auto;
  align-items: center;
}

.roots-media {
  position: relative;
  width: 100%;
  max-width: 500px;
  min-height: 300px;
}
.roots-text {
  width: 100%;
  max-width: 560px;
}

@media (min-width: 768px) {
  .roots-section { padding: var(--space-24) var(--gutter); }
  .roots-row {
    flex-direction: row;
    gap: var(--space-16);
    align-items: center;
  }
  .roots-row--reverse { flex-direction: row-reverse; }
  .roots-media {
    flex: 0 0 48%;
    max-width: 48%;
  }
  .roots-text {
    flex: 1;
    max-width: none;
  }
}

/* ── TEXT STYLES ── */
.roots-icon {
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-4);
}
.roots-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.roots-label {
  font-family: var(--font-label);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-earth);
  margin-bottom: var(--space-3);
}
.roots-text h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: normal;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-6);
}
.roots-text p {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}
.roots-link {
  display: inline-block;
  font-family: var(--font-label);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-earth);
  text-decoration: none;
  margin-top: var(--space-4);
  transition: opacity 0.2s;
}
.roots-link:hover { opacity: 0.7; }

@media (min-width: 768px) {
  .roots-text h2 { font-size: var(--text-3xl); }
}

/* ── POLAROID TREATMENT ── */
.polaroid {
  background: var(--color-white);
  padding: 8px 8px 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.08);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}
.polaroid img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
}
.polaroid--tilt-left { transform: rotate(-2.5deg); }
.polaroid--tilt-right { transform: rotate(2.5deg); }
.polaroid--center { transform: rotate(-0.5deg); }

.polaroid--overlap {
  margin-top: -40px;
  margin-left: 20%;
  z-index: 2;
  width: 75%;
}
.polaroid--overlap-right {
  margin-top: -30px;
  margin-left: auto;
  margin-right: 0;
  z-index: 2;
  width: 70%;
}
.polaroid--overlap-bottom {
  margin-top: -30px;
  margin-left: 10%;
  z-index: 3;
  width: 65%;
}

/* Vintage polaroid — sepia tint, extra bottom padding for caption */
.polaroid--vintage {
  padding-bottom: 48px;
  background: #FDFCF7;
}
.polaroid--vintage img {
  filter: sepia(0.15) contrast(0.95);
}
.polaroid-caption {
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-slate-60);
  margin-top: 8px;
}

.polaroid--wide img {
  aspect-ratio: 16 / 9;
}

.polaroid:hover {
  transform: rotate(0deg) scale(1.02);
  z-index: 10;
}

/* ── TORN / RIPPED EDGE ── */
.torn-edge {
  -webkit-mask-image:
    linear-gradient(to right,
      transparent 0px,
      black 3px,
      black calc(100% - 3px),
      transparent 100%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16'%3E%3Cpath d='M0,8 Q10,2 20,7 Q30,14 40,6 Q50,1 60,9 Q70,15 80,5 Q90,0 100,8 Q110,14 120,4 Q130,1 140,10 Q150,16 160,6 Q170,0 180,9 Q190,14 200,8' fill='none' stroke='black' stroke-width='20'/%3E%3C/svg%3E");
  -webkit-mask-size: 100% calc(100% - 12px), 200px 16px;
  -webkit-mask-position: center top, bottom left;
  -webkit-mask-repeat: no-repeat, repeat-x;
  -webkit-mask-composite: source-over;
  mask-image:
    linear-gradient(to right,
      transparent 0px,
      black 3px,
      black calc(100% - 3px),
      transparent 100%
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 16'%3E%3Cpath d='M0,8 Q10,2 20,7 Q30,14 40,6 Q50,1 60,9 Q70,15 80,5 Q90,0 100,8 Q110,14 120,4 Q130,1 140,10 Q150,16 160,6 Q170,0 180,9 Q190,14 200,8' fill='none' stroke='black' stroke-width='20'/%3E%3C/svg%3E");
  mask-size: 100% calc(100% - 12px), 200px 16px;
  mask-position: center top, bottom left;
  mask-repeat: no-repeat, repeat-x;
  mask-composite: add;
}

/* ── VIDEO FRAMES ── */
.roots-video-frame {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.roots-video-frame video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.roots-video-frame--small {
  margin-top: var(--space-6);
  width: 70%;
}

@media (prefers-reduced-motion: reduce) {
  .roots-video-frame video,
  .roots-section video { display: none; }
  .roots-video-frame {
    min-height: 200px;
    background: var(--color-slate-20);
  }
}

/* ── PLACE SECTION — 3 storefronts ── */
#place .roots-media {
  min-height: 380px;
}
#place .polaroid img {
  aspect-ratio: 3 / 2;
}

/* ── RIPPED EDGE — dramatic tear for Passion/Farm ── */
.ripped-edge {
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
  -webkit-mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,10 Q5,17 11,5 L16,15 Q21,20 27,6 Q31,0 37,13 L42,17 Q48,20 54,4 Q58,0 64,15 L70,17 Q76,20 82,3 Q86,0 92,14 L98,17 Q104,20 110,6 Q114,0 120,13 L126,17 Q132,20 138,4 Q142,0 148,15 L154,17 Q160,20 166,6 Q170,0 176,13 L182,17 Q188,20 194,5 Q198,0 200,10' fill='none' stroke='black' stroke-width='24'/%3E%3C/svg%3E"),
    linear-gradient(to right, transparent 0px, black 2px, black calc(100% - 2px), transparent 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,10 Q5,3 11,15 L16,5 Q21,0 27,14 Q31,20 37,7 L42,3 Q48,0 54,16 Q58,20 64,5 L70,3 Q76,0 82,17 Q86,20 92,6 L98,3 Q104,0 110,14 Q114,20 120,7 L126,3 Q132,0 138,16 Q142,20 148,5 L154,3 Q160,0 166,14 Q170,20 176,7 L182,3 Q188,0 194,15 Q198,20 200,10' fill='none' stroke='black' stroke-width='24'/%3E%3C/svg%3E");
  -webkit-mask-size: 200px 20px, 100% calc(100% - 24px), 200px 20px;
  -webkit-mask-position: top left, center, bottom left;
  -webkit-mask-repeat: repeat-x, no-repeat, repeat-x;
  -webkit-mask-composite: source-over;
  mask-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,10 Q5,17 11,5 L16,15 Q21,20 27,6 Q31,0 37,13 L42,17 Q48,20 54,4 Q58,0 64,15 L70,17 Q76,20 82,3 Q86,0 92,14 L98,17 Q104,20 110,6 Q114,0 120,13 L126,17 Q132,20 138,4 Q142,0 148,15 L154,17 Q160,20 166,6 Q170,0 176,13 L182,17 Q188,20 194,5 Q198,0 200,10' fill='none' stroke='black' stroke-width='24'/%3E%3C/svg%3E"),
    linear-gradient(to right, transparent 0px, black 2px, black calc(100% - 2px), transparent 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,10 Q5,3 11,15 L16,5 Q21,0 27,14 Q31,20 37,7 L42,3 Q48,0 54,16 Q58,20 64,5 L70,3 Q76,0 82,17 Q86,20 92,6 L98,3 Q104,0 110,14 Q114,20 120,7 L126,3 Q132,0 138,16 Q142,20 148,5 L154,3 Q160,0 166,14 Q170,20 176,7 L182,3 Q188,0 194,15 Q198,20 200,10' fill='none' stroke='black' stroke-width='24'/%3E%3C/svg%3E");
  mask-size: 200px 20px, 100% calc(100% - 24px), 200px 20px;
  mask-position: top left, center, bottom left;
  mask-repeat: repeat-x, no-repeat, repeat-x;
  mask-composite: add;
}

/* ── PEOPLE — balance the two polaroids ── */
#people .polaroid--vintage {
  width: 88%;
}
#people .polaroid--overlap-right img {
  aspect-ratio: 1 / 1;
  object-position: center 70%;
}

/* ── PASSION — larger, ripped video ── */
#passion .roots-video-frame {
  transform: rotate(-1.5deg);
}
#passion .roots-video-frame video {
  aspect-ratio: 4 / 3;
}
@media (min-width: 768px) {
  #passion .roots-media {
    flex: 0 0 52%;
    max-width: 52%;
  }
}

/* ── PLACE — photo adjustments ── */
#place .polaroid--tilt-left {
  width: 70%;
}
#place .polaroid--tilt-left img {
  aspect-ratio: 3 / 4;
  object-position: center center;
}
#place .polaroid--overlap-bottom img {
  object-position: center 35%;
}

/* ── FARM — polaroid + ripped video ── */
.roots-video-frame--farm {
  margin-top: var(--space-6);
  width: 82%;
  transform: rotate(2deg);
}
.roots-video-frame--farm video {
  aspect-ratio: 4 / 3;
}
