/* ============================================
   Meridian & Co. — Accounting & Auditing
   Modern editorial design system
   ============================================ */

:root {
  /* Color palette — warm minimal */
  --bg: #f6f3ec;
  --bg-alt: #efeae0;
  --surface: #ffffff;
  --ink: #14161a;
  --ink-soft: #3a3d44;
  --muted: #6b6f78;
  --line: #d9d3c5;
  --accent: #1f3a2e;        /* deep forest */
  --accent-hover: #2a4d3e;
  --gold: #b08a4a;          /* subtle metallic */

  /* Typography */
  --font-serif: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Spacing & layout */
  --container: 1280px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 4px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* Typography scale */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
h1 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.5rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 2rem); }
h4 { font-size: 1.25rem; }
p { color: var(--ink-soft); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.25rem); color: var(--ink-soft); max-width: 60ch; }

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--gold);
  display: inline-block;
}

/* Layout */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: clamp(4rem, 9vw, 8rem) 0; }

/* ============= NAVIGATION ============= */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  background: rgba(246, 243, 236, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), padding 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); padding: 0.85rem 0; }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem;
}
.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  display: inline-flex; align-items: baseline; gap: 0.35rem;
}
.logo-mark {
  display: inline-block; width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateY(-2px);
}
.nav-links {
  display: flex; gap: 2.25rem;
  list-style: none;
  font-size: 0.9rem;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  transition: color 0.25s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute;
  left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--ink);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-cta {
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.nav-cta:hover { background: var(--ink); color: var(--bg); }

.nav-toggle {
  display: none;
  width: 28px; height: 20px;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 0; right: 0; height: 1.5px; background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 4px; }
.nav-toggle.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .nav-links {
    position: fixed; inset: 70px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 2rem var(--gutter);
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li { width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links a { display: block; padding: 1.25rem 0; font-size: 1.5rem; font-family: var(--font-serif); }
}

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 1rem 1.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 999px;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ============= HERO ============= */
.hero {
  padding: 11rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}
.hero h1 .reveal-line { display: block; overflow: hidden; }
.hero h1 .reveal-line span {
  display: inline-block;
  transform: translateY(110%);
  animation: rise 1s var(--ease) forwards;
}
.hero h1 .reveal-line:nth-child(2) span { animation-delay: 0.1s; }
.hero h1 .reveal-line:nth-child(3) span { animation-delay: 0.2s; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero-meta {
  margin-top: 2.5rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.9s 0.5s var(--ease) forwards;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-image {
  aspect-ratio: 4/5;
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  opacity: 0; transform: translateY(40px);
  animation: fadeUp 1.1s 0.3s var(--ease) forwards;
}
.hero-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 8s ease-out;
}
.hero:hover .hero-image img { transform: scale(1.05); }

.hero-marquee {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 0;
  overflow: hidden;
}
.marquee-track {
  display: flex; gap: 4rem;
  animation: marquee 35s linear infinite;
  white-space: nowrap;
}
.marquee-track span {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--muted);
  font-style: italic;
}
.marquee-track .dot { color: var(--gold); }

@keyframes rise { to { transform: translateY(0); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes marquee { to { transform: translateX(-50%); } }

@media (max-width: 860px) {
  .hero { padding: 8rem 0 4rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-image { aspect-ratio: 4/3; }
}

/* ============= SECTIONS ============= */
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 4rem;
  align-items: end;
}
.section-head .lead { max-width: 50ch; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 2.5rem; }
}

/* Values */
.values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.value-card {
  background: var(--bg);
  padding: 2.5rem;
  transition: background 0.4s var(--ease);
  position: relative;
}
.value-card:hover { background: var(--surface); }
.value-num {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  display: block;
}
.value-card h3 { margin-bottom: 1rem; }
.value-card p { font-size: 0.95rem; }
@media (max-width: 760px) { .values { grid-template-columns: 1fr; } }

/* ============= SERVICES ============= */
.services-list { border-top: 1px solid var(--line); }
.service-row {
  display: grid;
  grid-template-columns: 80px 1fr 2fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: padding 0.4s var(--ease);
}
.service-row::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
  z-index: 0;
}
.service-row:hover { padding-left: 1.5rem; padding-right: 1.5rem; }
.service-row:hover::before { transform: scaleX(1); }
.service-row:hover * { color: var(--bg) !important; position: relative; z-index: 1; }
.service-row:hover .arrow-circle { border-color: var(--bg); }
.service-num { font-family: var(--font-serif); color: var(--muted); font-style: italic; position: relative; z-index: 1; }
.service-title { font-family: var(--font-serif); font-size: 1.75rem; position: relative; z-index: 1; }
.service-desc { color: var(--muted); font-size: 0.95rem; position: relative; z-index: 1; }
.arrow-circle {
  width: 48px; height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.4s var(--ease), border-color 0.3s;
  position: relative; z-index: 1;
}
.service-row:hover .arrow-circle { transform: rotate(-45deg); }
@media (max-width: 760px) {
  .service-row { grid-template-columns: 40px 1fr auto; }
  .service-desc { display: none; }
  .service-title { font-size: 1.25rem; }
}

/* ============= PROJECTS GRID ============= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2rem;
}
.project-card {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
}
.project-card.span-7 { grid-column: span 7; }
.project-card.span-5 { grid-column: span 5; }
.project-card.span-6 { grid-column: span 6; }
.project-card.span-12 { grid-column: span 12; }
.project-media {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}
.project-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease);
}
.project-card:hover .project-media img { transform: scale(1.06); }
.project-meta {
  padding: 1.5rem 0.25rem 0.5rem;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem;
}
.project-meta h3 {
  font-size: 1.4rem;
  transition: color 0.3s;
}
.project-card:hover .project-meta h3 { color: var(--gold); }
.project-meta .tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}
.project-card p { padding: 0 0.25rem; font-size: 0.92rem; }

@media (max-width: 860px) {
  .projects-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .project-card.span-7, .project-card.span-5, .project-card.span-6, .project-card.span-12 {
    grid-column: span 1;
  }
}

/* ============= CTA STRIP ============= */
.cta-strip {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(3rem, 8vw, 6rem) 0;
  border-radius: var(--radius);
  margin: 4rem auto;
  max-width: calc(var(--container) - 2rem);
}
.cta-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 0 clamp(2rem, 5vw, 4rem);
}
.cta-strip h2 { color: var(--bg); }
.cta-strip h2 em { color: var(--gold); font-style: italic; }
.cta-strip .btn-primary { background: var(--bg); color: var(--ink); }
.cta-strip .btn-primary:hover { background: var(--gold); color: var(--ink); }
@media (max-width: 760px) { .cta-inner { grid-template-columns: 1fr; gap: 2rem; } }

/* ============= ABOUT — Vision/Mission ============= */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
.vm-card {
  padding: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.vm-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(20,22,26,0.18); }
.vm-card h3 { margin: 1.5rem 0 1rem; font-size: 2rem; }
.vm-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
}
@media (max-width: 760px) { .vm-grid { grid-template-columns: 1fr; } }

/* ============= TEAM ============= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}
.team-card { display: block; }
.team-photo {
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-alt);
  position: relative;
}
.team-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(20%);
  transition: transform 1s var(--ease), filter 0.6s;
}
.team-card:hover .team-photo img { transform: scale(1.04); filter: grayscale(0); }
.team-info {
  padding: 1.5rem 0.25rem;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.team-info h3 { font-size: 1.75rem; }
.team-info .role { font-size: 0.85rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.4rem; }
.team-link { font-size: 0.85rem; border-bottom: 1px solid var(--ink); padding-bottom: 2px; transition: color 0.3s; }
.team-link:hover { color: var(--gold); border-color: var(--gold); }
@media (max-width: 760px) { .team-grid { grid-template-columns: 1fr; } }

/* ============= PROFILE PAGE ============= */
.profile-hero {
  padding: 10rem 0 4rem;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: end;
}
.profile-photo {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta .role { color: var(--gold); font-style: italic; font-family: var(--font-serif); font-size: 1.25rem; margin-bottom: 1rem; }
.profile-meta h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); margin-bottom: 1.5rem; }

.profile-body {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 4rem;
  padding: 4rem 0;
}
.profile-block { padding: 2rem 0; border-top: 1px solid var(--line); }
.profile-block:first-child { border-top: 0; padding-top: 0; }
.profile-block h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }
.cv-list { list-style: none; display: grid; gap: 1.5rem; }
.cv-item { display: grid; grid-template-columns: 120px 1fr; gap: 1.5rem; align-items: baseline; }
.cv-year { font-family: var(--font-serif); font-style: italic; color: var(--gold); }
.cv-title { font-weight: 500; color: var(--ink); margin-bottom: 0.25rem; }
.cv-place { color: var(--muted); font-size: 0.92rem; }

@media (max-width: 860px) {
  .profile-hero, .profile-body { grid-template-columns: 1fr; gap: 2.5rem; }
  .cv-item { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* ============= SINGLE PROJECT ============= */
.single-hero {
  padding: 9rem 0 3rem;
  text-align: center;
}
.single-hero .eyebrow { justify-content: center; }
.single-hero .eyebrow::before { display: none; }
.single-hero h1 { max-width: 18ch; margin: 1rem auto 2rem; }
.single-meta {
  display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.single-feature {
  aspect-ratio: 16/9;
  margin: 2rem auto 4rem;
  max-width: var(--container);
  padding: 0 var(--gutter);
}
.single-feature img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }

.single-body {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 4rem;
}
.single-body article p { margin-bottom: 1.5rem; font-size: 1.05rem; }
.single-body article h3 { margin: 2.5rem 0 1rem; }
.sidebar-card {
  position: sticky; top: 100px;
  padding: 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.sidebar-card .label { font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; }
.sidebar-author { display: flex; gap: 1rem; align-items: center; }
.sidebar-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.sidebar-author .name { font-family: var(--font-serif); font-size: 1.25rem; }
.sidebar-author .role { font-size: 0.78rem; color: var(--muted); }
.sidebar-card hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.sidebar-card dl { display: grid; gap: 0.75rem; font-size: 0.88rem; }
.sidebar-card dt { color: var(--muted); }
.sidebar-card dd { color: var(--ink); }

@media (max-width: 860px) {
  .single-body { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
}

/* ============= CONTACT ============= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 4rem;
  padding-top: 9rem;
}
.contact-info h1 { margin-bottom: 1.5rem; }
.contact-list { list-style: none; display: grid; gap: 2rem; margin-top: 3rem; }
.contact-list li .label { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.contact-list li .value { font-family: var(--font-serif); font-size: 1.5rem; }

.contact-form {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.field { margin-bottom: 1.5rem; position: relative; }
.field label {
  position: absolute; left: 0; top: 1rem;
  font-size: 0.95rem; color: var(--muted);
  pointer-events: none;
  transition: transform 0.25s var(--ease), color 0.25s, font-size 0.25s;
}
.field input, .field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 1rem 0 0.75rem;
  font: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.1rem);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; } }

/* ============= FOOTER ============= */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 5rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer h4 { color: var(--bg); font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 1.5rem; opacity: 0.6; }
.footer ul { list-style: none; display: grid; gap: 0.75rem; font-size: 0.92rem; }
.footer ul a { color: rgba(246,243,236,0.75); transition: color 0.3s; }
.footer ul a:hover { color: var(--gold); }
.footer-brand h3 { color: var(--bg); font-size: 2rem; margin-bottom: 1rem; }
.footer-brand p { color: rgba(246,243,236,0.6); max-width: 36ch; font-size: 0.95rem; }
.footer-bottom {
  padding-top: 2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: 0.8rem;
  color: rgba(246,243,236,0.5);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }

/* ============= REVEAL ANIMATIONS ============= */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

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