/* Kyle Spears — Merriweather + Public Sans (the U.S. Web Design System pairing).
   Federal green and paper; marigold for data and focus on dark; green focus on light. */
:root {
  --paper: #F3F5F4;
  --mist: #E7ECEA;
  --ink: #1B2B27;
  --green: #1F4D3F;
  --green-deep: #163A30;
  --marigold: #D9A021;
  --marigold-light: #F0C55A;
  --slate: #56635F;
  --rule: #C9D1CE;
  --sage-dark: #4F6B61;
  --serif: "Merriweather", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
}

[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.masthead :focus-visible, .hero :focus-visible, .page-head :focus-visible, .contact :focus-visible { outline-color: var(--marigold); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 20; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-block; font: 700 .95rem/1 var(--sans); text-decoration: none; padding: .8rem 1.15rem; border-radius: 3px; border: 2px solid transparent; }
.btn-light { background: var(--paper); color: var(--green-deep); border-color: var(--paper); }
.btn-light:hover { background: #fff; border-color: #fff; }
.btn-outline { background: transparent; color: var(--paper); border-color: rgba(243,245,244,.55); }
.btn-outline:hover { background: rgba(243,245,244,.1); border-color: var(--paper); }

/* Masthead */
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem var(--gutter); background: var(--green); color: var(--paper); }
.wordmark { font: 900 1.25rem/1 var(--serif); text-decoration: none; letter-spacing: -.01em; }
.masthead nav { display: flex; align-items: center; gap: 1.25rem; }
.masthead nav > a:not(.btn) { text-decoration: none; font-weight: 500; }
.masthead nav > a:not(.btn):hover { text-decoration: underline; }

/* Hero */
.hero {
  background: var(--green); color: var(--paper);
  padding: clamp(2.5rem, 6vw, 5rem) var(--gutter) clamp(2.5rem, 5vw, 4rem);
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem clamp(2rem, 4vw, 4rem); align-items: center;
}
.hero h1 { font: 900 clamp(2rem, 3.6vw, 3rem)/1.12 var(--serif); letter-spacing: -.015em; max-width: 24ch; }
.lede { margin-top: 1.4rem; font-size: 1.15rem; max-width: 56ch; color: rgba(243,245,244,.9); }
.proof { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.proof button {
  all: unset; box-sizing: border-box; display: block; width: 100%; height: 100%; cursor: pointer;
  border-left: 3px solid var(--marigold); padding: .15rem 0 .15rem .85rem;
  font: 400 .95rem/1.45 var(--sans); color: rgba(243,245,244,.9);
}
.proof strong { display: block; font: 900 1.85rem/1.1 var(--serif); color: var(--paper); margin-bottom: .25rem; text-decoration: underline dotted 2px var(--marigold-light); text-underline-offset: 7px; }
.proof button:hover strong { text-decoration-style: solid; }
.proof button:focus-visible { outline: 3px solid var(--marigold); outline-offset: 4px; }
.hero .actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-chart { margin: 0; }
.hero-chart svg { display: block; width: 100%; height: auto; }
.hero-chart figcaption { margin-top: .6rem; font-size: .85rem; color: rgba(243,245,244,.78); max-width: 46ch; }
.f-hist { fill: none; stroke: var(--paper); stroke-width: 3; vector-effect: non-scaling-stroke; }
.f-fore { fill: none; stroke: var(--marigold); stroke-width: 3; vector-effect: non-scaling-stroke; }
.f-band { fill: var(--marigold); opacity: .12; }
.f-edge { fill: none; stroke: var(--marigold-light); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: .9; }
.f-now { stroke: rgba(243,245,244,.5); stroke-width: 1; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.f-year { fill: rgba(243,245,244,.85); font: 500 14px var(--sans); }
.f-note { fill: var(--marigold-light); font: 700 14px var(--sans); }
.f-note-2 { fill: rgba(243,245,244,.85); font: 500 14px var(--sans); }
.band-in { opacity: 0; animation: band .6s ease-out .15s forwards; }
@keyframes band { to { opacity: .12; } }
@media (prefers-reduced-motion: reduce) { .band-in { animation: none; opacity: .12; } }

/* Experience + who band */
.rooms { padding: 2.25rem var(--gutter); background: var(--mist); border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 1.75rem 4rem; }
.rooms h2 { font: 700 1.05rem/1.3 var(--sans); color: var(--green); }
.rooms ul { list-style: none; padding: 0; margin: .9rem 0 0; }
.exp li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--rule); font-size: .95rem; color: var(--slate); }
.exp li:first-child { border-top: 0; padding-top: 0; }
.exp strong { grid-column: 1; display: block; font: 700 1rem/1.35 var(--serif); color: var(--ink); }
.exp span { grid-column: 2; grid-row: 1 / 3; align-self: start; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.who li { font-size: 1.02rem; color: var(--ink); padding: .1rem 0 .1rem .9rem; border-left: 3px solid var(--green); margin-top: .9rem; }
.who li:first-child { margin-top: 0; }
.who strong { font-family: var(--serif); font-weight: 700; }
.chart-kicker { font: 700 .92rem/1.3 var(--sans); color: var(--marigold-light); margin: 0 0 .25rem; }

/* Sections */
main > section:not(.hero):not(.rooms) { padding: clamp(3rem, 7vw, 5rem) var(--gutter); }
h2 { font: 900 clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--serif); letter-spacing: -.01em; }

/* Work */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1.25rem 2rem; margin-bottom: 1.75rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button { font: 500 .92rem/1 var(--sans); min-height: 44px; padding: 0 .95rem; border-radius: 999px; border: 1.5px solid #8A9893; background: transparent; color: var(--ink); cursor: pointer; }
.filters button:hover { border-color: var(--green); }
.filters button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--paper); }
.hint { color: var(--slate); margin: -.75rem 0 1.25rem; font-size: .95rem; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.tiles li[hidden] { display: none; }
.tile {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%; height: 100%; min-height: 15rem;
  display: grid; grid-template-rows: auto 1fr auto auto; gap: .35rem;
  padding: 1.4rem 1.4rem 1.2rem; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule);
}
.tiles li:nth-child(4n) .tile { border-right: 0; }
.tile:hover { background: var(--mist); }
.tile:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.tile-num { font: 900 clamp(2rem, 3vw, 2.6rem)/1 var(--serif); color: var(--green); letter-spacing: -.02em; }
.tile-title { font: 700 1.05rem/1.35 var(--sans); color: var(--ink); align-self: start; margin-top: .6rem; }
.tile-sub { font-size: .9rem; color: var(--slate); }
.tile-org { font-size: .85rem; font-weight: 700; color: var(--green); margin-top: .5rem; display: flex; justify-content: space-between; }
.tile-org::after { content: "View brief"; font-weight: 500; color: var(--slate); text-decoration: underline; text-underline-offset: 3px; }
.tile:hover .tile-org::after { color: var(--green); }

/* Side panel */
.panel { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(44rem, 100%); max-width: 100%; border: 0; padding: 0; background: var(--paper); color: var(--ink); display: none; flex-direction: column; }
.panel[open] { display: flex; animation: slide-in .26s cubic-bezier(.2,.7,.2,1); }
.panel::backdrop { background: rgba(22,58,48,.55); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel[open] { animation: none; } }
.panel-bar { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.75rem; border-bottom: 1px solid var(--rule); }
.panel-count { font-size: .9rem; color: var(--slate); }
.panel-close, .panel-nav button { font: 700 .95rem/1.2 var(--sans); min-height: 44px; padding: .5rem 1rem; border-radius: 3px; cursor: pointer; background: transparent; color: var(--green); border: 2px solid var(--green); }
.panel-close:hover, .panel-nav button:hover { background: var(--green); color: var(--paper); }
.panel-body { flex: 1; overflow-y: auto; padding: 1.75rem; }
.panel-body h3 { font: 700 clamp(1.4rem, 2.6vw, 1.8rem)/1.25 var(--serif); margin-top: .35rem; outline: none; }
.panel-body dl { margin: 1rem 0 0; }
.panel-body dt { font-weight: 700; color: var(--slate); font-size: .95rem; margin-top: .9rem; }
.panel-body dd { margin: .15rem 0 0; font-size: 1.05rem; max-width: var(--measure); }
.panel-body .brief-chart { margin: 1.75rem 0 0; max-width: 26rem; }
.panel-body .brief-chart svg { display: block; width: 100%; height: auto; }
.panel-nav { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 1.75rem; border-top: 1px solid var(--rule); }
.panel-nav button { max-width: 48%; text-align: left; }
.panel-nav #panel-next { text-align: right; }
.panel-nav .dest { display: block; font-weight: 500; font-size: .82rem; color: inherit; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.where { font-size: .92rem; font-weight: 700; color: var(--green); }
.more { display: inline-block; margin-top: 1.25rem; font-weight: 700; color: var(--green); text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* Chart primitives */
.c-big { font: 900 44px var(--serif); fill: var(--green); }
.c-label { font: 500 15px var(--sans); fill: var(--slate); }
.c-note { font: 400 14px var(--sans); fill: var(--slate); }
.c-in { font: 700 16px var(--sans); fill: var(--paper); }
.c-in-dark { font: 700 16px var(--sans); fill: var(--ink); }
.c-fill { fill: #A87A12; }
.c-fill-2 { fill: var(--green); }
.c-fill-3 { fill: var(--sage-dark); }
.c-axis { stroke: var(--rule); stroke-width: 2; }
.c-line { stroke: var(--green); stroke-width: 3; }
.c-dot { fill: #A87A12; }
.c-dot-2 { fill: var(--green); }
.w-on { fill: var(--green); }
.w-off { fill: var(--paper); stroke: #8A9893; stroke-width: 1.2; }
.m-hist { fill: none; stroke: var(--green); stroke-width: 2.5; }
.m-fore { fill: none; stroke: #A87A12; stroke-width: 2.5; }
.m-edge { fill: none; stroke: #A87A12; stroke-width: 1.2; stroke-dasharray: 4 4; }
.m-band { fill: #A87A12; opacity: .15; }
.m-now { stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 3 4; }

/* What I do */
.fit { background: var(--mist); }
.fit-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem 2.25rem; }
.fit-list strong { display: block; color: var(--green); font-size: 1.05rem; margin-bottom: .3rem; }

/* About */
.about { display: grid; grid-template-columns: minmax(10rem, 18rem) minmax(0, 1fr); gap: 1.5rem 3rem; }
.about-body { max-width: var(--measure); }
.about-body p { font: 400 1.08rem/1.75 var(--serif); }
.more-about { margin-top: 1rem; border-top: 1px solid var(--rule); }
.more-about summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; justify-content: space-between; font: 700 1rem/1.4 var(--sans); color: var(--green); list-style: none; }
.more-about summary::-webkit-details-marker { display: none; }
.more-about summary::after { content: "Show"; font-weight: 500; color: var(--slate); }
.more-about[open] summary::after { content: "Hide"; }
.more-about > p { margin: .25rem 0 1rem; }
.record { list-style: none; padding: 0; margin: 0 0 1rem; font: 400 1rem/1.5 var(--sans); }
.record li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .2rem 1.5rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.record li span:first-child { font-weight: 700; }
.record li span:last-child { color: var(--slate); }

/* Contact */
.contact { background: var(--green-deep); color: var(--paper); padding: clamp(2.5rem, 6vw, 4rem) var(--gutter); }
.contact-line { font: 700 clamp(1.5rem, 3vw, 2rem)/1.25 var(--serif); }
.contact .actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .75rem; }

/* Case-study page */
.page-head { background: var(--green); color: var(--paper); padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) 0; }
.back { display: inline-block; font-weight: 700; color: rgba(243,245,244,.88); margin-bottom: 1.75rem; text-underline-offset: 4px; }
.page-head .where { color: var(--marigold-light); }
.page-head h1 { font: 900 clamp(2rem, 4.6vw, 3.5rem)/1.1 var(--serif); letter-spacing: -.015em; max-width: 20ch; margin-top: .5rem; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; color: rgba(243,245,244,.9); }
.facts strong { color: var(--paper); }
.page-head .hero-chart { max-width: 72rem; margin: 2.5rem 0 0; }
.page-head .hero-chart svg { height: auto; }
.page-head .hero-chart figcaption { padding: 0 0 1.5rem; max-width: none; }
.longform { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter); display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, var(--measure)); gap: 2.5rem 3rem; }
.longform h2 { font-size: 1.35rem; padding-top: .2rem; }
.longform p, .longform li { font: 400 1.08rem/1.75 var(--serif); }
.longform p + p { margin-top: 1rem; }

/* Responsive */
@media (max-width: 1100px) {
  .hero, .rooms { grid-template-columns: 1fr; }
  .hero-chart { max-width: 40rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles li:nth-child(4n) .tile { border-right: 1px solid var(--rule); }
  .tiles li:nth-child(2n) .tile { border-right: 0; }
  .fit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .proof { grid-template-columns: 1fr; gap: 1rem; }
  .about, .longform { grid-template-columns: 1fr; }
  .record li { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .masthead { position: sticky; top: 0; z-index: 10; padding: .6rem var(--gutter); }
  .masthead nav > a:not(.btn):not(.nav-quiet) { display: none; }
  .masthead nav { gap: .9rem; }
  .hero > .hero-chart, .filters, .hint { display: none; }
  .rooms ul, .fit-list { grid-template-columns: 1fr; }
  .lede { font-size: 1.05rem; }
  .tiles { grid-template-columns: 1fr; }
  .tile, .tiles li:nth-child(n) .tile {
    min-height: 0; border-right: 0; padding: .9rem 0;
    grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; gap: .2rem .9rem;
  }
  .tile-num { grid-row: 1; grid-column: 1; white-space: nowrap; font-size: 1.5rem; }
  .tile-title { grid-row: 2; grid-column: 1; margin-top: 0; font-size: 1rem; }
  .tile-sub { display: none; }
  .tile-org { grid-row: 3; grid-column: 1; margin-top: 0; font-size: .8rem; }
  .tile-org::after { content: none; }
  .tile::after { content: "›"; grid-column: 2; grid-row: 1 / 4; align-self: center; font-size: 1.6rem; color: var(--green); }
  .panel-body dl { display: flex; flex-direction: column; }
  .panel-body dt:nth-of-type(3) { order: -2; margin-top: 0; }
  .panel-body dd:nth-of-type(3) { order: -1; font-weight: 500; padding-bottom: .6rem; border-bottom: 1px solid var(--rule); }
  .masthead .nav-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .4rem; }
  .panel-body { padding: 1.25rem 1.25rem 2rem; }
  .panel-bar, .panel-nav { padding: .6rem 1.25rem; }
  .panel-nav .dest { display: none; }
  .rooms { padding: 1.25rem var(--gutter); }
  .rooms li { font-size: .9rem; }
  .hero { padding-top: 1.75rem; }
  .proof { margin-top: 1.4rem; gap: .75rem; }
  .proof strong { font-size: 1.5rem; }
  .panel-body .brief-chart { max-width: 20rem; }
}

/* Headline: employer line set smaller under the main line */
.hero h1 .h1-sub { display: block; margin-top: .55rem; font: 700 clamp(1.1rem, 1.9vw, 1.45rem)/1.35 var(--serif); letter-spacing: 0; color: rgba(243,245,244,.8); hyphens: manual; text-wrap: balance; }

/* Phones: filters scroll sideways in one row */
@media (max-width: 600px) {
  .section-head { margin-bottom: 1rem; }
  .filters { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .5rem; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) .3rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button { flex: 0 0 auto; scroll-snap-align: start; }
}

/* Résumé downloads in the footer */
.resumes { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1px solid rgba(243,245,244,.25); }
.resumes-head { font: 700 1.05rem/1.3 var(--sans); color: var(--paper); margin: 0 0 .9rem; }
.resume-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.75rem; }
.resume-list a { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: var(--paper); font: 500 1rem/1.3 var(--sans); text-decoration: none; }
.resume-list .r-name { text-decoration: underline 2px var(--marigold-light); text-underline-offset: 5px; }
.resume-list a:hover .r-name { text-decoration-color: var(--paper); }
.resume-list .r-type { font-size: .8rem; color: rgba(243,245,244,.7); }
@media (max-width: 600px) { .resume-list { flex-direction: column; gap: 0; } }
.contact-email { margin-top: .4rem; font: 500 1.05rem/1.4 var(--sans); }
.contact-email a { color: var(--paper); text-decoration: underline 2px var(--marigold-light); text-underline-offset: 5px; }
