/* ============================================================
   main.css — Minterra Design Studio
   Contains: variables, reset, typography, nav, footer, utils
   ============================================================ */


/* ============================================================
   1. GOOGLE FONTS IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&display=swap');


/* ============================================================
   2. DESIGN TOKENS (CSS Custom Properties)
   Change values here to update the whole site.
   ============================================================ */
:root {

  /* --- Color Palette — Finalized Brand Colors --- */
  --color-primary:      #364330;   /* FOREST GREEN — brand primary */
  --color-primary-dark: #243020;   /* Darker Forest Green — footer, deep elements */
  --color-accent:       #C8A96E;   /* Warm Brass — accent, highlights, buttons */
  --color-accent-dark:  #a88b52;   /* Dark Brass — hover states */
  --color-bg:           #F8F8F5;   /* IVORY — main page background */
  --color-surface:      #EDEEE9;   /* Light Ivory-Sage tint — alternate section bg */
  --color-text:         #1C1C1C;   /* Near Black — body text */
  --color-text-muted:   #6E7866;   /* Muted Forest-tone grey — captions, meta */
  --color-border:       #D3D5CE;   /* Sage-tinted subtle border */
  --color-white:        #FFFFFF;

  /* --- Typography — Montserrat throughout --- */
  --font-display: 'Montserrat', sans-serif;   /* Headings, display text */
  --font-body:    'Montserrat', sans-serif;   /* Body copy, nav, UI labels */

  /* --- Type Scale --- */
  --text-xs:   0.75rem;    /* 12px — captions, eyebrows */
  --text-sm:   0.875rem;   /* 14px — small labels */
  --text-base: 1rem;       /* 16px — body copy */
  --text-lg:   1.125rem;   /* 18px — large body */
  --text-xl:   1.375rem;   /* 22px — lead text */
  --text-2xl:  1.75rem;    /* 28px — small headings */
  --text-3xl:  2.25rem;    /* 36px — section headings */
  --text-4xl:  3rem;       /* 48px — page titles */
  --text-5xl:  4rem;       /* 64px — display headings */
  --text-hero: 6.5rem;     /* 104px — hero headline */

  /* --- Line Heights --- */
  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  /* --- Letter Spacing --- */
  --tracking-tight:  -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.08em;
  --tracking-wider:   0.15em;

  /* --- Spacing Scale --- */
  --sp-1:  0.25rem;   /* 4px */
  --sp-2:  0.5rem;    /* 8px */
  --sp-3:  0.75rem;   /* 12px */
  --sp-4:  1rem;      /* 16px */
  --sp-5:  1.25rem;   /* 20px */
  --sp-6:  1.5rem;    /* 24px */
  --sp-8:  2rem;      /* 32px */
  --sp-10: 2.5rem;    /* 40px */
  --sp-12: 3rem;      /* 48px */
  --sp-16: 4rem;      /* 64px */
  --sp-20: 5rem;      /* 80px */
  --sp-24: 6rem;      /* 96px */
  --sp-32: 8rem;      /* 128px */

  /* --- Layout --- */
  --container-max:     1240px;
  --container-padding: clamp(1.25rem, 5vw, 2.5rem);
  --section-padding:   clamp(4rem, 8vw, 7rem);

  /* --- Nav --- */
  --nav-height: 5rem;

  /* --- Transitions --- */
  --ease-fast:   150ms ease;
  --ease-base:   280ms ease;
  --ease-slow:   500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* --- Shadows --- */
  --shadow-sm:  0 1px 4px rgba(27, 58, 45, 0.08);
  --shadow-md:  0 4px 16px rgba(27, 58, 45, 0.12);
  --shadow-lg:  0 12px 40px rgba(27, 58, 45, 0.16);

  /* --- Border Radius --- */
  --radius-sm:  2px;
  --radius-md:  4px;
  --radius-lg:  8px;
}


/* ============================================================
   3. CSS RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Remove default focus ring and use custom */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================================
   4. GLOBAL TYPOGRAPHY
   ============================================================ */

/* Display headings use Cormorant Garamond */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(var(--text-4xl), 7vw, var(--text-hero)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-loose);
  color: var(--color-text-muted);
  max-width: 65ch; /* Optimal reading line length */
}

/* Eyebrow — small caps label above headings */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-4);
}

/* Lead paragraph — slightly larger intro text */
.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-loose);
  color: var(--color-text-muted);
  max-width: 60ch;
}


/* ============================================================
   5. LAYOUT UTILITIES
   ============================================================ */

/* Centered constrained container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Standard section vertical padding */
.section {
  padding-top: var(--section-padding);
  padding-bottom: var(--section-padding);
}

/* Alternate background section */
.section--surface {
  background-color: var(--color-surface);
}

/* Dark (primary) background section */
.section--dark {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark p {
  color: var(--color-white);
}

.section--dark p {
  opacity: 0.8;
}

/* Horizontal divider line */
.divider {
  width: 100%;
  height: 1px;
  background-color: var(--color-border);
  border: none;
  margin: 0;
}

/* Thin decorative accent line */
.accent-line {
  display: block;
  width: 3rem;
  height: 2px;
  background-color: var(--color-accent);
  margin-bottom: var(--sp-6);
}


/* ============================================================
   6. NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  transition: background-color var(--ease-base), box-shadow var(--ease-base);
}

/* Default: transparent over hero */
.nav--transparent {
  background-color: transparent;
}

/* After scrolling: solid background */
.nav--scrolled {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

/* On non-hero pages: always solid */
.nav--solid {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.nav__container {
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
}

/* Logo */
.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
  text-decoration: none;
}

.nav__logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  /* background-color: var(--color-accent); */
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
}

.nav__logo-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-primary);
  transition: color var(--ease-fast);
}

/* Transparent nav: logo text is white */
.nav--transparent .nav__logo-text {
  color: var(--color-white);
}

/* Nav links */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav__links a {
  font-size: var(--text-sm);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  color: var(--color-text);
  transition: color var(--ease-fast);
  position: relative;
}

/* Underline animation on hover */
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--ease-base);
}

.nav__links a:hover { color: var(--color-primary); }
.nav__links a:hover::after { width: 100%; }
.nav__links a.active::after { width: 100%; }

/* Transparent nav: links are white */
.nav--transparent .nav__links a {
  color: rgba(255, 255, 255, 0.85);
}
.nav--transparent .nav__links a:hover {
  color: var(--color-white);
}

/* Contact CTA button in nav */
.nav__cta {
  padding: var(--sp-3) var(--sp-6) !important;
  background-color: var(--color-accent) !important;
  color: var(--color-primary) !important;
  font-weight: 500 !important;
  border-radius: var(--radius-sm);
  transition: background-color var(--ease-fast), transform var(--ease-fast) !important;
}
.nav__cta::after { display: none !important; } /* No underline on CTA */
.nav__cta:hover {
  background-color: var(--color-accent-dark) !important;
  transform: translateY(-1px);
}

/* Hamburger button (mobile) */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--color-text);
  transition: transform var(--ease-base), opacity var(--ease-base);
}

/* Transparent nav: hamburger lines white */
.nav--transparent .nav__hamburger span {
  background-color: var(--color-white);
}

/* Animated hamburger → X */
.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav__mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background-color: var(--color-primary);
  z-index: 99;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--sp-8);
}

.nav__mobile-menu.is-open {
  display: flex;
}

.nav__mobile-menu a {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--color-white);
  letter-spacing: var(--tracking-tight);
  transition: color var(--ease-fast);
}

.nav__mobile-menu a:hover {
  color: var(--color-accent);
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
}


/* ============================================================
   7. FOOTER
   ============================================================ */
.footer {
  background-color: var(--color-primary-dark); /* Darker than CTA's --color-primary so they don't blend */
  color: var(--color-white);
  padding-top: var(--sp-20);
}

.footer__main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding) var(--sp-16);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--sp-12);
}

/* Footer brand column */
.footer__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  color: var(--color-white);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--sp-4);
}

.footer__tagline {
  font-size: var(--text-sm);
  line-height: var(--leading-loose);
  color: rgba(255, 255, 255, 0.55);
  max-width: 24ch;
}

.footer__social {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-8);
}

.footer__social-link {
  display: inline-block;
  opacity: 0.65;
  transition: opacity var(--ease-fast), transform var(--ease-fast);
}

.footer__social-link img {
  width: 2.25rem;
  height: 2.25rem;
  display: block;
}

.footer__social-link:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* Footer link columns */
.footer__col-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-6);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer__col ul li a,
.footer__col ul li span {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--ease-fast);
  line-height: var(--leading-normal);
}

.footer__col ul li a:hover {
  color: var(--color-white);
}

/* Footer bottom bar */
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--sp-6) var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
}

.footer__bottom p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.35);
  max-width: none;
}

/* Footer responsive */
@media (max-width: 1024px) {
  .footer__main {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-10);
  }
}

@media (max-width: 600px) {
  .footer__main {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}


/* ============================================================
   8. SCROLL REVEAL ANIMATION
   Elements with .reveal fade up into view when scrolled into viewport.
   JS (main.js) adds .is-visible to trigger the animation.
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children: .reveal-group > .reveal-item */
.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--ease-slow), transform var(--ease-slow);
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.reveal-item:nth-child(1) { transition-delay: 0ms; }
.reveal-item:nth-child(2) { transition-delay: 80ms; }
.reveal-item:nth-child(3) { transition-delay: 160ms; }
.reveal-item:nth-child(4) { transition-delay: 240ms; }
.reveal-item:nth-child(5) { transition-delay: 320ms; }
.reveal-item:nth-child(6) { transition-delay: 400ms; }


/* ============================================================
   9. PAGE HEADER (non-home pages)
   Short banner at top of inner pages.
   ============================================================ */
.page-header {
  padding-top: calc(var(--nav-height) + var(--sp-16));
  padding-bottom: var(--sp-16);
  background-color: var(--color-primary);
  overflow: hidden;
  position: relative;
}

.page-header__container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  position: relative;
  z-index: 1;
}

.page-header__eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-4);
}

.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 6vw, var(--text-5xl));
  font-weight: 300;
  color: var(--color-white);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

/* Large watermark numeral behind the page title */
.page-header__bg-text {
  position: absolute;
  right: var(--container-padding);
  bottom: -0.2em;
  font-family: var(--font-display);
  font-size: clamp(8rem, 18vw, 18rem);
  font-weight: 300;
  color: rgba(255, 255, 255, 0.04);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.05em;
}
