/* half-ceo.com — editorial personal site. Self-hosted fonts, no runtime requests. */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "InterVar";
  src: url("/assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

:root {
  --bg: #fcfbf8;
  --bg-raised: #f6f3ec;
  --text: #14100c;
  --muted: #5a5349;
  --rule: #e2ddd2;
  --rule-strong: #c9c2b4;
  --accent: #1e4d3b;
  --accent-hover: #143427;
  --accent-contrast: #fcfbf8;

  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --sans: "InterVar", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --measure: 680px;
  --measure-wide: 960px;
  --gutter: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15120f;
    --bg-raised: #1e1a16;
    --text: #ece7df;
    --muted: #a9a196;
    --rule: #2f2a24;
    --rule-strong: #443d34;
    --accent: #84c7a8;
    --accent-hover: #a8dcc2;
    --accent-contrast: #15120f;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-synthesis-weight: none;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- links ---------- */

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--text);
  padding: 12px 18px;
  border: 1px solid var(--rule-strong);
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

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

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

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

main > section {
  padding-block: 56px;
  border-top: 1px solid var(--rule);
}

main > section:first-of-type {
  border-top: 0;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  max-width: var(--measure-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

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

.nav__list {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.nav__list a:hover,
.nav__list a[aria-current="page"] {
  color: var(--text);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  padding: 6px 12px;
  cursor: pointer;
}

.nav-toggle__bars {
  display: inline-block;
  width: 14px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

/* the full nav needs ~613px (brand 135 + items 406 + gutters); below that it
   collapses. Between there and 820px the items sit closer together so the row
   keeps a comfortable margin even before the webfont has loaded. */
@media (min-width: 640px) and (max-width: 819px) {
  .nav__list {
    gap: 16px;
  }
}

@media (max-width: 639px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 10px 24px rgb(0 0 0 / 8%);
  }

  .nav[hidden] {
    display: none;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: var(--measure-wide);
    margin-inline: auto;
    padding: 6px var(--gutter) 14px;
  }

  .nav__list a {
    display: block;
    padding: 11px 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--rule);
  }

  .nav__list li:last-child a {
    border-bottom: 0;
  }
}

/* ---------- typography ---------- */

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2.25rem, 7vw, 3.25rem);
}

h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.05rem);
  margin-bottom: 20px;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 34px 0 10px;
}

p {
  margin: 0 0 18px;
  text-wrap: pretty;
}

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

ul {
  margin: 0 0 18px;
  padding-left: 1.15em;
}

li {
  margin-bottom: 8px;
  text-wrap: pretty;
}

li::marker {
  color: var(--rule-strong);
}

strong {
  font-weight: 600;
}

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

.hero {
  padding-block: 64px 52px;
}

/* the portrait hangs into the left margin so the text keeps the full measure */
.hero .wrap {
  max-width: calc(var(--measure) + 160px);
}

.hero__inner {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 599px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

.portrait {
  margin: 0;
  width: 168px;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-raised);
}

.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait--placeholder {
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.hero__lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 3.2vw, 1.4rem);
  line-height: 1.35;
  margin: 14px 0 22px;
  color: var(--text);
  text-wrap: balance;
}

.hero__meta {
  color: var(--muted);
  margin-bottom: 0;
}

/* ---------- three ways ---------- */

.ways {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: grid;
  gap: 22px;
}

.ways li {
  margin: 0;
  padding-left: 18px;
  border-left: 2px solid var(--rule-strong);
}

.ways__label {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.ways p {
  margin: 0 0 8px;
}

.ways a {
  font-size: 0.9375rem;
}

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

.cta {
  display: inline-block;
  margin-top: 28px;
  padding: 11px 22px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 4px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.cta:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

/* ---------- quotes ---------- */

blockquote {
  margin: 0 0 26px;
  padding-left: 20px;
  border-left: 2px solid var(--rule-strong);
}

blockquote p {
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

blockquote footer,
.attrib {
  font-size: 0.875rem;
  color: var(--muted);
}

.subline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: -12px;
  margin-bottom: 26px;
}

/* ---------- public record ---------- */

.record {
  list-style: none;
  margin: 0;
  padding: 0;
}

.record li {
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}

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

.record__title {
  font-weight: 600;
}

.record__note {
  color: var(--muted);
}

/* bare URLs must break rather than push the page sideways on narrow screens */
.record a,
.case__proof a {
  overflow-wrap: anywhere;
}

.record a[target="_blank"]::after {
  content: "\2197";
  display: inline-block;
  margin-left: 0.22em;
  font-size: 0.82em;
  text-decoration: none;
  vertical-align: 0.08em;
}

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

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 10px;
}

.contact-list .label {
  display: inline-block;
  min-width: 104px;
  color: var(--muted);
}

/* ---------- cases ---------- */

.case {
  padding-block: 44px;
  border-top: 1px solid var(--rule);
}

.case:first-of-type {
  border-top: 0;
  padding-top: 12px;
}

.case h2 {
  margin-bottom: 6px;
}

.case__meta {
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.case__proof {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-top: 14px;
}

.page-intro {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.45;
  margin: 14px 0 8px;
  max-width: var(--measure);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.cta-row .cta {
  margin-top: 0;
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 34px 56px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.site-footer p {
  margin-bottom: 10px;
}

/* the toggle is revealed by JS; without JS the nav simply stays open */
.nav-toggle[hidden] {
  display: none;
}

/* ---------- cases page specifics ---------- */

.cases-head {
  padding-block: 56px 20px;
}

.case p,
.case ul {
  max-width: var(--measure);
}

.footer-legal {
  margin-top: 26px;
}
