/* ---------- Design tokens ---------- */
:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #444;
  --muted: #777;
  --line: #e6e6e1;
  --accent: #111111;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --container: 1200px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: none; }
  .btn:hover { transform: none; }
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

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

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1.05rem;
}

.brand-icon {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 0;
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: heartbeat 1.2s ease-in-out infinite;
  -webkit-animation: heartbeat 1.2s ease-in-out infinite;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand img {
  height: 28px;
  width: 28px;
  display: block;
}

@keyframes heartbeat {
  0%   { transform: translateZ(0) scale(1); }
  25%  { transform: translateZ(0) scale(1.18); }
  40%  { transform: translateZ(0) scale(1); }
  60%  { transform: translateZ(0) scale(1.18); }
  100% { transform: translateZ(0) scale(1); }
}

@-webkit-keyframes heartbeat {
  0%   { -webkit-transform: translateZ(0) scale(1); }
  25%  { -webkit-transform: translateZ(0) scale(1.18); }
  40%  { -webkit-transform: translateZ(0) scale(1); }
  60%  { -webkit-transform: translateZ(0) scale(1.18); }
  100% { -webkit-transform: translateZ(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-icon,
  .story-mark {
    animation: none;
    -webkit-animation: none;
  }
}

.nav {
  display: flex;
  gap: var(--space-6);
}

.nav a {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
}

.cart-link {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-badge {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent-ink);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  margin-left: 6px;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-8) 0;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-7);
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
  margin: 0 0 var(--space-4);
  letter-spacing: -0.01em;
}

.hero p {
  color: var(--ink-2);
  max-width: 50ch;
  font-size: 1.05rem;
}

.hero-art {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: #efece6 center / cover no-repeat url("../images/classic-hoodie-pigment-black.png");
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.05s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.btn-outline {
  background: transparent;
  color: var(--ink);
}

.btn.btn-outline:hover {
  background: var(--ink);
  color: var(--accent-ink);
}

.btn.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-7) 0;
}

.section h2 {
  margin: 0 0 var(--space-5);
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-5);
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.product-thumb {
  aspect-ratio: 4 / 5;
  background: #eee;
  position: relative;
}

.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: #FFCC00;
  color: #111;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.badge-soon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.is-coming-soon .product-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.product-thumb .swatch-strip {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.product-thumb .swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.product-meta {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-meta .name {
  font-weight: 600;
}

.product-meta .price {
  color: var(--ink-2);
  font-size: 0.95rem;
}

/* ---------- Product detail ---------- */
.product-detail {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-7);
  padding: var(--space-7) 0;
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.gallery .main {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  background: #ddd;
  position: relative;
  overflow: hidden;
}

.gallery .thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.gallery .thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: #ddd;
  cursor: pointer;
  border: 2px solid transparent;
}

.gallery .thumb.active {
  border-color: var(--ink);
}

.detail h1 {
  margin: 0 0 var(--space-2);
  font-size: 2rem;
  letter-spacing: -0.01em;
}

.detail .price {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-5);
}

.field {
  margin-bottom: var(--space-5);
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.field-label .selected {
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.swatches {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--ink);
}

.sizes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.size-pill {
  min-width: 48px;
  padding: 10px 14px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}

.size-pill.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--accent-ink);
}

.size-pill[disabled] {
  color: var(--muted);
  text-decoration: line-through;
  cursor: not-allowed;
  background: #f3f3ef;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}

.qty button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
}

.qty input {
  width: 48px;
  text-align: center;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-5);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--accent-ink);
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* ---------- Cart ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-7);
  padding: var(--space-7) 0;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cart-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  align-items: center;
}

.cart-row .thumb {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  background: #ddd;
}

.cart-row .info .name {
  font-weight: 600;
}

.cart-row .info .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 2px;
}

.cart-row .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

.cart-row .line-price {
  font-weight: 600;
}

.cart-row .remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  height: fit-content;
  position: sticky;
  top: 88px;
}

.summary h3 {
  margin: 0 0 var(--space-4);
}

.summary .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  color: var(--ink-2);
}

.summary .row.total {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: var(--space-7);
  text-align: center;
  color: var(--muted);
}

/* ---------- Our Story ---------- */
.story {
  padding: var(--space-8) 0 var(--space-7);
}

.story-inner {
  max-width: 680px;
}

.story-mark {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-5);
}

.story-mark {
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  animation: heartbeat 1.4s ease-in-out infinite;
  -webkit-animation: heartbeat 1.4s ease-in-out infinite;
}

.story-mark img {
  width: 56px;
  height: 56px;
}

.story h1 {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
}

.story-lead {
  text-align: center;
  font-size: 1.15rem;
  color: var(--ink-2);
  margin: 0 auto var(--space-7);
  max-width: 38ch;
  line-height: 1.5;
}

.story-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--ink-2);
}

.story-body p {
  margin: 0 0 var(--space-4);
}

.story-body blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-3) var(--space-5);
  border-left: 4px solid #FFCC00;
  background: #fff8dc33;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink);
  line-height: 1.6;
}

.story-body .smile {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  color: var(--ink);
  margin-top: var(--space-7);
  margin-bottom: var(--space-4);
}

.story-body .smile-emoji {
  display: inline-block;
  letter-spacing: normal;
  margin-left: var(--space-2);
}

@media (max-width: 540px) {
  .story {
    padding: var(--space-6) 0 var(--space-5);
  }
  .story-body {
    font-size: 1rem;
    line-height: 1.75;
  }
  .story-body .smile {
    font-size: 1.2rem;
    letter-spacing: 0.25em;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--space-8);
  padding: var(--space-6) 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---------- Responsive ---------- */

/* Tablet */
@media (max-width: 900px) {
  .hero-inner,
  .product-detail,
  .cart-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .hero {
    padding: var(--space-6) 0;
  }

  .hero-art {
    max-width: 420px;
    margin: 0 auto;
  }

  .section {
    padding: var(--space-6) 0;
  }

  .summary {
    position: static;
  }

  .nav {
    gap: var(--space-4);
  }

  .nav .nav-link-hide {
    display: none;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-4);
  }
}

/* Phone */
@media (max-width: 540px) {
  .container {
    padding: 0 var(--space-4);
  }

  .site-header .bar {
    height: 56px;
  }

  .brand-icon,
  .brand img {
    width: 26px;
    height: 26px;
  }

  .brand {
    font-size: 0.95rem;
  }

  .nav {
    gap: var(--space-3);
    font-size: 0.95rem;
  }

  .hero {
    padding: var(--space-5) 0 var(--space-4);
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero-art {
    max-width: 320px;
    aspect-ratio: 1 / 1;
  }

  .section h2 {
    font-size: 1.35rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .product-meta {
    padding: var(--space-3);
  }

  .product-meta .price {
    font-size: 0.85rem;
  }

  .detail h1 {
    font-size: 1.6rem;
  }

  .gallery .thumbs {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
  }

  /* Larger tap targets on touch screens */
  .qty button {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .qty input {
    width: 44px;
    height: 44px;
  }

  .size-pill {
    min-width: 52px;
    min-height: 44px;
    padding: 10px 14px;
  }

  .swatch {
    width: 36px;
    height: 36px;
  }

  .btn {
    padding: 14px 20px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn {
    width: 100%;
  }

  /* Cart row stacks: image + info on top, controls below */
  .cart-row {
    grid-template-columns: 72px 1fr;
    gap: var(--space-3);
    padding: var(--space-3);
  }

  .cart-row .right {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .summary {
    padding: var(--space-4);
  }

  .site-footer .row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
}

/* Avoid iOS zoom on focus by keeping form fields >= 16px */
@media (max-width: 540px) {
  .qty input {
    font-size: 16px;
  }
}
