/* ========================================================================
   Variables
   ======================================================================== */
:root {
  /* Color Palette: warm, modern, minimalist */
  --color-background: #f5f1eb; /* warm beige */
  --color-background-alt: #ffffff;
  --color-surface: #faf7f3;

  --color-text: #2b2b2b;
  --color-text-muted: #6e6a65;

  --color-primary: #a46b44; /* warm wood-tone accent */
  --color-primary-soft: #e4c4aa;
  --color-primary-strong: #8a5737;

  --color-success: #4f7d4b;
  --color-warning: #c28a35;
  --color-danger: #b5483b;

  --color-gray-50: #f8f6f3;
  --color-gray-100: #ece7df;
  --color-gray-200: #ddd4c9;
  --color-gray-300: #c8bbad;
  --color-gray-400: #a89a8b;
  --color-gray-500: #8b7d70;
  --color-gray-600: #6f6257;
  --color-gray-700: #52473f;
  --color-gray-800: #3a312c;
  --color-gray-900: #231f1c;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-serif: "Playfair Display", "Times New Roman", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;

  /* Font sizes (desktop baseline) */
  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-md: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem; /* 36px */

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */
  --space-24: 6rem; /* 96px */

  /* Radius */
  --radius-none: 0;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows: soft, realistic, not harsh */
  --shadow-xs: 0 1px 2px rgba(15, 10, 6, 0.06);
  --shadow-sm: 0 4px 10px rgba(15, 10, 6, 0.06);
  --shadow-md: 0 10px 30px rgba(15, 10, 6, 0.08);
  --shadow-lg: 0 18px 45px rgba(15, 10, 6, 0.12);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 260ms ease-out;

  /* Layout */
  --container-max-width: 1160px;
  --border-color-subtle: rgba(63, 45, 28, 0.13);
}

/* Fluid type scale for smaller screens */
@media (max-width: 768px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-4xl: 2rem;
  }
}

/* ========================================================================
   Reset / Normalize
   ======================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ol,
ul,
dl {
  margin: 0;
}

ol,
ul {
  padding-left: 1.25rem;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  padding: 0;
}

/* Remove default focus outlines; we will restore via :focus-visible */
:focus {
  outline: none;
}

/* ========================================================================
   Base Styles
   ======================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  min-height: 60vh;
}

/* Headings: clean hierarchy with subtle spacing */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--color-gray-900);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}

h2 {
  font-size: var(--font-size-3xl);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-4);
  }

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--font-size-sm);
}

strong,
b {
  font-weight: 600;
}

/* Links: understated but clear */
a {
  color: var(--color-primary-strong);
  text-decoration: none;
  text-underline-offset: 0.18em;
  transition: color var(--transition-normal),
    text-decoration-color var(--transition-normal);
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(164, 107, 68, 0.55);
}

/* Lists & text */
ul,
ol {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color-subtle);
  margin: var(--space-6) 0;
}

/* ========================================================================
   Accessibility & Reduced Motion
   ======================================================================== */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

/* Visually hidden, but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ========================================================================
   Utilities
   ======================================================================== */
/* Layout container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1200px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-row {
  flex-direction: row;
}

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

.flex-center {
  justify-content: center;
  align-items: center;
}

.flex-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-sm {
  gap: var(--space-3);
}

.gap-md {
  gap: var(--space-4);
}

.gap-lg {
  gap: var(--space-6);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Alignment utilities */
.text-center {
  text-align: center;
}

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

.m-auto {
  margin: auto;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-md {
  margin-top: var(--space-6);
}

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

.pt-section {
  padding-top: var(--space-12);
}

.pb-section {
  padding-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .pt-section {
    padding-top: var(--space-8);
  }
  .pb-section {
    padding-bottom: var(--space-8);
  }
}

/* Elevation helpers */
.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.radius-md {
  border-radius: var(--radius-md);
}

.radius-lg {
  border-radius: var(--radius-lg);
}

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

.bg-alt {
  background-color: var(--color-background-alt);
}

/* ========================================================================
   Components
   ======================================================================== */
/* Buttons: primary, subtle, ghost */
.button,
button.button,
input[type="submit"].button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background-color: var(--color-primary-strong);
  color: #fff!important;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    border-color var(--transition-normal),
    color var(--transition-normal);
}

.button:hover,
button.button:hover,
input[type="submit"].button:hover {
  background-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.button:active,
button.button:active,
input[type="submit"].button:active {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-xs);
  transform: translateY(0);
}

.button:disabled,
button.button:disabled,
input[type="submit"].button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.button--outline {
  background-color: transparent;
  color: var(--color-primary-strong)!important;
  border-color: rgba(164, 107, 68, 0.4);
  box-shadow: none;
}

.button--outline:hover {
  background-color: rgba(164, 107, 68, 0.06);
}

.button--ghost {
  background-color: transparent;
  color: var(--color-text)!important;
  border-color: transparent;
  box-shadow: none;
}

.button--ghost:hover {
  background-color: rgba(35, 31, 28, 0.04);
}

.button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

/* Inputs & form fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="search"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(63, 45, 28, 0.15);
  background-color: #fff;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition: border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    background-color var(--transition-normal);
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(164, 107, 68, 0.4);
}

input:disabled,
select:disabled,
textarea:disabled {
  background-color: var(--color-gray-50);
  cursor: not-allowed;
  color: var(--color-text-muted);
}

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

label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: var(--font-size-sm);
  color: var(--color-gray-800);
}

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

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  margin-top: 0.25rem;
}

/* Card: for product previews, trust blocks, content tiles */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  background-color: var(--color-background-alt);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  border: 1px solid rgba(63, 45, 28, 0.06);
}

.card--soft {
  background-color: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.card-header {
  margin-bottom: var(--space-4);
}

.card-media {
  margin: -var(--space-5);
  margin-bottom: var(--space-4);
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.card-footer {
  margin-top: var(--space-4);
}

/* Tag / pill - useful for trust labels, stock info etc. */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background-color: rgba(35, 31, 28, 0.06);
  color: var(--color-gray-800);
}

.badge--success {
  background-color: rgba(79, 125, 75, 0.1);
  color: var(--color-success);
}

.badge--neutral {
  background-color: rgba(168, 154, 139, 0.16);
  color: var(--color-gray-800);
}

/* Image wrappers for photography-heavy layout */
.aspect-ratio {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.aspect-ratio--16x9 {
  padding-top: 56.25%;
}

.aspect-ratio--4x3 {
  padding-top: 75%;
}

.aspect-ratio > img,
.aspect-ratio > picture,
.aspect-ratio > video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Subtle section background bands for hierarchy */
.section {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.section--muted {
  background: linear-gradient(
    180deg,
    rgba(248, 246, 243, 1) 0%,
    rgba(242, 237, 231, 1) 100%
  );
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}
