/*
 * miphen.com — CANDIDATE styling. Not approved brand identity.
 *
 * Every colour below is taken from src/theme/tokens.ts so the site and the app
 * cannot drift. Layout follows the approved atmospheric-cartography rules in
 * docs/BRAND_GUIDE.md: atmosphere first, night moving toward dawn, precise
 * editorial type, sheltered information, no decorative glass, no card grids.
 */

:root {
  --background: #f2eee7;
  --surface: #faf8f3;
  --surface-muted: #ede6e2;
  --background-dark: #090e15;
  --ink: #18202b;
  --ink-inverse: #f6f2ec;
  --text-secondary: #65717a;
  --text-secondary-inverse: #adb7bf;
  --border: #d7d2ca;
  --border-inverse: rgba(246, 242, 236, 0.18);
  --accent: #637f84;
  --accent-deep: #1f4155;

  --measure: 34rem;
  --page: 64rem;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* Small tracked uppercase labels — the only uppercase in the system. */
.label {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

.label--inverse {
  color: var(--text-secondary-inverse);
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.hero {
  position: relative;
  background: var(--background-dark);
  color: var(--ink-inverse);
  overflow: hidden;
  isolation: isolate;
}

.hero__image {
  position: absolute;
  inset: 0;
  background-image: url("assets/dawn-cloud-field.jpg");
  background-size: cover;
  background-position: 62% 50%;
  z-index: -2;
}

/*
 * The approved image is 1024 square and its quiet area is on the left. The
 * scrim keeps text off the bright dawn edge without flattening the atmosphere.
 */
.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
      100deg,
      rgba(9, 14, 21, 0.92) 0%,
      rgba(9, 14, 21, 0.72) 38%,
      rgba(9, 14, 21, 0.18) 72%,
      rgba(9, 14, 21, 0.05) 100%
    ),
    linear-gradient(to bottom, rgba(9, 14, 21, 0.45) 0%, rgba(9, 14, 21, 0) 30%);
  z-index: -1;
}

.hero__inner {
  min-height: min(46rem, 100svh);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4rem;
  /* Horizontal padding comes from .wrap; only the block padding belongs here. */
  padding-block: 2.25rem 4.5rem;
}

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

/* The product name set as an ordinary written name. No wordmark is approved. */
.masthead__name {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.masthead__links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary-inverse);
}

.masthead__links a {
  text-decoration: none;
}

.masthead__links a:hover {
  color: var(--ink-inverse);
}

.hero__copy {
  max-width: 32rem;
}

.hero__heading {
  margin: 1.25rem 0 0;
  font-size: clamp(2rem, 5.2vw, 3.125rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 400;
  text-wrap: balance;
}

.hero__standfirst {
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
  line-height: 1.55;
  color: #d8d3cc;
}

/* ------------------------------------------------------------ waitlist --- */

.waitlist {
  margin: 2.5rem 0 0;
  max-width: 27rem;
}

.waitlist__row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.waitlist__input {
  flex: 1 1 14rem;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  color: var(--ink-inverse);
  background: rgba(24, 32, 43, 0.55);
  border: 1px solid var(--border-inverse);
  border-radius: 12px;
  padding: 0.8125rem 1rem;
}

.waitlist__input::placeholder {
  color: #8d97a1;
}

.waitlist__input:focus-visible {
  outline: none;
  border-color: rgba(246, 242, 236, 0.55);
}

.waitlist__button {
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--ink-inverse);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.8125rem 1.375rem;
  cursor: pointer;
}

.waitlist__button:hover {
  background: #ffffff;
}

.waitlist__button[disabled] {
  opacity: 0.55;
  cursor: default;
}

.waitlist__note {
  margin: 0.875rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary-inverse);
}

.waitlist__status {
  margin: 0.875rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  min-height: 1.4em;
}

.waitlist__status:empty {
  display: none;
}

.waitlist__status[data-state="error"] {
  color: #e2c9c6;
}

.waitlist__status[data-state="done"] {
  color: #cfdcd9;
}

/* ----------------------------------------------------------- sections --- */

.section {
  padding-block: 5.5rem;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: 0;
}

.section__lede {
  max-width: var(--measure);
}

.section__heading {
  margin: 1.25rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 400;
  text-wrap: balance;
}

/*
 * Not a card grid: three plain columns of text separated by a hairline, which
 * collapse to a single readable column. Nothing is boxed.
 */
.columns {
  margin-top: 3.5rem;
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.column h3 {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.column p {
  margin: 0;
  color: var(--text-secondary);
}

.boundaries {
  margin: 3rem 0 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}

.boundaries li {
  padding: 1.125rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.boundaries li:last-child {
  border-bottom: 1px solid var(--border);
}

.boundaries strong {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

/* --------------------------------------------------------------- close --- */

.close {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 5.5rem 0;
}

.close .section__heading {
  max-width: var(--measure);
}

.close .waitlist {
  max-width: 27rem;
}

.close .waitlist__input {
  background: var(--background);
  border-color: var(--border);
  color: var(--ink);
}

.close .waitlist__input::placeholder {
  color: #97918a;
}

.close .waitlist__input:focus-visible {
  border-color: var(--accent);
}

.close .waitlist__button {
  background: var(--ink);
  color: var(--ink-inverse);
}

.close .waitlist__button:hover {
  background: #232c39;
}

.close .waitlist__note {
  color: var(--text-secondary);
}

.close .waitlist__status[data-state="error"] {
  color: #8f5f5b;
}

.close .waitlist__status[data-state="done"] {
  color: var(--accent);
}

/* -------------------------------------------------------------- footer --- */

.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.75rem;
  align-items: baseline;
  justify-content: space-between;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
}

.footer a {
  text-decoration: none;
}

.footer a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------- legal page --- */

.legal {
  padding: 3.5rem 0 5rem;
  max-width: 42rem;
}

.legal__title {
  margin: 1.25rem 0 0;
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 400;
}

.legal__updated {
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.legal__draft {
  margin: 2rem 0 0;
  padding: 1rem 1.25rem;
  background: var(--surface-muted);
  border-left: 2px solid var(--accent);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.legal__intro {
  margin: 2rem 0 0;
  font-size: 1.125rem;
  line-height: 1.6;
}

.legal h2 {
  margin: 3rem 0 0;
  font-size: 1.1875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.legal h2 + p {
  margin-top: 0.875rem;
}

.legal p {
  margin: 1rem 0 0;
  color: var(--text-secondary);
}

.legal__back {
  display: inline-block;
  margin-top: 3.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: no-preference) {
  .hero__image {
    animation: drift 60s ease-in-out infinite alternate;
  }
}

/* Almost-imagined motion: a slow drift, nothing that competes with reading. */
@keyframes drift {
  from {
    transform: scale(1.04) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.2%, -0.8%, 0);
  }
}
