:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --paper-soft: #ededdf;
  --ink: #171916;
  --ink-muted: #62665d;
  --line: rgba(23, 25, 22, 0.12);
  --accent: #356a5a;
  --accent-soft: rgba(53, 106, 90, 0.14);
  --connected-wave-primary: url("/assets/connected-waves-primary.svg");
  --connected-wave-secondary: url("/assets/connected-waves-accent.svg");
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), transparent 42%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

body::before,
body::after {
  position: fixed;
  pointer-events: none;
  content: "";
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

body::before {
  inset: -20vh -28vw;
  z-index: 0;
  opacity: 0.66;
  background-image:
    radial-gradient(circle at 72% 34%, rgba(53, 106, 90, 0.22) 0, rgba(53, 106, 90, 0.12) 24%, rgba(53, 106, 90, 0.04) 43%, transparent 68%),
    var(--connected-wave-primary),
    linear-gradient(135deg, rgba(255, 255, 255, 0.54), transparent 42%);
  background-position: 72% 34%, center center, center center;
  background-repeat: no-repeat;
  background-size: 118% 112%, 128% 118%, 100% 100%;
  animation: wave-field 38s cubic-bezier(0.42, 0, 0.2, 1) infinite alternate;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.34));
}

body::after {
  inset: -18vh -24vw;
  z-index: 1;
  opacity: 0.26;
  mix-blend-mode: multiply;
  background-image:
    var(--connected-wave-secondary),
    radial-gradient(circle at 14% 22%, rgba(23, 25, 22, 0.1) 0 1px, transparent 1px),
    radial-gradient(circle at 72% 56%, rgba(23, 25, 22, 0.08) 0 1px, transparent 1px);
  background-position: center center, 0 0, 11px 17px;
  background-repeat: no-repeat, repeat, repeat;
  background-size: 120% 110%, 32px 32px, 47px 47px;
  animation: wave-counter 52s cubic-bezier(0.42, 0, 0.2, 1) infinite alternate;
}

.home-page {
  height: 100svh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 0.05em 0.32em;
  border: 1px solid rgba(23, 25, 22, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink);
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.page-shell {
  position: relative;
  z-index: 2;
  display: grid;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(20px, 3vw, 42px);
}

.page-shell::before {
  position: absolute;
  inset: clamp(14px, 2.1vw, 28px);
  z-index: -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  content: "";
}

.home-shell {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100svh;
  min-height: 0;
  padding: clamp(16px, 2.3vw, 32px);
}

.home-shell::before {
  inset: clamp(10px, 1.8vw, 24px);
}

.legal-shell {
  grid-template-rows: auto 1fr;
  gap: clamp(36px, 6vw, 72px);
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  font-size: 13px;
}

.site-header {
  align-self: start;
}

.site-footer {
  align-self: end;
  color: var(--ink-muted);
  justify-content: flex-end;
}

.wordmark,
.quiet-link,
.mail-link,
.legal-links a,
.legal-page a {
  position: relative;
  width: fit-content;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  font-weight: 560;
}

.quiet-link,
.legal-links {
  color: var(--ink-muted);
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.legal-links.compact {
  font-size: 13px;
}

.quiet-link,
.legal-links a,
.mail-link,
.legal-page a {
  transition: color 220ms ease;
}

.quiet-link::after,
.legal-links a::after,
.mail-link::after,
.legal-page a::after {
  position: absolute;
  right: 0;
  bottom: -4px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left center;
  background: currentColor;
  content: "";
  transition: transform 280ms ease;
}

.quiet-link:hover,
.legal-links a:hover,
.legal-links a[aria-current="page"],
.mail-link:hover,
.legal-page a:hover {
  color: var(--ink);
}

.quiet-link:hover::after,
.legal-links a:hover::after,
.legal-links a[aria-current="page"]::after,
.mail-link:hover::after,
.legal-page a:hover::after {
  transform: scaleX(1);
}

a:focus-visible {
  outline: 3px solid rgba(53, 106, 90, 0.42);
  outline-offset: 5px;
  border-radius: var(--radius);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(22px, 4vw, 40px);
  align-self: center;
  align-items: center;
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vh, 38px) clamp(4px, 1vw, 12px);
}

.hero-copy {
  animation: reveal-up 900ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.kicker {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 620;
  line-height: 1.4;
}

h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--ink);
  font-size: clamp(52px, 8vw, 104px);
  font-weight: 520;
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

.services {
  margin: clamp(22px, 4vh, 34px) 0 clamp(18px, 3vh, 28px);
  color: var(--accent);
  font-size: clamp(19px, 2.4vw, 30px);
  font-weight: 560;
  line-height: 1.25;
}

.summary {
  max-width: 620px;
  margin: clamp(20px, 3vw, 32px) 0 0;
  color: var(--ink-muted);
  font-size: clamp(18px, 2.1vw, 25px);
  line-height: 1.45;
}

.mobile-break {
  display: none;
}

.contact-block {
  display: grid;
  gap: 14px;
  max-width: 340px;
  padding-left: clamp(0px, 2vw, 26px);
  border-left: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
  animation: reveal-up 900ms 140ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.mail-link {
  color: var(--ink);
  font-size: clamp(17px, 1.7vw, 23px);
  font-weight: 540;
  overflow-wrap: anywhere;
}

.contact-block p {
  margin: 0;
}

.legal-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.36fr) minmax(0, 0.64fr);
  column-gap: clamp(48px, 6vw, 86px);
  row-gap: 0;
  width: min(1120px, calc(100vw - clamp(56px, 8vw, 112px)));
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(8px, 1vw, 16px) clamp(2px, 1vw, 12px) clamp(58px, 7vw, 92px);
  animation: reveal-up 780ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.legal-page > .kicker,
.legal-page > h1,
.legal-page > .legal-note {
  grid-column: 1;
}

.legal-page h1 {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1;
  overflow-wrap: normal;
  word-break: normal;
}

.legal-section {
  display: grid;
  gap: 12px;
  grid-column: 2;
  min-width: 0;
  padding: clamp(24px, 3vw, 34px) 0;
  border-top: 1px solid var(--line);
}

.legal-section:first-of-type {
  border-top-color: rgba(23, 25, 22, 0.2);
}

.legal-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 560;
  line-height: 1.28;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-section p,
.legal-section ul {
  margin: 0;
  color: var(--ink-muted);
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.78;
  overflow-wrap: anywhere;
}

.legal-section ul {
  display: grid;
  gap: 8px;
  padding-left: 1.25em;
}

.legal-section li::marker {
  color: var(--accent);
}

.legal-page a {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.legal-note {
  margin: clamp(22px, 4vw, 36px) 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

@keyframes reveal-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wave-field {
  from {
    transform: translate3d(-32px, -12px, 0) scale(1.01);
  }

  to {
    transform: translate3d(32px, 10px, 0) scale(1.035);
  }
}

@keyframes wave-counter {
  from {
    transform: translate3d(26px, 8px, 0) scale(1.02);
  }

  to {
    transform: translate3d(-22px, -10px, 0) scale(1.04);
  }
}

@media (max-width: 820px) {
  .page-shell {
    min-height: 100svh;
    padding: 16px;
  }

  .page-shell::before {
    inset: 10px;
  }

  .site-header,
  .site-footer {
    font-size: 12px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .wordmark span:last-child {
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    align-content: center;
    min-height: calc(100svh - 102px);
    padding: 20px 10px 18px;
  }

  h1 {
    max-width: 9.4ch;
    font-size: clamp(42px, 10vw, 64px);
    line-height: 0.98;
  }

  .mobile-break {
    display: block;
  }

  .services {
    font-size: clamp(18px, 6vw, 25px);
  }

  .contact-block {
    max-width: none;
    padding-top: 20px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .legal-shell {
    gap: 34px;
  }

  .legal-page {
    grid-template-columns: 1fr;
    width: calc(100vw - 44px);
  }

  .legal-page > .kicker,
  .legal-page > h1,
  .legal-page > .legal-note,
  .legal-section {
    grid-column: 1;
  }

  .legal-page h1 {
    max-width: min(12ch, 100%);
    margin-bottom: clamp(22px, 7vw, 34px);
  }
}

@media (max-width: 560px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-links {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .quiet-link {
    display: none;
  }

  .hero {
    padding-top: 22px;
  }

  h1 {
    max-width: 9.4ch;
    font-size: clamp(38px, 12.4vw, 48px);
  }

  .mobile-break {
    display: block;
  }

  .legal-page h1 {
    font-size: clamp(38px, 12vw, 50px);
  }

  .legal-page {
    width: calc(100vw - 44px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  body::before,
  body::after {
    animation: none !important;
    transform: none !important;
  }
}
