/* Shared quality, contrast, accessibility, and responsive layout layer */
:root {
  --ux-focus: #6f4d24;
  --ux-focus-ring: rgba(111, 77, 36, 0.25);
  --ux-shadow: 0 18px 45px rgba(23, 23, 23, 0.09);
  --ux-body: #3f3a34;
  --ux-surface: #ffffff;
  --ux-border: #cfc3b2;
}

/* Global Accessibility & Page Offsets */
html {
  scroll-padding-top: 7rem;
}

body {
  text-rendering: optimizeLegibility;
  color: var(--ux-body);
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--ux-focus);
  outline-offset: 4px;
}

/* Skip Navigation Link */
.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 1rem;
  z-index: 100;
  padding: 0.7rem 1rem;
  background-color: #171717;
  color: #ffffff;
  border-radius: 4px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Header Component */
.site-header {
  box-shadow: 0 8px 24px rgba(23, 23, 23, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.site-header a {
  transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.site-header nav a[aria-current="page"] {
  color: var(--ux-focus);
  font-weight: 600;
}

/* Common Interactive Controls */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1.1rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(23, 23, 23, 0.12);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

/* Mobile Menu Toggle & Overlay Styling */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #171717;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 6rem 2rem 2rem;
  background-color: var(--ux-surface);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Cards & Surface Micro-interactions */
:is(.card, .tool-card) {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

:is(.card, .tool-card):hover {
  transform: translateY(-4px);
  box-shadow: var(--ux-shadow);
}

/* Page Spacing & Typography Rules */
.page-hero {
  padding-top: clamp(7rem, 13vw, 10rem);
}

.section-head p {
  max-width: 65ch;
}

/* Form Controls Styling */
:is(input, select, textarea) {
  border: 1px solid var(--ux-border);
  border-radius: 6px;
  background-color: var(--ux-surface);
  color: #27231f;
}

:is(input, textarea)::placeholder {
  color: #71695f;
  opacity: 1;
}

:is(input, select, textarea):focus-visible {
  border-color: var(--ux-focus);
  box-shadow: 0 0 0 3px var(--ux-focus-ring);
  outline: none;
}

/* Tablet Layout Adjustments */
@media (max-width: 900px) and (min-width: 681px) {
  .site-header {
    top: 10px;
    width: calc(100% - 24px);
    padding: 9px 12px;
    gap: 12px;
  }

  .site-header .brand-lockup img {
    width: 150px;
  }

  .site-header nav {
    gap: 14px;
  }

  .site-header nav a {
    font-size: 12px;
  }

  .site-header > .button {
    padding: 0.6rem 0.75rem;
    font-size: 12px;
  }
}

/* Mobile Layout Adjustments */
@media (max-width: 680px) {
  .site-header {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 12px auto 0;
    border-radius: 12px;
  }

  .site-header nav {
    display: none;
  }

  .site-header > .button {
    margin-left: auto;
  }

  .page-hero {
    padding-top: clamp(4rem, 12vw, 6rem);
  }
}

/* Accessibility: Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
