/* ===========================================================
   URSA — hero page
   Type: Helvetica Now Display, falling back through the
   Helvetica family available on the system.
   =========================================================== */

:root {
  --ursa-white: #ffffff;
  --ursa-rule: rgba(255, 255, 255, 0.45);
  --nav-h: 3.25rem;
  --gutter: clamp(1.25rem, 3vw, 3.25rem);
  --font-display: "Helvetica Now Display", "Helvetica Neue",
                  Helvetica, "Inter", Arial, sans-serif;
}

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

html,
body {
  margin: 0;
}

html { background: #000; }

body {
  background: #000;
  color: var(--ursa-white);
  font-family: var(--font-display);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

.hero {
  position: relative;
  height: 100vh;
  height: 100dvh;
  min-height: 30rem;
  width: 100%;
  overflow: hidden;
  /* The poster sits behind the video, so when autoplay is refused and
     the video hides, the frame is already there — no play glyph. */
  background: #1b1a17 url("assets/hero-poster.jpg") center / cover no-repeat;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: opacity 400ms ease;
}

.hero.video-blocked .hero__video {
  opacity: 0;
}

/* WebKit paints its own centered play glyph on a non-playing video —
   never wanted on a decorative background. */
.hero__video::-webkit-media-controls,
.hero__video::-webkit-media-controls-start-playback-button,
.hero__video::-webkit-media-controls-overlay-play-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
}

/* Very light scrim — keeps the white type legible over the
   bright desert plate without washing the footage out. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.28) 0,
      rgba(0, 0, 0, 0.04) 18%,
      rgba(0, 0, 0, 0.04) 60%,
      rgba(0, 0, 0, 0.18) 100%),
    rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

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

.nav {
  position: relative;
  z-index: 2;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ursa-rule);
}

.nav__logo {
  display: block;
  line-height: 0;
}

.nav__logo img {
  height: 1.8rem;
  width: auto;
  display: block;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__links a {
  color: var(--ursa-white);
  text-decoration: none;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  opacity: 0.95;
  transition: opacity 160ms ease;
}

.nav__links a:hover,
.nav__links a:focus-visible {
  opacity: 0.6;
}

/* The Contact trigger is a button that dresses like the nav links. */
.nav__contact {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ursa-white);
  font: inherit;
  font-size: 0.9375rem;
  letter-spacing: 0.005em;
  opacity: 0.95;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.nav__contact:hover,
.nav__contact:focus-visible {
  opacity: 0.6;
}

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

/* Hangs from the nav's bottom rule, flush right. Same hairline
   language as the rule; a light tint keeps fields legible on the
   bright plate without hiding the video. */
.contact {
  position: absolute;
  /* 100% resolves to the nav's padding box, which lands the panel on top
     of the 1px bottom rule and blurs it out — start just below instead. */
  top: calc(100% + 1px);
  right: var(--gutter);
  width: min(22rem, calc(100vw - 2 * var(--gutter)));
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px solid var(--ursa-rule);
  border-top: 0;
  background: rgba(0, 0, 0, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 1rem;

  /* Closed: fully clipped at the nav rule, like a drawer pushed shut.
     visibility flips only after the clip finishes so the close animates
     too; -1px margins keep the hairline border inside the open clip. */
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  pointer-events: none;
  transition: clip-path 340ms cubic-bezier(0.22, 1, 0.36, 1),
              height 340ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s 340ms;
}

.contact.is-open {
  clip-path: inset(0 -1px -1px -1px);
  visibility: visible;
  pointer-events: auto;
  transition: clip-path 340ms cubic-bezier(0.22, 1, 0.36, 1),
              height 340ms cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0s 0s;
}

/* Post-send confirmation: the box empties down to one line, sitting
   where the first field label was. */
.contact__confirm {
  display: none;
  margin: 0;
  font-size: 0.875rem;
  letter-spacing: 0.005em;
}

.contact.is-sent {
  overflow: hidden;
}

.contact.is-sent .contact__field,
.contact.is-sent .contact__send {
  display: none;
}

.contact.is-sent .contact__confirm {
  display: block;
}

.contact__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact__field label {
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
}

.contact__field input,
.contact__field textarea {
  background: transparent;
  border: 1px solid var(--ursa-rule);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
  color: var(--ursa-white);
  font: inherit;
  font-size: 0.875rem;
}

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

/* Autofill: the browser force-paints filled fields yellow with dark
   text. Its background can't be overridden directly — stall the repaint
   with an endless transition and re-assert the text color. */
.contact__field input:-webkit-autofill,
.contact__field input:-webkit-autofill:hover,
.contact__field input:-webkit-autofill:focus,
.contact__field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ursa-white);
  caret-color: var(--ursa-white);
  transition: background-color 9999999s step-end;
}

.contact__field input:autofill,
.contact__field textarea:autofill {
  -webkit-text-fill-color: var(--ursa-white);
  caret-color: var(--ursa-white);
  transition: background-color 9999999s step-end;
}

/* Inline validation, in the form's own voice: quiet text under the
   field, and the offending outline brightens to full white. */
.contact__error {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.005em;
  color: rgba(255, 255, 255, 0.85);
}

.contact__field.has-error input,
.contact__field.has-error textarea {
  border-color: var(--ursa-white);
}

.contact__field ::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.contact__field input:focus-visible,
.contact__field textarea:focus-visible {
  outline: none;
  border-color: var(--ursa-white);
}

.contact__send {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--ursa-rule);
  border-radius: 0;
  padding: 0.5rem 1.4rem;
  color: var(--ursa-white);
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: border-color 160ms ease;
}

.contact__send:hover,
.contact__send:focus-visible {
  border-color: var(--ursa-white);
}

/* ---------- headline ---------- */

.hero__content {
  position: absolute;
  inset: var(--nav-h) 0 0 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 var(--gutter) 9vh;
  pointer-events: none;
}

.hero__title {
  margin: 0;
  text-align: left;
  font-weight: 400;
  font-size: clamp(1.6875rem, 4.05vw, 5.625rem);
  line-height: 1.09;
  letter-spacing: -0.022em;
  /* Holds the break after "mining" without hard-coding it. */
  max-width: 15em;
}

/* ---------- colophon ---------- */

.colophon {
  background: var(--ursa-white);
  border-top: 1px solid var(--ursa-rule);
  color: #4a4a48;
  padding: 0.5rem var(--gutter);
  text-align: center;
}

.colophon p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0.005em;
}

/* ---------- narrow screens ---------- */

@media (max-width: 640px) {
  :root { --nav-h: 2.9rem; }

  .nav__logo img { height: 1.5rem; }

  .hero__title {
    font-size: clamp(1.4625rem, 7.2vw, 2.5875rem);
    letter-spacing: -0.015em;
    max-width: 12em;
  }
}

/* ---------- a11y ---------- */

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

@media (prefers-reduced-motion: reduce) {
  .contact,
  .contact.is-open {
    transition: none;
  }

  .hero__video { display: none; }
  .hero {
    background: #1b1a17 url("assets/hero-poster.jpg") center / cover no-repeat;
  }
}
