/* Soft palette: white page, gray words, a pale gray for secondary bands, gold for the line and buttons. */
:root {
  --wall: #FFFFFF;
  --mist: #F4F3F0;
  --thread: #BF9E57;
  --thread-light: #DEC383;
  --thread-text: #846826;
  --ink: #4A4947;
  --ink-soft: #706E69;
  --rule: rgba(74, 73, 71, .16);
  --rule-strong: rgba(74, 73, 71, .38);
  --display: "Josefin Sans", "Century Gothic", "Avenir Next", sans-serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --gutter: clamp(20px, 5vw, 80px);
  --page: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 1.125rem/1.7 var(--text); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
h1, h2, h3, h4, p, ul, dl, dd, figure, address { margin: 0; }
ul { padding: 0; list-style: none; }
address { font-style: normal; }
abbr { text-decoration: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--wall); padding: 10px 16px; }
.skip:focus { left: 8px; }

.thread { fill: none; stroke: var(--thread); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* Josefin sits high on its baseline, so buttons carry more padding on top. */
.button {
  display: inline-block; padding: 17px 26px 12px; border: 0; border-radius: 4px; background: var(--thread-light); color: var(--ink);
  font: 400 1.0625rem/1 var(--display); letter-spacing: .02em; text-decoration: none; cursor: pointer;
}
.button:hover { background: #D3B56E; }
.button-small { padding: 13px 18px 9px; font-size: 1rem; }
.button-light { background: var(--thread-light); color: var(--ink); }
.button-light:hover { background: #D3B56E; }
.plain-link { font: 400 1.0625rem/1 var(--display); letter-spacing: .02em; }

/* Header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter); border-bottom: 1px solid transparent;
}
.top.is-scrolled { background: var(--wall); border-bottom-color: var(--rule); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 48px; height: 48px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; padding-top: 4px; }
.brand-name { font: 400 1.0625rem/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-role { font: 400 .875rem/1.3 var(--text); color: var(--ink-soft); font-style: italic; }
.nav { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); }
.nav a { font: 400 1.0625rem/1 var(--display); text-decoration: none; }
.nav a:not(.button) { padding: 8px 0 4px; }
.nav a:not(.button):hover { text-decoration: underline; }
.menu-button { display: none; }

/* Hero: the one loud thing on the page is the line. */
/* Sized to its content (not the full screen height), so the space under the
   buttons stays about 84–100px: 84px padding plus up to ~16px where the
   line drawing is a little taller than the text. */
.hero {
  background: var(--mist); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  align-items: center; column-gap: clamp(24px, 4vw, 56px); overflow: hidden;
  padding: 120px max(var(--gutter), calc((100vw - var(--page)) / 2)) 84px;
}
.hero-text { grid-column: 1; grid-row: 1; min-width: 0; }
.hero h1 { font: 300 clamp(2.75rem, 7vw, 6rem)/1.04 var(--display); letter-spacing: -.025em; max-width: 7.4em; text-wrap: balance; }
.hero-lede { margin-top: 28px; max-width: 30em; font-size: clamp(1.125rem, 1.6vw, 1.3125rem); }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.hero-tangle { grid-column: 2; grid-row: 1; justify-self: end; width: 100%; max-width: 600px; pointer-events: none; }

/* Bands */
.band { padding: clamp(32px, 4.4vw, 60px) var(--gutter); }
.band-mist { background: var(--mist); }
.wrap { max-width: var(--page); margin: 0 auto; }
.wrap-gap { margin-top: clamp(40px, 5vw, 64px); }
.heading { font: 300 clamp(2.25rem, 4.6vw, 3.75rem)/1.08 var(--display); letter-spacing: -.02em; margin-bottom: clamp(24px, 3vw, 36px); }
.subheading { font: 300 clamp(1.625rem, 2.6vw, 2.25rem)/1.15 var(--display); letter-spacing: -.01em; margin-bottom: 24px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(32px, 6vw, 96px); align-items: start; }
.pair > p:last-child { max-width: 58ch; }

.prose { display: grid; gap: 1.1em; align-content: start; max-width: 62ch; }
.lead { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.3; }
.lead-narrow { max-width: 26em; }

/* About */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%; border-radius: 2px; }
.facts { display: grid; gap: 0; margin-top: 16px; border-top: 1px solid var(--rule); font-size: 1rem; }
.facts div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-soft); }

/* Services: plain rows, since these are three kinds of the same thing, not a sequence. */
.services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px clamp(24px, 3vw, 44px); }
.service > p { font-size: 1.0625rem; line-height: 1.65; }
@media (max-width: 1150px) { .services { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.service { padding-top: 22px; border-top: 1px solid var(--rule-strong); }
.service h3 { font: 300 clamp(1.75rem, 2.8vw, 2.375rem)/1.1 var(--display); letter-spacing: -.01em; }
.service-kind { margin: 4px 0 18px; font-style: italic; color: var(--ink-soft); }
.areas { columns: 4 11em; column-gap: 40px; font-size: 1.125rem; line-height: 1.5; }
.areas li { padding: 5px 0; break-inside: avoid; }

/* Office */
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px) clamp(16px, 2vw, 28px); max-width: var(--page); margin: 0 auto; }
.photo img { width: 100%; aspect-ratio: 10 / 7; object-fit: cover; border-radius: 2px; }
.photo-lead { grid-column: 1 / -1; }
.photo-lead img { aspect-ratio: auto; }
.photo figcaption { margin-top: 10px; font-size: 1rem; font-style: italic; color: var(--ink-soft); }

/* Team */
.member { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.member + .member { margin-top: clamp(40px, 5vw, 72px); padding-top: clamp(40px, 5vw, 72px); border-top: 1px solid var(--rule); }
.member-photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: 2px; }
.member-name { font: 300 clamp(2rem, 3.6vw, 3rem)/1.1 var(--display); letter-spacing: -.02em; }
.member-cred { font-size: 1rem; font-style: italic; color: var(--ink-soft); margin-top: -.6em; }
.member h4 { font: 600 1rem/1.3 var(--display); margin-top: .6em; padding-top: 4px; }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px clamp(32px, 6vw, 96px); align-items: stretch; }
.contact-main { display: grid; gap: clamp(36px, 4vw, 56px); align-content: start; }
.map { width: 100%; height: 100%; min-height: 420px; border: 0; border-radius: 2px; background: var(--wall); }
.contact-lines { display: grid; border-top: 1px solid var(--rule); }
.contact-lines div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 16px 0 13px; border-bottom: 1px solid var(--rule); }
.contact-lines span { font-size: 1rem; font-style: italic; color: var(--ink-soft); }
.contact-lines a { font: 400 clamp(1.1875rem, 1.7vw, 1.4375rem)/1.35 var(--display); text-decoration: none; overflow-wrap: anywhere; }
.contact-lines a:hover { color: var(--thread-text); text-decoration: underline; }
.form { display: grid; gap: 22px; max-width: 640px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label { font-size: 1rem; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%; padding: 8px 0 10px; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0;
  background: transparent; color: var(--ink); font: 400 1.125rem/1.5 var(--text); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-bottom: 2px solid var(--thread); padding-bottom: 9px; }
.form .button { justify-self: start; }
.form .button:disabled { opacity: .6; cursor: default; }
.form-done { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.35; }
.form-done:focus { outline: none; }
.form [hidden] { display: none; }
.form-note { font-size: .9375rem; line-height: 1.55; color: var(--ink-soft); max-width: 52ch; }
.form-error { font-size: 1rem; color: #A3463A; }
.form-error a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.foot { background: var(--mist); color: var(--ink-soft); font-size: .9375rem; line-height: 1.55; padding: 28px var(--gutter) 40px; border-top: 1px solid var(--rule); display: grid; gap: 6px; }
.foot p { max-width: var(--page); width: 100%; margin: 0 auto; }
.foot-line { display: flex; flex-wrap: wrap; gap: 4px 2em; }
.foot-line a { color: inherit; font: inherit; text-decoration: none; }
.foot-line a:hover { color: var(--ink); text-decoration: underline; }

.dock { display: none; }

/* Privacy page: the Google Analytics on/off control, styled as a text link. */
.link-button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; cursor: pointer; }
.policy-control[hidden] { display: none; }

/* Privacy policy page */
.policy { padding-top: clamp(120px, 12vw, 160px); padding-bottom: clamp(48px, 6.2vw, 88px); }
.policy h2 { font: 400 1.375rem/1.3 var(--display); margin-top: .9em; padding-top: 4px; }
.policy .heading { margin-bottom: 0; }
.policy-date { font-size: 1rem; font-style: italic; color: var(--ink-soft); }

/* The closing loop draws once when it comes into view. */
.js .thread-draw { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js .thread-draw.is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s cubic-bezier(.5, 0, .2, 1); }

@media (max-width: 899px) {
  .menu-button { display: block; position: relative; z-index: 60; padding: 14px 4px 9px; border: 0; background: none; color: var(--ink); font: 400 1.0625rem/1 var(--display); cursor: pointer; }
  .nav { position: fixed; inset: 0; z-index: 55; flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px; padding: 0 var(--gutter); background: var(--mist); display: none; }
  .nav.is-open { display: flex; }
  .nav a:not(.button) { font-size: 2.25rem; font-weight: 300; }
  .nav .button { margin-top: 12px; }

  .hero { display: block; min-height: 0; padding: 96px var(--gutter) clamp(40px, 6vw, 48px); }
  .hero-tangle { width: min(100%, 380px); margin: 0 auto 8px; }
  .about, .pair, .services, .member, .contact { grid-template-columns: 1fr; }
  .map { height: 320px; min-height: 0; }
  .portrait { max-width: 320px; order: -1; }
  .member-photo { max-width: 280px; }
  .photos { grid-template-columns: 1fr; }
  .foot { padding-bottom: 96px; }

  .dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--wall); transform: translateY(100%); transition: transform .3s ease-out; }
  .dock.is-shown { transform: none; }
  .dock a { background: var(--thread-light); color: var(--ink); text-align: center; padding: 18px 12px 13px; font: 400 1.0625rem/1 var(--display); text-decoration: none; }
}
@media (max-width: 520px) {
  .field-pair { grid-template-columns: 1fr; }
  .brand-role { display: none; }
  .contact-lines div { grid-template-columns: 4.25em minmax(0, 1fr); gap: 10px; }
  .contact-lines a { font-size: 1.0625rem; overflow-wrap: normal; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: .9375rem; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dock { transition: none; }
  .js .thread-draw, .js .thread-draw.is-drawn { stroke-dashoffset: 0; transition: none; }
}
