/* ============================================================
   Utah, Bodhi & Riptide LLC — site styles
   A coastal California law firm. Established 1991.
   ============================================================ */

:root {
  --navy: #0b2545;
  --deep: #13315c;
  --ink: #1b2a36;
  --text: #2a3a46;
  --muted: #5e6f7b;
  --faint: #66767f;
  --brass: #b08d3e;
  --brass-bright: #c9a227;
  --brass-text: #7d6325;
  --sea: #177e89;
  --seafoam: #7fc6bc;
  --sand: #f4efe4;
  --cream: #faf6ee;
  --paper: #fffdf8;
  --line: #e3dbc9;
  --shadow: 0 18px 40px -18px rgba(11, 37, 69, 0.25);
  --serif: "Palatino Nova", Palatino, "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wide: 0.14em;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sea); text-decoration: none; }
a:hover { color: var(--navy); }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--navy); line-height: 1.18; font-weight: 600; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: var(--wide);
  text-transform: uppercase;
  color: var(--brass-text);
  margin-bottom: 14px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  font-size: 14px;
}
.skip-link:focus { left: 0; color: #fff; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.lede { font-size: 20px; color: var(--muted); max-width: 62ch; }

/* ---------- Header ---------- */

.topbar {
  background: var(--navy);
  color: #cfd8e3;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 7px;
  padding-bottom: 7px;
}
.topbar a { color: #e8ddba; }
.topbar a:hover { color: #fff; }
.topbar .tide { color: #7fa3c0; }

header.site {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
header.site .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 14px; color: var(--navy); }
.brand svg { flex: 0 0 auto; }
.brand .name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.brand .est {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 3px;
}

nav.primary { display: flex; align-items: center; gap: 26px; }
nav.primary a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
nav.primary a:hover { color: var(--sea); }
nav.primary a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--brass); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--navy);
}

.btn {
  display: inline-block;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.03em;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1.5px solid var(--navy);
  transition: all 0.18s ease;
}
.btn.solid { background: var(--navy); color: #fff; }
.btn.solid:hover { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn.ghost { color: var(--navy); background: transparent; }
.btn.ghost:hover { background: var(--navy); color: #fff; }
.btn.brass { background: var(--brass); border-color: var(--brass); color: var(--navy); }
.btn.brass:hover { background: var(--brass-bright); border-color: var(--brass-bright); color: var(--navy); }

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

.hero {
  position: relative;
  background: linear-gradient(180deg, var(--navy) 0%, var(--deep) 58%, #1d4e6b 100%);
  color: #eef3f8;
  overflow: hidden;
}
.hero .container {
  position: relative;
  z-index: 2;
  padding-top: 88px;
  padding-bottom: 128px;
}
.hero .eyebrow { color: var(--seafoam); }
.hero h1 {
  color: #fff;
  font-size: clamp(38px, 5.4vw, 62px);
  max-width: 17ch;
  margin-bottom: 22px;
}
.hero h1 em { font-style: italic; color: #e8ddba; }
.hero p.lede { color: #b9c9d8; margin-bottom: 34px; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .actions .btn { border-color: transparent; }
.hero .actions .btn.ghost { border-color: #ffffff66; color: #fff; }
.hero .actions .btn.ghost:hover { background: #ffffff1a; }

.hero.photo {
  background-color: var(--navy);
  background-image:
    linear-gradient(180deg, rgba(9, 29, 54, 0.82) 0%, rgba(11, 37, 69, 0.72) 55%, rgba(17, 55, 84, 0.66) 100%),
    url("/img/hero-ocean.jpg");
  background-size: cover;
  background-position: center 62%;
}

.hero .swell {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  z-index: 1;
  line-height: 0;
}
.hero .swell svg { width: 100%; height: auto; display: block; }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin-top: 40px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8fb0c9;
}
.badge-row span { display: inline-flex; align-items: center; gap: 8px; }
.badge-row svg { opacity: 0.8; }

/* ---------- Sections ---------- */

section.block { padding: 84px 0; }
section.block.tint { background: var(--sand); }
section.block.dark { background: var(--navy); color: #d9e2ec; }
section.block.dark h2, section.block.dark h3 { color: #fff; }

.section-head { max-width: 70ch; margin-bottom: 44px; }
.section-head h1, .section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 12px; }
.section-head p { color: var(--muted); font-size: 18px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid { display: grid; gap: 22px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 28px;
  box-shadow: 0 1px 0 rgba(11,37,69,0.03);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font-size: 21px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15.5px; }
.card .glyph { margin-bottom: 16px; color: var(--sea); }
.card a.more { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; }

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: center;
}
.stats .stat {
  padding: 26px 12px;
  border-top: 3px solid var(--brass);
  background: var(--paper);
  border-radius: 0 0 10px 10px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stats .num { font-family: var(--serif); font-size: 40px; color: var(--navy); font-weight: 700; }
.stats .label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- People ---------- */

.person {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.person:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.person .photo { aspect-ratio: 1 / 1.05; background: var(--sand); position: relative; overflow: hidden; }
.person .photo img { width: 100%; height: 100%; object-fit: cover; }
.person .photo .mono {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.person .body { padding: 20px 22px 24px; }
.person h3 { font-size: 20px; margin-bottom: 2px; }
.person .role { font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass-text); font-weight: 700; margin-bottom: 12px; }
.person p.bio { font-size: 14.5px; color: var(--muted); }
.person .contact { margin-top: 14px; font-size: 13.5px; }
.person .contact a { font-weight: 600; }

.partner-card { border-top: 4px solid var(--brass); }

/* ---------- Practice areas list ---------- */

.practice {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.practice:last-child { border-bottom: none; }
.practice .num {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--brass);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
}
.practice h3 { font-size: 22px; margin-bottom: 6px; }
.practice p { color: var(--muted); max-width: 75ch; }

/* ---------- Quote / pull ---------- */

.pullquote {
  border-left: 4px solid var(--brass);
  padding: 8px 0 8px 28px;
  margin: 40px 0;
}
.pullquote p {
  font-family: var(--serif);
  font-size: clamp(20px, 2.6vw, 27px);
  font-style: italic;
  color: var(--deep);
  line-height: 1.45;
}
.pullquote cite { display: block; margin-top: 12px; font-size: 14px; color: var(--muted); font-style: normal; letter-spacing: 0.05em; }

/* ---------- Clients ---------- */

.client-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--muted);
}
.client-strip span { opacity: 0.85; }

.matter { padding: 30px; }
.matter .client-name { font-family: var(--serif); font-size: 23px; color: var(--navy); margin-bottom: 4px; }
.matter .sector { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sea); font-weight: 700; margin-bottom: 14px; }

/* ---------- News ---------- */

.news-item {
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
}
.news-item:last-child { border-bottom: none; }
.news-item .date { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding-top: 5px; }
.news-item h3 { font-size: 21px; margin-bottom: 6px; }
.news-item p { color: var(--muted); max-width: 78ch; }

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

.contact-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: start; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 34px; }
.contact-card h3 { margin-bottom: 8px; }
.contact-card .row { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); font-size: 15.5px; }
.contact-card .row:last-child { border-bottom: none; }
.contact-card .row .k { min-width: 96px; font-weight: 700; color: var(--navy); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; padding-top: 2px; }

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

.cta-band {
  background: linear-gradient(120deg, var(--deep), var(--navy));
  border-radius: 14px;
  color: #fff;
  padding: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); margin-bottom: 8px; }
.cta-band p { color: #b9c9d8; max-width: 52ch; }
.cta-band .wave-mark { position: absolute; right: -30px; bottom: -46px; opacity: 0.14; pointer-events: none; }

/* ---------- Footer ---------- */

footer.site {
  background: var(--navy);
  color: #a8b8c8;
  font-size: 14.5px;
  margin-top: 0;
}
footer.site .upper {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  padding: 60px 0 44px;
}
footer.site h4 { color: #e8ddba; font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 16px; }
footer.site a { color: #c3d0dd; display: inline-block; padding: 3px 0; }
footer.site a:hover { color: #fff; }
footer.site .brandline { font-family: var(--serif); font-size: 20px; color: #fff; margin-bottom: 10px; }
footer.site .motto { font-style: italic; color: #7fa3c0; margin-top: 14px; }
footer.site .lower {
  border-top: 1px solid #ffffff1f;
  padding: 20px 0 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 12.5px;
  color: #7d90a3;
}
footer.site .lower .fine { max-width: 72ch; }

/* ---------- The 50-Year Storm (easter egg) ---------- */

#storm-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  background: linear-gradient(180deg, rgba(6,20,38,0.92), rgba(11,37,69,0.96));
}
#storm-overlay.on { opacity: 1; }
#storm-overlay .storm-title {
  position: absolute;
  top: 34%;
  width: 100%;
  text-align: center;
  font-family: var(--serif);
  color: #e8ddba;
  font-size: clamp(28px, 5vw, 54px);
  font-style: italic;
  letter-spacing: 0.04em;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
  animation: storm-title-in 1.2s ease both;
}
#storm-overlay .storm-sub {
  position: absolute;
  top: calc(34% + 74px);
  width: 100%;
  text-align: center;
  color: #8fb0c9;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: storm-title-in 1.2s 0.4s ease both;
}
#storm-overlay .wave-train { position: absolute; left: 0; bottom: 0; width: 300%; animation: storm-roll 7s linear infinite; }
#storm-overlay .wave-train svg { width: 100%; height: auto; display: block; }

@keyframes storm-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-66.666%); }
}
@keyframes storm-title-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Toast (easter egg) ---------- */

.ubr-toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: var(--navy);
  color: #e8ddba;
  font-family: var(--serif);
  font-size: 17px;
  font-style: italic;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid #b08d3e88;
  box-shadow: 0 14px 40px -10px rgba(11, 37, 69, 0.55);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1000;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.ubr-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card:hover, .person:hover { transform: none; }
  #storm-overlay .wave-train { animation: none; }
  #storm-overlay .storm-title, #storm-overlay .storm-sub { animation: none; }
}

/* ---------- 404 ---------- */

.wipeout {
  min-height: 62vh;
  display: flex;
  align-items: center;
  text-align: center;
}
.wipeout .code {
  font-family: var(--serif);
  font-size: clamp(90px, 16vw, 170px);
  color: var(--navy);
  line-height: 1;
  font-weight: 700;
}
.wipeout h1 { font-size: clamp(26px, 4vw, 40px); margin: 10px 0 14px; }
.wipeout p { color: var(--muted); max-width: 55ch; margin: 0 auto 28px; }

/* ---------- Utility ---------- */

.center { text-align: center; }
.mt-l { margin-top: 44px; }
.divider-wave { line-height: 0; }
.divider-wave svg { width: 100%; height: auto; display: block; }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  footer.site .upper { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 900px) {
  nav.primary {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 24px 18px;
    box-shadow: var(--shadow);
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 11px 0; width: 100%; border-bottom: 1px solid var(--line); }
  nav.primary a:last-child { border-bottom: none; }
  .nav-toggle { display: block; }
}

@media (max-width: 680px) {
  .grid.cols-3, .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; }
  .hero .container { padding-top: 56px; padding-bottom: 96px; }
  footer.site .upper { grid-template-columns: 1fr; gap: 28px; }
  footer.site a { overflow-wrap: anywhere; }
  .news-item { grid-template-columns: 1fr; gap: 4px; }
  .topbar .hide-sm { display: none; }
  .practice { grid-template-columns: 1fr; }
  .brand .name { font-size: 17.5px; }
  .brand .est { font-size: 9.5px; letter-spacing: 0.16em; }
  .brand svg { width: 38px; height: 38px; }
  .practice .num { width: 44px; height: 44px; font-size: 20px; }
}
