/*
  ============================================================
  AVERMONTE — Shared Stylesheet
  Replace "AVERMONTE" with your chosen company name sitewide.
  ============================================================
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* ── Light mode (default) ─────────────────────────── */
  --bg:           #F5F2ED;
  --bg-tint:      #EBE6DC;
  --text:         #1A1714;
  --text-muted:   #6E6560;   /* AA-compliant on --bg: 4.93:1 */
  --rule:         #D6CEC3;
  --accent:       #8B7355;
  --white:        #FDFCFA;

  /* ── Brand extended palette ──────────────────────── */
  --green:        #004225;   /* British Racing Green */
  --gold:         #C5A028;   /* Matt Gold */

  /* ── Typography ──────────────────────────────────── */
  --serif:        'Cormorant', Georgia, serif;
  --sans:         'Inter', system-ui, -apple-system, sans-serif;

  /* ── Motion ──────────────────────────────────────── */
  --ease:         0.4s ease;
  --ease-fast:    0.18s ease;
  --ease-slow:    0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* ── Layout ──────────────────────────────────────── */
  --max-w:        1240px;
  --nav-h:        76px;
}

/* ── Dark mode (inverted primary palette) ────────────── */
html.dark {
  --bg:           #1A1714;
  --bg-tint:      #252018;
  --text:         #F5F2ED;
  --text-muted:   #A09488;
  --rule:         #3A342E;
  --accent:       #8B7355;
  --white:        #FDFCFA;
}

/* ── Accessibility toggle button ────────────────────── */
.a11y-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 600;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), border-color var(--ease), transform var(--ease-fast);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.a11y-toggle:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.a11y-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.a11y-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  transition: stroke var(--ease);
}

.a11y-toggle:hover svg { stroke: var(--accent); }

html.dark .a11y-toggle {
  background: var(--bg-tint);
  border-color: var(--rule);
}

/* ── Focus styles (keyboard navigation) ─────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Skip to content ─────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  background: var(--text);
  color: var(--white);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 10px 20px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 64px;
}

@media (max-width: 900px) {
  .wrap { padding: 0 32px; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 20px; }
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background var(--ease), border-color var(--ease), backdrop-filter var(--ease);
}

/* Default: transparent over images — white text */
.site-nav .nav-logo,
.site-nav .nav-list a {
  color: var(--white);
}

.site-nav .nav-list a.current {
  color: var(--white);
  opacity: 0.45;
}

.site-nav .nav-burger span {
  background: var(--white);
}

/* Scrolled: solid background */
.site-nav.stuck {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.site-nav.stuck .nav-logo,
.site-nav.stuck .nav-list a {
  color: var(--text);
}

.site-nav.stuck .nav-list a.current {
  color: var(--text);
  opacity: 0.40;
}

.site-nav.stuck .nav-burger span {
  background: var(--text);
}

/* Light nav variant (pages starting on image hero) */
.site-nav.light-nav .nav-logo,
.site-nav.light-nav .nav-list a {
  color: var(--white);
}

.site-nav.light-nav.stuck .nav-logo,
.site-nav.light-nav.stuck .nav-list a {
  color: var(--text);
}

.site-nav.light-nav.stuck .nav-list a.current {
  color: var(--text);
  opacity: 0.40;
}

.site-nav.light-nav.stuck .nav-burger span {
  background: var(--text);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color var(--ease), opacity var(--ease);
}

.nav-logo:hover { opacity: 0.65; }

.nav-list {
  display: flex;
  gap: 44px;
  list-style: none;
}

.nav-list a {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: opacity var(--ease-fast), color var(--ease);
}

.nav-list a:hover { opacity: 0.55; }

.nav-list a.current { opacity: 0.40; }

.nav-list .nav-cta a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  opacity: 1 !important;
}

/* Burger */
.nav-burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 1px;
  transition: transform var(--ease), opacity var(--ease-fast), background var(--ease);
}

.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-burger { display: flex; }

  .nav-logo { font-size: 17px; }

  .nav-list {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--rule);
  }

  .nav-list.open { display: flex; }

  .nav-list li { padding: 0; }

  .nav-list a {
    display: block;
    padding: 14px 24px;
    color: var(--text) !important;
    opacity: 1 !important;
    font-size: 11px;
  }

  .nav-list a.current { opacity: 0.40 !important; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-copy {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-white {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}

.label-accent {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1.05;
}

.d-hero  { font-size: clamp(46px, 7.5vw, 100px); }
.d-large { font-size: clamp(38px, 5.5vw, 72px); }
.d-mid   { font-size: clamp(30px, 3.8vw, 52px); }
.d-small { font-size: clamp(24px, 2.8vw, 38px); }

.body {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.9;
  color: var(--text-muted);
}

.body-large {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-muted);
}

/* ============================================================
   BUTTONS & LINKS
   ============================================================ */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
  transition: opacity var(--ease-fast), color var(--ease);
}

.text-link .arr {
  transition: transform var(--ease);
  display: inline-block;
}

.text-link:hover .arr { transform: translateX(6px); }

.text-link-white {
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.4);
}

.text-link-white:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.75);
  opacity: 1;
}

.text-link-dark {
  color: var(--text);
  border-color: var(--rule);
}

.text-link-dark:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

.d1 { transition-delay: 0.10s; }
.d2 { transition-delay: 0.22s; }
.d3 { transition-delay: 0.34s; }
.d4 { transition-delay: 0.46s; }

/* Fade only (no translate) variant */
.reveal-fade {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.reveal-fade.in { opacity: 1; }

/* ============================================================
   HORIZONTAL RULE
   ============================================================ */
hr.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ============================================================
   TEAM PORTRAIT WRAPPER
   ============================================================ */
.member-portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin-bottom: 32px;
  background: var(--bg-tint);
}

.member-portrait svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field-input,
.field-select,
.field-textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 10px 0 13px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
  outline: none;
  width: 100%;
  border-radius: 0;
  -webkit-appearance: none;
  transition: border-color var(--ease-fast);
}

.field-input::placeholder,
.field-textarea::placeholder { color: var(--rule); }

.field-input:focus,
.field-select:focus,
.field-textarea:focus { border-bottom-color: var(--accent); }

.field-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='none' stroke='%237A7269' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  padding-right: 22px;
}

.field-select option { background: var(--bg); }

.field-textarea {
  resize: none;
  min-height: 100px;
  line-height: 1.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--text);
  border: none;
  padding: 18px 36px;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease-fast);
}

.btn .arr {
  transition: transform var(--ease);
  display: inline-block;
}

.btn:hover { background: var(--accent); }
.btn:hover .arr { transform: translateX(5px); }

.btn.sent {
  background: #5A6B46;
  cursor: default;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-xs { margin-top: 8px; }
.mt-s  { margin-top: 14px; }
.mt-m  { margin-top: 28px; }
.mt-l  { margin-top: 44px; }
.mt-xl { margin-top: 64px; }
.mt-2xl{ margin-top: 96px; }

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

/* Thin divider line with padding */
.section-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}
