/* =========================================================
   Cake Feet Woodworking — shared stylesheet
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@500;700&family=Fredoka:wght@500;600;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  /* wood tones — used only for the banner / accents, not the whole page */
  --wood-1: #7c5431;
  --wood-2: #5a3b20;
  --wood-3: #3a2514;
  --wood-text: #ecdfc3;

  /* neutral, modern palette */
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-alt: #efece6;
  --border: #e2ddd3;
  --ink: #221d17;
  --ink-soft: #5c5247;
  /* --accent / --accent-dark are SOLID FILL colors (always dark enough for
     white text on top). --accent-text is the same hue tuned for use as TEXT
     on the page background, and is lightened in dark mode. Never use
     --accent as text color or it goes dark-on-dark in dark mode. */
  --accent: #7a4a24;
  --accent-dark: #5f3a1c;
  --accent-text: #5f3a1c;

  /* Paired fill+text for solid interactive elements: buttons, the selected
     wood chip, active step badges. These DO flip in dark mode so a pressed
     or selected control reads lighter than the page instead of vanishing
     into it. Always use them together — never pair --control with a
     hardcoded white, or dark mode breaks. --control-hover is a step further
     from the page background again, so hover is always visible. */
  --control: #221d17;
  --control-text: #fdfbf8;
  --control-hover: #3f3529;

  /* the footer band stays dark in both themes (its text is light) */
  --footer-bg: #221d17;

  --radius: 5px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(20, 15, 10, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 15, 10, 0.12);

  /* overridden per-page by settings.js via data-font/data-accent/etc */
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --heading-transform: uppercase;
  --heading-spacing: 0.5px;
  --heading-weight: 600;

  /* page width — shared by the banner and every content container so the
     logo/nav stay aligned with the content below on any screen size */
  --page-max: 1240px;

  /* horizontal breathing room from the window edge. Shared by the banner,
     the content containers and the mobile menu so everything lines up, and
     responsive so content doesn't hug the edges on a narrow window. */
  --gutter: clamp(28px, 5vw, 40px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  transition: background 0.2s ease, color 0.2s ease;
}

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

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  text-transform: var(--heading-transform);
  letter-spacing: var(--heading-spacing);
  color: var(--ink);
}

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

/* ---------------------------------------------------------
   Header — the whole bar is a wood plank, logo burned in
   --------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* NOTE: deliberately no `overflow: hidden` here. The grain/vignette layers
   below are inset:0 so they can never overflow, and clipping this box would
   hide the mobile nav dropdown, which hangs below the banner at top:100%. */
.wood-banner {
  position: relative;
  background: linear-gradient(115deg, var(--wood-1) 0%, var(--wood-2) 55%, var(--wood-3) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* fine grain noise, stretched along the grain direction */
.wood-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.26' numOctaves='4' seed='7' stitchTiles='stitch' result='n'/%3E%3CfeColorMatrix in='n' type='matrix' values='0 0 0 0 0.4  0 0 0 0 0.26  0 0 0 0 0.14  0 0 0 0.85 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
  background-size: 260px 260px;
  mix-blend-mode: overlay;
  opacity: 0.9;
  pointer-events: none;
}

/* depth vignette + a couple of plank seams so it reads as real boards */
.wood-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, transparent 30%, transparent 65%, rgba(0, 0, 0, 0.28) 100%),
    radial-gradient(ellipse 160px 70px at 10% 85%, rgba(15, 8, 4, 0.4), transparent 70%),
    radial-gradient(ellipse 130px 60px at 90% 10%, rgba(15, 8, 4, 0.35), transparent 70%);
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px var(--gutter);
  max-width: var(--page-max);
  margin: 0 auto;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

/* The logo artwork. Height drives the size; width:auto keeps the aspect
   ratio of the source file. Like the rest of the banner it is deliberately
   fixed — the Font / Style / Theme settings never touch it.
   A soft drop-shadow lifts the cream artwork off the wood grain. */
.brand-logo {
  height: clamp(46px, 4.6vw, 62px);
  width: auto;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

/* smaller variant used in the footer */
.wood-banner.small .header-inner {
  padding: 12px var(--gutter);
}

.wood-banner.small .brand-logo {
  height: 40px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

/* ---------------------------------------------------------
   Navigation
   --------------------------------------------------------- */

.main-nav ul {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  /* fixed, like the logo: the whole banner stays visually constant and is
     never restyled by the Font setting */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  color: var(--wood-text);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 1px;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

/* Only the CURRENT page is highlighted. Hovering another link just
   underlines it — it never takes on the active colour, so hover can't be
   mistaken for "this is the page you're on". */
.main-nav a.active {
  color: #fff;
  border-color: #cb9256;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--wood-text);
  border-radius: 1px;
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero {
  background: var(--surface-alt);
  padding: clamp(56px, 7vw, 104px) 0 clamp(48px, 6vw, 88px);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 3rem);
  margin: 0 0 14px;
  line-height: 1.15;
}

.hero p {
  max-width: 64ch;
  margin: 0 auto 28px;
  font-size: clamp(1rem, 1.15vw, 1.2rem);
  color: var(--ink-soft);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  background: var(--control);
  color: var(--control-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.4px;
  border: 1px solid var(--control);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: var(--control-hover);
  color: var(--control-text);
  border-color: var(--control-hover);
}

/* held down: nudge it and ring it so the press is obvious in both themes */
.btn:active,
.choice-btn:active,
.wood-option input:active + span {
  transform: translateY(1px);
  box-shadow: 0 0 0 3px var(--accent-text);
}

/* keyboard focus needs to be visible on every control, not just inputs */
.btn:focus-visible,
.choice-btn:focus-visible,
.color-swatch:focus-visible,
.wood-option input:focus-visible + span,
.nav-toggle:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.btn.outline:hover {
  background: var(--control);
  color: var(--control-text);
  border-color: var(--control);
}

/* ---------------------------------------------------------
   Generic section / card layout
   --------------------------------------------------------- */

section {
  padding: clamp(48px, 5vw, 84px) 0;
}

.section-title {
  font-size: clamp(1.4rem, 2.1vw, 2.1rem);
  text-align: center;
  margin: 0 0 10px;
  line-height: 1.2;
}

.section-sub {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto 36px;
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
}

.grid {
  display: grid;
  gap: 24px;
}

/* auto-fit rather than a fixed column count: a 4-item group fills the row
   on a wide screen instead of leaving one card orphaned on its own line,
   and it steps down to 2 then 1 column on narrow screens with no
   media queries needed. */
.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.grid.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.card {
  display: block;
  color: inherit;
}

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

.card-media {
  height: clamp(150px, 14vw, 210px);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 20px 22px 24px;
}

.card-category {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 8px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.card-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.card-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 14px;
}

.card-price {
  font-weight: 700;
  color: var(--ink);
}

.card-time {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------
   Two-column content block (used on About page)
   --------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split .media-block {
  height: clamp(300px, 26vw, 420px);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.split h2 {
  font-size: 1.5rem;
}

/* ---------------------------------------------------------
   Contact form
   --------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
  display: block;
  color: var(--ink);
}

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--ink);
}

input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent-text);
  outline-offset: 1px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* city / state / zip */
.field-row-3 {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr;
  gap: 16px;
}

@media (max-width: 620px) {
  .field-row-3 {
    grid-template-columns: 1fr;
  }
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  margin-bottom: 18px;
}

.info-list li strong {
  display: block;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.form-note {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fdecea;
  border: 1px solid #e3a9a0;
  color: #7a2e22;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

.form-alert .icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  margin-top: 1px;
}

.form-alert strong {
  font-size: 0.88rem;
}

.form-alert ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.form-alert li {
  margin-bottom: 2px;
}

input.invalid, select.invalid, textarea.invalid {
  border-color: #c0392b;
  background: #fff7f6;
}

/* ---------------------------------------------------------
   Product detail + order wizard
   --------------------------------------------------------- */

.breadcrumb {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.product-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

.product-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 44px;
  align-items: center;
}

.product-media-lg {
  height: clamp(280px, 24vw, 400px);
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

.product-hero h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.5rem);
  margin: 0 0 14px;
  line-height: 1.18;
}

.product-hero p.description {
  color: var(--ink-soft);
  margin: 0 0 26px;
}

.product-meta {
  display: flex;
  gap: 36px;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.meta-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--ink);
}

.order-section {
  padding: 50px 0 70px;
}

.stepper {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
}

.step:not(:last-child)::after {
  content: "";
  width: 60px;
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  background: var(--surface);
}

.step.active .step-num {
  background: var(--control);
  color: var(--control-text);
  border-color: var(--control);
}

.step.active .step-label {
  color: var(--ink);
  font-weight: 600;
}

.step.done .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.step-panel {
  max-width: 560px;
  margin: 0 auto;
}

.wood-slot {
  margin-bottom: 30px;
}

.wood-slot > .slot-label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.slot-hint {
  margin: 8px 0 0 26px;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* the "Other wood…" text box, revealed under its chip */
.custom-wood {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.custom-wood label {
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.custom-wood .slot-hint {
  margin: 8px 0 0;
}

.wood-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wood-option {
  position: relative;
}

.wood-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.wood-option span {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.wood-option input:checked + span {
  border-color: var(--control);
  background: var(--control);
  color: var(--control-text);
}

.accent-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 600;
  cursor: pointer;
}

.accent-toggle input {
  width: 16px;
  height: 16px;
}

.step-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.order-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow: hidden;
}

.order-summary .row {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.order-summary .row:last-child {
  border-bottom: none;
}

.order-summary .row span:first-child {
  color: var(--ink-soft);
}

.order-summary .row span:last-child {
  font-weight: 600;
  text-align: right;
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.site-footer {
  background: var(--footer-bg);
  color: #cfc5b8;
  padding-bottom: clamp(28px, 3vw, 40px);
  margin-top: 40px;
}

/* padding-TOP only, not the `padding` shorthand: this element is also a
   .container, and a shorthand here would reset its left/right gutter to 0
   and push the footer content flush against the window edges. */
.footer-body {
  padding-top: clamp(32px, 4vw, 48px);
}

/* grid, not space-between: with only two columns, space-between pushed them
   to opposite edges of the screen with a huge empty gap on wide displays.
   The 260px minimum drops it to a single column before the columns get
   squeezed narrow enough to wrap the email address awkwardly. */
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), max-content));
  justify-content: start;
  gap: 34px 72px;
}

.footer-col h4 {
  color: #f1ece3;
  margin: 0 0 12px;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
  /* stop the email address from overflowing on very narrow screens */
  overflow-wrap: anywhere;
}

.footer-col a {
  color: #b3a996;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  margin-top: clamp(28px, 3.5vw, 40px);
  padding-top: clamp(18px, 2vw, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #8f8575;
}

/* ---------------------------------------------------------
   Theme settings — dark mode, fun vs modern, fonts, accent color
   Controlled by data-theme / data-style / data-font / data-accent
   on <html>, set by js/settings.js and js/settings-page.js
   --------------------------------------------------------- */

/* Each font sets its family pair plus the heading treatment that suits it.
   Oswald is a condensed face that wants wide uppercase tracking; Playfair and
   Courier are much wider per character, so they get mixed case and tighter
   tracking or headings overflow and look stretched. */

html[data-font="inter"] {
  --font-heading: 'Oswald', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --heading-transform: uppercase;
  --heading-spacing: 0.5px;
  --heading-weight: 600;
}

html[data-font="serif"] {
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: Georgia, 'Times New Roman', serif;
  --heading-transform: none;
  --heading-spacing: 0;
  --heading-weight: 700;
}

html[data-font="mono"] {
  --font-heading: 'Courier New', Courier, monospace;
  --font-body: 'Courier New', Courier, monospace;
  --heading-transform: uppercase;
  --heading-spacing: -0.5px;
  --heading-weight: 700;
}

html[data-font="rounded"] {
  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --heading-transform: none;
  --heading-spacing: 0;
  --heading-weight: 600;
}

/* ---- Dark mode ---- */

html[data-theme="dark"] {
  --bg: #171510;
  --surface: #211e18;
  --surface-alt: #2a261e;
  --border: #3a352b;
  --ink: #efe8da;
  --ink-soft: #b7ac98;

  /* Flipped: on a dark page a solid control has to be LIGHTER than its
     surroundings to read as pressed/selected. Text flips with it so the
     pair always has contrast. */
  --control: #ece4d6;
  --control-text: #1a160f;
  --control-hover: #ffffff;

  --footer-bg: #100e0a;
}

html[data-theme="dark"] .form-alert {
  background: #3a1f1c;
  border-color: #6b332c;
  color: #f1b4ac;
}

html[data-theme="dark"] input.invalid,
html[data-theme="dark"] select.invalid,
html[data-theme="dark"] textarea.invalid {
  background: #3a1f1c;
}

/* (dark-mode button hover now comes from --control-hover) */

/* ---- Accent color ----
   Each accent sets a fill pair (--accent / --accent-dark) plus --accent-text.
   In light mode --accent-text is the dark variant; in dark mode it is
   replaced below with a lightened variant so accent text stays readable.
   Values verified at >= 4.5:1 against their own theme's surfaces. */

html[data-accent="brown"] {
  --accent: #7a4a24;
  --accent-dark: #5f3a1c;
  --accent-text: #5f3a1c;
}

html[data-accent="green"] {
  --accent: #3f6b3f;
  --accent-dark: #2d4e2d;
  --accent-text: #2d4e2d;
}

html[data-accent="blue"] {
  --accent: #345b8c;
  --accent-dark: #244066;
  --accent-text: #244066;
}

html[data-accent="red"] {
  --accent: #8c3030;
  --accent-dark: #6b2323;
  --accent-text: #6b2323;
}

html[data-accent="charcoal"] {
  --accent: #4a443c;
  --accent-dark: #332f29;
  --accent-text: #332f29;
}

/* Dark mode: lighten accent TEXT only — fills stay dark so white text on
   top of them (step badges, fun-style buttons) keeps its contrast. */
html[data-theme="dark"][data-accent="brown"]   { --accent-text: #c3804b; }
html[data-theme="dark"][data-accent="green"]   { --accent-text: #609c60; }
html[data-theme="dark"][data-accent="blue"]    { --accent-text: #6d93c3; }
html[data-theme="dark"][data-accent="red"]     { --accent-text: #cc7979; }
html[data-theme="dark"][data-accent="charcoal"]{ --accent-text: #988f82; }

/* ---- Fun style: bolder, rounder, more playful ---- */

html[data-style="fun"] .btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  border-color: var(--accent-dark);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(20, 15, 10, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

html[data-style="fun"] .btn:hover {
  background: linear-gradient(180deg, var(--accent), var(--accent-dark));
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(20, 15, 10, 0.26);
}

/* must restate the transparent background: the `html[data-style] .btn` rule
   above is more specific than the base `.btn.outline`, so without this the
   outline button keeps the filled background and its dark accent text
   disappears into it. */
html[data-style="fun"] .btn.outline {
  background: transparent;
  border-radius: 999px;
  border: 2px solid var(--accent);
  color: var(--accent-text);
  box-shadow: none;
}

html[data-style="fun"] .btn.outline:hover {
  background: var(--accent);
  color: #fff;
}

html[data-style="fun"] .card {
  border-radius: 18px;
}

html[data-style="fun"] .card:hover {
  transform: translateY(-5px);
}

html[data-style="fun"] .card-media {
  background: linear-gradient(135deg, var(--accent), var(--wood-2));
  color: rgba(255, 255, 255, 0.9);
}

html[data-style="fun"] .product-media-lg,
html[data-style="fun"] .split .media-block {
  background: linear-gradient(135deg, var(--accent), var(--wood-2));
  color: rgba(255, 255, 255, 0.9);
}

html[data-style="fun"] .step-num {
  border-radius: 10px;
}

/* ---- Rustic style: warm, crafted, workshop sign feel ---- */

html[data-style="rustic"] .btn {
  background: var(--accent-dark);
  border: 2px solid var(--wood-3);
  border-radius: 3px;
  color: #fdfbf8;
}

html[data-style="rustic"] .btn:hover {
  background: var(--accent);
}

html[data-style="rustic"] .btn.outline {
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 3px;
  color: var(--accent-text);
}

html[data-style="rustic"] .btn.outline:hover {
  background: var(--accent-dark);
  color: #fdfbf8;
}

html[data-style="rustic"] .card {
  border: 2px solid var(--border);
  border-radius: 10px;
}

html[data-style="rustic"] .card-media {
  background: var(--wood-1);
  color: #fdfbf8;
}

html[data-style="rustic"] .product-media-lg,
html[data-style="rustic"] .split .media-block {
  background: var(--wood-1);
  color: #fdfbf8;
}

html[data-style="rustic"] .step-num {
  border-radius: 4px;
}

html[data-style="rustic"] .wood-option span {
  border-radius: 4px;
}

/* ---- Minimal style: flat, quiet, no decoration ---- */

html[data-style="minimal"] .btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
}

html[data-style="minimal"] .btn:hover {
  background: var(--control);
  color: var(--control-text);
  border-color: var(--control);
}

html[data-style="minimal"] .btn.outline {
  background: transparent;
  border-radius: 0;
}

html[data-style="minimal"] .card {
  border-radius: 0;
  box-shadow: none;
}

html[data-style="minimal"] .card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--ink);
}

html[data-style="minimal"] .step-num,
html[data-style="minimal"] .wood-option span,
html[data-style="minimal"] .choice-btn,
html[data-style="minimal"] .color-swatch {
  border-radius: 0;
}

/* ---------------------------------------------------------
   Settings page
   --------------------------------------------------------- */

.settings-group {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.settings-group:first-child {
  padding-top: 0;
}

.settings-group:last-of-type {
  border-bottom: none;
}

.settings-group h2 {
  font-size: 1.1rem;
  margin: 0 0 6px;
}

.settings-group .section-sub {
  text-align: left;
  margin: 0 0 16px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.choice-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

/* Deliberately NO :hover recolor on choice controls — only the actually
   selected option changes color, so hovering never looks like a selection. */

.choice-btn.active {
  background: var(--control);
  border-color: var(--control);
  color: var(--control-text);
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.color-swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--ink);
}

/* ---------------------------------------------------------
   Home page: how-it-works + testimonials
   --------------------------------------------------------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 32px;
}

.how-step {
  text-align: center;
  padding: 0 10px;
}

.how-step .num {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--control);
  color: var(--control-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 auto 16px;
}

.how-step h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}

.how-step p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 24px;
}

.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.testimonial .quote {
  font-style: italic;
  color: var(--ink);
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.testimonial .author {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */

@media (max-width: 860px) {
  .split, .contact-grid, .product-hero-grid {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  /* .grid.cols-2/cols-3 are auto-fit and reflow on their own — no override */
}

@media (max-width: 720px) {
  /* Mobile dropdown. Stays in the layout (display:block) and is hidden with
     opacity/visibility instead of display:none so it can animate open. */
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: block;
    background: var(--wood-3);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s linear;
  }

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

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 18px;
  }

  .main-nav a {
    display: block;
    padding: 14px 0;
    border-bottom: none;
  }

  .main-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav li:last-child {
    border-bottom: none;
  }

  /* each tab drops in just after the panel, slightly staggered */
  .main-nav li {
    opacity: 0;
    transform: translateY(-8px);
  }

  .main-nav.open li {
    animation: navItemIn 0.26s ease forwards;
  }

  .main-nav.open li:nth-child(1) { animation-delay: 0.05s; }
  .main-nav.open li:nth-child(2) { animation-delay: 0.10s; }
  .main-nav.open li:nth-child(3) { animation-delay: 0.15s; }
  .main-nav.open li:nth-child(4) { animation-delay: 0.20s; }
  .main-nav.open li:nth-child(5) { animation-delay: 0.25s; }

  .nav-toggle {
    display: flex;
  }

  .header-inner {
    position: relative;
  }

  .brand-logo {
    height: 42px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .stepper {
    gap: 0;
  }

  .step:not(:last-child)::after {
    width: 24px;
    margin: 0 8px;
  }

  /* footer stacks to one column here — open it up so the columns and the
     copyright line don't bunch together */
  .footer-inner {
    gap: 30px;
  }

  .footer-col ul li {
    margin-bottom: 11px;
  }

  .wood-banner.small .brand-logo {
    height: 34px;
  }

  .step-label {
    display: none;
  }
}

@keyframes navItemIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* dims the page behind the open menu; sits under the header (z-index 100)
   so the banner and the dropdown itself stay fully lit */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s linear;
}

.nav-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* hamburger morphs into an X while open */
.nav-toggle span {
  transition: transform 0.25s ease, opacity 0.18s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* stop the page scrolling underneath the open menu */
body.nav-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .main-nav,
  .nav-overlay,
  .nav-toggle span {
    transition-duration: 0.01ms;
  }
  .main-nav.open li {
    animation-duration: 0.01ms;
    animation-delay: 0s;
  }
}

/* desktop: never show the overlay or allow a stuck scroll lock */
@media (min-width: 721px) {
  .nav-overlay {
    display: none;
  }
  body.nav-open {
    overflow: auto;
  }
}
