/* ==========================================================================
   Monteque — launch page
   ========================================================================== */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-300-italic.woff2") format("woff2");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

:root {
  --paper: #FAF8F4;
  --ink: #1C1B19;
  --text: #3A3A3A;
  --text-soft: #5E5A53;
  --rule: rgba(28, 27, 25, 0.28);

  --cream: #F3EFE7;
  --cream-dim: rgba(243, 239, 231, 0.68);
  --cream-faint: rgba(243, 239, 231, 0.26);
  --error: #EDB9A9;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: 600ms;

  --gutter: 16px;
  --inline-left: calc(env(safe-area-inset-left, 0px) + var(--gutter));
  --inline-right: calc(env(safe-area-inset-right, 0px) + var(--gutter));
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: #FFFFFF; /* matches the photograph's white sky */
}

body {
  margin: 0;
  min-height: 100vh;
  background: #FFFFFF;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg { display: block; max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

/* --------------------------------------------------------------------------
   Layout
   Phones: photo band on top, then the white and black panels.
   Wide screens: panels on the left, photo filling the right and held in place.
   -------------------------------------------------------------------------- */

.stage {
  display: grid;
  grid-template-areas:
    "photo"
    "panel";
  min-height: 100vh;
  min-height: 100svh;
}

.panel {
  grid-area: panel;
  display: flex;
  flex-direction: column;
}

.photo {
  grid-area: photo;
  position: relative;
  height: 42vh;
  height: 42svh;
  min-height: 260px;
  overflow: hidden;
  background: #F6F6F6; /* the photograph's sky, shown while it loads */
}

.photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 70% 55%; /* keep the herd in frame */
}

/* --------------------------------------------------------------------------
   White panel
   -------------------------------------------------------------------------- */

.intro {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding:
    48px
    var(--inline-right)
    44px
    var(--inline-left);
  background: #FFFFFF;
  text-align: center;
  animation: rise 800ms var(--ease-out) 120ms both;
}

.intro > * { max-width: 520px; }

.intro__logo {
  width: auto;
  height: 84px;
  margin: 0 auto 28px;
}

.headline {
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.75rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-wrap: balance;
}

.rule {
  width: 44px;
  height: 1px;
  margin: 16px auto 14px;
  border: 0;
  background: var(--rule);
}

.philosophy {
  max-width: 66ch;
  margin: 0 auto;
}

.philosophy p {
  margin: 0;
  font-size: 0.875rem;       /* 14px */
  line-height: 1.65;
  letter-spacing: 0.005em;
  color: var(--text);
  text-wrap: pretty;
}

.philosophy p + p { margin-top: 0.8em; }

/* --------------------------------------------------------------------------
   Black panel (registration), directly below the white one
   -------------------------------------------------------------------------- */

.signup {
  container-type: inline-size;
  padding:
    44px
    var(--inline-right)
    calc(env(safe-area-inset-bottom, 0px) + 28px)
    var(--inline-left);
  background: var(--ink);
  color: var(--cream);
  animation: rise 800ms var(--ease-out) 380ms both;
}

.signup > * {
  max-width: 520px;
  margin-inline: auto;
}

.register,
.thanks { transition: opacity var(--slow) var(--ease-out); }
.is-fading { opacity: 0; }

.register__title,
.thanks__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.45rem + 1.3vw, 2.125rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.035em;
  text-align: center;
  color: var(--cream);
}

.register__intro,
.thanks__text {
  margin: 10px auto 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--cream-dim);
}

.form { margin-top: 32px; }

.form__fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px 28px;
}

@container (min-width: 400px) {
  .form__fields { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.6875rem;      /* 11px */
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream-dim);
  transition: color 400ms var(--ease-out);
}

.field:focus-within .field__label { color: var(--cream); }

.field__input {
  display: block;
  width: 100%;
  padding: 8px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--cream-faint);
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  caret-color: var(--cream);
  font-family: var(--sans);
  font-size: 1rem;           /* 16px: no zoom-on-focus on iOS */
  line-height: 1.4;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 0 0 transparent;
  transition:
    border-color 400ms var(--ease-out),
    box-shadow 400ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder {
  color: rgba(243, 239, 231, 0.36);
  opacity: 1;
}

.field__input:hover { border-bottom-color: rgba(243, 239, 231, 0.42); }

.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-bottom-color: var(--cream);
  box-shadow: 0 1px 0 0 var(--cream);
}

.field__input[aria-invalid="true"] { border-bottom-color: var(--error); }
.field__input[aria-invalid="true"]:focus { box-shadow: 0 1px 0 0 var(--error); }

.field__input:-webkit-autofill,
.field__input:-webkit-autofill:hover,
.field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--cream);
  -webkit-box-shadow: 0 0 0 100px var(--ink) inset;
  caret-color: var(--cream);
  transition: background-color 9999s;
}

.field__error {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--error);
}
.field__error:not(:empty) { margin-top: 8px; }

/* Honeypot */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Consent */
.consent {
  display: grid;
  grid-template-columns: 16px 1fr;
  column-gap: 14px;
  margin-top: 30px;
}

.consent__box {
  display: grid;
  place-content: center;
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  border: 1px solid rgba(243, 239, 231, 0.6);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  transition: background-color 300ms var(--ease-out), border-color 300ms var(--ease-out);
  -webkit-appearance: none;
  appearance: none;
}

.consent__box::before {
  content: "";
  width: 8px;
  height: 4px;
  margin-top: -2px;
  border-left: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(-45deg) scale(0);
  transition: transform 250ms var(--ease-out);
}

.consent__box:checked {
  background: var(--cream);
  border-color: var(--cream);
}
.consent__box:checked::before { transform: rotate(-45deg) scale(1); }

.consent__box:hover { border-color: var(--cream); }

.consent__box:focus-visible {
  outline: 1px solid var(--cream);
  outline-offset: 3px;
}

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

.consent__text {
  font-size: 0.75rem;        /* 12px */
  line-height: 1.65;
  letter-spacing: 0.015em;
  color: var(--cream-dim);
  cursor: pointer;
}

.consent__text a {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(243, 239, 231, 0.45);
  transition: text-decoration-color 300ms var(--ease-out);
}
.consent__text a:hover { text-decoration-color: var(--cream); }

.consent__error { grid-column: 2; }

/* Button */
.button {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 32px;
  padding: 17px 24px 16px;
  border: 1px solid var(--cream);
  border-radius: 2px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.6875rem;      /* 11px */
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.32em;
  text-indent: 0.32em;       /* optically re-centre tracked caps */
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 500ms var(--ease-out),
    color 500ms var(--ease-out),
    opacity 300ms var(--ease-out);
}

@media (hover: hover) {
  .button:hover {
    background: transparent;
    color: var(--cream);
  }
}

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

.button[aria-busy="true"] {
  opacity: 0.6;
  cursor: progress;
}

.form__status {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  color: var(--error);
}
.form__status:not(:empty) { margin-top: 16px; }

/* Thank-you */
.thanks { padding: 28px 0 22px; }
.thanks[hidden] { display: none; }
.thanks__title { outline: none; }
.thanks__text { max-width: 30ch; margin-top: 14px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(243, 239, 231, 0.12);
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.footer a {
  text-decoration: none;
  border-bottom: 1px solid rgba(243, 239, 231, 0.3);
  padding-bottom: 1px;
  transition: border-color 300ms var(--ease-out), color 300ms var(--ease-out);
}
.footer a:hover {
  color: var(--cream);
  border-bottom-color: var(--cream);
}

/* --------------------------------------------------------------------------
   Privacy dialog
   -------------------------------------------------------------------------- */

.dialog {
  width: min(680px, 100% - 2 * var(--gutter));
  max-width: none;
  max-height: min(88svh, 920px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.dialog[open] {
  display: flex;
  flex-direction: column;
  animation: dialog-in 500ms var(--ease-out) both;
}

.dialog::backdrop {
  background: rgba(18, 15, 12, 0.55);
  animation: fade 500ms var(--ease-out) both;
}

.dialog__bar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 16px 0;
}

.dialog__close {
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
}

.dialog__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 28px 40px;
}

/* --------------------------------------------------------------------------
   Privacy notice (page + dialog)
   -------------------------------------------------------------------------- */

.page-legal {
  background: var(--paper);
}

.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top, 0px) + 40px)
    calc(env(safe-area-inset-right, 0px) + 24px)
    calc(env(safe-area-inset-bottom, 0px) + 56px)
    calc(env(safe-area-inset-left, 0px) + 24px);
}

.legal-page__home {
  display: inline-block;
  margin-bottom: 40px;
}
.legal-page__home img { width: auto; height: 52px; }

.legal h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.035em;
  color: var(--ink);
}

.legal__meta {
  margin: 12px 0 0;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.legal__lead {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(28, 27, 25, 0.14);
}

.legal h2 {
  margin: 40px 0 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.legal p,
.legal li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}
.legal p { margin: 0 0 0.9em; }
.legal ul { margin: 0 0 0.9em; padding-left: 1.1em; }
.legal li + li { margin-top: 0.35em; }
.legal li::marker { color: var(--text-soft); }
.legal strong { font-weight: 500; color: var(--ink); }

.legal a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(28, 27, 25, 0.35);
}
.legal a:hover { text-decoration-color: var(--ink); }

.legal address { font-style: normal; }

/* Placeholders that must be filled in before launch */
.todo {
  padding: 0 3px;
  border-radius: 2px;
  background: #F1E6C8;
  color: var(--ink);
}

.legal-page__footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(28, 27, 25, 0.14);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.legal-page__footer a { text-decoration: none; margin-right: 14px; }
.legal-page__footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Larger screens
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
  :root { --gutter: 48px; }

  .photo { height: 50vh; height: 50svh; }

  .intro { padding-top: 72px; padding-bottom: 64px; }
  .intro__logo { height: 96px; margin-bottom: 32px; }
  .rule { margin: 22px auto 20px; }
  .philosophy p { font-size: 0.9375rem; }  /* 15px */

  .signup { padding-top: 52px; }
  .form { margin-top: 38px; }

  .dialog__body { padding: 0 56px 56px; }
  .legal-page { padding-top: 72px; }
}

@media (min-width: 900px) {
  :root { --gutter: clamp(48px, 5vw, 96px); }

  .stage {
    grid-template-areas: "panel photo";
    grid-template-columns: minmax(460px, 46%) 1fr;
  }

  .photo {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    align-self: start;
  }

  .photo img { object-position: 80% 50%; }

  .panel { min-height: 100vh; min-height: 100svh; }

  .intro { padding-top: calc(env(safe-area-inset-top, 0px) + 72px); }
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to   { opacity: 1; transform: none; }
}

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

@keyframes dialog-in {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .intro,
  .signup,
  .dialog[open] { animation: fade 400ms linear both; }
  .register,
  .thanks { transition-duration: 1ms; }
}
