@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --paper: #ece5d5;
  --paper-raised: #f6f2e6;
  --paper-dim: #e1d8c1;
  --ink: #1e2b3c;
  --ink-muted: #665f4d;
  --red: #ab3a2c;
  --red-dark: #7c2a1f;
  --teal: #3f6e63;
  --line: #c9bfa4;
  --line-strong: #a99e80;
  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Newsreader', Georgia, serif;
  --font-ui: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- editorial link style: "track changes" hover ---------- */
.edit-link {
  position: relative;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.2s ease;
}
.edit-link:hover, .edit-link:focus-visible {
  color: var(--red-dark);
  border-bottom-color: var(--red);
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand span { color: var(--red); }
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a.edit-link.is-active { border-bottom-color: var(--ink-muted); }
.nav-cta {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  color: var(--paper-raised);
  background: var(--ink);
  padding: 9px 18px;
  border-radius: 3px;
  border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { background: var(--red); border-color: var(--red); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--paper-raised);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    display: none;
    padding: 8px 32px 20px;
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: none; }
}

/* ---------- eyebrow / pilcrow labels ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--red-dark);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.eyebrow::before { content: '\00B6'; font-size: 15px; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 88px;
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.hero h1 em { font-style: italic; color: var(--red-dark); }
.hero p.lede {
  font-size: 20px;
  color: var(--ink-muted);
  max-width: 46ch;
  margin: 0 0 32px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper-raised); border: 1px solid var(--ink); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.btn-secondary:hover { border-color: var(--ink); }

/* ---------- counter card (signature element) ---------- */
.counter-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 36px 32px;
  position: relative;
}
.counter-card::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 1px dashed var(--line-strong);
  pointer-events: none;
  opacity: 0.5;
}
.counter-row { margin-bottom: 26px; }
.counter-row:last-child { margin-bottom: 0; }
.counter-value {
  font-family: var(--font-mono);
  font-size: clamp(34px, 4.4vw, 46px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.counter-label {
  font-family: var(--font-ui);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.counter-label .mark { color: var(--red); font-family: var(--font-mono); }
.counter-divider { border: none; border-top: 1px dashed var(--line-strong); margin: 26px 0; }

/* ---------- sections ---------- */
section { padding: 88px 0; }
section.alt { background: var(--paper-dim); }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 500;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--ink-muted); font-size: 18px; margin: 0; }

/* ---------- services ---------- */
.services-list { display: flex; flex-direction: column; }
.service-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
}
.services-list .service-row:last-child { border-bottom: 1px solid var(--line); }
.service-mark {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--red);
  padding-top: 2px;
}
.service-row h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 8px;
}
.service-row p { margin: 0; color: var(--ink-muted); font-size: 16px; max-width: 62ch; }

/* ---------- portfolio cards ---------- */
.port-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.port-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.port-card__mark {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: 20px;
  margin: 0 0 12px;
}
.port-card__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  margin: 0 0 8px;
  line-height: 1.3;
}
.port-card__title a:hover { color: var(--red-dark); }
.port-card__meta {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0 0 14px;
}
.port-card__summary { font-size: 16px; color: var(--ink-muted); margin: 0 0 16px; }
.port-card__link {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}
.port-card__link:hover { color: var(--red-dark); border-color: var(--red); }

/* ---------- portfolio hero (sub pages) ---------- */
.page-hero { padding: 64px 0 56px; border-bottom: 1px solid var(--line); }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 500;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}
.page-hero p { font-size: 19px; color: var(--ink-muted); max-width: 60ch; margin: 0; }

/* ---------- latest article callout ---------- */
.latest {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: 4px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.latest .mark { color: var(--teal); font-family: var(--font-mono); font-size: 24px; }
.latest h3 { font-family: var(--font-display); font-size: 19px; font-weight: 500; margin: 0 0 4px; }
.latest p { margin: 0; font-family: var(--font-ui); font-size: 13px; color: var(--ink-muted); }
.latest a.port-card__link { white-space: nowrap; }
@media (max-width: 640px) {
  .latest { grid-template-columns: 1fr; text-align: left; }
}

/* ---------- about page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
.about-grid h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 500;
  margin: 0 0 20px;
}
.about-copy p { color: var(--ink-muted); font-size: 18px; margin: 0 0 20px; }
.credentials {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px;
}
.credentials h2 {
  font-family: var(--font-ui);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 18px;
}
.credentials ul { list-style: none; margin: 0; padding: 0; }
.credentials li {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 15px;
}
.credentials li:first-child { border-top: none; }
.credentials li::before { content: '^'; color: var(--red); font-family: var(--font-mono); font-weight: 500; }

@media (max-width: 800px) {
  .about-grid, .hero .wrap { grid-template-columns: 1fr; }
  .credentials { order: -1; }
}

/* ---------- contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 56px;
}
.contact-info h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 16px;
}
.contact-info p { color: var(--ink-muted); font-size: 17px; margin: 0 0 20px; }
.contact-detail { margin-bottom: 20px; }
.contact-detail .label {
  font-family: var(--font-ui);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 4px;
}
.contact-detail a { font-family: var(--font-mono); font-size: 16px; border-bottom: 1px solid var(--line-strong); }
.contact-detail a:hover { color: var(--red-dark); border-color: var(--red); }

form.contact-form {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-family: var(--font-ui);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 12px 14px;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
.form-status { margin-top: 16px; font-family: var(--font-ui); font-size: 14px; }
.form-status--ok { color: var(--teal); }
.form-status--error { color: var(--red-dark); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.footer-note { font-family: var(--font-ui); font-size: 13px; color: var(--ink-muted); }

.cta-strip {
  background: var(--ink);
  color: var(--paper-raised);
  padding: 64px 0;
}
.cta-strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-strip h2 { font-family: var(--font-display); font-size: 32px; font-weight: 500; margin: 0; }
.cta-strip .btn-primary { background: var(--red); border-color: var(--red); }
.cta-strip .btn-primary:hover { background: var(--paper-raised); color: var(--ink); border-color: var(--paper-raised); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

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