/* Kingsbury Law LLC — shared stylesheet */

:root {
  color-scheme: light;

  --paper:        #F4F6F9;
  --surface:      #FFFFFF;
  --ink:          #0C1826;
  --ink-soft:     #2A3C52;
  --muted:        #59697E;
  --hairline:     #D2DAE4;
  --hairline-dim: #E4E9EF;
  --accent:       #1A5A99;
  --accent-deep:  #11446B;
  --accent-tint:  #E9F0F8;
  --accent-onband:#6FADEC;
  --band:         #0C1826;
  --band-text:    #EAF0F7;
  --band-muted:   #A3B6CC;
  --band-rule:    rgba(163, 182, 204, .24);

  --measure: 66ch;
  --shell: 72rem;
  --rail: 13rem;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --masthead-h: 4.5rem;
  --section-gap: clamp(3.25rem, 7vw, 5.5rem);

  --font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 800px) {
  :root { --masthead-h: 3.85rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper:        #0B131E;
    --surface:      #111C29;
    --ink:          #E7EDF4;
    --ink-soft:     #C6D3E1;
    --muted:        #97A9BF;
    --hairline:     #243651;
    --hairline-dim: #1A2635;
    --accent:       #86B8EE;
    --accent-deep:  #AFD0F5;
    --accent-tint:  #152538;
    --accent-onband:#86B8EE;
    --band:         #070E17;
    --band-text:    #E7EDF4;
    --band-muted:   #97A9BF;
    --band-rule:    rgba(151, 169, 191, .22);
  }
}

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

/* Hardening: nothing on this site may create a sideways scrollbar. `clip`
   does not spawn a scroll container, so sticky positioning keeps working. */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
  scroll-padding-top: calc(var(--masthead-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 38%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }

:where(a, button, .btn):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; margin: 0; letter-spacing: -.014em; }

p { margin: 0; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Clipped rather than parked off-screen, so it can never contribute to a
   scrollable area in any direction. */
.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: .7rem 1.1rem;
  font-size: .875rem;
  text-decoration: none;
  clip-path: inset(50%);
}

.skip-link:focus { clip-path: none; }

/* ---------- Eyebrow / labels ---------- */

.eyebrow {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---------- Masthead ---------- */

/* One bar, always the same bar. It sticks from the first pixel, so the
   headline is never buried under a screenful of video and there is no
   absolute -> fixed swap to go wrong mid-scroll. */
.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--band) 94%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--band-rule);
  color: var(--band-text);
}

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  min-height: var(--masthead-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  color: inherit;
  flex: none;
  margin-inline-end: auto;
}

.wordmark__mark { flex: none; color: var(--accent-onband); width: 30px; height: 30px; }

.wordmark__name {
  font-family: var(--font-display);
  font-size: 1.24rem;
  line-height: 1.1;
  letter-spacing: -.012em;
  display: block;
}

.wordmark__sub {
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--band-muted);
  display: block;
  margin-top: .2rem;
}

/* ---------- Masthead nav ---------- */

.nav {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2.2vw, 1.9rem);
}

.nav a {
  position: relative;
  font-size: .875rem;
  color: var(--band-muted);
  text-decoration: none;
  padding-block: .35rem;
  white-space: nowrap;
  transition: color .18s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--accent-onband);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease;
}

.nav a:hover { color: var(--band-text); }
.nav a:hover::after { transform: scaleX(1); }

.masthead__actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex: none;
}

.masthead__tel {
  font-family: var(--font-mono);
  font-size: .82rem;
  letter-spacing: .02em;
  color: var(--band-text);
  text-decoration: none;
  white-space: nowrap;
}

.masthead__tel:hover { color: var(--accent-onband); }

@media (max-width: 1000px) { .nav { display: none; } }
@media (max-width: 560px) { .masthead__tel { display: none; } }
@media (max-width: 420px) { .wordmark__sub { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: .55rem 1.25rem;
  border-radius: 3px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.btn--sm { min-height: 2.35rem; padding: .4rem 1rem; font-size: .83rem; }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-deep); }

@media (prefers-color-scheme: dark) {
  .btn--primary { color: #08101A; }
}

.btn--ghost { border-color: var(--hairline); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.masthead .btn--primary,
.band .btn--primary,
.hero .btn--primary { background: var(--accent-onband); color: #08101A; }

.masthead .btn--primary:hover,
.band .btn--primary:hover,
.hero .btn--primary:hover { background: var(--band-text); }

.btn--onband { border-color: rgba(234,240,247,.38); color: #fff; background: rgba(255,255,255,.06); }
.btn--onband:hover { border-color: #fff; background: rgba(255,255,255,.14); }

/* ---------- Bands (footer) ---------- */

.band {
  background: var(--band);
  color: var(--band-text);
  position: relative;
  overflow: hidden;
}

.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(58% 85% at 18% 0%, rgba(31,95,158,.34), transparent 64%),
    radial-gradient(48% 78% at 94% 100%, rgba(31,95,158,.18), transparent 62%);
  pointer-events: none;
}

/* ---------- Hero ---------- */

/* Sized by its content with a sane ceiling — never a forced viewport height,
   so the headline reads immediately instead of sitting below a screen of sky. */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #060E1A;
  color: #EAF0F7;
  min-height: clamp(27rem, 62vh, 36rem);
  display: grid;
  grid-template-rows: 1fr auto;
}

/* The footage is the same in either theme — the hero does not follow
   color-scheme, so its palette is fixed rather than tokenised. */

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero__media video,
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Keeps the skyline band low in frame so type sits in open sky. */
  object-position: 50% 58%;
  display: block;
}

/* Legibility scrim: a left-weighted wash so the headline has a quiet field,
   plus a bottom wash under the buttons. The right stays clear — that is
   where the skyline lives. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      rgba(6,14,26,.80) 0%,
      rgba(6,14,26,.58) 38%,
      rgba(6,14,26,.12) 78%,
      rgba(6,14,26,.04) 100%),
    linear-gradient(to top,
      rgba(6,14,26,.62) 0%,
      rgba(6,14,26,.24) 34%,
      transparent 68%);
}

.hero__inner {
  position: relative;
  z-index: 2;
  grid-row: 1;
  align-self: center;
  padding-block: clamp(3.25rem, 8vh, 5.5rem) clamp(2rem, 4vh, 3rem);
}

.hero__eyebrow { color: #CBDCEF; }

.hero__title {
  margin-top: 1rem;
  font-size: clamp(2.5rem, 6.4vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -.03em;
  max-width: 15ch;
  text-shadow: 0 2px 30px rgba(3, 9, 18, .55);
}

.hero__lede {
  margin-top: 1.35rem;
  max-width: 44ch;
  font-size: clamp(1.03rem, 1.55vw, 1.2rem);
  line-height: 1.6;
  color: #E2EAF4;
  text-shadow: 0 1px 18px rgba(3, 9, 18, .6);
}

.hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

/* ---------- Scroll cue ---------- */

.hero__scroll {
  grid-row: 2;
  position: relative;
  z-index: 2;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  margin-inline-start: var(--gutter);
  margin-bottom: clamp(1.25rem, 3vh, 2rem);
  color: #C3D4E8;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  transition: color .18s ease;
}

.hero__scroll:hover { color: #fff; }
.hero__scroll svg { animation: hero-cue 2.6s ease-in-out infinite; }

@keyframes hero-cue {
  0%, 100% { transform: translateY(0); opacity: .75; }
  50%      { transform: translateY(4px); opacity: 1; }
}

@media (max-width: 800px) {
  .hero { min-height: clamp(25rem, 56vh, 31rem); }
  .hero__media video,
  .hero__media img { object-position: 58% 56%; }
  .hero__media::after {
    background:
      linear-gradient(to top,
        rgba(6,14,26,.80) 0%,
        rgba(6,14,26,.56) 34%,
        rgba(6,14,26,.28) 72%,
        rgba(6,14,26,.20) 100%);
  }
  .hero__title { max-width: 13ch; }
  .hero__actions .btn { flex: 1 1 13rem; }
}

/* ---------- Contact strip ---------- */

.strip {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline-dim);
}

.strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem clamp(1.5rem, 4vw, 3rem);
  padding-block: 1.1rem;
  font-size: .875rem;
  color: var(--muted);
}

.strip__item { display: inline-flex; align-items: baseline; gap: .55rem; }

.strip__key {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  flex: none;
}

.strip__item address { font-style: normal; color: var(--ink-soft); }
.strip__item a { color: var(--ink-soft); text-decoration: none; }
.strip__item a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Section rows: pleading-margin rail ---------- */

.rows { padding-block: var(--section-gap); }

.row {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--hairline-dim);
  scroll-margin-top: calc(var(--masthead-h) + 1.5rem);
}

.row:first-child { border-top: 0; padding-top: 0; }

.row__rail { position: relative; }

.row__label {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  line-height: 1.22;
  position: sticky;
  top: calc(var(--masthead-h) + 1.75rem);
  padding-top: .55rem;
  border-top: 2px solid var(--accent);
  display: inline-block;
}

.row__body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: var(--measure);
}

.row__body p { color: var(--ink-soft); }

/* Matters needs the full column for its two-up card grid. */
.row--wide .row__body { max-width: none; }

@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 1.25rem; }
  .row__label { position: static; }
}

/* ---------- Bio ---------- */

.bio {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
}

.portrait {
  position: relative;
  width: 132px;
  height: 132px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(170deg, #1B3350, #0E1B2C);
  box-shadow: 0 0 0 1px var(--hairline), 0 0 0 6px var(--paper), 0 0 0 7px var(--hairline-dim);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; position: relative; z-index: 1; }

.portrait__fallback {
  font-family: var(--font-display);
  font-size: 1.9rem;
  letter-spacing: .06em;
  color: rgba(234,240,247,.72);
  position: absolute;
}

.bio__name {
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  line-height: 1.18;
  text-wrap: pretty;
}

.bio__role {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .4rem;
  padding-top: .4rem;
  border-top: 1px solid var(--hairline);
  display: inline-block;
}

/* On the stacked layout the rail holds the portrait and the name side by
   side; in the two-column layout they stack under one another. */
@media (min-width: 861px) {
  .bio { display: block; }
  .bio__name { margin-top: 1.35rem; }
}

/* ---------- Education ---------- */

.facts { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }

.facts li {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--hairline-dim);
}

.facts li:first-child { padding-top: 0; }
.facts li:last-child { border-bottom: 0; padding-bottom: 0; }

.facts strong { font-weight: 500; font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }

.facts span { font-size: .9rem; color: var(--muted); }

/* ---------- Case captions ---------- */

.cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case {
  display: grid;
  align-content: start;
  gap: .5rem;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--hairline-dim);
  border-left: 2px solid var(--hairline);
  border-radius: 3px;
  transition: border-left-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.case:hover {
  border-left-color: var(--accent);
  box-shadow: 0 10px 30px -18px rgba(12, 24, 38, .45);
  transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
  .case:hover { box-shadow: 0 10px 30px -16px rgba(0, 0, 0, .8); }
}

.case__name {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.32;
  color: var(--ink);
  text-wrap: pretty;
}

.case__cite {
  font-family: var(--font-mono);
  font-size: .74rem;
  line-height: 1.5;
  letter-spacing: .01em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.case__note {
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-top: .15rem;
  padding-top: .65rem;
  border-top: 1px solid var(--hairline-dim);
}

/* ---------- Closing band ---------- */

.closing { padding-block: clamp(3.5rem, 8vw, 5.5rem); position: relative; z-index: 1; }

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

@media (max-width: 860px) { .closing__grid { grid-template-columns: 1fr; } }

.closing__title {
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -.024em;
  max-width: 12ch;
}

.closing__detail { display: flex; flex-direction: column; gap: 1.1rem; color: var(--band-muted); font-size: .95rem; }

.closing__detail a { color: var(--band-text); text-decoration: none; }
.closing__detail a:hover { text-decoration: underline; }

.closing__detail .btn--primary { align-self: start; }

.closing__lines { display: flex; flex-direction: column; gap: .2rem; font-style: normal; }

/* ---------- Colophon ---------- */

.colophon {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--band-rule);
  padding-block: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: .5rem 2rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--band-muted);
}

.colophon a { color: var(--band-muted); text-decoration: none; border-bottom: 1px solid var(--band-rule); padding-bottom: 1px; }
.colophon a:hover { color: var(--band-text); border-bottom-color: currentColor; }

/* ---------- Legal document page ---------- */

.doc-head { padding-block: clamp(2.75rem, 7vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }

.doc-head__title {
  font-size: clamp(2rem, 4.8vw, 2.9rem);
  line-height: 1.1;
  letter-spacing: -.024em;
  margin-top: 1rem;
  max-width: 18ch;
}

.doc-head__meta { margin-top: 1.1rem; font-size: .88rem; color: var(--muted); }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--rail)) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(3.5rem, 9vw, 6rem);
  align-items: start;
}

@media (max-width: 900px) { .doc-layout { grid-template-columns: 1fr; } }

.toc { position: sticky; top: calc(var(--masthead-h) + 1.75rem); }

@media (max-width: 900px) {
  .toc { position: static; border-bottom: 1px solid var(--hairline); padding-bottom: 1.5rem; }
}

.toc ol { list-style: none; margin: .9rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; counter-reset: toc; }

.toc a {
  font-size: .84rem;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
  display: block;
  padding-left: 1.5rem;
  position: relative;
}

.toc li { counter-increment: toc; }

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--hairline);
}

.toc a:hover { color: var(--accent); }
.toc a:hover::before { color: var(--accent); }

.doc { max-width: var(--measure); }

.doc__preamble {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-soft);
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.clause {
  padding-block: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--hairline-dim);
  scroll-margin-top: calc(var(--masthead-h) + 1.5rem);
}

.clause:last-of-type { border-bottom: 0; }

.clause__title {
  font-size: clamp(1.22rem, 2.4vw, 1.45rem);
  line-height: 1.25;
  margin-bottom: .9rem;
}

.clause__sub {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 1.6rem;
  margin-bottom: .55rem;
  color: var(--ink);
}

.clause p { color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.7; }
.clause p:last-child { margin-bottom: 0; }

.clause ul { margin: 0 0 1rem; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .85rem; }

.clause ul li {
  color: var(--ink-soft);
  line-height: 1.7;
  padding-left: 1.35rem;
  position: relative;
}

.clause ul li::before {
  content: "‣";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.doc__footnote {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
  font-size: .85rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
