/* ============================================
   050 ROSIN USA — Design Tokens & Styles
   Art Direction: Warm, artisanal, classical music
   Palette: Amber/rosin tones, deep warm neutrals
   ============================================ */

: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);

  --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;

  --font-display: 'Instrument Serif', 'Georgia', serif;
  --font-body: 'Satoshi', 'Helvetica Neue', sans-serif;

  --radius-sm: 0.375rem; --radius-md: 0.5rem;
  --radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --content-narrow: 640px; --content-default: 960px; --content-wide: 1200px;
}

/* LIGHT MODE */
:root,
[data-theme='light'] {
  --color-bg: #fefdfb;
  --color-surface: #f8f6f1;
  --color-surface-2: #f0ece4;
  --color-surface-offset: #f4f1eb;
  --color-divider: #e4ddd2;
  --color-border: #d4cbbe;
  --color-text: #1e1b16;
  --color-text-muted: #6b6358;
  --color-text-faint: #a39a8d;
  --color-text-inverse: #fefdfb;
  --color-primary: #c47a2a;
  --color-primary-hover: #a86520;
  --color-primary-active: #8d5218;
  --color-primary-highlight: #f5ece0;
  --color-accent: #3b7a4a;
  --color-accent-hover: #2d6339;
  --color-success: #3b7a4a;
  --shadow-sm: 0 1px 3px rgba(30, 27, 22, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 27, 22, 0.08);
  --shadow-lg: 0 12px 40px rgba(30, 27, 22, 0.12);
}

/* DARK MODE */
[data-theme='dark'] {
  --color-bg: #161616;
  --color-surface: #1e1e1e;
  --color-surface-2: #272727;
  --color-surface-offset: #1a1a1a;
  --color-divider: #333333;
  --color-border: #404040;
  --color-text: #edebe8;
  --color-text-muted: #a8a49c;
  --color-text-faint: #6e6a62;
  --color-text-inverse: #161616;
  --color-primary: #e0a04a;
  --color-primary-hover: #eab368;
  --color-primary-active: #d0903a;
  --color-primary-highlight: #2a2520;
  --color-accent: #5daa68;
  --color-accent-hover: #72c07c;
  --color-success: #5daa68;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #161616;
    --color-surface: #1e1e1e;
    --color-surface-2: #272727;
    --color-surface-offset: #1a1a1a;
    --color-divider: #333333;
    --color-border: #404040;
    --color-text: #edebe8;
    --color-text-muted: #a8a49c;
    --color-text-faint: #6e6a62;
    --color-text-inverse: #161616;
    --color-primary: #e0a04a;
    --color-primary-hover: #eab368;
    --color-primary-active: #d0903a;
    --color-primary-highlight: #2a2520;
    --color-accent: #5daa68;
    --color-success: #5daa68;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ============================================ LAYOUT ============================================ */
.container { width: 100%; max-width: var(--content-wide); margin-inline: auto; padding-inline: var(--space-6); }
.container--narrow { 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(12px);
  border-bottom: 1px solid var(--color-divider);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-4); gap: var(--space-6); }
.header__logo { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--color-text); }
.header__logo-text { font-family: var(--font-display); font-size: var(--text-lg); letter-spacing: -0.02em; }
.header__logo-tagline { font-size: var(--text-xs); color: var(--color-text-muted); display: none; }
@media (min-width: 640px) { .header__logo-tagline { display: block; } }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav__link { font-size: var(--text-sm); color: var(--color-text-muted); text-decoration: none; letter-spacing: 0.03em; text-transform: uppercase; font-weight: 500; }
.nav__link:hover { color: var(--color-primary); }
.nav__cta {
  font-size: var(--text-sm); font-weight: 600; color: var(--color-text-inverse);
  background: var(--color-primary); padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full); text-decoration: none; letter-spacing: 0.03em; text-transform: uppercase;
}
.nav__cta:hover { background: var(--color-primary-hover); }

.theme-toggle { color: var(--color-text-muted); padding: var(--space-2); border-radius: var(--radius-md); }
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface); }

.mobile-menu-btn { display: none; color: var(--color-text); padding: var(--space-2); }
@media (max-width: 767px) {
  .mobile-menu-btn { display: block; }
  .nav { display: none; }
  .nav.nav--open {
    display: flex; flex-direction: column; position: absolute;
    top: 100%; left: 0; right: 0; background: var(--color-bg);
    border-bottom: 1px solid var(--color-divider);
    padding: var(--space-6); gap: var(--space-5); box-shadow: var(--shadow-md);
  }
}

/* Cart icon */
.cart-btn { position: relative; color: var(--color-text-muted); padding: var(--space-2); border-radius: var(--radius-md); }
.cart-btn:hover { color: var(--color-text); background: var(--color-surface); }
.cart-count {
  position: absolute; top: -2px; right: -2px;
  background: var(--color-primary); color: var(--color-text-inverse);
  font-size: 10px; font-weight: 700; width: 18px; height: 18px;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
}
.cart-count:empty { display: none; }

/* ============================================ HERO ============================================ */
.hero {
  padding-block: clamp(var(--space-20), 12vw, var(--space-32));
  text-align: center; position: relative; overflow: hidden;
  background: url('./images/hero-bg.webp') center/cover no-repeat;
  min-height: 70vh; display: flex; align-items: center; justify-content: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(254, 253, 251, 0.88) 0%,
    rgba(254, 253, 251, 0.75) 40%,
    rgba(254, 253, 251, 0.92) 100%
  );
  pointer-events: none;
}
[data-theme='dark'] .hero::before {
  background: linear-gradient(
    to bottom,
    rgba(22, 22, 22, 0.88) 0%,
    rgba(22, 22, 22, 0.75) 40%,
    rgba(22, 22, 22, 0.92) 100%
  );
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .hero::before {
    background: linear-gradient(
      to bottom,
      rgba(22, 22, 22, 0.88) 0%,
      rgba(22, 22, 22, 0.75) 40%,
      rgba(22, 22, 22, 0.92) 100%
    );
  }
}
.hero .container { position: relative; z-index: 1; }
.hero__badge {
  display: inline-block; font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-primary);
  background: var(--color-primary-highlight); padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full); margin-bottom: var(--space-6);
}
.hero__title {
  font-family: var(--font-display); font-size: var(--text-2xl); color: var(--color-text);
  margin-bottom: var(--space-6); max-width: 18ch; margin-inline: auto;
}
.hero__subtitle {
  font-size: var(--text-base); color: var(--color-text-muted);
  max-width: 52ch; margin-inline: auto; margin-bottom: var(--space-8); line-height: 1.7;
}
.hero__actions { display: flex; gap: var(--space-4); justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: 600;
  padding: var(--space-3) var(--space-6); border-radius: var(--radius-full);
  text-decoration: none; letter-spacing: 0.02em; cursor: pointer; border: none;
}
.btn--primary { background: var(--color-primary); color: var(--color-text-inverse); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--secondary { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-primary); }
.btn--secondary:hover { background: var(--color-primary-highlight); }
.btn--add-to-cart { background: var(--color-accent); color: #fff; }
.btn--add-to-cart:hover { background: var(--color-accent-hover); }
.btn--sm { font-size: var(--text-xs); padding: var(--space-2) var(--space-4); }

/* ============================================ SECTIONS ============================================ */
.section { padding-block: clamp(var(--space-12), 8vw, var(--space-24)); }
.section--alt { background: var(--color-surface); }
.section__header { text-align: center; margin-bottom: clamp(var(--space-8), 4vw, var(--space-16)); }
.section__eyebrow { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); margin-bottom: var(--space-3); }
.section__title { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-text); margin-bottom: var(--space-4); }
.section__desc { font-size: var(--text-base); color: var(--color-text-muted); max-width: 56ch; margin-inline: auto; }

/* ============================================ PRODUCT CARDS ============================================ */
.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-6); }

.product-card {
  background: var(--color-bg); border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg); padding: var(--space-8);
  display: flex; flex-direction: column;
  transition: transform var(--transition-interactive), box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-primary); }
.product-card__icon {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  background: var(--color-primary-highlight); display: flex;
  align-items: center; justify-content: center; margin-bottom: var(--space-5);
  color: var(--color-primary);
}
.product-card__name { font-family: var(--font-display); font-size: var(--text-lg); color: var(--color-text); margin-bottom: var(--space-2); }
.product-card__price { font-size: var(--text-sm); font-weight: 600; color: var(--color-primary); margin-bottom: var(--space-4); }
.product-card__desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.65; flex-grow: 1; margin-bottom: var(--space-5); }
.product-card__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); }
.tag { font-size: var(--text-xs); color: var(--color-text-muted); background: var(--color-surface-2); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); border: 1px solid var(--color-divider); }

.product-card__actions { margin-top: auto; }

/* ============================================ USP STRIP ============================================ */
.usp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-8); }
.usp { text-align: center; }
.usp__icon { width: 48px; height: 48px; margin-inline: auto; margin-bottom: var(--space-4); color: var(--color-primary); }
.usp__title { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); letter-spacing: 0.02em; }
.usp__desc { font-size: var(--text-sm); color: var(--color-text-muted); max-width: 28ch; margin-inline: auto; line-height: 1.6; }

/* ============================================ ABOUT / TWO-COLUMN ============================================ */
.two-col { display: grid; grid-template-columns: 1fr; gap: var(--space-10); align-items: center; }
@media (min-width: 768px) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col__visual {
  aspect-ratio: 4/3; background: var(--color-surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--color-divider);
  display: flex; align-items: center; justify-content: center;
}
.two-col__visual img { width: 100%; height: 100%; object-fit: cover; }
.two-col__content { max-width: 520px; }
.two-col__content h2 { font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--space-4); }
.two-col__content p { color: var(--color-text-muted); margin-bottom: var(--space-4); line-height: 1.7; }

/* ============================================ SCIENCE SECTION ============================================ */
.science-visual { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-8); }
.science-step { text-align: center; padding: var(--space-5); background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-divider); }
.science-step__num { font-family: var(--font-display); font-size: var(--text-xl); color: var(--color-primary); margin-bottom: var(--space-2); }
.science-step__title { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-2); }
.science-step__desc { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; }
@media (max-width: 640px) { .science-visual { grid-template-columns: 1fr; } }

/* ============================================ COMPARISON TABLE ============================================ */
.comparison-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: var(--space-8); }
.comparison-table { min-width: 600px; font-size: var(--text-sm); }
.comparison-table th { text-align: left; padding: var(--space-3) var(--space-4); font-weight: 600; font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); border-bottom: 2px solid var(--color-divider); }
.comparison-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-divider); color: var(--color-text-muted); }
.comparison-table tr.highlight td { background: var(--color-primary-highlight); color: var(--color-text); font-weight: 500; }

/* ============================================ TESTIMONIALS ============================================ */
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-6); }
.testimonial { background: var(--color-bg); border: 1px solid var(--color-divider); border-radius: var(--radius-lg); padding: var(--space-6); transition: box-shadow var(--transition-interactive); }
.testimonial:hover { box-shadow: var(--shadow-md); }
.testimonial__quote { font-family: var(--font-display); font-size: var(--text-base); font-style: italic; color: var(--color-text); margin-bottom: var(--space-4); line-height: 1.6; }
.testimonial__quote::before { content: '\201C'; color: var(--color-primary); font-size: var(--text-xl); line-height: 0; vertical-align: -0.25em; margin-right: var(--space-1); }
.testimonial__author { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 500; }

/* ============================================ CTA / CONTACT ============================================ */
.cta-section { background: var(--color-surface); padding-block: clamp(var(--space-12), 8vw, var(--space-24)); text-align: center; }
.cta-section h2 { font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--space-4); }
.cta-section p { color: var(--color-text-muted); max-width: 48ch; margin-inline: auto; margin-bottom: var(--space-8); }

.contact-form { max-width: 520px; margin-inline: auto; display: flex; flex-direction: column; gap: var(--space-4); }
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-group label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
.form-group input, .form-group textarea, .form-group select {
  padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-bg); font-size: var(--text-base);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--color-primary); outline: none;
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* ============================================ FOOTER ============================================ */
.footer { border-top: 1px solid var(--color-divider); padding-block: var(--space-10); font-size: var(--text-xs); color: var(--color-text-muted); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-4); }
.footer__links { display: flex; gap: var(--space-6); }
.footer__links a { color: var(--color-text-muted); text-decoration: none; }
.footer__links a:hover { color: var(--color-primary); }

/* ============================================ ANIMATIONS ============================================ */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============================================ CART DRAWER ============================================ */
.cart-overlay {
  position: fixed; inset: 0; background: oklch(0 0 0 / 0.4);
  z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 90vw); background: var(--color-bg);
  z-index: 101; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
  border-left: 1px solid var(--color-divider);
}
.cart-drawer.open { transform: translateX(0); }

.cart-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
}
.cart-drawer__title { font-family: var(--font-display); font-size: var(--text-lg); }
.cart-drawer__close { color: var(--color-text-muted); padding: var(--space-2); }
.cart-drawer__close:hover { color: var(--color-text); }

.cart-drawer__items { flex: 1; overflow-y: auto; padding: var(--space-6); }
.cart-drawer__empty { text-align: center; color: var(--color-text-muted); padding: var(--space-10); font-size: var(--text-sm); }

.cart-item {
  display: flex; gap: var(--space-4); padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider); margin-bottom: var(--space-4);
}
.cart-item:last-child { border-bottom: none; margin-bottom: 0; }
.cart-item__info { flex: 1; }
.cart-item__name { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-1); }
.cart-item__variant { font-size: var(--text-xs); color: var(--color-text-muted); }
.cart-item__price { font-size: var(--text-sm); color: var(--color-primary); font-weight: 600; margin-top: var(--space-2); }
.cart-item__qty { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.cart-item__qty button {
  width: 28px; height: 28px; border-radius: var(--radius-md); border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--color-text);
}
.cart-item__qty button:hover { background: var(--color-surface); }
.cart-item__qty span { font-size: var(--text-sm); min-width: 24px; text-align: center; }
.cart-item__remove { color: var(--color-text-faint); font-size: var(--text-xs); margin-top: var(--space-2); text-decoration: underline; cursor: pointer; background: none; border: none; }
.cart-item__remove:hover { color: var(--color-primary); }

.cart-drawer__footer {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-6);
}
.cart-drawer__total {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: var(--text-base); margin-bottom: var(--space-4);
}
.cart-drawer__checkout { width: 100%; justify-content: center; }
.cart-drawer__checkout:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================ NOTIFICATION TOAST ============================================ */
.toast {
  position: fixed; bottom: var(--space-6); right: var(--space-6);
  background: var(--color-success); color: #fff;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-lg);
  font-size: var(--text-sm); font-weight: 500;
  transform: translateY(120%); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateY(0); opacity: 1; }
