/* AnonyLabs — one viewport, nothing more. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  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: "Plex Mono";
  src: url("../fonts/plex-mono-400-latin.woff2") format("woff2");
  font-weight: 400;
  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 {
  color-scheme: dark;

  --bg: #0a0a0b;
  --bg-lift: #131416;
  --panel: #111214;
  --fg: #e8e6e1; /* 16.6:1 on --bg */
  --fg-2: #9b9994; /* 7.0:1 */
  --fg-3: #7f7e7a; /* 4.8:1 — the floor for any text */
  --rule: rgba(232, 230, 225, 0.12);
  --mark: rgba(232, 230, 225, 0.24);
  --field: rgba(232, 230, 225, 0.035);
  --warn: #e0927f; /* errors only; 7.4:1 on --panel */

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --g: clamp(20px, 2.1vw, 48px);
  --pad-t: max(var(--g), env(safe-area-inset-top));
  --pad-r: max(var(--g), env(safe-area-inset-right));
  --pad-b: max(var(--g), env(safe-area-inset-bottom));
  --pad-l: max(var(--g), env(safe-area-inset-left));

  --track-caps: 0.26em;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  --px: 0;
  --py: 0;
}

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

html {
  background: var(--bg) radial-gradient(ellipse 85% 75% at 50% 42%, var(--bg-lift) 0%, var(--bg) 62%) no-repeat fixed;
  color: var(--fg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-optical-sizing: auto;
  font-feature-settings: "kern", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Grain: a static texture above everything, alpha baked into the PNG. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: url("../img/grain.png") repeat;
  background-size: 128px 128px;
}

p,
h1,
h2,
dl,
dd {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
}

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

.nowrap {
  white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Frame                                                              */
/* ------------------------------------------------------------------ */

.frame {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

/* Interface annotations: mono, small, quiet. */
.meta {
  font-family: var(--mono);
  font-size: clamp(10px, 0.56vw, 12px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}

/* Wordmark and controls share one set of metrics, so the contact panel's
   "Close" lands exactly where "Contact" was. */
.wordmark,
.ctl {
  font-family: var(--sans);
  font-size: clamp(11.5px, 0.66vw, 14px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
}

.top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: clamp(28px, 2.6vw, 56px);
  transform: translate3d(calc(var(--px) * 1px), calc(var(--py) * 0.5px), 0);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  margin-right: auto;
  color: var(--fg);
  text-decoration: none;
}

.wordmark:focus-visible {
  outline-offset: 6px;
}

/* The logo: outlined Oxanium SemiBold lettering with a cap-height dot. The
   viewBox is exactly the cap height (Oxanium's O and S do not overshoot),
   width 9.53 × height. */
.wordmark__logo {
  display: block;
  height: var(--logo-cap);
  width: auto;
  aspect-ratio: 6573 / 690;
  overflow: visible;
}

:root {
  --logo-cap: clamp(9.5px, 0.6vw, 13px);
}

.nav {
  display: flex;
  align-items: center;
  gap: inherit;
}

/* ------------------------------------------------------------------ */
/* Controls                                                           */
/* ------------------------------------------------------------------ */

.ctl {
  position: relative;
  display: inline-block;
  padding: 12px;
  margin: -12px calc(-12px - var(--track-caps)) -12px -12px; /* optical right edge */
  color: var(--fg-2);
  transition: color 0.24s var(--ease);
}

.ctl::after {
  content: "";
  position: absolute;
  left: 12px;
  right: calc(12px + var(--track-caps));
  bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.32s var(--ease);
}

.ctl:hover,
.ctl:focus-visible,
.ctl[aria-expanded="true"] {
  color: var(--fg);
}

.ctl:hover::after,
.ctl:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.ctl:focus-visible {
  outline-offset: -5px;
}

.ctl:active {
  color: var(--fg-2);
}

a.ctl {
  text-decoration: none;
}

.ctl[aria-current="page"] {
  color: var(--fg);
}

.ctl[aria-current="page"]::after {
  transform: scaleX(1);
}

/* "Our Projects": drawn like a hidden edge in a technical drawing. The label
   is dimmed, a dashed leader runs to a mono call-out, and a thin caret blinks
   at its end: present, but not yet drawn in. */
.soon-wrap {
  position: relative;
  display: inline-flex;
}

.ctl--soon {
  display: inline-flex;
  align-items: baseline;
  color: var(--fg-3);
  cursor: default;
}

.ctl--soon::after {
  display: none;
}

.ctl--soon:hover,
.ctl--soon:focus-visible {
  color: var(--fg-2);
}

.soon {
  display: inline-flex;
  align-items: center;
  align-self: center;
  font-family: var(--mono);
  font-size: clamp(9.5px, 0.5vw, 11px);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--fg-3);
}

.soon__leader {
  width: 2.4em;
  height: 1px;
  margin: 0 0.9em 0 0.4em;
  background: repeating-linear-gradient(to right, currentColor 0 3px, transparent 3px 6px);
  opacity: 0.8;
}

.ctl--soon:hover .soon__leader,
.ctl--soon:focus-visible .soon__leader {
  animation: leader-run 0.9s linear infinite;
}

.soon__caret {
  width: 1px;
  height: 1.05em;
  margin-left: 0.45em;
  background: currentColor;
  animation: caret 1.4s steps(1, end) infinite;
}

.soon-note {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  white-space: nowrap;
  color: var(--fg-2);
  opacity: 0;
  translate: 0 -3px;
  transition: opacity 0.24s var(--ease), translate 0.24s var(--ease);
  pointer-events: none;
}

.soon-note[data-shown="true"] {
  opacity: 1;
  translate: 0 0;
}

@keyframes leader-run {
  to { background-position: 6px 0; }
}

@keyframes caret {
  50% { opacity: 0; }
}

/* ------------------------------------------------------------------ */
/* Stage: figure + statement                                          */
/* ------------------------------------------------------------------ */

.stage {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.figure {
  position: relative;
  min-height: 0;
  container-type: size;
}

.figure__box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(56vh, 76vw);
  width: calc(min(100cqw, 100cqh) * 0.9);
  aspect-ratio: 1;
  translate: -50% -50%;
}

.figure__canvas {
  --figure-scale: 0.36;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.figure__mark {
  position: absolute;
  width: 9px;
  height: 9px;
  translate: -50% -50%;
  background:
    linear-gradient(var(--mark), var(--mark)) center / 1px 100% no-repeat,
    linear-gradient(var(--mark), var(--mark)) center / 100% 1px no-repeat;
}

.figure__mark--tl { left: 0; top: 0; }
.figure__mark--tr { left: 100%; top: 0; }
.figure__mark--bl { left: 0; top: 100%; }
.figure__mark--br { left: 100%; top: 100%; }

.figure__label,
.figure__readout {
  position: absolute;
  white-space: nowrap;
  transform: translate3d(calc(var(--px) * 1.5px), calc(var(--py) * 1px), 0);
}

.figure__label {
  left: 14px;
  top: 0;
  translate: 0 -50%;
}

.figure__readout {
  right: 14px;
  top: 100%;
  translate: 0 -50%;
  display: flex;
  gap: 1.6em;
}

.figure__readout div {
  display: flex;
  gap: 0.7em;
}

.figure__readout dd {
  color: var(--fg-2);
  min-width: 6ch;
  text-align: right;
}

.statement {
  padding-top: clamp(16px, 2.6vh, 36px);
  transform: translate3d(calc(var(--px) * -2px), calc(var(--py) * -1.5px), 0);
}

.headline {
  font-size: clamp(30px, min(4.1vw, 7.4vh), 88px);
  font-weight: 470;
  line-height: 0.92;
  letter-spacing: -0.018em;
  text-transform: uppercase;
  font-feature-settings: "kern", "case";
  color: var(--fg);
  margin-left: -0.04em; /* optical: align the B's stem with the wordmark */
}

.lede {
  margin-top: clamp(12px, 2vh, 24px);
  max-width: 24.5em;
  font-size: clamp(14px, 0.36vw + 9.6px, 18px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.003em;
  color: var(--fg-2);
  text-wrap: pretty;
}

.bottom {
  position: absolute;
  right: var(--pad-r);
  bottom: var(--pad-b);
  transform: translate3d(calc(var(--px) * -1px), calc(var(--py) * -1px), 0);
}

/* The company block: a small register in the corner, flush right. Its last
   line and the lede's last line share a bottom edge. */
.company {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: end;
  font-style: normal;
  line-height: 1.5;
  padding-bottom: 0.2em;
}

.company__name {
  color: var(--fg-2);
}

/* ------------------------------------------------------------------ */
/* Phone menu                                                         */
/* ------------------------------------------------------------------ */

/* Two hairlines that turn into a cross. */
.menu-btn {
  position: relative;
  display: none;
  width: 44px;
  height: 44px;
  margin: -14px -12px -14px 0;
  color: var(--fg);
}

.menu-btn__line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: currentColor;
  transition: transform 0.32s var(--ease), translate 0.32s var(--ease);
}

.menu-btn__line:first-child { top: 18px; }
.menu-btn__line:last-child { top: 25px; left: 18px; }

.menu-btn:focus-visible {
  outline-offset: -6px;
}

.menu .menu-btn__line:first-child {
  translate: 0 3.5px;
  transform: rotate(45deg);
}

.menu .menu-btn__line:last-child {
  left: 12px;
  translate: 0 -3.5px;
  transform: rotate(-45deg);
}

html.is-locked {
  overflow: hidden;
}

.menu {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  background: transparent;
  color: var(--fg);
  overflow: hidden;
}

.menu::backdrop {
  background: rgba(5, 5, 6, 0.62);
}

.menu__sheet {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--pad-t) var(--pad-r) var(--pad-b) var(--pad-l);
  background: var(--bg);
}

.menu__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.menu__bar .menu-btn {
  display: block;
}

.menu__nav {
  display: grid;
  margin-top: clamp(40px, 10vh, 96px);
  border-top: 1px solid var(--rule);
}

.menu__item {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  align-items: baseline;
  row-gap: 8px;
  width: 100%;
  padding: clamp(14px, 2.6vh, 22px) 0;
  border-bottom: 1px solid var(--rule);
  text-align: start;
  text-decoration: none;
  color: var(--fg);
  font-size: clamp(26px, 8.4vw, 40px);
  font-weight: 470;
  line-height: 1;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  font-feature-settings: "kern", "case";
}

.menu__item:focus-visible {
  outline-offset: -1px;
}

.menu__item[aria-current="page"] .menu__label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  text-decoration-color: var(--fg-3);
}

.menu__n {
  align-self: start;
  padding-top: 0.35em;
}

.menu__item--soon {
  cursor: default;
}

.menu__item--soon .menu__label {
  color: var(--fg-3);
}

.menu__item--soon .soon {
  grid-column: 2;
  justify-self: start;
}

.menu__item--soon .soon__leader {
  margin-left: 0;
}

.menu__note {
  min-height: 1.5em;
  margin-top: 14px;
  color: var(--fg-2);
  line-height: 1.5;
}

.menu__company {
  margin-top: auto;
  padding-top: 28px;
}

.menu[open] .menu__sheet {
  animation: panel-in 0.42s var(--ease) both;
}

/* The cross draws itself from the two lines on open. */
.menu[open] .menu-btn__line:first-child {
  animation: line-a 0.36s var(--ease) 0.06s both;
}

.menu[open] .menu-btn__line:last-child {
  animation: line-b 0.36s var(--ease) 0.06s both;
}

@keyframes line-a {
  from { translate: 0 0; transform: none; }
}

@keyframes line-b {
  from { left: 18px; translate: 0 0; transform: none; }
}

.menu[open] .menu__nav,
.menu[open] .menu__company {
  animation: content-in 0.5s var(--ease) 0.08s both;
}

.menu.is-closing .menu__sheet {
  animation: panel-out 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}

/* Phones (and narrow windows): the navigation goes behind the button. */
@media (max-width: 760px) {
  .top .nav,
  .top .contact-trigger {
    display: none;
  }

  .menu-btn {
    display: block;
  }
}

/* ------------------------------------------------------------------ */
/* Text pages: About, Privacy                                         */
/* ------------------------------------------------------------------ */

.frame--page {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.page {
  min-height: 0;
  padding-top: clamp(32px, 8vh, 120px);
}

.page__kicker {
  margin-bottom: clamp(14px, 2.4vh, 26px);
}

.page__title {
  font-size: clamp(30px, min(3.3vw, 6.6vh), 76px);
  font-weight: 470;
  line-height: 0.95;
  letter-spacing: -0.016em;
  text-transform: uppercase;
  font-feature-settings: "kern", "case";
  color: var(--fg);
  margin-left: -0.04em;
}

.page a:not(.ctl),
.page__foot a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s var(--ease);
}

.page a:not(.ctl):hover,
.page__foot a:hover,
.page a:not(.ctl):focus-visible,
.page__foot a:focus-visible {
  text-decoration-color: var(--fg);
}

.page a:focus-visible,
.page__foot a:focus-visible {
  outline-offset: 2px;
}

.page__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(20px, 3.6vh, 56px);
}

.page__foot .company {
  margin-left: auto;
}

.page__foot a.meta {
  color: var(--fg-3);
  text-decoration: none;
}

.page__foot a.meta:hover,
.page__foot a.meta:focus-visible {
  color: var(--fg);
}

/* About: heading and sign-off on the left, the text on the right. */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "head text"
    "sign text";
  column-gap: clamp(32px, 6vw, 160px);
}

.about .page__head { grid-area: head; }

.about__text {
  grid-area: text;
  max-width: 40em;
}

.about__lead {
  font-size: clamp(19px, 0.62vw + 11px, 30px);
  font-weight: 400;
  line-height: 1.36;
  letter-spacing: -0.011em;
  color: var(--fg);
  text-wrap: pretty;
}

.about__list {
  list-style: none;
  margin: clamp(22px, 4.2vh, 48px) 0 0;
  padding: 0;
  display: grid;
  gap: clamp(12px, 2.2vh, 24px);
  counter-reset: none;
}

.about__list li {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr);
  padding-top: clamp(12px, 2.2vh, 22px);
  border-top: 1px solid var(--rule);
}

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

.about__n {
  padding-top: 0.5em;
}

.about__list p {
  font-size: clamp(15px, 0.3vw + 10.5px, 19px);
  line-height: 1.6;
  color: var(--fg-2);
  text-wrap: pretty;
}

.about__sign {
  grid-area: sign;
  align-self: end;
  font-size: clamp(22px, min(2.3vw, 4.8vh), 54px);
  font-weight: 470;
  line-height: 0.98;
  letter-spacing: -0.014em;
  text-transform: uppercase;
  font-feature-settings: "kern", "case";
  color: var(--fg);
  margin-left: -0.04em;
}

.about__sign .nowrap:last-child {
  color: var(--fg-3);
}

/* Privacy: a short register of facts. */
.privacy {
  display: grid;
  align-content: start;
  row-gap: clamp(20px, 4vh, 56px);
  padding-top: clamp(28px, 6vh, 120px);
}

.privacy__intro {
  margin-top: clamp(12px, 2vh, 22px);
  max-width: 44em;
  font-size: clamp(15px, 0.3vw + 10.5px, 19px);
  line-height: 1.55;
  color: var(--fg-2);
}

.privacy__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(250px, 22%), 1fr));
  gap: clamp(18px, 3.4vh, 40px) clamp(24px, 2.6vw, 56px);
}

.privacy__list div {
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.privacy__list dt {
  margin-bottom: 10px;
  color: var(--fg-2);
}

.privacy__list dd {
  margin: 0;
  font-size: clamp(14px, 0.18vw + 11.4px, 16.5px);
  line-height: 1.55;
  color: var(--fg-2);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

@media (max-width: 900px) {
  .about {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "head" "text" "sign";
    row-gap: clamp(24px, 4vh, 40px);
  }

  .about__sign {
    padding-top: 8px;
  }
}

@media (max-width: 600px) {
  .page {
    padding-top: clamp(28px, 5vh, 48px);
  }

  .about__list li {
    grid-template-columns: 2.6em minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------------ */
/* Pointer grid: faint, local, only for fine pointers                 */
/* ------------------------------------------------------------------ */

.grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  background-image:
    linear-gradient(to right, rgba(232, 230, 225, 0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(232, 230, 225, 0.075) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: var(--pad-l) var(--pad-t);
  -webkit-mask-image: radial-gradient(circle 240px at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
  mask-image: radial-gradient(circle 240px at var(--mx, -999px) var(--my, -999px), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
}

.grid.is-on {
  opacity: 1;
}

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

.contact {
  position: fixed;
  inset: 0 0 auto auto;
  margin: 0;
  padding: 0;
  border: 0;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: visible;
  background: transparent;
  color: var(--fg);
}

.contact::backdrop {
  background: rgba(5, 5, 6, 0.62);
}

.contact__panel {
  width: min(440px, 100vw);
  max-height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--pad-t) var(--pad-r) clamp(22px, 3vh, 36px) clamp(24px, 2.2vw, 40px);
  background: var(--panel);
  border-left: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.contact__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(18px, 4vh, 40px);
}

.contact__bar .meta {
  font-size: clamp(10px, 0.56vw, 12px);
}

/* Form */

.cform {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(10px, 1.8vh, 18px);
}

.cform[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field__label {
  display: block;
  color: var(--fg-2);
}

.field__opt {
  color: var(--fg-3);
  text-transform: none;
  letter-spacing: 0.04em;
}

.field__input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 9px 11px;
  font: 400 15px/1.4 var(--sans);
  letter-spacing: -0.003em;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 0;
  appearance: none;
  transition: border-color 0.2s var(--ease);
}

.field__input--area {
  height: clamp(76px, 20vh, 168px);
  resize: none;
  display: block;
}

.field__input:hover {
  border-color: var(--mark);
}

.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-color: var(--fg-2);
}

.field__input[aria-invalid="true"] {
  border-color: var(--warn);
}

.field__input:read-only {
  color: var(--fg-2);
}

.field__foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.field__error {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--warn);
}

.field__error:empty {
  display: none;
}

.field__count {
  margin-left: auto;
  color: var(--fg-3);
}

.field__count[data-near="true"] {
  color: var(--fg-2);
}

/* Honeypot: off-screen for people and assistive tech, present for bots. */
.cform__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Turnstile, size "flexible": 100% wide (min 300px), 65px tall. */
.cform__verify {
  min-height: 65px;
  min-width: 0;
}

.cform__verify iframe {
  display: block;
}

.cform__alert {
  font-size: 13px;
  line-height: 1.45;
  color: var(--warn);
}

.cform__alert:empty {
  display: none;
}

.cform__send {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cform__submit {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  padding: 12px 18px 12px 16px;
  font-size: clamp(11.5px, 0.66vw, 14px);
  font-weight: 560;
  line-height: 1;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid var(--fg-3);
  transition: color 0.24s var(--ease), border-color 0.24s var(--ease), background-color 0.24s var(--ease);
}

.cform__submit::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
}

.cform__submit:hover:not(:disabled) {
  border-color: var(--fg);
  background: rgba(232, 230, 225, 0.05);
}

.cform__submit:focus-visible {
  outline-offset: 3px;
}

.cform__submit:disabled {
  color: var(--fg-3);
  border-color: var(--rule);
  cursor: not-allowed;
}

.cform__submit[data-state="sending"] {
  cursor: progress;
}

.cform__submit[data-state="sending"]::before {
  background: currentColor;
  animation: caret 0.9s steps(1, end) infinite;
}

.cform__note {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--fg-3);
}

.cform__note a,
.contact__alt a {
  color: var(--fg-2);
  text-decoration: underline;
  text-decoration-color: var(--mark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.cform__note a:hover,
.contact__alt a:hover,
.cform__note a:focus-visible,
.contact__alt a:focus-visible {
  color: var(--fg);
  text-decoration-color: var(--fg);
}

.cform__note a:focus-visible,
.contact__alt a:focus-visible {
  outline-offset: 2px;
}

/* Sent */

.cform__sent {
  padding: clamp(8px, 3vh, 28px) 0 clamp(8px, 2vh, 18px);
  outline: none;
}

.cform__sent-title {
  font-size: clamp(20px, 1.25vw + 4px, 27px);
  line-height: 1.2;
  letter-spacing: -0.012em;
  color: var(--fg);
}

.cform__sent-text {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-2);
  overflow-wrap: anywhere;
}

/* The address, for people who prefer their own mail program. */

.contact__alt {
  margin-top: clamp(14px, 2.4vh, 24px);
  padding-top: clamp(12px, 2vh, 18px);
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-3);
  overflow-wrap: anywhere;
}

.contact__copy {
  position: relative;
  margin-left: 0.7em;
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  transition: color 0.24s var(--ease);
}

.contact__copy::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 0.8em;
  vertical-align: 0.12em;
  border: 1px solid currentColor;
}

.contact__copy:hover,
.contact__copy:focus-visible,
.contact__copy[data-state="copied"] {
  color: var(--fg);
}

.contact__copy[data-state="copied"]::before {
  background: currentColor;
}

.contact__copy:focus-visible {
  outline-offset: 2px;
}

/* Open: the panel unrolls from the control line; content follows. */
.contact[open] .contact__panel {
  animation: panel-in 0.42s var(--ease) both;
}

.contact[open] .cform,
.contact[open] .cform__sent,
.contact[open] .contact__alt,
.contact[open] .contact__bar .meta {
  animation: content-in 0.5s var(--ease) 0.08s both;
}

.contact[open]::backdrop {
  animation: fade-in 0.42s ease both;
}

.contact.is-closing .contact__panel {
  animation: panel-out 0.2s cubic-bezier(0.4, 0, 1, 1) both;
}

.contact.is-closing::backdrop {
  animation: fade-out 0.2s ease both;
}

@keyframes panel-in {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes panel-out {
  from { clip-path: inset(0 0 0 0); opacity: 1; }
  to { clip-path: inset(0 0 100% 0); opacity: 0.6; }
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Touch screens: 16px text so iOS does not zoom into the field. */
@media (pointer: coarse) {
  .field__input {
    font-size: 16px;
  }
}

/* ------------------------------------------------------------------ */
/* Small screens                                                      */
/* ------------------------------------------------------------------ */

/* Phones, portrait: same composition, headline on two lines. */
@media (max-width: 700px) and (orientation: portrait) {
  :root {
    --g: 20px;
  }

  .headline {
    line-height: 0.95;
  }

  .lede {
    max-width: 17.5em;
    font-size: 14px;
  }

  .statement {
    padding-top: clamp(14px, 2.4vh, 28px);
  }

  .figure__box {
    width: min(100cqw, 100cqh);
  }

  .figure__canvas {
    --figure-scale: 0.4;
  }

  .headline {
    font-size: min(15vw, 8vh, 64px);
  }

  .figure__readout div:last-child {
    display: none;
  }

  .frame:not(.frame--page) {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .frame:not(.frame--page) .bottom {
    position: static;
    justify-self: end;
    margin-top: 14px;
    transform: none;
  }

  .company {
    line-height: 1.45;
  }
}

/* Short landscape screens (phones on their side): figure beside the text. */
@media (orientation: landscape) and (max-height: 520px) {
  :root {
    --g: 18px;
  }

  .stage {
    grid-template-rows: minmax(0, 1fr);
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: end;
  }

  .figure {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    margin-bottom: calc(var(--pad-b) * -0.4);
  }

  .statement {
    grid-column: 1;
    grid-row: 1;
    padding-bottom: 1.6em;
  }

  .headline {
    font-size: min(5.4vw, 11vh, 44px);
  }

  .lede {
    font-size: 13px;
    max-width: 22em;
  }

  .figure {
    margin-bottom: calc(6.4em + 14px); /* room for the company block */
  }

  .company {
    font-size: 9.5px;
  }

  .figure__readout,
  .figure__label,
  .figure__mark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::backdrop {
    animation: none !important;
    transition: none !important;
  }

  .top,
  .statement,
  .bottom,
  .figure__label,
  .figure__readout {
    transform: none;
  }
}

/* Full-width panel on narrow phones: no left rule against the screen edge. */
@media (max-width: 440px) {
  .contact__panel {
    border-left: 0;
  }
}

/* Short landscape screens: the form in two columns. */
@media (orientation: landscape) and (max-height: 520px) {
  .contact__panel {
    width: min(720px, 100vw);
  }

  .contact__bar {
    margin-bottom: 14px;
  }

  .cform {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "email message"
      "name message"
      "verify send"
      "alert alert";
    column-gap: 22px;
    row-gap: 10px;
  }

  .field--email { grid-area: email; }
  .field--name { grid-area: name; }
  .field--message { grid-area: message; grid-template-rows: auto minmax(0, 1fr) auto; }
  .cform__verify { grid-area: verify; }
  .cform__alert { grid-area: alert; }
  .cform__send { grid-area: send; align-items: flex-start; flex-direction: column; gap: 10px; }

  .field__input--area {
    height: 100%;
    min-height: 0;
  }

  .contact__alt {
    margin-top: 12px;
    padding-top: 10px;
  }
}
