/* ============================================
   Addie Bakes — Design Tokens & Styles
   ============================================ */

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* --- Spacing --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* --- Transitions --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Content Widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* --- Fonts --- */
  --font-display: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Nunito', 'Helvetica Neue', sans-serif;
}

/* --- Color Palette: Addie Bakes --- */
:root, [data-theme="light"] {
  --color-bg: #FFF9FB;
  --color-surface: #FFFFFF;
  --color-surface-2: #FFF0F5;
  --color-surface-offset: #F8EDF2;

  --color-text: #3D2B33;
  --color-text-muted: #8A7580;
  --color-text-faint: #BEB0B7;

  --color-primary: #D4729A;
  --color-primary-hover: #C0588A;
  --color-primary-active: #A64575;

  --color-accent-purple: #B48ECC;
  --color-accent-blue: #8BB8D6;

  --color-border: rgba(61, 43, 51, 0.1);
  --color-divider: rgba(61, 43, 51, 0.06);

  --shadow-sm: 0 1px 3px rgba(61, 43, 51, 0.06);
  --shadow-md: 0 4px 12px rgba(61, 43, 51, 0.08);
  --shadow-lg: 0 12px 32px rgba(61, 43, 51, 0.12);
}

[data-theme="dark"] {
  --color-bg: #1E1720;
  --color-surface: #2A2030;
  --color-surface-2: #352940;
  --color-surface-offset: #241C2A;

  --color-text: #E8DDE3;
  --color-text-muted: #A898A2;
  --color-text-faint: #6E5F68;

  --color-primary: #E090B4;
  --color-primary-hover: #ECA8C6;
  --color-primary-active: #D07AA4;

  --color-accent-purple: #C8A8DC;
  --color-accent-blue: #A0CCE4;

  --color-border: rgba(232, 221, 227, 0.1);
  --color-divider: rgba(232, 221, 227, 0.06);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #1E1720;
    --color-surface: #2A2030;
    --color-surface-2: #352940;
    --color-surface-offset: #241C2A;
    --color-text: #E8DDE3;
    --color-text-muted: #A898A2;
    --color-text-faint: #6E5F68;
    --color-primary: #E090B4;
    --color-primary-hover: #ECA8C6;
    --color-primary-active: #D07AA4;
    --color-accent-purple: #C8A8DC;
    --color-accent-blue: #A0CCE4;
    --color-border: rgba(232, 221, 227, 0.1);
    --color-divider: rgba(232, 221, 227, 0.06);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

.container--narrow {
  max-width: var(--content-narrow);
}

.container--default {
  max-width: var(--content-default);
}

/* ============================================
   Header
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s var(--ease-out);
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .header__inner { padding-inline: var(--space-8); }
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
}

.header__logo svg {
  width: 36px;
  height: 36px;
}

.header__logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-primary);
}

.header__nav {
  display: none;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 768px) {
  .header__nav { display: flex; }
}

.header__nav a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.header__nav a:hover {
  color: var(--color-primary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: color var(--transition-interactive),
              background var(--transition-interactive);
}

.theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-surface-2);
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text);
  border-radius: var(--radius-md);
}

@media (min-width: 768px) {
  .mobile-menu-btn { display: none; }
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 60px;
  z-index: 40;
  background: var(--color-bg);
  padding: var(--space-6) var(--space-4);
  flex-direction: column;
  gap: var(--space-4);
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  transition: color var(--transition-interactive);
}

.mobile-menu a:hover {
  color: var(--color-primary);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    oklch(from var(--color-bg) l c h / 0.95) 0%,
    oklch(from var(--color-bg) l c h / 0.7) 50%,
    oklch(from var(--color-bg) l c h / 0.3) 100%
  );
}

@media (max-width: 767px) {
  .hero__overlay {
    background: linear-gradient(
      to bottom,
      oklch(from var(--color-bg) l c h / 0.85) 0%,
      oklch(from var(--color-bg) l c h / 0.6) 100%
    );
  }
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 580px;
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.hero__badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  line-height: 1.1;
}

.hero h1 span {
  color: var(--color-primary);
}

.hero__desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 460px;
  line-height: 1.7;
}

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

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-interactive),
              color var(--transition-interactive),
              box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
  min-height: 48px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

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

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   Products Section
   ============================================ */

.products {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

.section-header {
  text-align: center;
  margin-bottom: clamp(var(--space-8), 5vw, var(--space-16));
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.section-desc {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 520px;
  margin-inline: auto;
}

.products__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .products__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

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

.product-card__img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.product-card:hover .product-card__img img {
  transform: scale(1.04);
}

.product-card__body {
  padding: var(--space-6);
}

.product-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.product-card__price {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
}

.product-card__price span {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-faint);
}

/* ============================================
   About Section
   ============================================ */

.about {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
  background: var(--color-surface-2);
}

.about__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (min-width: 768px) {
  .about__inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.about__content {
  order: 2;
}

@media (min-width: 768px) {
  .about__content { order: 1; }
}

.about__image-wrap {
  order: 1;
  border-radius: var(--radius-2xl);
  overflow: hidden;
}

@media (min-width: 768px) {
  .about__image-wrap { order: 2; }
}

.about__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-2xl);
}

.about__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

.about__text {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-4);
}

.about__highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.highlight {
  text-align: center;
  padding: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
}

.highlight__icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

.highlight__label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Flavors Section
   ============================================ */

.flavors {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}

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

@media (min-width: 768px) {
  .flavors__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.flavor-card {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

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

.flavor-card__swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-3);
}

.flavor-card__swatch--chocolate {
  background: linear-gradient(135deg, #6B3A2A, #8B5E3C);
}

.flavor-card__swatch--vanilla {
  background: linear-gradient(135deg, #F5E6C8, #E8D5A8);
  border: 1px solid var(--color-border);
}

.flavor-card__swatch--strawberry {
  background: linear-gradient(135deg, #E88BA0, #F4A0B2);
}

.flavor-card__swatch--redvelvet {
  background: linear-gradient(135deg, #A82C3E, #C94455);
}

.flavor-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.flavor-card__note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================
   Perfect For Section
   ============================================ */

.perfect-for {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
  background: var(--color-surface-2);
}

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

@media (min-width: 768px) {
  .perfect-for__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
  }
}

.occasion-card {
  text-align: center;
  padding: var(--space-6) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}

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

.occasion-card__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-full);
  background: oklch(from var(--color-primary) l c h / 0.1);
  color: var(--color-primary);
}

.occasion-card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.occasion-card__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================
   Order Form Section
   ============================================ */

.order {
  padding-block: clamp(var(--space-12), 8vw, var(--space-24));
  background: var(--color-surface-2);
}

.order__form-wrap {
  max-width: 600px;
  margin-inline: auto;
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

@media (max-width: 600px) {
  .order__form-wrap {
    padding: var(--space-5);
  }
}

.order__delivery-note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: oklch(from var(--color-accent-blue) l c h / 0.1);
  border-radius: var(--radius-lg);
  line-height: 1.6;
}

.order__delivery-note strong {
  color: var(--color-text);
}

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

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  transition: border-color var(--transition-interactive),
              box-shadow var(--transition-interactive);
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238A7580' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4H4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-10);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}

.form-group input::placeholder {
  color: var(--color-text-faint);
}

.order__submit {
  width: 100%;
  margin-top: var(--space-4);
}

.order__payment-note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: oklch(from var(--color-accent-purple) l c h / 0.1);
  border-radius: var(--radius-lg);
  line-height: 1.6;
}

.order__payment-note strong {
  color: var(--color-text);
}

.order__seasonal-note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-top: var(--space-6);
  font-style: italic;
}

.form-success {
  text-align: center;
  padding: var(--space-8);
}

.form-success__icon {
  width: 64px;
  height: 64px;
  background: oklch(from var(--color-primary) l c h / 0.12);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--color-primary);
}

.form-success__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-success__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__brand svg {
  width: 28px;
  height: 28px;
}

.footer__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
}

.footer__text {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.footer__text a {
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__text a:hover {
  color: var(--color-primary);
}

/* ============================================
   Scroll Reveals
   ============================================ */

.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* JS fallback reveal for browsers without scroll-timeline */
.js-reveal {
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

.js-reveal.visible {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .js-reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
    transition: none;
  }
  .js-reveal.visible {
    /* let CSS handle it */
  }
}
