*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--oat);
  color: var(--cocoa);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background-color: var(--oat);
  color: var(--cocoa);
  overflow-x: hidden;
}

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

h1, h2, h3, .price, .wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.06;
  margin: 0;
}

p {
  margin: 0;
}

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 3px;
}

.surface-cocoa :focus-visible {
  outline: var(--focus-ring-light);
  outline-offset: 3px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--cocoa);
  color: var(--oat);
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  left: 16px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

.section-oat {
  background-color: var(--oat);
  color: var(--cocoa);
}

.section-oat-deep {
  background-color: var(--oat-deep);
  color: var(--cocoa);
}

.surface-cocoa {
  background-color: var(--cocoa);
  color: var(--oat);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(251, 247, 240, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--cocoa-10);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cocoa);
  min-height: 44px;
}

.brand-lockup .wordmark {
  font-size: 26px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--cocoa);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-primary {
  background-color: var(--cocoa);
  color: var(--oat);
}

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

.btn-secondary {
  background-color: transparent;
  color: var(--cocoa);
  border-color: var(--cocoa-16);
}

.btn-secondary:hover {
  border-color: var(--cocoa);
}

.btn-oat {
  background-color: var(--oat);
  color: var(--cocoa);
}

/* Hero */
.hero {
  text-align: center;
  padding: 64px 0 80px;
}

.hero-mark-wrap {
  width: 96px;
  margin: 0 auto 28px;
}

.hero h1 {
  font-size: clamp(46px, 8vw, 88px);
  margin-bottom: 16px;
}

.hero-sub {
  max-width: 540px;
  margin: 0 auto 28px;
  font-size: 18px;
  color: var(--cocoa-70);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Canonical Kelly Law targets */
.hugs-mark .mark-arm {
  stroke: var(--kelly);
}

.box-band {
  background-color: var(--kelly);
  color: var(--oat);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* Reduced-motion gated Hero assembly */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark-wrap .capsule-left {
    animation: slideLeft 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero-mark-wrap .capsule-right {
    animation: slideRight 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .hero-mark-wrap .mark-arm {
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    animation: drawArm 0.7s 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
}

@keyframes slideLeft {
  from { transform: translateX(-14px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
  from { transform: translateX(14px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes drawArm {
  to { stroke-dashoffset: 0; }
}

/* Pair Cards */
.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 40px;
}

.section-head h2 {
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 12px;
}

.section-head p {
  font-size: 17px;
  opacity: 0.82;
}

.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--oat-deep);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--cocoa-10);
}

.section-oat-deep .card {
  background-color: var(--oat);
}

.card .price {
  font-size: 36px;
  margin: 8px 0 12px;
}

/* Configurator & Give Card Studio */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.preview-panel {
  background-color: var(--oat);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--cocoa-10);
  text-align: center;
}

.hoodie-stage {
  border-radius: var(--radius-md);
  padding: 40px 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: var(--oat-deep);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hoodie-stage[data-color="cocoa"] { background-color: var(--cocoa); color: var(--oat); }
.hoodie-stage[data-color="oat"] { background-color: var(--oat-deep); color: var(--cocoa); }
.hoodie-stage[data-color="matcha"] { background-color: var(--matcha); color: var(--cocoa); }
.hoodie-stage[data-color="pine"] { background-color: var(--pine); color: var(--oat); }
.hoodie-stage[data-color="honey"] { background-color: var(--honey); color: var(--cocoa); }

.control-group {
  margin-bottom: 22px;
}

.control-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--cocoa-16);
  background: var(--oat);
  color: var(--cocoa);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.pill-btn[aria-pressed="true"] {
  background: var(--cocoa);
  color: var(--oat);
  border-color: var(--cocoa);
}

.swatch-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--cocoa-16);
  cursor: pointer;
  position: relative;
}

.swatch-btn[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--oat), 0 0 0 5px var(--cocoa);
}

.swatch-cocoa { background-color: var(--cocoa); }
.swatch-oat { background-color: var(--oat); }
.swatch-matcha { background-color: var(--matcha); }
.swatch-pine { background-color: var(--pine); }
.swatch-honey { background-color: var(--honey); }

/* Give Card Studio */
.give-card-box {
  background-color: var(--oat);
  border: 1px solid var(--cocoa-16);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 22px;
}

.field-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--cocoa-16);
  background-color: var(--oat);
  color: var(--cocoa);
  font-family: var(--font-body);
  font-size: 15px;
  margin-top: 6px;
}

.field-input.is-invalid {
  border-color: var(--honey);
}

.field-hint {
  font-size: 13px;
  color: var(--cocoa-70);
  margin-top: 6px;
}

.give-card-preview {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--oat-deep);
  font-size: 14px;
}

/* Spec Grid */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Email Form */
.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 480px;
  margin: 24px auto 0;
}

.email-form .field-input {
  flex: 1 1 240px;
  margin-top: 0;
}

.form-status {
  margin-top: 12px;
  font-size: 14px;
  min-height: 22px;
}

/* Bag Drawer */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(43, 35, 32, 0.45);
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer-panel {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background-color: var(--oat);
  color: var(--cocoa);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cocoa-10);
}

.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--cocoa-10);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--cocoa);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 820px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}
