/* lobariahealth.com: one stylesheet for every page. Self-hosted Roboto (OFL). */

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('/assets/roboto-latin-var.woff2') format('woff2');
}

:root {
  --ink: #dcdcdc;
  --ink-bright: #fafafa;
  --ink-muted: #a8a8a8;
  --pill: #e4e4e4;
  --pill-hover: #ffffff;
  --pill-ink: #111111;
  --focus: #8fd0b9;
  --error: #ffb4a8;
  --gutter: clamp(1.5rem, 4vw, 3.6rem);
}

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

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

body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 0.6rem 1.2rem;
  border-radius: 300px;
  background: var(--pill);
  color: var(--pill-ink);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ─────────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
}

.site-header--overlay {
  position: absolute;
  inset: 0 0 auto 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-bright);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0;
}

/* The mark's viewBox is cropped to the shape (design/website/site_mark.py). */
.brand img {
  width: auto;
  height: 2.1rem;
}

.nav a {
  color: var(--ink-bright);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}

.nav a:hover,
.nav a[aria-current='page'] {
  border-bottom-color: currentColor;
}

/* ── Pill buttons ───────────────────────────────────────── */

.pill {
  display: inline-block;
  border: 0;
  border-radius: 300px;
  background: var(--pill);
  color: var(--pill-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.15em 2em;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pill:hover {
  background: var(--pill-hover);
}

.pill:disabled {
  cursor: progress;
  opacity: 0.7;
}

/* ── Home hero ──────────────────────────────────────────── */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: 7rem var(--gutter) clamp(4rem, 13vh, 9rem);
  overflow: hidden;
  isolation: isolate;
}

.hero__art,
.hero__art img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
}

.hero__art img {
  object-fit: cover;
  object-position: 30% 50%;
}

/* Darken the headline corner, as the reference does, so text stays legible. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.1) 62%, rgb(0 0 0 / 0.35)),
    linear-gradient(to right, rgb(0 0 0 / 0.35), transparent 70%);
}

.hero__copy {
  max-width: 62rem;
  padding-left: clamp(0rem, 4vw, 3.5rem);
}

.hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.6rem, 4.75vw, 4.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.hero p {
  margin: 1.6rem 0 2.6rem;
  color: var(--ink-bright);
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.35;
  max-width: 48rem;
}

/* Lichen hero (home): the poster, with waves of light drawn on a canvas above it by
   /hero.js. The thallus enters from the upper right; on portrait screens the
   mobile poster is used and it enters from the top. */
.hero--lichen .hero__art img {
  object-position: 50% 50%;
}

@media (max-aspect-ratio: 4/5) {
  .hero--lichen .hero__art img {
    object-position: 50% 0%;
  }
}

/* Camera (set by /hero.js): the poster element takes the whole poster's size
   at the largest zoom (inline width/height) and the script pans and zooms it
   with a transform; the hero clips it. Without the script, the poster is the
   static cover image above. */
.hero--lichen.has-camera .hero__art img {
  inset: 0 auto auto 0;
  transform-origin: 0 0;
  will-change: transform;
}

.hero__veins {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}

.hero__veins.is-ready {
  opacity: 1;
}

/* A slow breath: the whole thallus swells a few percent in brightness. */
@media (prefers-reduced-motion: no-preference) {
  .hero.is-live .hero__art img {
    animation: lichen-breathe 7s ease-in-out infinite alternate;
  }

  .hero.is-paused .hero__art img {
    animation-play-state: paused;
  }
}

@keyframes lichen-breathe {
  from {
    opacity: 0.93;
  }

  to {
    opacity: 1;
  }
}

/* Pause/play for the animation (WCAG 2.2.2); shown by /hero.js. */
.motion-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 300px;
  background: rgb(0 0 0 / 0.45);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.motion-toggle:hover {
  border-color: rgb(255 255 255 / 0.6);
}

.motion-toggle[hidden] {
  display: none;
}

/* Pause icon: two bars. */
.motion-toggle::before {
  content: '';
  width: 0.55rem;
  height: 0.65rem;
  border-left: 0.18rem solid currentColor;
  border-right: 0.18rem solid currentColor;
}

/* Play icon: a triangle. */
.motion-toggle[data-state='paused']::before {
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.33rem 0 0.33rem 0.55rem;
  border-color: transparent transparent transparent currentColor;
}

/* ── Contact page ───────────────────────────────────────── */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 8vw, 9rem);
  padding: clamp(2rem, 9vh, 6rem) var(--gutter) 5rem;
}

.contact h1 {
  margin: 0 0 2.6rem;
  color: var(--ink);
  font-size: clamp(2.2rem, 2.9vw, 2.65rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.contact__intro p {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  line-height: 1.4;
}

.form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form legend,
.field > label {
  padding: 0;
  font-size: 1.1rem;
}

.name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.name-row label {
  font-size: 0.8rem;
}

.req {
  color: var(--ink-muted);
  font-size: 0.8rem;
  margin-left: 0.35rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 1.4rem;
}

.name-row .field {
  margin-top: 0.4rem;
}

.form input,
.form textarea {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 1.45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
}

.form textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.form input::placeholder,
.form textarea::placeholder {
  color: #8c8c8c;
}

.form input:focus-visible,
.form textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

.form input[aria-invalid='true'],
.form textarea[aria-invalid='true'] {
  border-color: var(--error);
}

.form .pill {
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

/* Honeypot: off-screen for people, still in the DOM for naive bots. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 1rem 0 0;
  min-height: 1.4em;
  font-size: 1rem;
}

.form-status--error {
  color: var(--error);
}

.form-done {
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
}

.form-done:focus {
  outline: none;
}

.notice {
  margin: 0.5rem 0 0;
  max-width: 36rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.site-footer {
  padding: 1.5rem var(--gutter) 2rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

/* ── Small screens ──────────────────────────────────────── */

@media (max-width: 800px) {
  .contact {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .contact h1 {
    margin-bottom: 1.2rem;
  }
}

@media (max-width: 440px) {
  .brand {
    font-size: 1.05rem;
  }

  .brand img {
    width: 2.2rem;
    height: 2.2rem;
  }

  .name-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .name-row .field {
    margin-top: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pill,
  .motion-toggle {
    transition: none;
  }
}
