* { box-sizing: border-box; }

:root {
  --ink: #171717;
  --paper: #faf9f7;
  --focus: #125bd4;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper) url('assets/Tew American/SVGs/Background_SpecksandMarks.svg') center top / 980px auto;
  font-family: Arial, sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }

.top { position: relative; width: 100%; height: 82px; }
.nav-art { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.nav {
  position: relative;
  display: grid;
  grid-template-columns: 49px minmax(0, 1fr) 155px 45px;
  align-items: center;
  gap: 26px;
  height: 100%;
  padding: 8px 4%;
}
.nav img { display: block; max-width: 100%; max-height: 60px; }
.nav .star { width: 49px; }
.nav .lore img { width: 155px; }
.nav .cart img { width: 45px; }
.brand-back { display: inline-flex; align-items: center; }
.brand-back > svg, .nav .lore img, .nav .cart img,
.gallery-arrow, .qty button, .add, .robbie-choice, .news button {
  transition: transform 120ms ease, filter 120ms ease;
}
.brand-back:hover, .brand-back:focus-visible { transform: none; }
.brand-back > svg { transform-origin: center center; }
.brand-back:hover > svg, .brand-back:focus-visible > svg { transform: rotate(-2deg) translateY(-2px) scale(1.03); }
.nav .star { transition: transform 160ms ease; }
.nav .star:hover { transform: translateX(-3px) rotate(-2deg); }
.nav .lore:hover img, .nav .lore:focus-visible img { transform: rotate(-2deg) translateY(-2px) scale(1.03); }
.nav .cart img { transform: rotate(6deg); }
.nav .cart:hover img, .nav .cart:focus-visible img { transform: rotate(13deg) translateY(-2px) scale(1.08); }

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 220px;
  padding: 16px;
}
.brand a { animation: ft-logo-float 5s linear infinite; }
.brand img { display: block; width: min(360px, 80vw); height: 190px; object-fit: contain; }
@keyframes ft-logo-float { 0% { translate: 0 0; } 10% { translate: 0 -2.35px; } 20% { translate: 0 -3.8px; } 25% { translate: 0 -4px; } 30% { translate: 0 -3.8px; } 40% { translate: 0 -2.35px; } 50% { translate: 0 0; } 60% { translate: 0 2.35px; } 70% { translate: 0 3.8px; } 75% { translate: 0 4px; } 80% { translate: 0 3.8px; } 90% { translate: 0 2.35px; } 100% { translate: 0 0; } }

.wrap { width: min(1200px, 100%); margin: 0 auto; padding: 12px 32px 64px; }
.back {
  display: inline-block;
  margin-bottom: 24px;
  padding: 8px 12px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  text-underline-offset: 4px;
}

.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr);
  gap: 56px;
  align-items: start;
}
.gallery { min-width: 0; }
.image-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  isolation: isolate;
  background: #f1f0ee;
}
.image-stage > img {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 50%;
  transform: translateY(-5%);
}
.image-stage::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: url('assets/Tew American/SVGs/Background_SpecksandMarks.svg') center / 390px auto repeat;
  -webkit-mask-image: radial-gradient(ellipse 58% 58% at center, transparent 0%, transparent 56%, #000 78%);
  mask-image: radial-gradient(ellipse 58% 58% at center, transparent 0%, transparent 56%, #000 78%);
  pointer-events: none;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
}
.gallery-arrow:hover, .gallery-arrow:focus-visible { background: #fff; transform: translateY(-2px) rotate(-1deg); }
.gallery-arrow.prev { left: 12px; }
.gallery-arrow.next { right: 12px; }
.photo-count { margin: 10px 0 0; font-size: 13px; text-align: right; }

.thumbs {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 86px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.thumbs button {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  padding: 3px;
  border: 2px solid transparent;
  background: var(--paper);
  cursor: pointer;
}
.thumbs button[aria-pressed="true"] { border-color: var(--ink); }
.thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }

.summary { padding: 12px 0; background: rgb(250 249 247 / 94%); }
.series { margin: 4px 0 12px; font-size: 14px; font-weight: 800; text-transform: uppercase; }
.summary h1 {
  margin: 0 0 14px;
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(44px, 5vw, 62px);
  font-weight: 900;
  line-height: 1.03;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.selection { display: inline-block; border-bottom: 2px solid var(--ink); padding: 6px 0; font-size: 14px; font-weight: 800; }
.intro { margin: 24px 0; font-size: 18px; line-height: 1.65; }
.price { margin: 24px 0 16px; font-size: 17px; font-weight: bold; }
.buy { display: flex; align-items: stretch; gap: 14px; }
.qty { display: flex; min-height: 54px; border: 2px solid var(--ink); align-items: center; }
.qty button { width: 32px; border: 0; background: var(--paper); cursor: pointer; font-size: 24px; }
.qty input { width: 36px; border: 0; background: var(--paper); text-align: center; appearance: textfield; }
.qty input::-webkit-inner-spin-button { appearance: none; }
.add { flex: 1; min-height: 54px; max-width: 280px; padding: 0 10px; border: 0; background: transparent; cursor: pointer; }
.add img { display: block; width: 100%; height: 64px; object-fit: contain; }
.add .added-label { display: none; min-height: 54px; padding: 0 22px; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font-family: Impact, 'Arial Black', sans-serif; font-size: 19px; letter-spacing: .7px; text-transform: uppercase; }
.add:hover, .add:focus-visible { transform: translateY(-2px) rotate(-1deg); }
.add:disabled { cursor: not-allowed; opacity: .48; }
.add:disabled:hover { transform: none; }
.add.is-added img { display: none; }
.add.is-added .added-label { display: flex; }
.add.is-added:disabled { opacity: 1; cursor: default; }
.cart-note { min-height: 20px; margin: 12px 0 0; font-size: 13px; font-weight: bold; }
.character-lore-link { display: inline-block; margin: -7px 0 12px; color: #b52e2c; font-size: 13px; font-weight: 800; text-transform: uppercase; text-underline-offset: 4px; }
.character-lore-link[hidden] { display: none; }
.character-lore-link:hover, .character-lore-link:focus-visible { transform: translateY(-2px) rotate(-1deg); }
.shipping { margin: 16px 0 28px; font-size: 14px; line-height: 1.6; }
.details { border-top: 2px solid var(--ink); padding-top: 20px; line-height: 1.65; }
.details h2 { margin: 0 0 8px; font-size: 17px; text-transform: uppercase; }
.details p { margin: 0; }

.browser {
  margin: 0 0 42px;
  padding: 0 0 20px;
  border-bottom: 3px solid var(--ink);
}
.browser-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.browser h2 { margin: 0; font-family: Impact, "Arial Black", sans-serif; font-size: 34px; text-transform: uppercase; }
.browser-count { margin: 0; font-size: 14px; font-weight: bold; white-space: nowrap; }
.robbie-list {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  grid-template-rows: repeat(2, auto);
  gap: clamp(1px, .6vw, 8px);
  margin-top: 22px;
  overflow: hidden;
  padding: 2px;
}
.robbie-choice {
  position: relative;
  display: block;
  min-width: 0;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  background: rgb(250 249 247 / 94%);
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.robbie-choice:hover, .robbie-choice:focus-visible { border-color: var(--ink); transform: translateY(-2px) rotate(-1deg); }
.robbie-choice[aria-pressed="true"] { border-color: var(--ink); }
.robbie-choice.is-sold-out { border-color: #c52c24; }
.robbie-choice.is-sold-out::before,
.robbie-choice.is-sold-out::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: -12%;
  width: 124%;
  height: 7px;
  border-radius: 999px;
  background: #d72d24;
  box-shadow: 0 0 0 1px rgb(250 249 247 / 70%);
  pointer-events: none;
}
.robbie-choice.is-sold-out::before { transform: rotate(45deg); }
.robbie-choice.is-sold-out::after { transform: rotate(-45deg); }
.robbie-choice.is-sold-out img { opacity: .58; }
.robbie-choice img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f1f0ee; }

.brand-footer { position: relative; height: 132px; --left: 219.9px; --right: 99.05px; --mid: 76.8px; }
.footer-left, .footer-right { position: absolute; bottom: 0; display: block; pointer-events: none; }
.footer-left { z-index: 2; left: 0; width: var(--left); height: 99.09px; }
.footer-right { z-index: 2; right: 0; width: var(--right); height: 90.1px; }
.footer-mobile { display: none; }
.footer-mid { position: absolute; bottom: 0; left: calc(var(--left) - 2px); display: block; width: calc(100% - var(--left) - var(--right) + 4px); height: var(--mid); pointer-events: none; }
.footer-mid-mobile { display: none; }
.news { position: absolute; z-index: 3; right: calc(var(--right) + 32px); bottom: 10px; left: calc(var(--left) + 32px); max-width: 740px; }
.news-copy { display: block; width: 412px; max-width: 100%; height: 23px; object-fit: contain; object-position: left; transform: translateY(7px); }
.news-fields { display: flex; align-items: center; gap: 14px; }
.news input { flex: 1; min-width: 0; height: 32px; padding: 3px 10px; border: 2px solid var(--ink); background: var(--paper); font-size: 14px; }
.news button { flex-shrink: 0; width: 128px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.news button img { display: block; width: 100%; }
.news button:hover, .news button:focus-visible { transform: rotate(-2deg) translateY(-2px); }
.bolt { width: 70px; height: 44px; object-fit: contain; }
.legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; padding: 20px; background: var(--ink); color: var(--paper); font-size: 14px; }

dialog { width: min(440px, calc(100% - 40px)); border: 3px solid var(--ink); background: var(--paper); padding: 26px; line-height: 1.6; }
dialog::backdrop { background: #0008; }
dialog button { padding: 10px 22px; border: 2px solid var(--ink); background: var(--paper); cursor: pointer; }

@media (max-width: 760px) {
  .top { height: 62px; }
  .nav { grid-template-columns: 28px minmax(0, 1fr) 75px 30px; gap: 12px; padding: 8px 18px; }
  .nav .star { width: 28px; }
  .brand { height: 180px; }
  .brand img { width: min(300px, 82vw); height: 155px; }
  .wrap { padding: 10px 20px 44px; }
  .product { grid-template-columns: 1fr; gap: 26px; }
  .thumbs { display:grid; grid-template-columns:repeat(auto-fit,minmax(32px,1fr)); gap:5px; min-height:0; overflow:hidden; padding-bottom:0; }
  .thumbs button { width:100%; height:auto; min-width:0; aspect-ratio:1; flex:none; }
  .summary { padding: 0; }
  .buy { gap: 8px; }
  .add { max-width: 230px; }
  .gallery-arrow { width: 38px; height: 38px; }
  .browser { margin-bottom: 30px; padding-bottom: 16px; }
  .browser-head { align-items: start; flex-direction: column; gap: 5px; }
  .browser h2 { font-size: 28px; }
  .robbie-list { gap: 2px; }
  .robbie-choice { width: auto; min-height: 0; }
  .brand-footer { --left: 67.7px; --right: 24.7px; --mid: 71.15px; height: 120px; }
  .footer-desktop, .footer-mid-desktop { display: none; }
  .footer-mobile, .footer-mid-mobile { display: block; }
  .footer-left { height: 74px; }
  .footer-right { height: 83.85px; }
  .news { right: 32px; bottom: 10px; left: 80px; }
  .news-copy { height: 18px; transform: none; }
  .news-fields { gap: 6px; }
  .news button { width: 90px; }
  .news input { height: 30px; padding: 3px 5px; font-size: 14px; }
  .bolt { display: none; }
}

@media (prefers-reduced-motion: reduce) { .add:hover { transform: none; } }
