/* ==========================================================================
   Hooked On JigFlys — Design Tokens & Base
   ========================================================================== */

:root {
  /* Brand colors */
  --color-forest: #2c3a2a;
  --color-forest-dark: #1c2619;
  --color-forest-light: #435a3f;
  --color-parchment: #f4efdf;
  --color-parchment-dark: #e9e0c8;
  --color-navy: #12161a;
  --color-navy-light: #1c2229;
  --color-teal: #2a6f6a;
  --color-teal-dark: #1e5450;
  --color-gold: #c7a03c;
  --color-gold-light: #ddc06d;
  --color-ink: #1a1f17;
  --color-white: #ffffff;

  /* Semantic tokens */
  --bg-page: var(--color-parchment);
  --bg-surface: var(--color-white);
  --bg-dark: var(--color-navy);
  --text-body: var(--color-ink);
  --text-muted: #5a5f52;
  --text-inverse: var(--color-parchment);
  --border-subtle: rgba(26, 31, 23, 0.12);
  --border-inverse: rgba(244, 239, 223, 0.16);
  --accent-primary: var(--color-forest);
  --accent-secondary: var(--color-teal);
  --accent-highlight: var(--color-gold);

  /* Typography */
  --font-heading: "Zilla Slab", Georgia, "Times New Roman", serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.3rem + 0.7vw, 1.8rem);
  --step-3: clamp(1.8rem, 1.55rem + 1.2vw, 2.4rem);
  --step-4: clamp(2.3rem, 1.9rem + 2vw, 3.4rem);
  --step-5: clamp(2.9rem, 2.3rem + 3vw, 4.6rem);

  /* Spacing (8px rhythm) */
  --space-1: 0.5rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4rem;
  --space-8: 6rem;
  --space-9: 8rem;

  /* Layout */
  --container-max: 1200px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(18, 22, 26, 0.08);
  --shadow-md: 0 8px 24px rgba(18, 22, 26, 0.12);
  --shadow-lg: 0 20px 50px rgba(18, 22, 26, 0.18);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p {
  margin: 0 0 var(--space-3);
  max-width: 68ch;
}

ul {
  padding-left: 1.2em;
}

/* Respect user motion preference globally */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visibility (accessibility) */
:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

.section {
  padding-block: var(--space-8);
}

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

.section--dark {
  background: var(--bg-dark);
  color: var(--text-inverse);
}

.section--surface {
  background: var(--bg-surface);
}

.stack {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: var(--space-2);
}

.section--dark .eyebrow {
  color: var(--color-gold-light);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.9em 1.8em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step-0);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 48px;
  transition: transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:hover {
  background: var(--color-forest-dark);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: var(--color-gold);
  color: var(--color-navy);
}

.btn-gold:hover {
  background: var(--color-gold-light);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  border-color: currentColor;
  color: inherit;
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
}

.section--dark .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-block {
  width: 100%;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: var(--step-1);
  color: var(--color-forest);
  font-weight: 700;
}

.brand img {
  height: 48px;
  width: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
}

.nav-toggle__bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-ink);
  margin: 5px 0;
  transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.main-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: var(--step--1);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-body);
  position: relative;
  padding: 0.3em 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--color-gold);
  transition: right var(--duration-base) var(--ease-out);
}

.main-nav a:hover::after,
.main-nav a[aria-current="page"]::after {
  right: 0;
}

.main-nav a[aria-current="page"] {
  color: var(--color-forest);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-base) var(--ease-out);
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

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

.site-footer {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding-block: var(--space-7) var(--space-5);
}

.site-footer a {
  color: var(--color-gold-light);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-5);
  border-bottom: 1px solid var(--border-inverse);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-4);
}

.footer-grid h4 {
  color: var(--color-gold-light);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-3);
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* ==========================================================================
   Cards / Product grid
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--products {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

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

.card__media {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--color-parchment-dark);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out);
}

.card:hover .card__media img {
  transform: scale(1.06);
}

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

.card__price {
  font-weight: 700;
  color: var(--color-forest);
}

.card__tag {
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* ==========================================================================
   Specs table
   ========================================================================== */

.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--space-4);
}

.specs-table th,
.specs-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--step--1);
}

.specs-table th {
  color: var(--text-muted);
  font-weight: 600;
  width: 40%;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin-bottom: var(--space-4);
}

.form-field label {
  font-weight: 600;
  font-size: var(--step--1);
}

.form-field input,
.form-field textarea {
  font: inherit;
  color: var(--text-body);
  padding: 0.8em 1em;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  min-height: 48px;
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(42, 111, 106, 0.15);
}

.form-note {
  font-size: var(--step--1);
  color: var(--text-muted);
}

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

.hero {
  position: relative;
  padding-block: var(--space-9) var(--space-8);
  background: linear-gradient(180deg, var(--color-parchment) 0%, var(--color-parchment-dark) 100%);
  overflow: hidden;
}

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

@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .eyebrow,
  .hero p {
    margin-inline: auto;
  }
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

@media (max-width: 900px) {
  .hero__actions {
    justify-content: center;
  }
}

/* ==========================================================================
   Trust note / banner strip
   ========================================================================== */

.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: var(--color-teal);
  color: var(--color-parchment);
  padding: var(--space-2) var(--space-4);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Scroll reveal animation
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  transition-delay: calc(var(--stagger-index, 0) * 60ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ==========================================================================
   Misc components
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.3em 0.8em;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--color-gold);
  color: var(--color-navy);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin-block: var(--space-6);
}

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

@media (max-width: 860px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

.figure-frame img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-dark);
  color: var(--color-parchment);
  padding: 1em 1.4em;
  z-index: 1000;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
}
