/* ============================================================
   Ember & Oak — Base stylesheet
   Design tokens · reset · typography · core UI · utilities
   ============================================================ */

/* ---------- 1. Design tokens ---------- */
:root {
  /* palette — warm espresso, cream, copper */
  --espresso:      #191209;
  --espresso-2:    #221811;
  --espresso-3:    #2c2015;
  --cream:         #f3ecdf;
  --cream-2:       #faf6ee;
  --cream-3:       #eae0cd;
  --copper:        #b57b4b;
  --copper-soft:   #d9a97a;
  --copper-deep:   #8a5a30;
  --ink:           #241b11;
  --muted:         #6f6150;
  --line:          rgba(36, 27, 17, 0.12);
  --line-strong:   rgba(36, 27, 17, 0.24);
  --line-light:    rgba(244, 237, 225, 0.14);
  --line-light-2:  rgba(244, 237, 225, 0.30);

  /* typography */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* layout */
  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius-s: 8px;
  --radius:   16px;
  --radius-l: 26px;

  /* motion */
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-soft:  cubic-bezier(0.4, 0, 0.2, 1);
  --dur:        0.55s;

  /* elevation */
  --shadow-1: 0 1px 2px rgba(25, 18, 9, 0.05), 0 14px 34px -20px rgba(25, 18, 9, 0.25);
  --shadow-2: 0 30px 70px -28px rgba(25, 18, 9, 0.42);
  --shadow-copper: 0 14px 34px -16px rgba(181, 123, 75, 0.55);
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

ul[class],
ol[class] {
  list-style: none;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--espresso);
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection {
  background: var(--copper);
  color: var(--cream-2);
}

/* slim, on-brand scrollbar */
html {
  scrollbar-color: var(--copper) var(--cream-3);
}
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--cream-3); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--copper), var(--copper-deep));
  border-radius: 8px;
  border: 2px solid var(--cream-3);
}

:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. Film-grain overlay ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4000;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 4. Layout primitives ---------- */
.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.section {
  position: relative;
  padding-block: clamp(88px, 11vw, 150px);
}

.section--tight {
  padding-block: clamp(64px, 8vw, 104px);
}

.section--dark {
  background: var(--espresso);
  color: var(--cream);
}

.section--dark h2,
.section--dark h3 {
  color: var(--cream-2);
}

.section--dark .lead {
  color: rgba(244, 237, 225, 0.72);
}

/* section heading block */
.section-head {
  max-width: 680px;
  margin-bottom: clamp(46px, 6vw, 76px);
}

.section-head h2 {
  font-size: clamp(2.05rem, 3.8vw, 3.25rem);
  margin: 20px 0 18px;
}

.section-head .lead {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--copper-deep);
}

.eyebrow::before {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section-head--center .eyebrow::after {
  content: "";
  width: 36px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section--dark .eyebrow { color: var(--copper-soft); }

/* ---------- 5. Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.btn .btn__arrow {
  transition: transform 0.35s var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(4px);
}

.btn--copper {
  background: linear-gradient(135deg, var(--copper) 0%, #a4683a 100%);
  color: var(--cream-2);
  box-shadow: var(--shadow-copper);
}

.btn--copper:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -16px rgba(181, 123, 75, 0.7);
}

.btn--espresso {
  background: var(--espresso);
  color: var(--cream-2);
  box-shadow: var(--shadow-1);
}

.btn--espresso:hover {
  transform: translateY(-2px);
  background: var(--espresso-3);
  box-shadow: var(--shadow-2);
}

.btn--cream {
  background: var(--cream-2);
  color: var(--espresso);
  box-shadow: var(--shadow-1);
}

.btn--cream:hover {
  transform: translateY(-2px);
  background: #fffdf8;
  box-shadow: var(--shadow-2);
}

.btn--outline {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--outline:hover {
  transform: translateY(-2px);
  border-color: var(--copper);
  color: var(--copper-deep);
}

.btn--ghost-light {
  background: rgba(250, 246, 238, 0.04);
  border-color: var(--line-light-2);
  color: var(--cream-2);
  backdrop-filter: blur(6px);
}

.btn--ghost-light:hover {
  transform: translateY(-2px);
  background: rgba(250, 246, 238, 0.1);
  border-color: rgba(250, 246, 238, 0.5);
}

.btn--lg { padding: 18px 36px; font-size: 1rem; }
.btn--sm { padding: 11px 22px; font-size: 0.85rem; }
.btn--block { width: 100%; }

/* ---------- 6. Accessibility helpers ---------- */
.skip-link {
  position: fixed;
  top: -80px;
  left: 24px;
  z-index: 10000;
  padding: 13px 24px;
  background: var(--espresso);
  color: var(--cream-2);
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: top 0.3s var(--ease);
}

.skip-link:focus { top: 0; }

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

/* ---------- 7. Scroll-reveal system ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal="fade"] {
  transform: none;
}

/* ---------- 8. Shared keyframes ---------- */
@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scrollHint {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(9px); opacity: 0.35; }
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ---------- 9. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
