/* ==========================================================================
   BARE Renovations — Design Tokens & Base Styles
   ========================================================================== */

:root {
  /* Typography */
  --font-display: 'Instrument Serif', 'Georgia', serif;
  --font-body: 'Work Sans', system-ui, sans-serif;

  /* Type scale (fluid) */
  --text-xs:  clamp(0.75rem, 0.72rem + 0.13vw, 0.813rem);
  --text-sm:  clamp(0.875rem, 0.85rem + 0.13vw, 0.938rem);
  --text-base: clamp(1rem, 0.97rem + 0.16vw, 1.063rem);
  --text-lg:  clamp(1.125rem, 1.06rem + 0.31vw, 1.25rem);
  --text-xl:  clamp(1.5rem, 1.36rem + 0.7vw, 1.875rem);
  --text-2xl: clamp(2rem, 1.66rem + 1.7vw, 3rem);
  --text-3xl: clamp(2.75rem, 2.1rem + 3.25vw, 5rem);
  --text-hero: clamp(3.5rem, 2.5rem + 5vw, 7.5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Color — Stone & Brass palette (warm, refined, gallery-like) */
  --color-bg: #F5F2EC;          /* warm cream */
  --color-surface: #FBF9F4;      /* lighter cream surface */
  --color-surface-alt: #EDE8DD;  /* warm putty */
  --color-ink: #1A1814;          /* near black */
  --color-text: #2A2722;         /* primary text */
  --color-text-muted: #6E6A60;   /* secondary text */
  --color-text-faint: #A39E92;   /* tertiary text */
  --color-border: #D9D3C5;       /* warm taupe border */
  --color-border-light: #E8E2D4;
  --color-accent: #8B6F3C;       /* warm brass */
  --color-accent-hover: #6E5629;

  /* Layout */
  --container-max: 1480px;
  --container-narrow: 880px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration: 400ms;
  --duration-slow: 800ms;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(26,24,20,.04), 0 4px 12px rgba(26,24,20,.04);
  --shadow-md: 0 8px 32px rgba(26,24,20,.08);
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  font-feature-settings: 'kern', 'liga', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

img { background: var(--color-surface-alt); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button { font: inherit; cursor: pointer; }

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--color-ink);
  margin: 0;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); font-family: var(--font-body); font-weight: 500; letter-spacing: 0; }

p { margin: 0 0 1em; }

::selection { background: var(--color-accent); color: var(--color-surface); }

/* Layout primitives */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section--tight { padding-block: clamp(var(--space-12), 6vw, var(--space-20)); }

/* Eyebrow / kicker text */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-text-muted);
}

.eyebrow--accent { color: var(--color-accent); }

/* Italic display lead-in (used in hero) */
.italic-lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* Hairline rule */
.hairline {
  height: 1px;
  background: var(--color-border);
  border: 0;
  margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--color-ink);
  background: var(--color-ink);
  color: var(--color-bg);
  transition: all var(--duration) var(--ease-out);
  cursor: pointer;
}
.btn:hover {
  background: transparent;
  color: var(--color-ink);
}

.btn--ghost {
  background: transparent;
  color: var(--color-ink);
}
.btn--ghost:hover {
  background: var(--color-ink);
  color: var(--color-bg);
}

/* Underline link */
.link {
  position: relative;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration) var(--ease-out);
}
.link:hover { background-size: 0% 1px; background-position: 100% 100%; }

.link--reverse {
  background-size: 0% 1px;
  background-position: 100% 100%;
}
.link--reverse:hover { background-size: 100% 1px; background-position: 0 100%; }

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  padding: var(--space-6) 0;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: padding var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.site-header--scrolled {
  padding: var(--space-3) 0;
  border-bottom-color: var(--color-border-light);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.nav__logo {
  display: flex;
  align-items: center;
  color: var(--color-ink);
  flex-shrink: 0;
}
.nav__logo svg { height: 32px; width: auto; }

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

.nav__menu a {
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-text);
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
}
.nav__menu a::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration) var(--ease-out);
}
.nav__menu a:hover::after,
.nav__menu a.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-ink);
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-ink);
  transition: all var(--duration) var(--ease-out);
}
.nav__cta:hover { background: var(--color-ink); color: var(--color-bg); }

.nav__toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: var(--space-2);
  color: var(--color-ink);
}

@media (max-width: 880px) {
  .nav__menu, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }

  .nav__menu--open {
    display: flex;
    position: fixed;
    inset: 80px 0 0 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    background: var(--color-bg);
    padding: var(--space-12);
  }
  .nav__menu--open a { font-size: var(--text-xl); font-family: var(--font-display); text-transform: none; letter-spacing: 0; }
}

/* Footer */
.site-footer {
  background: var(--color-ink);
  color: color-mix(in srgb, var(--color-bg) 70%, transparent);
  padding-block: var(--space-24) var(--space-8);
}

.site-footer h2 {
  color: var(--color-bg);
  font-size: var(--text-3xl);
  margin-bottom: var(--space-8);
  max-width: 18ch;
}

.site-footer a { color: var(--color-bg); }

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-12);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid color-mix(in srgb, var(--color-bg) 12%, transparent);
}

@media (max-width: 880px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-8); }
  .footer__brand { grid-column: 1 / -1; }
}

.footer__col h6 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 var(--space-4);
  color: var(--color-bg);
  opacity: 0.6;
}

.footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__col li a { font-size: var(--text-sm); }
.footer__col li a:hover { color: var(--color-accent); }

.footer__brand p { font-size: var(--text-sm); max-width: 36ch; margin-bottom: var(--space-6); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-8);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__bottom-links { display: flex; gap: var(--space-6); }

/* Reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s var(--ease-out),
    transform 1.1s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* Utilities */
.flex { display: flex; }
.center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.no-scroll { overflow: hidden; }
