/* marcvrusso.com, shared styles (v3)
   Blue from Marc's CV as the main accent, crimson used sparingly.
   Light and dark themes: follows the device setting unless the visitor
   picks one with the toggle (stored as data-theme on <html>). */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("fonts/source-serif-4.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif";
  src: url("fonts/source-serif-4-italic.woff2") format("woff2-variations");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ---------- Theme tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #e9edf3;
  --field: #ffffff;
  --ink: #0f1b2d;
  --muted: #4a5568;
  --rule: #cdd4de;
  --field-border: #8a95a6;
  --blue: #0b5394;          /* CV blue (Google Docs dark blue 2) */
  --blue-hover: #083e70;
  --on-blue: #ffffff;
  --red: #b4232f;           /* sparing accent */
  --panel: #0b5394;         /* blue service panels */
  --on-panel: #f6f7f9;
  --panel-rule: rgba(246, 247, 249, 0.3);
  --ok-bg: #e3edf9;
  --error-bg: #f8e3e5;
  --footer-bg: #0f1b2d;
  --footer-ink: #e7ecf3;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif", Georgia, "Times New Roman", serif;
  --measure: 64ch;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1421;
  --surface: #142033;
  --field: #101a2a;
  --ink: #e7ecf3;
  --muted: #a3afc0;
  --rule: #2a3a52;
  --field-border: #5b6b82;
  --blue: #8cbcf0;
  --blue-hover: #b3cff6;
  --on-blue: #0c1421;
  --red: #f0707a;
  --panel: #0d3a66;
  --on-panel: #e7ecf3;
  --panel-rule: rgba(231, 236, 243, 0.25);
  --ok-bg: #16304f;
  --error-bg: #3b1a22;
  --footer-bg: #070d16;
  --footer-ink: #c9d3e0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c1421;
    --surface: #142033;
    --field: #101a2a;
    --ink: #e7ecf3;
    --muted: #a3afc0;
    --rule: #2a3a52;
    --field-border: #5b6b82;
    --blue: #8cbcf0;
    --blue-hover: #b3cff6;
    --on-blue: #0c1421;
    --red: #f0707a;
    --panel: #0d3a66;
    --on-panel: #e7ecf3;
    --panel-rule: rgba(231, 236, 243, 0.25);
    --ok-bg: #16304f;
    --error-bg: #3b1a22;
    --footer-bg: #070d16;
    --footer-ink: #c9d3e0;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.62;
  font-optical-sizing: auto;
}

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

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blue-hover); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: var(--bg); padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- Type scale (ratio 1.333) ---------- */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 760;
  font-stretch: 118%;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 4.75rem); }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem); margin-top: 1.6em; }
h3 { font-size: 1.3rem; font-stretch: 105%; font-weight: 700; line-height: 1.2; margin-top: 1.4em; }
p, ul, ol, dl { margin: 0 0 1em; }
.lead { font-size: 1.22em; line-height: 1.5; max-width: 36ch; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding: 1.1rem var(--gutter);
  max-width: 82rem; margin: 0 auto;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--display); font-weight: 800; font-stretch: 125%;
  font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.wordmark .sigil { width: 2.4rem; height: 2.4rem; color: var(--blue); flex: none; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; }
.site-nav a {
  font-family: var(--display); font-stretch: 100%; font-weight: 520; font-size: 1rem;
  text-decoration: none; padding: 0.25rem 0; border-bottom: 2px solid transparent; color: var(--ink);
}
.site-nav a:hover { border-bottom-color: var(--rule); color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--rule); border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle[data-mode="dark"] .icon-sun { display: block; }
.theme-toggle[data-mode="dark"] .icon-moon { display: none; }

/* ---------- Layout ---------- */
main { display: block; }
.wrap { max-width: 82rem; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: end;
  padding-top: clamp(1rem, 4vw, 3.5rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.hero-name {
  font-size: clamp(2.9rem, 0.9rem + 6.6vw, 7rem);
  font-stretch: 125%;
  font-weight: 820;
  line-height: 0.86;
  letter-spacing: -0.035em;
  margin: 0;
}
.hero-name span { display: block; }
.trace { display: block; width: 100%; height: auto; margin: clamp(1rem, 2.5vw, 1.75rem) 0 clamp(1.25rem, 3vw, 2.25rem); overflow: visible; }
.trace path { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.trace .baseline { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 5; }
.hero-statement { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); line-height: 1.4; max-width: 34ch; margin: 0 0 1.75rem; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 25%; }

@media (prefers-reduced-motion: no-preference) {
  .trace .signal { stroke-dasharray: var(--len, 2400); stroke-dashoffset: var(--len, 2400); animation: draw 2.2s cubic-bezier(.6,.1,.2,1) 0.25s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.button {
  display: inline-block;
  font-family: var(--display); font-stretch: 108%; font-weight: 650; font-size: 1.02rem;
  text-decoration: none;
  background: var(--blue); color: var(--on-blue);
  padding: 0.8rem 1.35rem; border: 2px solid var(--blue); border-radius: 2px;
  cursor: pointer;
}
.button:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--on-blue); }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button.secondary:hover { background: var(--ink); color: var(--bg); }

/* ---------- Home: the services ---------- */
.services { display: grid; grid-template-columns: 1fr 1fr; }
.service--panel { background: var(--panel); color: var(--on-panel); }
.service--plain { background: var(--surface); }
.service.service--left { padding-left: var(--edge); }
.service.service--right { padding-right: var(--edge); }
.service { --edge: max(var(--gutter), calc((100vw - 82rem) / 2 + var(--gutter))); padding: clamp(2rem, 5vw, 4.5rem) var(--gutter); }
.service h2 { margin-top: 0; font-size: clamp(1.9rem, 1.3rem + 2vw, 3rem); color: inherit; }
.service p { max-width: 38ch; }
.service--panel .button { background: var(--on-panel); border-color: var(--on-panel); color: var(--panel); }
.service--panel .button:hover { background: transparent; color: var(--on-panel); }
.service .facts { list-style: none; padding: 0; margin: 0 0 1.75rem; font-size: 0.95em; }
.service .facts li { padding: 0.45rem 0; border-top: 1px solid var(--rule); }
.service--panel .facts li { border-top-color: var(--panel-rule); }

.about-strip {
  display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: start;
  padding-top: clamp(3rem, 7vw, 6rem); padding-bottom: clamp(3rem, 7vw, 6rem);
}
.about-strip h2 { margin-top: 0; }

/* ---------- Inner pages ---------- */
.page-head { padding-top: clamp(1.5rem, 5vw, 4rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.page-head h1 { max-width: 16ch; }
.page-head.with-photo {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(14rem, 24rem);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: end;
}
.page-head .head-photo { margin: 0; }
.page-head .head-photo img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

.page-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
  padding-bottom: clamp(3rem, 7vw, 6rem);
}
.page-body.single { grid-template-columns: minmax(0, 1fr); }
.page-body > .prose > h2:first-child { margin-top: 0; }

.aside-box { background: var(--surface); padding: 1.5rem 1.6rem; position: sticky; top: 1.5rem; }
.aside-box h2 { font-size: 1.35rem; margin: 0 0 0.75rem; font-stretch: 110%; }
.aside-box p:last-child { margin-bottom: 0; }

.price-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.price-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.65rem 0; border-top: 1px solid var(--rule); }
.price-list li:last-child { border-bottom: 1px solid var(--rule); }
.price-list .plan { font-family: var(--display); font-stretch: 100%; font-weight: 600; font-size: 0.98rem; }
.price-list .amount { font-family: var(--display); font-stretch: 118%; font-weight: 800; font-size: 1.45rem; white-space: nowrap; }
.price-list .amount small { font-family: var(--body); font-weight: 400; font-size: 0.6em; color: var(--muted); }

.plans { margin: 0 0 1.5rem; }
.plans dt { font-family: var(--display); font-stretch: 105%; font-weight: 680; padding-top: 1rem; border-top: 1px solid var(--rule); }
.plans dt .price { color: var(--muted); font-weight: 520; }
.plans dd { margin: 0.25rem 0 1rem; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.25rem 0 1.5rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.75rem 1fr; gap: 0 0.75rem; padding: 1rem 0; border-top: 1px solid var(--rule); }
.steps li::before {
  content: counter(step);
  font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 1.6rem; line-height: 1.1; color: var(--blue);
}
.steps strong { font-family: var(--display); font-stretch: 105%; font-weight: 680; display: block; }

.ticks { padding-left: 1.2rem; }
.ticks li { margin-bottom: 0.4rem; }
.ticks li::marker { color: var(--blue); }

.record { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.record li { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.7rem 0; border-top: 1px solid var(--rule); }
.record .when { font-family: var(--display); font-weight: 650; font-stretch: 100%; color: var(--muted); font-variant-numeric: tabular-nums; }

.portrait { margin: 0; }
.portrait img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }

/* ---------- Contact form ---------- */
.form { max-width: 36rem; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-family: var(--display); font-weight: 620; font-stretch: 100%; margin-bottom: 0.35rem; }
.field .hint { display: block; font-size: 0.9em; color: var(--muted); margin: -0.2rem 0 0.4rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--field); border: 1.5px solid var(--field-border); border-radius: 2px;
  padding: 0.7rem 0.8rem;
}
textarea { min-height: 10rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--ink); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: 0.92em; color: var(--muted); }
.form-status { margin-top: 1rem; padding: 0.9rem 1rem; display: none; }
.form-status.is-visible { display: block; }
.form-status.ok { background: var(--ok-bg); border-left: 4px solid var(--blue); }
.form-status.error { background: var(--error-bg); border-left: 4px solid var(--red); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding: 2.5rem 0 3rem; font-size: 0.95rem; }
.site-footer a { color: var(--footer-ink); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */
@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 26rem; }
  .services { grid-template-columns: 1fr; }
  .service.service--left, .service.service--right { padding-left: var(--gutter); padding-right: var(--gutter); }
  .service--plain + .service--plain { background: var(--bg); border-top: 1px solid var(--rule); }
  .about-strip { grid-template-columns: 1fr; }
  .page-head.with-photo { grid-template-columns: 1fr; }
  .page-head .head-photo { max-width: 22rem; }
  .page-body { grid-template-columns: 1fr; }
  .portrait { max-width: 22rem; }
  .aside-box { position: static; }
}

@media print {
  .site-nav, .site-footer, .trace, .actions { display: none; }
  :root { --bg: #fff; }
}

/* ---------- v3 additions ---------- */
.wordmark .sigil { width: 2.75rem; height: 2.75rem; display: block; }
.wordmark picture { display: block; flex: none; line-height: 0; }
p, li, dd, dt { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
.trace .guide { fill: none; stroke: var(--muted); opacity: 0.4; stroke-width: 1.2; stroke-dasharray: 3 5; }

.note { font-size: 0.95em; color: var(--muted); border-left: 3px solid var(--red); padding: 0.1rem 0 0.1rem 0.9rem; margin: 0 0 1.5rem; max-width: 46ch; }

.menu-toggle {
  display: none; align-items: center; gap: 0.4rem;
  font-family: var(--display); font-weight: 620; font-size: 0.98rem;
  background: transparent; color: var(--ink); border: 1.5px solid var(--rule); border-radius: 2px;
  padding: 0.45rem 0.8rem; cursor: pointer;
}
.menu-toggle:hover { border-color: var(--ink); }

.faq { margin: 0 0 1.5rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 0.95rem 2rem 0.95rem 0; position: relative;
  font-family: var(--display); font-stretch: 100%; font-weight: 640;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.75rem; font-size: 1.4rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 1rem; }

.pubs { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.pubs li { padding: 0.8rem 0; border-top: 1px solid var(--rule); }
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .status { color: var(--muted); }
.interests { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.interests li { border: 1px solid var(--rule); padding: 0.3rem 0.7rem; font-size: 0.95em; }

.site-footer .contact-line { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

/* v3.3: two-row header for the longer menu names */
.site-nav { display: contents; }
.site-header { row-gap: 0.5rem; }
.theme-toggle { order: 2; margin-left: auto; }
.menu-toggle { order: 3; }
.site-nav nav { order: 4; flex-basis: 100%; }
.site-nav ul { gap: 0.2rem 1.7rem; padding-top: 0.6rem; border-top: 1px solid var(--rule); }
.site-nav a { font-size: 0.97rem; }
.wordmark .sigil { width: 3rem; height: 3rem; color: var(--ink); }
.site-nav li a { display: inline-block; }
/* v3.4: the menu opens from a button at every screen size (Marc's choice) */
.js .menu-toggle { display: inline-flex; }
.js .site-nav nav { display: none; }
.js .site-nav nav.is-open { display: block; }
.js .site-nav ul { flex-direction: column; gap: 0; padding-top: 0; border-top: 1px solid var(--rule); }
.js .site-nav li a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); }
.js .site-nav a[aria-current="page"] { border-bottom-color: var(--rule); color: var(--blue); }
.site-header { gap: 0.75rem; }
@media (min-width: 48rem) {
  .site-header { position: relative; }
  .js .site-nav nav.is-open {
    position: absolute; top: calc(100% - 0.4rem); right: var(--gutter); z-index: 60;
    width: 23rem; max-width: calc(100% - 2 * var(--gutter));
    background: var(--bg); border: 1px solid var(--rule); box-shadow: 0 14px 34px rgba(15, 27, 45, 0.16);
    padding: 0.2rem 1.25rem 0.4rem;
  }
  .js .site-nav nav.is-open ul { border-top: 0; }
  .js .site-nav nav.is-open li:last-child a { border-bottom: 0; }
}
}
@media (max-width: 30rem) {
  .wordmark { font-stretch: 100%; font-size: 1.02rem; gap: 0.45rem; }
  .wordmark .sigil { width: 2.6rem; height: 2.6rem; }
}
