/* Nicholas Soleyn: site styles. Palette and type per "Website Plan & First Draft". */
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --paper: #FAF8F3;      /* background */
  --ink: #1F2328;        /* body text, headings: 14.9:1 */
  --secondary: #5B6169;  /* labels, captions, footer: 5.9:1 */
  --rule: #E4DFD5;       /* hairlines only, never text */
  --accent: #9A3B26;     /* links, buttons, focus: 6.5:1; white on it 6.9:1 */
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 42.5rem;    /* about 66 characters at body size */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.6;
  font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
@media (min-width: 48em) { body { font-size: 1.25rem; } }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }

/* Skip link and focus */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; font-family: var(--sans); font-size: .9rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
.wordmark { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-nav a { font-family: var(--sans); font-size: .95rem; color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--rule); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }

/* Type */
main { padding: 3rem 0 2rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); }
h1 { font-size: 2.125rem; margin: 0 0 1.25rem; letter-spacing: -.01em; }
h2 { font-size: 1.5rem; margin: 3rem 0 1rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
@media (min-width: 48em) { h1 { font-size: 2.75rem; } h2 { font-size: 1.75rem; } h3 { font-size: 1.3rem; } }
p { margin: 0 0 1.1rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
.lede { font-size: 1.15em; color: var(--ink); }
.section { border-top: 1px solid var(--rule); margin-top: 3rem; }
.section > h2:first-child { margin-top: 2.5rem; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin: 1.75rem 0 0; }
.button { display: inline-block; font-family: var(--sans); font-size: 1rem; font-weight: 600; background: var(--accent); color: #fff; text-decoration: none; padding: .8rem 1.25rem; border-radius: 4px; border: 2px solid var(--accent); cursor: pointer; line-height: 1.2; }
.button:hover { background: #7f3020; border-color: #7f3020; text-decoration: none; }
.button[disabled] { opacity: .7; cursor: progress; }
.text-link { font-family: var(--sans); font-size: 1rem; }

/* Services summary list */
.services { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.services li { padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.services li:first-child { border-top: 1px solid var(--rule); }
.services strong { font-weight: 600; }

/* Process steps */
.steps { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.steps li { margin: 0 0 .75rem; padding-left: .25rem; }
.steps li::marker { font-family: var(--sans); color: var(--secondary); font-size: .9em; }

/* Selected work */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-list li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.work-list li:first-child { border-top: 1px solid var(--rule); }
.label { display: block; font-family: var(--sans); font-size: .8125rem; font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--secondary); margin-bottom: .35rem; text-transform: lowercase; }
.work-title { font-style: italic; }
.work-list p { margin: .25rem 0 0; }
.work-list .text-link { display: inline-block; margin-top: .5rem; }

/* Closing band */
.closing { border-top: 1px solid var(--rule); margin-top: 3.5rem; padding-top: 2.5rem; }
.closing h2 { margin-top: 0; }

/* Portrait slot: renders only when a figure with an image is present */
.portrait { margin: 0 0 2rem; }
.portrait img { display: block; width: 100%; max-width: 16rem; height: auto; border-radius: 2px; }
.portrait:not(:has(img)) { display: none; }
@media (min-width: 48em) {
  .about-intro.has-portrait { display: grid; grid-template-columns: 1fr 14rem; gap: 2.5rem; align-items: start; }
  .about-intro.has-portrait .portrait { grid-column: 2; grid-row: 1; margin: .35rem 0 0; }
  .about-intro.has-portrait .lede { grid-column: 1; grid-row: 1; margin-top: 0; }
}

/* Pull quote (reserved; for Nicholas's own words only, never testimonials) */
.pull { font-style: italic; font-size: 1.2em; border-left: 2px solid var(--accent); margin: 2rem 0; padding: .25rem 0 .25rem 1.25rem; }

/* Form */
.form { margin-top: 2rem; }
.field { margin: 0 0 1.5rem; border: 0; padding: 0; }
.field label, .field legend { display: block; font-family: var(--sans); font-size: .95rem; font-weight: 600; margin-bottom: .35rem; padding: 0; }
.req, .opt { font-weight: 400; color: var(--secondary); }
.hint { display: block; font-family: var(--sans); font-size: .875rem; color: var(--secondary); margin: 0 0 .5rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid #8b9097; border-radius: 4px; padding: .7rem .8rem;
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.checks { display: grid; gap: .4rem; font-family: var(--sans); font-size: 1rem; }
.checks label { font-weight: 400; display: flex; gap: .6rem; align-items: center; margin: 0; }
.checks input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
.field-error { display: block; font-family: var(--sans); font-size: .9rem; color: var(--accent); font-weight: 600; margin-top: .4rem; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--accent) !important; border-width: 2px !important; }
.form-status { font-family: var(--sans); font-size: 1rem; border-left: 3px solid var(--accent); padding: .75rem 1rem; background: #fff; margin: 0 0 1.5rem; }
.form-status:empty { display: none; }
.privacy { font-family: var(--sans); font-size: .875rem; color: var(--secondary); margin-top: .9rem; }
.fallback { font-family: var(--sans); font-size: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; font-family: var(--sans); font-size: .875rem; color: var(--secondary); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { color: var(--secondary); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .site-nav, .closing, .skip { display: none; } body { background: #fff; } }

/* Cartoons */
.cartoons .cartoon-note {
  font-family: var(--sans); font-size: .875rem; color: var(--secondary);
  margin: -.5rem 0 1.25rem; font-style: italic;
}
.cartoon-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.75rem;
}
@media (min-width: 40em) {
  .cartoon-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1.25rem; }
  .cartoon-grid li:last-child:nth-child(odd) { grid-column: 1 / -1; max-width: 28rem; justify-self: center; }
}
.cartoon-grid figure { margin: 0; }
.cartoon-grid img {
  display: block; width: 100%; height: auto;
  border-radius: 2px; border: 1px solid var(--rule); background: #fff;
}
.cartoon-grid figcaption {
  font-family: var(--sans); font-size: .9rem; color: var(--secondary);
  margin-top: .55rem; line-height: 1.45;
}
