/* Design tokens */
:root {
  --c-brand: #2f4f4f;
  --c-brand-dark: #1e3535;
  --c-brand-deep: #142424;
  --c-brand-soft: #e8efee;
  --c-accent: #c9a24b;
  --c-accent-dark: #8a6a1f;
  --c-text: #1d2a2a;
  --c-muted: #4a5a5a;
  --c-line: #d5dfde;
  --c-bg: #ffffff;
  --c-bg-alt: #f4f7f6;
  --c-error: #b42318;
  --c-success: #1f6b3a;

  --f-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --fs-sm: clamp(0.875rem, 0.84rem + 0.15vw, 0.95rem);
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.35rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.55rem);
  --fs-h2: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --fs-h1: clamp(2.1rem, 1.4rem + 3.6vw, 4.5rem);

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  --space-xl: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(20, 36, 36, 0.06), 0 2px 8px rgba(20, 36, 36, 0.06);
  --shadow: 0 10px 30px rgba(20, 36, 36, 0.12);
  --shadow-lg: 0 20px 45px rgba(20, 36, 36, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --header-h: 72px;
  --container: 1200px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-wrap: break-word;
}

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

h1, h2, h3, h4 {
  font-family: var(--f-head);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--c-brand-deep);
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--space-md); }

a { color: var(--c-brand); text-underline-offset: 3px; }
a:hover { color: var(--c-brand-dark); }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--c-brand-deep);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; color: #fff; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 var(--fs-base)/1.2 var(--f-body);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--c-brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--c-brand-dark); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.75); }
.btn-ghost:hover { background: #fff; color: var(--c-brand-deep); }
.btn-block { width: 100%; }
.hero .btn-primary { background: var(--c-accent); color: var(--c-brand-deep); }
.hero .btn-primary:hover { background: #dcb965; color: var(--c-brand-deep); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(47, 79, 79, 0.12);
  transition: box-shadow 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); background: rgba(255, 255, 255, 0.94); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 48px;
  min-width: 0;
  text-decoration: none;
  color: var(--c-brand-deep);
}
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--c-brand), var(--c-brand-deep));
  color: var(--c-accent);
  font: 700 1.5rem/1 var(--f-head);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-name { font: 700 1.3rem/1.1 var(--f-head); letter-spacing: 0.02em; }
.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-muted);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px; height: 48px;
  flex: none;
  padding: 0;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 22px; height: 2px;
  background: var(--c-brand-deep);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
  box-shadow: var(--shadow);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}
.primary-nav.is-open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0.75rem clamp(1rem, 4vw, 2rem) 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
  position: relative;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-link:hover { background: var(--c-brand-soft); color: var(--c-brand-deep); }
.nav-link.is-active { color: var(--c-brand); background: var(--c-brand-soft); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  inset-inline-start: 0.9rem;
  bottom: 8px;
  width: 22px; height: 3px;
  border-radius: 3px;
  background: var(--c-accent);
}
.nav-cta { background: var(--c-brand); color: #fff; justify-content: center; margin-top: 0.5rem; }
.nav-cta:hover, .nav-cta.is-active { background: var(--c-brand-dark); color: #fff; }

/* Hero */
.hero {
  position: relative;
  display: grid;
  min-height: clamp(520px, 82vh, 820px);
  align-items: center;
  color: #fff;
  background: var(--c-brand-deep);
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(20, 36, 36, 0.92) 0%, rgba(30, 53, 53, 0.78) 50%, rgba(30, 53, 53, 0.45) 100%);
}
.hero-content { padding-block: var(--space-xl); }
.hero h1 {
  font-size: var(--fs-h1);
  color: #fff;
  max-width: 14ch;
  margin-bottom: var(--space-md);
}
.hero-lead { font-size: var(--fs-lg); max-width: 40rem; color: rgba(255, 255, 255, 0.92); margin-bottom: var(--space-lg); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.eyebrow-dark { color: var(--c-accent-dark); }

/* Sections */
.section { padding-block: var(--space-xl); }
.section-tint { background: var(--c-bg-alt); }
.section-dark { background: linear-gradient(135deg, var(--c-brand), var(--c-brand-deep)); color: #fff; }
.section-dark h2 { color: #fff; }
.section-head { max-width: 44rem; margin-bottom: var(--space-lg); }
.section-lead { font-size: var(--fs-lg); color: var(--c-muted); }
.section-dark .section-lead { color: rgba(255, 255, 255, 0.88); }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-brand-soft); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: var(--space-lg); padding-top: var(--space-md); }
.card-body p:last-child { margin-bottom: 0; color: var(--c-muted); }
.card-highlight {
  font-weight: 700;
  color: var(--c-brand);
  padding-inline-start: 0.75rem;
  border-inline-start: 3px solid var(--c-accent);
}

/* Careers split */
.split { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); align-items: start; }
.split > * { min-width: 0; }
.subhead { font-family: var(--f-body); font-size: var(--fs-lg); font-weight: 700; color: var(--c-brand); }
.check-list { display: grid; gap: 0.6rem; margin-top: var(--space-md); }
.check-list li { position: relative; padding-inline-start: 2rem; }
.check-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.35em;
  width: 1.2rem; height: 1.2rem;
  border-radius: 50%;
  background: var(--c-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* Forms */
.form-card {
  min-width: 0;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: var(--space-md); min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 0 var(--space-md); }
label { font-weight: 600; color: var(--c-text); }
.req { color: var(--c-error); }
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #a8b8b7;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
  font: inherit;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
textarea { resize: vertical; min-height: 120px; }
input:focus, textarea:focus { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 4px rgba(47, 79, 79, 0.18); }
[aria-invalid="true"] { border-color: var(--c-error) !important; }
.field-error { margin: 0; min-height: 0; font-size: var(--fs-sm); color: var(--c-error); font-weight: 600; }
.field-error:empty { display: none; }

.file-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; cursor: pointer; }
.file-button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.6rem 1.2rem;
  border: 1.5px dashed var(--c-brand);
  border-radius: var(--radius-sm);
  color: var(--c-brand);
  background: var(--c-brand-soft);
  font-weight: 700;
  transition: background-color 0.2s var(--ease);
}
.file-label:hover .file-button { background: #d9e5e3; }
.file-input:focus-visible + .file-count,
.field:focus-within .file-button { outline: 3px solid var(--c-accent); outline-offset: 2px; }
.file-hint { font-size: var(--fs-sm); font-weight: 400; color: var(--c-muted); }
.file-count { margin: 0; font-size: var(--fs-sm); color: var(--c-muted); }

.checkbox { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: var(--space-md); }
.checkbox input {
  flex: none;
  width: 24px; height: 24px;
  margin: 0.15rem 0 0;
  accent-color: var(--c-brand);
  cursor: pointer;
}
.checkbox label { font-weight: 400; cursor: pointer; }

.legal { font-size: var(--fs-sm); color: var(--c-muted); }
.form-status { margin: var(--space-sm) 0 0; font-weight: 600; }
.form-status:empty { display: none; }
.form-status.is-success { color: var(--c-success); }
.form-status.is-error { color: var(--c-error); }

/* Social */
.social-wrap { text-align: center; }
.social-wrap .section-lead { margin-inline: auto; max-width: 36rem; }
.social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg) !important;
}
.social-list li { min-width: 0; }
.social-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 64px;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
  text-align: start;
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease), color 0.25s var(--ease);
}
.social-link:hover { background: #fff; color: var(--c-brand-deep); transform: translateY(-3px); }
.social-text { display: flex; flex-direction: column; line-height: 1.25; }
.social-name { font-weight: 700; }
.social-handle { font-size: var(--fs-sm); opacity: 0.9; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); align-items: start; }
.contact-grid > * { min-width: 0; }
.visit-card {
  background: var(--c-brand-deep);
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}
.visit-card h3, .visit-card h4 { color: #fff; }
.visit-name { font: 700 var(--fs-lg)/1.3 var(--f-head); color: var(--c-accent); }
.hours-title { font-family: var(--f-body); font-size: var(--fs-sm); letter-spacing: 0.16em; text-transform: uppercase; margin-top: var(--space-md); }
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 400;
  text-align: start;
}
.hours-table td { text-align: end; white-space: nowrap; }
.hours-table tr.is-today th,
.hours-table tr.is-today td { color: var(--c-accent); font-weight: 700; }
.hours-table tr.is-today { background: rgba(255, 255, 255, 0.06); }

/* Footer */
.site-footer { background: var(--c-brand-deep); color: rgba(255, 255, 255, 0.82); padding-top: var(--space-xl); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); padding-bottom: var(--space-lg); }
.footer-col { min-width: 0; }
.footer-col ul { display: grid; gap: 0.35rem; }
.footer-col a { color: rgba(255, 255, 255, 0.88); text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.footer-col a:hover { color: var(--c-accent); text-decoration: underline; }
.footer-col li:not(:has(a)) { padding-block: 0.4rem; }
.footer-title {
  font-family: var(--f-body);
  font-size: var(--fs-sm);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: var(--space-sm);
}
.brand-footer { color: #fff; margin-bottom: var(--space-sm); }
.brand-footer:hover { color: #fff; }
.brand-footer .brand-sub { color: rgba(255, 255, 255, 0.75); }
.footer-brand p { max-width: 22rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-block: var(--space-md);
  font-size: var(--fs-sm);
}
.footer-bottom p { margin: 0; }

/* Back to top */
.back-to-top {
  position: fixed;
  inset-inline-end: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 90;
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--c-brand);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background-color 0.2s var(--ease);
}
.back-to-top[hidden] { display: none; }
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--c-brand-dark); }

/* Tablet */
@media (min-width: 600px) {
  .field-row { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid .card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .card-grid .card:last-child:nth-child(odd) .card-media { flex: 0 0 45%; aspect-ratio: auto; min-height: 260px; }
  .card-grid .card:last-child:nth-child(odd) .card-body { align-self: center; padding-top: var(--space-lg); }
}

/* Desktop */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    transition: none;
  }
  .nav-list { flex-direction: row; align-items: center; padding: 0; gap: 0.25rem; }
  .nav-link { padding-inline: 0.85rem; }
  .nav-link.is-active { background: transparent; }
  .nav-link.is-active::after { inset-inline-start: 0.85rem; bottom: 6px; }
  .nav-cta { margin: 0; margin-inline-start: 0.5rem; padding-inline: 1.3rem; border-radius: 999px; }
  .nav-cta.is-active { background: var(--c-brand-dark); }
  .nav-cta.is-active::after { display: none; }

  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-grid .card:last-child:nth-child(odd) { grid-column: auto; flex-direction: column; }
  .card-grid .card:last-child:nth-child(odd) .card-media { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
  .card-grid .card:last-child:nth-child(odd) .card-body { align-self: stretch; padding-top: var(--space-md); }

  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 5rem); }
  .split-intro { position: sticky; top: calc(var(--header-h) + 2rem); }
  .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr 1.2fr; }
}

@media (min-width: 1600px) {
  :root { --container: 1320px; }
}

/* Small phones */
@media (max-width: 360px) {
  .brand-mark { width: 38px; height: 38px; font-size: 1.25rem; }
  .brand-name { font-size: 1.1rem; }
  .brand-sub { font-size: 0.62rem; letter-spacing: 0.08em; }
  .hero-actions .btn { width: 100%; }
  .social-link { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
