/* ==========================================================================
   brianelliot.me — shared stylesheet
   Refined editorial: ivory ground, ink type, bronze accent.
   Fraunces (display serif) + Instrument Sans (body).
   ========================================================================== */

:root {
  --ivory: #faf7f1;
  --ivory-deep: #f3eee4;
  --ink: #1d1a15;
  --ink-soft: #4a443b;
  --ink-faint: #857d6f;
  --bronze: #96682a;
  --bronze-dark: #7a5220;
  --hairline: rgba(29, 26, 21, 0.14);
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Instrument Sans", "Helvetica Neue", sans-serif;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --measure: 34em;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem; /* keep anchored sections clear of the sticky header */
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; }

::selection { background: rgba(150, 104, 42, 0.22); }

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

/* ---------- type ---------- */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 470;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bronze);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
}

.eyebrow::after {
  content: "";
  height: 1px;
  width: 3.5rem;
  background: var(--bronze);
  opacity: 0.5;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 241, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.35s ease;
}

.site-header.scrolled {
  box-shadow: 0 12px 32px -20px rgba(29, 26, 21, 0.35);
}

.site-header .bar {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 520;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark em {
  font-style: italic;
  color: var(--bronze);
}

.site-nav {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: baseline;
}

.site-nav a {
  position: relative;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding-bottom: 3px;
  transition: color 0.2s;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--bronze);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after,
.site-nav a.active::after { transform: scaleX(1); }
.site-nav a.active { color: var(--ink); }

/* ---------- layout helpers ---------- */

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

section { position: relative; }

/* ---------- hero ---------- */

.hero {
  padding: clamp(2rem, 5vh, 3.5rem) 0 clamp(2.5rem, 6vh, 4.5rem);
  overflow: hidden;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

/* small optical offset so the headline doesn't sit flush with the portrait top */
.hero .wrap > div:first-child { padding-top: clamp(0.5rem, 5vh, 3rem); }

.hero h1 {
  font-size: clamp(2.3rem, 4.8vw, 3.9rem);
  text-wrap: balance;
}

/* roman (upright) ampersand — the Fraunces italic form is too ornate */
.hero h1 .amp {
  font-style: normal;
  color: var(--bronze);
  font-weight: 400;
}

.hero .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 1.5rem 0 2.25rem;
}

.hero-actions { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }

/* portrait with offset bronze frame */
.portrait-frame {
  position: relative;
  justify-self: end;
  width: min(100%, 20rem);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 1px solid var(--bronze);
  opacity: 0.55;
  z-index: 0;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.portrait-frame:hover::before { transform: translate(-8px, -8px); }

/* the image file itself is cropped to 3:4 — no CSS cropping needed */
.portrait-frame img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  filter: saturate(0.92);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s,
              transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}

.btn:hover {
  background: var(--ink);
  color: var(--ivory);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -16px rgba(29, 26, 21, 0.5);
}

.btn:active { transform: translateY(0); box-shadow: none; }

.btn-solid { background: var(--ink); color: var(--ivory); }
.btn-solid:hover { background: var(--bronze-dark); border-color: var(--bronze-dark); }

.btn-light { border-color: var(--ivory); color: var(--ivory); }
.btn-light:hover { background: var(--ivory); color: var(--ink); box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.6); }

/* text links draw their underline across on hover */
.text-link {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bronze-dark);
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(150, 104, 42, 0.3);
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 0 1px;
  transition: color 0.25s, background-size 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.text-link:hover {
  color: var(--ink);
  background-size: 100% 1px;
}

/* ---------- belief band ---------- */

.belief {
  border-top: 1px solid var(--hairline);
  background: var(--ivory-deep);
  padding: clamp(3rem, 8vh, 5.5rem) 0;
}

.belief .wrap {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4rem);
}

.belief h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  max-width: 16em;
}

.belief h2 em { color: var(--bronze); }

.belief p {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.belief p:last-child { margin-bottom: 0; }

/* ---------- track record cards ---------- */

.record {
  border-top: 1px solid var(--hairline);
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
}

.record h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  max-width: 18em;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.card:hover { transform: translateY(-6px); }

.card .thumb {
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 1.4rem;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.72);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s;
}

.card:hover .thumb img { transform: scale(1.06); filter: saturate(1); }

.card .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--bronze);
  margin-bottom: 0.5rem;
}

.card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.65rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- about / background ---------- */

.bio {
  border-top: 1px solid var(--hairline);
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
}

.bio .wrap {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

/* photo column is width-capped; image files are pre-cropped (portrait 3:4,
   family landscape 3:2), so the column stays shorter than the text beside it */
.bio-photos {
  max-width: 22rem;
  width: 100%;
}

.bio-photos img {
  width: 100%;
  height: auto;
  filter: saturate(0.92);
}

.bio-photos .secondary {
  position: relative;
  width: 88%;
  margin: -3rem 0 0 auto;
  border: 6px solid var(--ivory);
  box-shadow: 0 18px 40px rgba(29, 26, 21, 0.18);
}

.bio h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-bottom: 1.75rem;
}

.bio p {
  margin: 0 0 1.3rem;
  color: var(--ink-soft);
  max-width: var(--measure);
}

.bio .creds {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 1rem 2.5rem;
  justify-content: start;
}

.bio .creds div { font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink-soft); }

.bio .creds strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 520;
  color: var(--ink);
  letter-spacing: 0;
}

/* ---------- testimonials ---------- */

.testimonials {
  border-top: 1px solid var(--hairline);
  background: var(--ivory-deep);
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
}

.testimonials h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.quote {
  background: var(--ivory);
  border: 1px solid var(--hairline);
  padding: 2rem 1.9rem 1.7rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.45s, box-shadow 0.45s;
}

.quote:hover {
  transform: translateY(-5px);
  border-color: rgba(150, 104, 42, 0.45);
  box-shadow: 0 22px 44px -24px rgba(29, 26, 21, 0.3);
}

.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.45;
  font-weight: 450;
}

.quote blockquote::before {
  content: "“";
  display: block;
  font-size: 2.6rem;
  line-height: 0.6;
  color: var(--bronze);
  margin-bottom: 0.75rem;
}

.quote cite {
  margin-top: auto;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- CTA band ---------- */

.cta {
  position: relative;
  color: var(--ivory);
  padding: clamp(4rem, 12vh, 8rem) 0;
  isolation: isolate;
  overflow: hidden;
}

.cta .bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
}

.cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(20, 17, 12, 0.82) 20%, rgba(20, 17, 12, 0.45) 100%);
}

.cta h2 {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  max-width: 12em;
  margin-bottom: 2.25rem;
}

.cta h2 em { color: #d8a95c; }

/* gentle parallax on larger screens (fixed backgrounds misbehave on mobile) */
@media (min-width: 56rem) {
  .cta .bg { background-attachment: fixed; }
}

/* ---------- contact ---------- */

.contact {
  padding: clamp(3.5rem, 9vh, 6.5rem) 0 clamp(4rem, 10vh, 7rem);
}

.contact h2 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
}

.contact h2 em { color: var(--bronze); }

.contact .lede {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin: 1.25rem 0 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
  margin-top: clamp(2.5rem, 6vh, 3.5rem);
}

form.contact-form { display: grid; gap: 1.5rem; }

/* honeypot — hidden from humans, visible to spam bots */
.hidden-field { position: absolute; left: -9999px; opacity: 0; }

.field { display: grid; gap: 0.45rem; }

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.2s;
}

.field:focus-within label { color: var(--bronze-dark); }

.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  padding: 0.6rem 0.1rem;
  border-radius: 0;
  transition: border-color 0.25s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--bronze);
}

.field textarea { resize: vertical; min-height: 8rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.contact-aside {
  border-left: 1px solid var(--hairline);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  display: grid;
  gap: 2rem;
  align-content: start;
}

.contact-aside h3 {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}

.contact-aside p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 2.25rem 0 2.5rem;
  background: var(--ivory);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.site-footer a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--hairline); transition: color 0.2s, border-color 0.2s; }
.site-footer a:hover { color: var(--ink); border-bottom-color: var(--bronze); }

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .card, .quote, .btn, .portrait-frame::before { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 56rem) {
  .hero .wrap,
  .belief .wrap,
  .bio .wrap,
  .contact-grid { grid-template-columns: 1fr; }

  .hero { padding-top: 1.75rem; }

  .portrait-frame {
    justify-self: start;
    margin-top: 0.5rem;
    width: min(100%, 22rem);
  }

  /* square crop keeps the hero compact on small screens (progressive enhancement) */
  .portrait-frame img { aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 20%; }

  .card-grid { grid-template-columns: 1fr 1fr; }
  .quote-grid { grid-template-columns: 1fr; }

  .contact-aside {
    border-left: none;
    border-top: 1px solid var(--hairline);
    padding-left: 0;
    padding-top: 2rem;
  }
}

@media (max-width: 34rem) {
  html { scroll-padding-top: 6.5rem; }

  .site-header .bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }

  .site-nav { gap: 1.4rem; }

  .eyebrow::after { display: none; }

  .hero { padding-top: 1.25rem; }
  .hero .lede { margin: 1.25rem 0 1.75rem; }

  .card-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .bio .creds { grid-template-columns: 1fr; }

  .btn { display: block; text-align: center; }
  .hero-actions .btn { flex: 1 1 100%; }
}
