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

:root {
  /* Color Palette - Nature inspired */
  --color-background: #f5f7f4;
  --color-surface: #ffffff;
  --color-surface-soft: #f0f3ef;
  --color-text: #1f2a24;
  --color-text-muted: #5c6b61;

  --color-primary: #2f7d4a; /* deep leaf green */
  --color-primary-soft: #e0f1e6;
  --color-primary-strong: #205737;

  --color-success: #2f7d4a;
  --color-warning: #c5890a;
  --color-danger: #b53a3a;

  --gray-50: #f7faf8;
  --gray-100: #edf1ee;
  --gray-200: #d8dfda;
  --gray-300: #c1ccc4;
  --gray-400: #9aa79d;
  --gray-500: #748377;
  --gray-600: #5b685d;
  --gray-700: #424c44;
  --gray-800: #2c332e;
  --gray-900: #181d19;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Merriweather", "Georgia", serif;
  --font-mono: "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --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 */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px converted to rem assuming 16px root) */
  --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-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows - soft and natural */
  --shadow-xs: 0 1px 2px rgba(15, 23, 18, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 18, 0.08);
  --shadow-md: 0 10px 25px rgba(15, 23, 18, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 18, 0.12);

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

  /* Layout */
  --container-max-width: 1120px;
}

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

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

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

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

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

body {
  min-height: 100vh;
}

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

img {
  height: auto;
}

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

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

ul,
ol[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Remove default link outlines but keep focus-visible */
a {
  text-decoration: none;
  color: inherit;
}

a:focus {
  outline: none;
}

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

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

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

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

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

h1 {
  font-size: clamp(2.25rem, 3vw, var(--font-size-5xl));
}

h2 {
  font-size: clamp(1.875rem, 2.5vw, var(--font-size-4xl));
}

h3 {
  font-size: clamp(1.5rem, 2vw, var(--font-size-3xl));
}

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

h5 {
  font-size: var(--font-size-xl);
}

h6 {
  font-size: var(--font-size-lg);
}

strong,
b {
  font-weight: 600;
}

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

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

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

a:hover {
  color: var(--color-primary-strong);
}

/* ========================================================================== */
/* Accessibility                                                              */
/* ========================================================================== */

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

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

/* 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;
}

/* ========================================================================== */
/* Layout & Utilities                                                         */
/* ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

/* Spacing utilities (y-axis and x-axis) */

.u-my-0 { margin-top: 0; margin-bottom: 0; }
.u-my-4 { margin-top: var(--space-4); margin-bottom: var(--space-4); }
.u-my-6 { margin-top: var(--space-6); margin-bottom: var(--space-6); }
.u-my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }

.u-py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.u-py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.u-py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }

/* Flex utilities */

.flex {
  display: flex;
}

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

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

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

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

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

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

/* Grid utilities */

.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);
  }
}

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

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

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

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

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

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: var(--space-5);
  padding-block: var(--space-2);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    border-color var(--transition-normal);
}

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

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

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

.button--ghost {
  background-color: transparent;
  color: var(--color-primary-strong);
  border-color: rgba(47, 125, 74, 0.2);
  box-shadow: none;
}

.button--ghost:hover {
  background-color: var(--color-primary-soft);
}

.button--secondary {
  background-color: #ffffff;
  color: var(--color-primary-strong);
  border-color: rgba(47, 125, 74, 0.18);
}

.button--secondary:hover {
  background-color: var(--color-surface-soft);
}

/* Inputs & form controls */

.input,
textarea,
select {
  width: 100%;
  padding-inline: var(--space-3);
  padding-block: calc(var(--space-2) + 2px);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-md);
  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(--gray-400);
}

.input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(47, 125, 74, 0.35);
}

.input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--gray-100);
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-weight: 500;
}

/* Card */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15, 23, 18, 0.03);
}

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

.card__header {
  margin-bottom: var(--space-3);
}

.card__title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-1);
}

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

.card__body {
  font-size: var(--font-size-md);
}

/* Tag / Pill - for project statuses, categories */

.tag {
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-3);
  padding-block: 0.25rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag--neutral {
  background-color: var(--gray-100);
  color: var(--gray-700);
}

.tag--success {
  background-color: #e0f3e6;
  color: var(--color-success);
}

/* Media wrappers for galleries */

.media-cover {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

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

.media-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(15, 23, 18, 0.45),
    rgba(15, 23, 18, 0.05)
  );
  pointer-events: none;
}

/* Subtle section divider utility */

.section-divider {
  border-top: 1px solid var(--gray-200);
  margin-block: var(--space-8);
}
