/* ========================================
   MERIDIAN GROUP — Main Stylesheet
   Premium minimal · cold paper + deep pine
   Fraunces display + Inter body
   Mobile-first
   ======================================== */

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

:root {
  --ink: #1a1a18;
  --ink-soft: #3a3a35;
  --muted: #6b7280;
  --faint: #9ca3af;
  --pine: #1f4a44;
  --pine-deep: #163632;
  --paper: #fafaf8;
  --card: #f1f0ec;
  --hairline: #e8e5dc;
  --hairline-soft: #f0eee7;
  --font-serif: 'Fraunces', 'Georgia', serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --gutter: 24px;
  --transition: 0.2s ease;
}

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

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul,
ol {
  list-style: none;
}

::selection {
  background: rgba(31, 74, 68, 0.15);
}

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 30px;
  height: 30px;
}

.logo-text {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.logo-sub {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 4px;
}

.nav-desktop a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  padding: 8px 12px;
  transition: color var(--transition);
}

.nav-desktop a:hover {
  color: var(--ink);
}

.nav-desktop a.active {
  color: var(--pine);
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 68px;
  right: -100%;
  width: 300px;
  height: calc(100vh - 68px);
  background: var(--paper);
  border-left: 1px solid var(--hairline);
  padding: 24px;
  transition: right 0.3s ease;
  z-index: 99;
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 68px 0 0 0;
  background: rgba(26, 26, 24, 0.25);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.mobile-menu-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.mobile-menu-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
}

.mobile-link {
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1.4;
  color: var(--ink-soft);
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline-soft);
  transition: color var(--transition);
}

.mobile-link:hover,
.mobile-link.active {
  color: var(--pine);
}

/* === Shared layout === */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px var(--gutter) 64px;
}

/* Eyebrow */
.eyebrow,
.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

/* Page hero (inner pages) */
.page-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 48px;
}

.page-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(34px, 6vw, 54px);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Section title */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 24px;
}

/* === Buttons === */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--pine);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 26px;
  transition: background var(--transition);
}

.btn-primary:hover {
  background: var(--pine-deep);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  padding: 13px 0;
  border-bottom: 1px solid var(--hairline);
  transition: border-color var(--transition), color var(--transition);
}

.btn-ghost:hover {
  color: var(--pine);
  border-color: var(--pine);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.link-quiet {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.link-quiet:hover {
  color: var(--pine);
}

/* === HOME: Hero === */
.hero {
  padding: 56px 0 64px;
}

.hero-rule {
  height: 1px;
  background: var(--hairline);
  margin-bottom: 40px;
  position: relative;
}

.hero-rule::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 40px;
  height: 5px;
  background: var(--pine);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1.02;
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 28px;
}

.hero-title-accent {
  color: var(--pine);
  font-style: italic;
}

.hero-lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

/* === HOME: Capabilities === */
.capabilities {
  border-top: 1px solid var(--hairline);
  padding: 56px 0;
}

.capabilities-grid {
  display: grid;
  gap: 32px;
}

.cap-card {
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}

.cap-number {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}

.cap-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 10px;
}

.cap-card p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 44ch;
}

/* === HOME: Work preview === */
.work-preview {
  padding: 56px 0;
  border-top: 1px solid var(--hairline);
}

.work-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.work-grid {
  display: grid;
  gap: 32px;
}

.work-card {
  cursor: default;
}

.work-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--card);
  margin-bottom: 18px;
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: filter 0.4s ease;
}

.work-card:hover .work-card-media img {
  filter: grayscale(0);
}

.work-card-cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pine);
  display: block;
  margin-bottom: 8px;
}

.work-card-body h3 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
}

.work-card-meta {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* === HOME: Metrics === */
.metrics {
  border-top: 1px solid var(--hairline);
  padding: 48px 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 16px;
}

.metric {
  border-left: 2px solid var(--pine);
  padding-left: 18px;
}

.metric-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 300;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* === CTA block === */
.cta-block {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 32px;
  margin-top: 40px;
  text-align: left;
}

.cta-block h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 300;
  line-height: 1.12;
  margin-bottom: 16px;
}

.cta-block p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 28px;
  max-width: 46ch;
}

/* === ABOUT === */
.about-grid {
  display: grid;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--hairline);
}

.about-h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 20px;
}

.about-prose p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin-bottom: 18px;
  max-width: 60ch;
}

.aside-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.principles-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.principle-num {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
}

/* Team */
.team-section {
  padding: 56px 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.team-card {
  border: 1px solid var(--hairline);
  background: var(--card);
  padding: 24px;
}

.team-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}

.team-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 6px;
}

.team-card p {
  font-size: 13px;
  color: var(--muted);
}

/* === SERVICES === */
.service-block {
  padding: 40px 0;
  border-bottom: 1px solid var(--hairline);
}

.service-block:first-of-type {
  padding-top: 0;
}

.service-label {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 28px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  color: var(--ink);
}

.service-label span {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
}

.service-items {
  display: grid;
  gap: 24px;
}

.service-item {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
}

.service-item h4 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
}

.service-item p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 56ch;
}

/* === WORK page === */
.work-intro {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 40px;
}

.work-list {
  border-top: 1px solid var(--hairline);
}

.work-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
}

.work-row-year {
  font-size: 13px;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}

.work-row-content h3 {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  margin: 8px 0 10px;
}

.work-row-content p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 62ch;
}

/* === CONTACT === */
.contact-grid {
  display: grid;
  gap: 48px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-hint {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--faint);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 10px 0;
  transition: border-color var(--transition);
}

.form-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--pine);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.form-status {
  font-size: 14px;
  color: var(--pine);
  margin-top: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-status.show {
  opacity: 1;
}

.contact-aside {
  display: grid;
  gap: 28px;
  align-content: start;
}

.office-block h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 8px;
}

.office-block p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.office-block a {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  transition: color var(--transition), border-color var(--transition);
}

.office-block a:hover {
  color: var(--pine);
  border-color: var(--pine);
}

.contact-note {
  font-size: 13px;
  color: var(--faint);
  line-height: 1.55;
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 48px var(--gutter);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  width: 24px;
  height: 24px;
}

.footer-brand-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.footer-brand-sub {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-link {
  font-size: 13px;
  color: var(--muted);
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--pine);
}

.footer-note {
  font-size: 13px;
  color: var(--faint);
  letter-spacing: 0.02em;
}

.footer-copy {
  font-size: 12px;
  color: var(--faint);
}

/* === Page transition === */
.page {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive: Tablet 768px+ === */
@media (min-width: 768px) {
  .header-inner {
    height: 72px;
  }

  .hamburger {
    display: none;
  }

  .nav-desktop {
    display: flex;
  }

  .mobile-menu,
  .mobile-menu-overlay {
    display: none;
  }

  .main-content {
    padding: 56px var(--gutter) 80px;
  }

  .hero {
    padding: 72px 0;
  }

  .capabilities-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .work-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .about-grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
  }

  .service-items {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
  }

  .contact-aside {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .contact-note {
    grid-column: 1 / -1;
  }

  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cta-block {
    padding: 72px 48px;
  }
}

/* === Responsive: Desktop 1024px+ === */
@media (min-width: 1024px) {
  .header-inner {
    padding: 0 32px;
  }

  .hero-title {
    font-size: 88px;
  }

  .page-hero {
    padding: 80px 0 56px;
  }

  .work-row {
    grid-template-columns: 80px 1fr;
  }
}

/* === Utilities === */
.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;
}
