@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
}

:root {
  --gutter: clamp(1.25rem, 4vw, 2.5rem);

  /* Document pages (legal notice, 404) */
  --paper: #f6f7fb;
  --ink: #10132b;
  --muted: #4d5273;
  --heading: #1f2bb8;
  --link: #2b3be5;
  --rule: #dcdff0;
  --focus: #2b3be5;

  /* Home: a full-bleed cobalt field */
  --field: #2b3be5;
  --on-field: #f5f6ff;
  --on-field-muted: #c3c9ff;
  --on-field-accent: #9fe7ff;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0e24;
    --ink: #e6e8f7;
    --muted: #a2a7c8;
    --heading: #e6e8f7;
    --link: #9fabff;
    --rule: #232849;
    --focus: #9fabff;

    --field: #141a73;
    --on-field: #eef0ff;
    --on-field-muted: #aab1ef;
    --on-field-accent: #8fdcff;

    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Home ---------- */

.home {
  display: flex;
  flex-direction: column;
  padding: var(--gutter);
  background: var(--field);
  color: var(--on-field);
}

.home a:focus-visible {
  outline-color: var(--on-field);
}

.bar {
  display: flex;
  justify-content: flex-end;
}
.bar a {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--on-field-muted);
  font-size: 0.875rem;
  text-decoration: none;
}
.bar a:hover {
  color: var(--on-field);
  text-decoration: underline;
}

.home main {
  flex: 1;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
}

.contact {
  order: 1;
  margin-top: clamp(1.5rem, 9vh, 6rem);
  font-style: normal;
}
.contact p {
  margin: 0 0 0.6rem;
  color: var(--on-field-muted);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  line-height: 1.3;
}
.contact a {
  color: var(--on-field);
  font-size: clamp(1.55rem, 5.4vw, 4.5rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--on-field-accent), var(--on-field-accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 0.06em;
  transition: background-size 0.2s ease;
}
.contact a:hover {
  background-size: 100% 0.14em;
}

/* The one bold gesture: the name, as wide as the page, resting on the bottom edge.
   Ink is 3.722em wide with a 0.04em left bearing (Bricolage Grotesque 800). */
.wordmark {
  order: 2;
  margin: auto 0 0;
  padding-top: 2rem;
  overflow: hidden;
  color: var(--on-field);
  font-weight: 800;
  font-size: calc((100vw - 2 * var(--gutter)) / 3.75);
  font-size: min(calc(100cqi / 3.722), 52svh);
  line-height: 0.72;
  letter-spacing: -0.035em;
}
.wordmark span {
  display: block;
  margin-left: -0.04em;
  animation: rise 0.9s cubic-bezier(0.2, 0.75, 0.2, 1) 0.1s both;
}
@keyframes rise {
  from { transform: translateY(110%); }
  to { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wordmark span { animation: none; }
  .contact a { transition: none; }
}

/* Very short screens (phone held sideways): tighter spacing so nothing scrolls. */
@media (max-height: 460px) {
  .contact { margin-top: 0.75rem; }
  .wordmark { padding-top: 1rem; }
}

/* Portrait screens: contact sits on the name instead of floating at the top. */
@media (max-aspect-ratio: 4/5) {
  .contact { margin-top: auto; }
  .wordmark { margin-top: 0; padding-top: clamp(1.25rem, 5vh, 2.5rem); }
}

/* ---------- Document pages ---------- */

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) 0;
}
.brand {
  display: inline-block;
  padding: 0.25rem 0;
  color: var(--heading);
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.035em;
  text-decoration: none;
}
.doc-header nav a {
  display: inline-block;
  padding: 0.5rem 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) var(--gutter) clamp(3rem, 10vh, 6rem);
}
.doc h1 {
  margin: 0 0 2.5rem;
  color: var(--heading);
  font-weight: 700;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.doc h2 {
  margin: 2.75rem 0 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--heading);
  font-weight: 650;
  font-size: 1.125rem;
  line-height: 1.3;
}
.doc p {
  max-width: 62ch;
  margin: 0 0 1rem;
}
.doc address {
  font-style: normal;
}
