/* ============================================================
   MARK WARREN — markbwarren.com
   ============================================================ */

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

:root {
  --col-bg:       #fafaf8;
  --col-surface:  #f2f1ee;
  --col-border:   #e0ded9;
  --col-text:     #1a1917;
  --col-muted:    #6b6860;
  --col-accent:   #1a5c6b;   /* deep teal */
  --col-accent-l: #e8f2f4;
  --col-white:    #ffffff;

  --font:         'Inter', system-ui, -apple-system, sans-serif;

  --max-w:        1180px;
  --gutter:       clamp(1.25rem, 4vw, 2.5rem);

  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
}

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

body {
  font-family: var(--font);
  background: var(--col-bg);
  color: var(--col-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* --- Utility ---------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--col-accent);
  margin-bottom: 0.75rem;
}

.section-intro {
  max-width: 52ch;
  color: var(--col-muted);
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

/* --- Buttons ---------------------------------------------- */
.btn-primary {
  display: inline-block;
  background: var(--col-accent);
  color: var(--col-white);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary:hover { background: #144d5a; transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--col-accent);
  border-bottom: 1px solid var(--col-accent);
  padding-bottom: 1px;
  transition: opacity 0.2s;
}
.btn-secondary:hover { opacity: 0.7; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--col-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--col-text);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-desktop a {
  font-size: 0.85rem;
  font-weight: 450;
  color: var(--col-muted);
  transition: color 0.2s;
}
.nav-desktop a:hover { color: var(--col-text); }

.nav-cta {
  background: var(--col-accent) !important;
  color: var(--col-white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500 !important;
  transition: background 0.2s !important;
}
.nav-cta:hover { background: #144d5a !important; }

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--col-text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.nav-mobile {
  display: none;
  flex-direction: column;
  background: var(--col-white);
  border-top: 1px solid var(--col-border);
  padding: 1rem var(--gutter) 1.5rem;
  gap: 0;
}
.nav-mobile.is-open { display: flex; }
.nav-mobile a {
  font-size: 1rem;
  font-weight: 450;
  color: var(--col-text);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--col-border);
}
.nav-mobile a:last-child { border-bottom: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(4rem, 10vw, 7rem) 0;
  background: var(--col-bg);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--col-accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  max-width: 18ch;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--col-muted);
  max-width: 44ch;
  margin-bottom: 2rem;
  line-height: 1.7;
}

/* Hero photo */
.hero-image-area {
  display: flex;
  align-items: flex-start;
  padding-top: 36px; /* aligns image top exactly with h1 */
}

.hero-photo-wrap {
  width: calc(100% + 2rem); /* bleed into gap to grow left */
  margin-left: -2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.13);
}

.hero-photo {
  width: 100%;
  height: auto;
  display: block;
}

/* All footprint outlines — same weight, same colour */
.hg-fp {
  stroke: var(--col-accent);
  stroke-width: 1.5;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

/* Draw sequence — upper row first, then lower left to right */
/* City intersection — draw quadrant by quadrant */
.hg-fp-ula { animation: hgDraw 0.6s ease-out both 0.3s; }
.hg-fp-ulb { animation: hgDraw 0.45s ease-out both 0.75s; }
.hg-fp-ura { animation: hgDraw 0.6s ease-out both 1.1s; }
.hg-fp-urb { animation: hgDraw 0.45s ease-out both 1.55s; }
.hg-fp-lla { animation: hgDraw 0.55s ease-out both 1.9s; }
.hg-fp-llb { animation: hgDraw 0.5s ease-out both 2.3s; }
.hg-fp-lra { animation: hgDraw 0.55s ease-out both 2.7s; }
.hg-fp-lrb { animation: hgDraw 0.4s ease-out both 3.1s; }

/* --- Keyframes -------------------------------------------- */
@keyframes hgDraw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-graphic { animation: none; }
  .hg-fp { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--col-white);
  border-top: 1px solid var(--col-border);
}

.about-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 5rem;
  align-items: start;
}

.photo-frame {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--col-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--col-border);
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.photo-frame.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame.photo-placeholder::after {
  content: 'MW';
  font-size: 3rem;
  font-weight: 300;
  color: var(--col-muted);
  opacity: 0.4;
}

.about-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 1.5rem;
}

.about-text p {
  color: var(--col-muted);
  margin-bottom: 1rem;
  font-size: 0.975rem;
  max-width: 60ch;
}

.credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  margin: 2rem 0 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--col-border);
  border-bottom: 1px solid var(--col-border);
}

.credential { display: flex; flex-direction: column; gap: 0.15rem; }

.cred-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--col-accent);
}

.cred-body {
  font-size: 0.875rem;
  color: var(--col-text);
}

/* ============================================================
   SERVICES
   ============================================================ */
.services {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--col-bg);
  border-top: 1px solid var(--col-border);
}

.services h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5px;
  background: var(--col-border);
  border: 1.5px solid var(--col-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 2.5rem;
}

.service-card {
  background: var(--col-white);
  padding: 2rem;
  transition: background 0.2s;
}
.service-card:hover { background: var(--col-accent-l); }

.service-icon {
  width: 36px;
  height: 36px;
  color: var(--col-accent);
  margin-bottom: 1rem;
}
.service-icon svg { width: 100%; height: 100%; }

.service-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--col-muted);
  line-height: 1.65;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--col-white);
  border-top: 1px solid var(--col-border);
}

.projects h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.project-card {
  border: 1px solid var(--col-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--col-bg);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Category colour band — sits flush at card top, clips to card border-radius via overflow:hidden */
.card-band {
  height: 8px;
  flex-shrink: 0;
}
.project-card--urban      .card-band { background: #1a5c6b; }
.project-card--healthcare .card-band { background: #2a446e; }
.project-card--community  .card-band { background: #7a4f1e; }

/* Category text matches the band colour */
.project-card--urban      .project-type { color: #1a5c6b; }
.project-card--healthcare .project-type { color: #2a446e; }
.project-card--community  .project-type { color: #7a4f1e; }

.project-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.project-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.project-type {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-location {
  font-size: 0.75rem;
  color: var(--col-muted);
}

.project-card h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0.25rem;
}

.project-card p {
  font-size: 0.85rem;
  color: var(--col-muted);
  line-height: 1.65;
  flex: 1;
}

.project-client {
  font-size: 0.75rem;
  color: var(--col-muted);
  border-top: 1px solid var(--col-border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  font-style: italic;
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
  padding: clamp(4rem, 8vw, 6rem) 0;
  background: var(--col-bg);
  border-top: 1px solid var(--col-border);
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.contact-text h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.contact-text p {
  color: var(--col-muted);
  font-size: 0.975rem;
  margin-bottom: 2rem;
  max-width: 44ch;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--col-text);
  font-weight: 450;
  transition: color 0.2s;
}
.contact-link:hover { color: var(--col-accent); }
.contact-link svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--col-accent); }

/* Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: var(--col-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--col-border);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--col-text);
}

.form-group input,
.form-group textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--col-text);
  background: var(--col-bg);
  border: 1px solid var(--col-border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--col-muted); opacity: 0.7; }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--col-accent);
  box-shadow: 0 0 0 3px rgba(26,92,107,0.12);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--col-text);
  color: var(--col-white);
  padding: 2rem 0;
  border-top: 1px solid var(--col-border);
}

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

.footer-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.footer-divider {
  width: 1px;
  height: 14px;
  background: rgba(255,255,255,0.2);
}

.footer-tagline {
  font-size: 0.8rem;
  opacity: 0.5;
}

.footer-email {
  font-size: 0.8rem;
  opacity: 0.5;
  color: var(--col-white);
  text-decoration: none;
  transition: opacity 0.2s;
}
.footer-email:hover { opacity: 0.85; }

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.4;
}

@media (max-width: 600px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .footer-left { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .footer-divider { display: none; }
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image-area { justify-content: center; }
  .hero-photo-wrap { width: 100%; margin-left: 0; }
  .hero h1 { max-width: 100%; }

  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .photo-frame { width: 160px; aspect-ratio: 1/1; border-radius: 50%; }
  .photo-frame.photo-placeholder::after { font-size: 2rem; }

  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }

  .contact-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }

  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .credentials { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}
