#textures {
  background: #fff;
  padding: clamp(4.5rem, 8vw, 6.25rem) clamp(1rem, 4vw, 2rem);
  scroll-margin-top: 90px;
}
.ews-textures-inner { max-width: 1200px; margin: 0 auto; }
.ews-textures-head { text-align: center; margin: 0 auto 3.25rem; max-width: 760px; }
.ews-textures-kicker {
  display: block; color: #2563eb; font-family: 'Source Sans 3', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.ews-textures-title {
  font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12; color: #0f2040; margin: .5rem 0 1rem; font-weight: 900;
}
.ews-textures-intro {
  font-family: 'Source Sans 3', sans-serif; color: #556; font-size: 17px;
  line-height: 1.7; margin: 0;
}
.ews-textures-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; align-items: stretch;
}
.ews-texture-card {
  background: #fff; border: 1px solid #e3e7ef; border-radius: 14px; overflow: hidden;
  box-shadow: 0 7px 26px rgba(15,32,64,.07); display: flex; flex-direction: column;
  min-width: 0;
}
.ews-texture-swatch {
  display: block; width: 100%; border: 0; padding: 0; margin: 0; background: #eef1f5;
  aspect-ratio: 1/1; position: relative; overflow: hidden; cursor: zoom-in;
}
.ews-texture-swatch img {
  width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease;
}
.ews-texture-swatch:hover img, .ews-texture-swatch:focus-visible img { transform: scale(1.035); }
.ews-texture-swatch:focus-visible { outline: 3px solid #2563eb; outline-offset: -3px; }
.ews-texture-img-fallback {
  position: absolute; inset: 0; display: none; place-items: center; padding: 1.5rem;
  text-align: center; font: 700 14px/1.45 'Source Sans 3', sans-serif; color: #526174;
  background:
    radial-gradient(circle at 18% 25%, rgba(255,255,255,.95) 0 3px, transparent 4px),
    radial-gradient(circle at 67% 72%, rgba(255,255,255,.9) 0 2px, transparent 3px),
    repeating-linear-gradient(22deg,#e5e8e8 0 2px,#f5f5f1 2px 7px,#dcdeda 7px 9px);
}
.ews-texture-swatch.is-error .ews-texture-img-fallback { display: grid; }
.ews-texture-swatch.is-error img { opacity: 0; }
.ews-texture-body { padding: 1.35rem; display: flex; flex-direction: column; flex: 1; }
.ews-texture-type {
  font: 700 11px/1.3 'Source Sans 3', sans-serif; text-transform: uppercase;
  letter-spacing: .09em; color: #2563eb; margin-bottom: .45rem;
}
.ews-texture-name {
  font-family: 'Playfair Display', Georgia, serif; font-size: 21px; font-weight: 800;
  color: #0f2040; margin: 0 0 .65rem;
}
.ews-texture-desc {
  font: 400 14.5px/1.6 'Source Sans 3', sans-serif; color: #667; margin: 0 0 1.2rem; flex: 1;
}
.ews-texture-cta {
  align-self: flex-start; font: 700 14px/1.3 'Source Sans 3', sans-serif; color: #2563eb;
  text-decoration: none; border-bottom: 1px solid rgba(37,99,235,.3); padding-bottom: 2px;
}
.ews-texture-cta:hover { border-bottom-color: #2563eb; }
.ews-textures-note {
  margin-top: 2rem; background: #f8f9fc; border: 1px solid #e5e8ef; border-radius: 12px;
  padding: 1.25rem 1.5rem; font: 400 13.5px/1.65 'Source Sans 3', sans-serif; color: #667;
}
.ews-textures-note strong { color: #0f2040; }
.ews-textures-sources { margin-top: .55rem; color: #7a8190; font-size: 12.5px; }
.ews-textures-sources a { color: #2563eb; }
.ews-texture-modal {
  position: fixed; inset: 0; z-index: 9999; background: rgba(5,12,24,.88);
  display: none; align-items: center; justify-content: center; padding: clamp(1rem,4vw,3rem);
}
.ews-texture-modal.is-open { display: flex; }
.ews-texture-modal-card {
  position: relative; width: min(900px,94vw); max-height: 92vh; background: #fff;
  border-radius: 16px; overflow: auto; box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.ews-texture-modal-img-wrap { position: relative; background: #eef1f5; min-height: 260px; }
.ews-texture-modal-img { display: block; width: 100%; max-height: 72vh; object-fit: cover; }
.ews-texture-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 42px; height: 42px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.5); background: rgba(10,22,40,.82);
  color: #fff; font-size: 25px; line-height: 1; cursor: pointer;
}
.ews-texture-modal-copy { padding: 1.2rem 1.4rem 1.4rem; }
.ews-texture-modal-copy h3 {
  font-family: 'Playfair Display', Georgia, serif; font-size: clamp(1.4rem,3vw,2rem);
  color: #0f2040; margin: 0 0 .4rem;
}
.ews-texture-modal-copy p { font: 400 15px/1.55 'Source Sans 3', sans-serif; color: #667; margin: 0; }
body.ews-modal-open { overflow: hidden; }
@media (max-width: 560px) {
  #textures { padding-left: 1rem; padding-right: 1rem; }
  .ews-textures-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .ews-texture-card { max-width: 430px; width: 100%; margin: 0 auto; }
  .ews-textures-note { padding: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ews-texture-swatch img { transition: none; }
}

/* Responsive hardening for tablet and mobile viewports */
.ews-texture-cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}
.ews-texture-name,
.ews-texture-desc,
.ews-textures-intro,
.ews-textures-note,
.ews-textures-sources {
  overflow-wrap: anywhere;
}
.ews-textures-sources a { word-break: normal; }
.ews-texture-modal-img { object-fit: contain; background: #eef1f5; }

@media (max-width: 900px) {
  #textures {
    padding-top: clamp(3.75rem, 8vw, 5rem);
    padding-bottom: clamp(3.75rem, 8vw, 5rem);
  }
  .ews-textures-head { margin-bottom: 2.25rem; }
  .ews-textures-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
  .ews-texture-body { padding: 1.15rem; }
}

@media (max-width: 680px) {
  #textures {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    scroll-margin-top: 76px;
  }
  .ews-textures-head { margin-bottom: 1.75rem; }
  .ews-textures-kicker { font-size: 12px; letter-spacing: .12em; }
  .ews-textures-title { font-size: clamp(1.85rem, 9vw, 2.35rem); margin-top: .4rem; }
  .ews-textures-intro { font-size: 16px; line-height: 1.6; }
  .ews-textures-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .ews-texture-card { max-width: 480px; width: 100%; margin-inline: auto; border-radius: 12px; }
  .ews-texture-body { padding: 1.05rem 1.05rem 1.1rem; }
  .ews-texture-name { font-size: 20px; }
  .ews-texture-desc { font-size: 14.5px; margin-bottom: .75rem; }
  .ews-textures-note { margin-top: 1.25rem; padding: 1rem; }
  .ews-textures-sources { line-height: 1.6; }

  .ews-texture-modal {
    padding: max(.6rem, env(safe-area-inset-top)) max(.6rem, env(safe-area-inset-right)) max(.6rem, env(safe-area-inset-bottom)) max(.6rem, env(safe-area-inset-left));
  }
  .ews-texture-modal-card {
    width: 100%;
    max-height: calc(100dvh - 1.2rem);
    border-radius: 14px;
    overscroll-behavior: contain;
  }
  .ews-texture-modal-img-wrap { min-height: 0; }
  .ews-texture-modal-img { width: 100%; max-height: 62dvh; object-fit: contain; }
  .ews-texture-modal-close {
    top: 10px; right: 10px; width: 46px; height: 46px; font-size: 28px;
  }
  .ews-texture-modal-copy { padding: 1rem 1.05rem calc(1.1rem + env(safe-area-inset-bottom)); }
  .ews-texture-modal-copy h3 { font-size: 1.55rem; }
  .ews-texture-modal-copy p { font-size: 14.5px; }
}

@media (max-width: 380px) {
  #textures { padding-left: .8rem; padding-right: .8rem; }
  .ews-textures-title { font-size: 1.8rem; }
  .ews-texture-body { padding: .95rem; }
  .ews-textures-note { padding: .9rem; }
}

@media (hover: none) {
  .ews-texture-swatch:hover img { transform: none; }
}

@media (max-width: 1100px) and (min-width: 901px) {
  .ews-textures-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .ews-texture-swatch { aspect-ratio: 4 / 3; }
}
.ews-texture-modal-close { min-width: 44px; min-height: 44px; }
