/* Humble Goats — shared styles
   Palette: lichen (page), basalt (ink), amber (goat-eye accent), slate, moss */
:root {
  --lichen: #E4E8DC;
  --lichen-deep: #D5DBCA;
  --paper: #F5F7F0;
  --basalt: #1E2826;
  --basalt-soft: #46524E;
  --amber: #E9A320;
  --amber-deep: #B87A0A;
  --slate: #3B5566;
  --moss: #5E6B4E;

  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Source Serif 4", Georgia, serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lichen);
  color: var(--basalt);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  font-optical-sizing: auto;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--amber-deep); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 38em; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
}
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: 1.5rem; font-stretch: 110%; line-height: 1.15; }
p { margin: 0 0 1em; }

/* ---------- Header ---------- */
.site-header { padding: 20px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 40px; height: 40px; }
.brand span { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 1.35rem; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: clamp(12px, 3vw, 32px); font-family: var(--display); font-weight: 600; font-size: 1rem; }
.nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--basalt); }
.nav a[aria-current="page"] { border-bottom-color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 110%;
  font-size: 1.05rem;
  text-decoration: none;
  background: var(--basalt);
  color: var(--paper);
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid var(--basalt);
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--amber); color: var(--basalt); border-color: var(--basalt); }
.nav .btn { white-space: nowrap; padding: 9px 18px; font-size: .95rem; border-bottom: 2px solid var(--basalt); }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 10vw, 120px) 0 clamp(56px, 9vw, 110px); }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 5.4rem); }
.hero h1 .correction { display: inline-block; margin-top: .45em; }
.hero .lede { font-size: clamp(1.15rem, 2vw, 1.4rem); margin-top: 1.4em; max-width: 34em; color: var(--basalt-soft); }
.hero .actions { margin-top: 2em; display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.hero .aside { font-family: var(--hand); font-size: 1.5rem; color: var(--slate); }

/* The correction: struck phrase + handwritten replacement */
.correction { position: relative; display: inline-block; white-space: nowrap; }
.correction .struck { position: relative; }
.correction .struck::after {
  content: "";
  position: absolute;
  left: -2%; right: -2%;
  top: 54%;
  height: .1em;
  background: var(--amber);
  transform: rotate(-1deg) scaleX(0);
  transform-origin: left center;
  border-radius: 4px;
  animation: strike .5s cubic-bezier(.6,.1,.3,1) .7s forwards;
}
.correction .fix {
  position: absolute;
  left: 4%;
  top: -0.78em;
  font-family: var(--hand);
  font-weight: 700;
  font-stretch: normal;
  font-size: .62em;
  color: var(--amber-deep);
  transform: rotate(-4deg);
  letter-spacing: 0;
  opacity: 0;
  animation: write .4s ease-out 1.25s forwards;
  white-space: nowrap;
}
@keyframes strike { to { transform: rotate(-1deg) scaleX(1); } }
@keyframes write { from { opacity: 0; transform: rotate(-4deg) translateY(6px); } to { opacity: 1; transform: rotate(-4deg); } }

@media (prefers-reduced-motion: reduce) {
  .correction .struck::after { animation: none; transform: rotate(-1deg) scaleX(1); }
  .correction .fix { animation: none; opacity: 1; }
  .btn { transition: none; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 9vw, 110px) 0; }
.section--paper { background: var(--paper); }
.section--ink { background: var(--basalt); color: var(--paper); }
.section-intro { margin-bottom: clamp(32px, 5vw, 56px); }
.section-intro p { margin-top: .9em; color: var(--basalt-soft); max-width: 36em; }
.section--ink .section-intro p { color: #C9D1C6; }

/* They say / we say */
.saying { display: grid; gap: 0; border-top: 2px solid var(--basalt); }
.saying-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 4vw, 56px); padding: 28px 0; border-bottom: 1px solid var(--lichen-deep); }
.saying-row .they { font-family: var(--display); font-weight: 700; font-stretch: 112%; font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.15; }
.saying-row .we { font-size: 1.1rem; color: var(--basalt-soft); align-self: center; }
.saying-head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 4vw, 56px); padding: 12px 0; font-family: var(--hand); font-size: 1.6rem; color: var(--slate); }

/* Range: startup to Fortune 50 */
.range { position: relative; margin-top: 8px; }
.range svg { width: 100%; height: auto; }
.range-labels { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-stretch: 110%; margin-top: 12px; gap: 12px; }
.range-labels span:last-child { text-align: right; }
.range-labels small { display: block; font-family: var(--body); font-weight: 400; font-stretch: normal; color: #C9D1C6; font-size: .95rem; }

/* Industries */
.industries { display: flex; flex-wrap: wrap; gap: 10px 12px; list-style: none; padding: 0; margin: 0; }
.industries li { border: 1.5px solid var(--basalt); border-radius: 999px; padding: 6px 16px; font-size: 1rem; background: var(--paper); }

/* Closing CTA */
.closing { padding: clamp(64px, 10vw, 130px) 0; background: var(--amber); }
.closing h2 { max-width: 13em; }
.closing p { max-width: 32em; margin: 1.1em 0 1.8em; font-size: 1.2rem; }
.closing .btn:hover { background: var(--paper); }

/* ---------- About ---------- */
.page-hero { padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); }
.page-hero h1 { font-size: clamp(2.4rem, 7vw, 5.5rem); max-width: 12em; }
.page-hero .lede { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-top: 1.2em; color: var(--basalt-soft); max-width: 36em; }

.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(24px, 6vw, 80px); align-items: start; }
.story .pull { font-family: var(--hand); font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.15; color: var(--slate); transform: rotate(-2deg); }

.rules { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 clamp(24px, 3vw, 40px); }
.rules li { border-top: 2px solid var(--basalt); padding: 20px 0 32px; }
.rules h3 { margin-bottom: .45em; }
.rules p { color: var(--basalt-soft); margin: 0; }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: clamp(28px, 4vw, 48px); }
.goat { display: grid; gap: 12px; }
.goat .photo { aspect-ratio: 4 / 5; background: var(--lichen-deep); border-radius: 160px 160px 12px 12px; display: grid; place-items: center; overflow: hidden; }
.goat .photo img { width: 100%; height: 100%; object-fit: cover; }
.goat .photo span { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: 3rem; color: var(--moss); }
.goat h3 { font-size: 1.35rem; }
.goat .role { font-family: var(--display); font-weight: 600; font-size: .98rem; color: var(--slate); margin: -4px 0 0; }
.goat p { font-size: 1rem; color: var(--basalt-soft); margin: 0; }
.goat .others { font-family: var(--hand); font-size: 1.3rem; color: var(--amber-deep); line-height: 1.2; }

/* ---------- Portfolio ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.filters button {
  font: 600 1rem var(--display);
  background: transparent; color: var(--basalt);
  border: 1.5px solid var(--basalt); border-radius: 999px;
  padding: 7px 16px; cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--basalt); color: var(--paper); }

.stories { display: grid; gap: 0; border-top: 2px solid var(--basalt); }
.case { border-bottom: 1px solid var(--lichen-deep); }
.case > button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 16px 32px; align-items: baseline;
  padding: 26px 0;
}
.case > button:focus-visible { outline: 3px solid var(--amber-deep); outline-offset: 2px; }
.case .title { font-family: var(--display); font-weight: 700; font-stretch: 112%; font-size: clamp(1.3rem, 2.6vw, 1.85rem); line-height: 1.15; }
.case .meta { color: var(--basalt-soft); font-size: 1rem; }
.case .toggle { font-family: var(--body); font-weight: 400; font-size: 2.2rem; line-height: 1; width: 1em; text-align: center; transition: transform .2s; }
.case[data-open="true"] .toggle { transform: rotate(45deg); }
.case .body { display: none; padding: 0 0 36px; }
.case[data-open="true"] .body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px clamp(24px, 4vw, 56px); }
.case .body h4 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; margin: 0 0 .4em; }
.case .body p { font-size: 1.02rem; color: var(--basalt-soft); margin: 0; }
.case .result p { color: var(--basalt); font-weight: 600; }
.case .body .byline { margin-top: -4px; color: var(--slate); grid-column: 1 / -1; font-family: var(--hand); font-size: 1.35rem; color: var(--slate); }
.placeholder-tag { font-family: var(--hand); color: var(--amber-deep); font-size: 1.2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--basalt); color: #C9D1C6; padding: 40px 0; font-size: .95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--paper); }
.site-footer .fine { font-family: var(--hand); font-size: 1.25rem; color: var(--amber); }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  body { font-size: 1.0625rem; }
  .nav { width: 100%; justify-content: space-between; }
  .saying-head { display: none; }
  .saying-row { grid-template-columns: 1fr; gap: 8px; }
  .saying-row .we::before { content: "What we say: "; font-family: var(--hand); font-size: 1.3rem; color: var(--slate); }
  .story { grid-template-columns: 1fr; }
  .case > button { grid-template-columns: minmax(0, 1fr) auto; }
  .case .meta { grid-column: 1; grid-row: 2; }
  .case .toggle { grid-column: 2; grid-row: 1; }
  .nav { gap: 20px; justify-content: flex-start; }
  .nav .btn { margin-left: auto; padding: 8px 14px; font-size: .9rem; }
  .correction { white-space: normal; display: flex !important; flex-direction: column-reverse; }
  .hero h1 .correction { margin-top: .2em; }
  .correction .fix { position: static; display: block; margin: 0 0 .1em; font-size: .7em; }
  .correction .struck::after { display: none; }
  .correction .struck { text-decoration: line-through; text-decoration-color: var(--amber); text-decoration-thickness: .1em; }
}

@media (max-width: 400px) {
  .nav .btn { display: none; }
}

/* ---------- Contact form ---------- */
.contact-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px clamp(20px, 3vw, 40px); max-width: 52rem; }
.field { display: grid; gap: 8px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-family: var(--display); font-weight: 700; font-size: 1rem; }
.field .opt { font-weight: 400; color: var(--basalt-soft); }
.field input, .field textarea {
  font: inherit; font-size: 1.05rem; color: var(--basalt);
  background: #fff; border: 1.5px solid var(--basalt-soft); border-radius: 10px;
  padding: 12px 14px; width: 100%;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--amber); outline-offset: 1px; border-color: var(--basalt); }
.field input::placeholder { color: #8A948F; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-actions .btn { cursor: pointer; }
.form-actions .btn:disabled { opacity: .6; cursor: progress; }
.form-error { margin: 0; color: #9B2C1F; font-weight: 600; }
.hp { position: absolute; left: -9999px; }
.form-sent { max-width: 36rem; }
.form-sent:focus { outline: none; }
.form-sent p { margin-top: 1em; font-size: 1.15rem; }
.form-sent .aside { font-family: var(--hand); font-size: 1.5rem; color: var(--slate); }
@media (max-width: 720px) {
  .contact-form { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }
