/* Fremont Makers Website Styles */

/* ===== CSS CUSTOM PROPERTIES (DESIGN TOKENS) ===== */
:root {
  /* Brand Colors */
  --walnut:       #3B2C24; /* Primary. Type, the mark, structure. Reads near-black, warm up close. */
  --bone:         #F2EADB; /* The ground everything sits on. Default page background. */
  --sandstone:    #C9AE86; /* Warm mid-tone: panels, fills, dividers, large UI accents. */
  --sage:         #6F7459; /* Secondary green. Buttons/accents used sparingly. */
  --ridge-slate:  #56686E; /* Cool note. Secondary text on light, quiet UI. */
  --hogback-clay: #B0613C; /* ACCENT ONLY — a little goes a long way (primary CTA, key links). */

  /* Typography Scale */
  --font-display: "Fraunces", serif;
  --font-body: "Hanken Grotesk", sans-serif;
  --font-spec: "IBM Plex Mono", monospace;

  /* Fluid Type Scale */
  --text-display-1: clamp(2.5rem, 4vw, 3.5rem);      /* ~46px target */
  --text-display-2: clamp(1.75rem, 3vw, 2.25rem);    /* ~32px target */
  --text-heading: clamp(1.25rem, 2.5vw, 1.75rem);    /* ~23px target */
  --text-body: clamp(1rem, 1.5vw, 1.125rem);         /* ~17px target */
  --text-spec: 0.75rem;                              /* ~11.5px, fixed */

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 4rem;
  --space-xxl: 6rem;

  /* Layout */
  --content-width: 1200px;
  --content-narrow: 800px;
  --border-radius: 0.25rem;
  --transition: 0.2s ease;
}

/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--walnut);
  background-color: var(--bone);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--space-sm) 0;
}

h1 {
  font-size: var(--text-display-1);
}

h2 {
  font-size: var(--text-display-2);
}

h3 {
  font-size: var(--text-heading);
}

p {
  margin: 0 0 var(--space-sm) 0;
}

a {
  color: var(--hogback-clay);
  text-decoration: underline;
  transition: color var(--transition);
}

a:hover, a:focus {
  color: var(--walnut);
}

/* Eyebrow/Spec text (shop-drawing voice) */
.eyebrow {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ridge-slate);
  margin-bottom: var(--space-xs);
  display: block;
}

/* ===== LAYOUT COMPONENTS ===== */

/* Skip to content for accessibility */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--walnut);
  color: var(--bone);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--border-radius);
  z-index: 1000;
}

.skip-to-content:focus {
  top: 6px;
}

/* Container */
.container {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

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

/* Header */
.header {
  background-color: var(--bone);
  border-bottom: 1px solid var(--sandstone);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-sm);
  min-height: 80px;
}

.header__logo {
  flex-shrink: 0;
  height: 48px;
}

.header__logo img {
  height: 100%;
  width: auto;
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-md);
}

.nav__link {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--walnut);
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition);
}

.nav__link:hover,
.nav__link:focus {
  border-bottom-color: var(--sandstone);
  color: var(--walnut);
}

.nav__link--current {
  border-bottom-color: var(--hogback-clay);
}

/* Mobile menu toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--walnut);
  cursor: pointer;
  padding: var(--space-xs);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-body);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 48px; /* Accessibility: minimum touch target */
}

.btn--primary {
  background-color: var(--hogback-clay);
  color: var(--bone);
  border-color: var(--hogback-clay);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: var(--walnut);
  border-color: var(--walnut);
  color: var(--bone);
  text-decoration: none;
}

.btn--secondary {
  background-color: transparent;
  color: var(--walnut);
  border-color: var(--walnut);
}

.btn--secondary:hover,
.btn--secondary:focus {
  background-color: var(--walnut);
  color: var(--bone);
  text-decoration: none;
}

.btn--large {
  padding: var(--space-md) var(--space-lg);
  font-size: 1.125rem;
}

/* ===== SECTIONS ===== */
.section {
  padding: var(--space-xl) 0;
}

.section--hero {
  padding: var(--space-xxl) 0;
}

.section--dark {
  background-color: var(--walnut);
  color: var(--bone);
}

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

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--bone);
}

.section--dark a {
  color: var(--sandstone);
}

.section--dark a:hover,
.section--dark a:focus {
  color: var(--bone);
}

/* Section divider */
.section-divider {
  height: 1px;
  background-color: var(--sandstone);
  border: none;
  margin: var(--space-lg) auto;
  width: 200px;
}

/* ===== HERO SECTION ===== */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  min-height: 70vh;
}

.hero__content h1 {
  margin-bottom: var(--space-md);
}

.hero__content p {
  font-size: 1.125rem;
  margin-bottom: var(--space-lg);
  color: var(--ridge-slate);
}

.hero__actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero__image {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  aspect-ratio: 4/3;
}

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

/* ===== FOOTER ===== */
.footer {
  background-color: var(--walnut);
  color: var(--bone);
  padding: var(--space-xl) 0 var(--space-md) 0;
}

.footer__container {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer__logo {
  height: 64px;
  margin-bottom: var(--space-md);
}

.footer__logo img {
  height: 100%;
  width: auto;
}

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

.footer__nav-section h4 {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
  color: var(--sandstone);
}

.footer__nav-section ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__nav-section li {
  margin-bottom: var(--space-xs);
}

.footer__nav-section a {
  color: var(--bone);
  text-decoration: none;
}

.footer__nav-section a:hover,
.footer__nav-section a:focus {
  color: var(--sandstone);
}

.footer__contact h4 {
  color: var(--sandstone);
  margin-bottom: var(--space-sm);
}

.footer__contact p {
  margin-bottom: var(--space-xs);
  font-size: 0.95rem;
}

.footer__bottom {
  border-top: 1px solid var(--ridge-slate);
  padding-top: var(--space-md);
  text-align: center;
  font-size: 0.9rem;
  color: var(--sandstone);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  :root {
    --space-xl: 3rem;
    --space-xxl: 4rem;
  }

  /* Mobile navigation */
  .nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bone);
    border-top: 1px solid var(--sandstone);
    flex-direction: column;
    padding: var(--space-sm);
    gap: 0;
  }

  .nav__menu.is-open {
    display: flex;
  }

  .nav__toggle {
    display: block;
  }

  .nav__link {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--sandstone);
  }

  .nav__link:last-child {
    border-bottom: none;
  }

  /* Hero responsive */
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }

  .hero__actions {
    justify-content: center;
  }

  /* Footer responsive */
  .footer__container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__nav {
    grid-template-columns: 1fr;
  }

  .footer__brand {
    align-items: center;
  }
}

/* ===== HOMEPAGE COMPONENTS ===== */

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
}

.section-header__link {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ridge-slate);
}

.section-header__link:hover {
  color: var(--hogback-clay);
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.category-card {
  background-color: var(--bone);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition);
}

.category-card:hover {
  transform: translateY(-4px);
}

.category-card__image {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.category-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.category-card:hover .category-card__image img {
  transform: scale(1.05);
}

.category-card__content {
  padding: var(--space-md);
}

.category-card__content h3 {
  margin-bottom: var(--space-sm);
}

.category-card__content p {
  margin-bottom: var(--space-md);
  color: var(--ridge-slate);
}

.category-card__link {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--hogback-clay);
  font-weight: 500;
}

/* Reasons Grid */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.reason {
  text-align: center;
}

.reason__icon {
  margin-bottom: var(--space-md);
}

.reason__icon .eyebrow {
  color: var(--hogback-clay);
  font-size: 1.5rem;
}

.reason h3 {
  margin-bottom: var(--space-sm);
}

/* Process Steps */
.process-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
}

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

.process-step__number {
  margin-bottom: var(--space-md);
}

.process-step h3 {
  margin-bottom: var(--space-sm);
  color: var(--bone);
}

.process-step p {
  color: var(--sandstone);
}

/* Gallery Preview */
.gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

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

.gallery-preview__item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--border-radius);
  margin-bottom: var(--space-sm);
}

.gallery-preview__caption {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ridge-slate);
  margin: 0;
}

/* Final CTA */
.final-cta {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.final-cta__logo {
  margin-bottom: var(--space-md);
  filter: brightness(0) invert(1); /* Make logo white on dark background */
}

.final-cta h2 {
  margin-bottom: var(--space-sm);
  color: var(--bone);
}

.final-cta p {
  margin-bottom: var(--space-lg);
  color: var(--sandstone);
  font-size: 1.125rem;
}

/* ===== FINISHES BROWSER STYLES ===== */
.finishes-browser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.finishes-browser__controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.finishes-browser__section-title {
  margin-bottom: var(--space-md);
  font-size: var(--text-heading);
}

.finishes-browser__styles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.style-button {
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--sandstone);
  background: transparent;
  color: var(--walnut);
  font-family: var(--font-body);
  font-weight: 500;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
}

.style-button:hover,
.style-button:focus {
  border-color: var(--hogback-clay);
  color: var(--hogback-clay);
}

.style-button.is-selected {
  background-color: var(--hogback-clay);
  color: var(--bone);
  border-color: var(--hogback-clay);
}

.finishes-browser__category {
  margin-bottom: var(--space-md);
}

.finishes-browser__category-title {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ridge-slate);
  margin-bottom: var(--space-sm);
}

.finishes-browser__swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
}

.finish-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border: 2px solid transparent;
  background: transparent;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
}

.finish-button:hover,
.finish-button:focus {
  border-color: var(--sandstone);
}

.finish-button.is-selected {
  border-color: var(--hogback-clay);
}

.finish-button__swatch {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--bone);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.finish-button__name {
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  color: var(--walnut);
}

.finishes-browser__preview {
  position: sticky;
  top: 120px; /* Below sticky header */
}

.finishes-browser__preview-container {
  background-color: var(--bone);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.finishes-browser__preview-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.finishes-browser__preview-caption {
  padding: var(--space-md);
}

.finishes-browser__preview-name {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.finishes-browser__preview-description {
  color: var(--ridge-slate);
  margin: 0;
}

.finishes-browser__error {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-xl);
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--border-radius);
  color: #dc2626;
}

/* Form Styles */
.form {
  max-width: 600px;
  margin: 0 auto;
}

.form-field {
  margin-bottom: var(--space-md);
}

.form-field label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--walnut);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: var(--space-sm);
  border: 2px solid var(--sandstone);
  border-radius: var(--border-radius);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--hogback-clay);
}

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

.field--error input,
.field--error select,
.field--error textarea {
  border-color: #dc2626;
}

.field-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: var(--space-xs);
}

.form-field--required label::after {
  content: " *";
  color: #dc2626;
}

.form-field--honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.turnstile-container {
  margin: var(--space-md) 0;
}

/* Fieldsets */
fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-lg) 0;
}

legend {
  font-family: var(--font-spec);
  font-size: var(--text-spec);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ridge-slate);
  margin-bottom: var(--space-md);
  padding: 0;
}

.form-field__note {
  font-size: 0.875rem;
  color: var(--ridge-slate);
  font-weight: normal;
}

.form-actions {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--sandstone);
}

.form-note {
  margin-top: var(--space-sm);
  font-size: 0.9rem;
  color: var(--ridge-slate);
}

/* Thank You Page */
.thank-you {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: center;
  text-align: center;
}

.thank-you__message {
  font-size: 1.125rem;
  color: var(--ridge-slate);
  margin-bottom: var(--space-lg);
}

.thank-you__contact {
  background-color: var(--sandstone);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--space-lg);
}

.thank-you__contact p {
  margin-bottom: var(--space-xs);
}

.thank-you__contact p:last-child {
  margin-bottom: 0;
}

.thank-you__actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.thank-you__image {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: var(--border-radius);
}

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

/* Next Steps */
.next-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.next-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-md);
  align-items: start;
}

.next-step__number .eyebrow {
  color: var(--hogback-clay);
  font-weight: 600;
}

.next-step h3 {
  margin-bottom: var(--space-sm);
}

.next-steps-note {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid var(--sandstone);
}

/* Inspiration Grid */
.inspiration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.inspiration-card {
  text-align: center;
  padding: var(--space-md);
}

.inspiration-card h3 {
  color: var(--bone);
  margin-bottom: var(--space-sm);
}

.inspiration-card p {
  color: var(--sandstone);
  margin-bottom: var(--space-md);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .thank-you {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .thank-you__actions {
    flex-direction: column;
    align-items: center;
  }
  
  .next-step {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* 404 Error Page */
.error-page {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.error-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
}

.helpful-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
}

.helpful-link {
  display: block;
  padding: var(--space-md);
  border: 2px solid var(--sandstone);
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.helpful-link:hover,
.helpful-link:focus {
  border-color: var(--hogback-clay);
  transform: translateY(-2px);
}

.helpful-link h3 {
  color: var(--walnut);
  margin-bottom: var(--space-xs);
}

.helpful-link p {
  color: var(--ridge-slate);
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .error-actions {
    flex-direction: column;
    align-items: center;
  }

/* ===== ACCESSIBILITY & FOCUS STATES ===== */
:focus {
  outline: 2px solid var(--hogback-clay);
  outline-offset: 2px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  :root {
    --walnut: #000000;
    --bone: #ffffff;
  }
}