/* ========================================================================== */
/* Variables                                                                 */
/* ========================================================================== */

:root {
  /* Color Palette */
  --color-bg: #f7f4ef; /* warm, soft background */
  --color-surface: #ffffff;
  --color-text: #1f2421; /* deep, natural dark */
  --color-text-muted: #6b746e;
  --color-primary: #2f6b4f; /* deep plant green */
  --color-primary-soft: #5d8f6f; /* softer accent green */
  --color-success: #3f8f5c;
  --color-warning: #c58b2b;
  --color-danger: #b2483b;

  /* Neutral Grays / Stones */
  --color-gray-50: #f7f5f2;
  --color-gray-100: #ece7df;
  --color-gray-200: #ded6cb;
  --color-gray-300: #c8bfb1;
  --color-gray-400: #a79f93;
  --color-gray-500: #847c72;
  --color-gray-600: #68625a;
  --color-gray-700: #524c46;
  --color-gray-800: #3c3732;
  --color-gray-900: #26221f;

  /* Semantic Backgrounds */
  --color-bg-elevated: var(--color-surface);
  --color-border-subtle: rgba(24, 32, 22, 0.07);

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", 
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Cormorant Garamond", "Playfair Display", "Georgia", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 
    "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 1rem;    /* 16px */
  --font-size-md: 1.0625rem; /* 17px */
  --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 */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing Scale (px) */
  --space-0: 0;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-80: 80px;
  --space-96: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows (soft, natural) */
  --shadow-sm: 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 16px 32px rgba(18, 34, 25, 0.12);
  --shadow-lg: 0 24px 60px rgba(15, 26, 19, 0.18);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 320ms ease-out;
}

/* Reduced motion: limit transitions/animations */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-normal: 0ms;
    --transition-slow: 0ms;
  }
}

/* ========================================================================== */
/* Reset / Normalize                                                          */
/* ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
}

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

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

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

img {
  height: auto;
}

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

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

button:disabled,
[disabled] {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

/* ========================================================================== */
/* Base Styles                                                                */
/* ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 60vh;
}

/* Headings - elegant, slightly serif accent for hero/elevated titles */

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0.02em;
}

h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(var(--font-size-3xl), 4vw, var(--font-size-5xl));
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-24);
}

h2 {
  font-size: clamp(var(--font-size-2xl), 3vw, var(--font-size-4xl));
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-20);
}

h3 {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-16);
}

h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-12);
}

h5 {
  font-size: var(--font-size-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-8);
}

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
}

p {
  margin-bottom: var(--space-16);
  color: var(--color-text);
}

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

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

strong {
  font-weight: 600;
}

/* Links */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal),
    opacity var(--transition-fast),
    text-decoration-color var(--transition-normal);
  text-decoration-color: transparent;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(47, 107, 79, 0.55);
}

a:active {
  opacity: 0.9;
}

/* Lists */

ul,
ol {
  margin-bottom: var(--space-16);
  color: var(--color-text);
}

/* Blockquotes */

blockquote {
  margin: var(--space-24) 0;
  padding-left: var(--space-16);
  border-left: 2px solid var(--color-primary-soft);
  color: var(--color-text-muted);
  font-style: italic;
}

/* ========================================================================== */
/* Accessibility & Focus States                                               */
/* ========================================================================== */

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

:focus {
  outline: none;
}

/* Better default for keyboard focus within high-level containers */

[tabindex="-1"]:focus {
  outline: none !important;
}

/* ========================================================================== */
/* Utilities                                                                  */
/* ========================================================================== */

/* Layout */

.container {
  width: 100%;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

@media (min-width: 1200px) {
  .container {
    max-width: 1200px;
  }
}

.section {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
}

.section--tight {
  padding-top: var(--space-40);
  padding-bottom: var(--space-40);
}

/* Flex Helpers */

.flex {
  display: flex;
}

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

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

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

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

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

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

.justify-around {
  justify-content: space-around;
}

.gap-16 {
  gap: var(--space-16);
}

.gap-24 {
  gap: var(--space-24);
}

.gap-32 {
  gap: var(--space-32);
}

/* Grid Helpers */

.grid {
  display: grid;
}

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

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

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

/* Screen Reader Only */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Text Utilities */

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

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

.text-muted {
  color: var(--color-text-muted);
}

/* Spacing Utilities (minimal, for layout tweaks) */

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

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

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

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

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

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

/* ========================================================================== */
/* Components                                                                 */
/* ========================================================================== */

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    opacity var(--transition-fast);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: #275843;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: rgba(47, 107, 79, 0.35);
}

.btn-outline:hover {
  background-color: rgba(47, 107, 79, 0.06);
  border-color: rgba(47, 107, 79, 0.6);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
}

.btn-ghost:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  box-shadow: none;
  pointer-events: none;
}

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

/* Form Elements */

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-size-base);
  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);
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  outline: none;
  border-color: rgba(47, 107, 79, 0.8);
  box-shadow: 0 0 0 1px rgba(47, 107, 79, 0.32);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
}

.label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-4);
}

.field-group {
  margin-bottom: var(--space-16);
}

.field-hint {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.field-error {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}

/* Card */

.card {
  position: relative;
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.card--soft {
  background: linear-gradient(135deg, #f7f5f1 0%, #ffffff 100%);
}

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

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-8);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-body {
  font-size: var(--font-size-base);
}

/* Image Styles - soft radii for plant photography */

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

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

/* ========================================================================== */
/* Motion Preferences                                                         */
/* ========================================================================== */

@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;
  }
}
