/*
Theme Name: Cheap Bricks
Theme URI: https://cheapbricks.io
Author: Cheap Bricks
Description: FUEGO-style bold storefront for a cross-border brick shop.
Version: 1.0.0
Text Domain: cheapbricks
*/

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cream: #FFF0E0;
  --brand: #F9423A;
  --brand-dark: #D9322A;
  --dark: #1A1A1A;
  --text: #333333;
  --peach: #FDDCB5;
  --mint: #C8EAD3;
  --lavender: #D9CCE8;
  --butter: #F5E6A3;
  --display: "Passion One", cursive;
  --body: "Figtree", sans-serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-snap: cubic-bezier(0.85, 0, 0.15, 1);
  --space-s: clamp(1.00rem, 0.91rem + 0.43vw, 1.25rem);
  --space-m: clamp(1.50rem, 1.37rem + 0.65vw, 1.88rem);
  --space-l: clamp(2.00rem, 1.83rem + 0.87vw, 2.50rem);
  --space-xl: clamp(3.00rem, 2.74rem + 1.30vw, 3.75rem);
  --space-2xl: clamp(4.00rem, 3.65rem + 1.74vw, 5.00rem);
  --space-3xl: clamp(6.00rem, 5.48rem + 2.61vw, 7.50rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--brand); color: #fff; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10000;
  background: var(--dark);
  color: var(--cream);
  padding: 0.75rem 1.25rem;
  font-family: var(--display);
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

#shop,
#story,
#ship,
#subscribe {
  scroll-margin-top: 5.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── NAV ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2.5rem;
  background: var(--cream);
  border-bottom: 2px solid var(--dark);
}
.nav-logo {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
}
.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark);
  text-decoration: none;
  letter-spacing: 0.02em;
  position: relative;
}
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
@media (hover: hover) {
  .nav-links a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}
.nav-links a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.nav-cart {
  position: relative;
  border: 2px solid var(--dark);
  padding: 0.5rem 1.2rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--dark);
  color: var(--cream);
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--brand);
  transition: transform 0.15s var(--ease-snap), box-shadow 0.15s var(--ease-snap);
}
.nav-cart:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
@media (hover: hover) {
  .nav-cart:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--brand); }
}
.nav-cart:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--brand); }
.nav-cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--dark);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--dark);
  background: var(--cream);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--brand);
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--dark);
}
.nav-toggle:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ── HERO ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 8rem 2rem 4rem;
  overflow: hidden;
}
.hero-stacked-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.8;
  position: relative;
  z-index: 2;
}
.hero-stacked-name span {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(4.2rem, 16vw, 15rem);
  letter-spacing: -0.045em;
  line-height: 0.8;
  text-transform: uppercase;
  display: block;
  color: var(--dark);
}
.hero-stacked-name span:nth-child(1) {
  -webkit-text-stroke: 3px var(--dark);
  color: transparent;
}
.hero-stacked-name span:nth-child(2) { color: var(--brand); }
.hero-stacked-name span:nth-child(3) {
  -webkit-text-stroke: 3px var(--brand);
  color: transparent;
  opacity: 0.4;
}
.hero-tagline {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 2.2rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2rem;
  color: var(--text);
  z-index: 2;
  text-align: center;
}
.hero-cta-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 3rem;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-3d {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1rem 2.8rem;
  border: 2px solid var(--dark);
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-3d:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.btn-3d--brand {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 0 var(--dark);
}
.btn-3d--outline {
  background: transparent;
  color: var(--dark);
  box-shadow: 0 6px 0 var(--dark);
}
@media (hover: hover) {
  .btn-3d--brand:hover,
  .btn-3d--outline:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--dark); }
}
.btn-3d--brand:active,
.btn-3d--outline:active { transform: translateY(6px); box-shadow: 0 0 0 var(--dark); }

.starburst {
  position: absolute;
  width: 160px;
  height: 160px;
  z-index: 3;
  animation: spin 12s linear infinite;
}
.starburst--hero { top: 15%; right: 8%; }
.starburst svg { width: 100%; height: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }
.starburst-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
  text-align: center;
  color: var(--cream);
  pointer-events: none;
}

.hero-bricks {
  position: absolute;
  bottom: 2rem;
  left: 6%;
  z-index: 5;
  animation: float 4s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.brick {
  width: 108px;
  height: 36px;
  border: 3px solid var(--dark);
  position: relative;
  margin-top: -3px;
}
.brick::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 10px;
  width: 18px;
  height: 10px;
  background: inherit;
  border: 3px solid var(--dark);
  border-bottom: none;
  box-shadow: 22px 0 0 0 currentColor, 44px 0 0 0 currentColor, 66px 0 0 0 currentColor;
  color: inherit;
}
.brick--red { background: var(--brand); color: var(--brand); }
.brick--cream { background: var(--cream); color: var(--cream); width: 86px; }
.brick--cream::before { box-shadow: 22px 0 0 0 currentColor, 44px 0 0 0 currentColor; }
.brick--dark { background: var(--dark); color: var(--dark); width: 64px; }
.brick--dark::before { box-shadow: 22px 0 0 0 currentColor; left: 8px; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-20px) rotate(2deg); }
}

.divider-torn {
  width: 100%;
  display: block;
  margin: -2px 0;
  position: relative;
  z-index: 10;
  line-height: 0;
}
.divider-torn svg { width: 100%; height: auto; display: block; }

.marquee-section {
  background: var(--dark);
  overflow: hidden;
  padding: 1rem 0;
  position: relative;
  z-index: 10;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 22s linear infinite;
}
.marquee-item {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cream);
  white-space: nowrap;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  letter-spacing: 0.04em;
}
.marquee-dot {
  width: 10px;
  height: 10px;
  background: var(--brand);
  display: inline-block;
  flex-shrink: 0;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-section--brand { background: var(--brand); }
.marquee-section--brand .marquee-item { color: var(--dark); font-weight: 900; }
.marquee-section--brand .marquee-dot { background: var(--dark); }

.products-section {
  background: var(--cream);
  padding: var(--space-3xl) 2rem;
  position: relative;
}
.section-label {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--brand);
  margin-bottom: 0.5rem;
}
.section-heading {
  font-family: var(--display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--dark);
  margin-bottom: 3rem;
  text-wrap: balance;
}

.products-carousel {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 2rem 0 3rem;
  scrollbar-width: none;
}
.products-carousel::-webkit-scrollbar { display: none; }

.product-card {
  flex: 0 0 320px;
  scroll-snap-align: start;
  border: 2px solid var(--dark);
  border-radius: 0;
  padding: 2rem;
  position: relative;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  cursor: pointer;
  perspective: 600px;
  text-decoration: none;
  color: inherit;
  display: block;
}
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-8px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 8px 12px 0 var(--dark);
  }
}
.product-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; }
.product-card--crane { background: var(--peach); }
.product-card--market { background: var(--butter); }
.product-card--orbit { background: var(--lavender); }
.product-card--bulk { background: var(--mint); }

.product-card-badge {
  position: absolute;
  top: -12px;
  right: -12px;
  background: var(--brand);
  color: #fff;
  font-family: var(--display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  border: 2px solid var(--dark);
  letter-spacing: 0.04em;
}
.product-illustration {
  width: 100%;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.product-studs {
  display: grid;
  grid-template-columns: repeat(4, 22px);
  gap: 8px;
}
.product-studs span {
  width: 22px;
  height: 22px;
  border: 3px solid var(--dark);
  background: rgba(26, 26, 26, 0.08);
  border-radius: 50%;
}
.product-meta {
  display: flex;
  gap: 6px;
  margin: 0.8rem 0;
}
.stud-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--dark);
}
.stud-dot--filled { background: var(--brand); }
.stud-dot--empty { background: transparent; }
.product-name {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--dark);
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.product-desc {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-price {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--dark);
}
.product-add-btn {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.6rem 1.4rem;
  background: var(--dark);
  color: var(--cream);
  border: 2px solid var(--dark);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--brand);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.03em;
}
.product-add-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.product-add-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--brand);
}

.story-section {
  background: var(--dark);
  color: var(--cream);
  padding: var(--space-3xl) 2rem;
  position: relative;
  overflow: hidden;
}
.story-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.story-left .section-label { color: var(--brand); }
.story-left .section-heading { color: var(--cream); }
.story-text {
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 2rem;
  max-width: 42rem;
}
.story-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.stat-number {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 900;
  color: var(--brand);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-top: 0.3rem;
}
.story-image-block {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--brand);
  border: 2px solid var(--cream);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.story-image-block::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
}
.story-image-text {
  font-family: var(--display);
  font-size: 6rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  writing-mode: vertical-rl;
  letter-spacing: 0.1em;
}

.cta-section {
  background: var(--cream);
  padding: var(--space-3xl) 2rem;
  text-align: center;
  position: relative;
}
.cta-subtitle {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto 3rem;
  line-height: 1.6;
  color: var(--text);
}
.newsletter-row {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
  border: 2px solid var(--dark);
}
.newsletter-input {
  flex: 1;
  font-family: var(--body);
  font-size: 1rem;
  padding: 1rem 1.2rem;
  border: none;
  background: #fff;
  outline: none;
  min-width: 0;
}
.newsletter-input:focus { box-shadow: inset 0 0 0 3px var(--brand); }
.newsletter-btn {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--brand);
  color: #fff;
  border: none;
  border-left: 2px solid var(--dark);
  padding: 1rem 2rem;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.newsletter-btn:focus-visible { outline: 3px solid var(--dark); outline-offset: -3px; }
@media (hover: hover) {
  .newsletter-btn:hover { background: var(--brand-dark); }
}
.newsletter-note {
  margin-top: 1rem;
  min-height: 1.4em;
  font-size: 0.95rem;
}

.social-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.social-link {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark);
  text-decoration: none;
  padding: 0.8rem 1.8rem;
  border: 2px solid var(--dark);
  letter-spacing: 0.04em;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
@media (hover: hover) {
  .social-link:hover { background: var(--dark); color: var(--cream); }
}
.social-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.footer {
  background: var(--brand);
  border-top: 2px solid var(--dark);
  padding: 4rem 2rem 2rem;
  color: var(--dark);
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
}
.footer-brand {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.9;
  margin-bottom: 1rem;
}
.footer-tagline { font-size: 0.95rem; line-height: 1.6; opacity: 0.85; }
.footer-col-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a {
  color: var(--dark);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}
@media (hover: hover) {
  .footer-col a:hover { opacity: 1; text-decoration: underline; }
}
.footer-col a:focus-visible { outline: 3px solid var(--dark); outline-offset: 2px; }
.footer-bottom {
  border-top: 2px solid rgba(0, 0, 0, 0.2);
  padding-top: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  opacity: 0.75;
  flex-wrap: wrap;
  gap: 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .starburst,
  .hero-bricks { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .story-grid { grid-template-columns: 1fr; gap: 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 2px solid var(--dark);
    padding: 1.25rem 2rem 1.5rem;
    gap: 1rem;
  }
  .nav-toggle { display: block; }
  .starburst--hero { width: 110px; height: 110px; top: 12%; right: 4%; }
  .hero-bricks { display: none; }
}
@media (max-width: 600px) {
  .nav { padding: 0.85rem 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .product-card { flex: 0 0 280px; }
  .story-stats { gap: 1rem; }
  .stat-number { font-size: 2.2rem; }
  .newsletter-row { flex-direction: column; }
  .newsletter-btn { border-left: none; border-top: 2px solid var(--dark); }
  .hero-stacked-name span:nth-child(1),
  .hero-stacked-name span:nth-child(3) { -webkit-text-stroke-width: 1.5px; }
}
