/* ===========================================================================
   EME Showroom — landing page styles.

   Hand-authored to replace the Tailwind CDN build. That CDN ships a JavaScript
   compiler that has to download and run before the page has any styling at
   all; in an exhibition hall — hundreds of phones sharing congested wifi — that
   is seconds of unstyled text, or a blank screen. This file is a few KB, is
   render-blocking for a single round trip, and cannot fail halfway.

   Design tokens are carried over unchanged from the original Tailwind config,
   so the page looks exactly as it was designed.
   ========================================================================= */

/* ---------------------------------------------------------------------------
   Poppins, self-hosted.

   Subset to Latin and converted to WOFF2 from the TTFs already in the repo
   (Documents/Expert/Fonts/Poppins, OFL — licence copied into fonts/). 156 KB of
   TTF becomes 7.5 KB per weight, and being same-origin there is no third-party
   DNS lookup or TLS handshake to stall on hall wifi — which is exactly the
   moment a webfont from a CDN would leave the page in fallback type.

   Only the three weights the page actually uses are shipped: 300, 400, 600.
   ------------------------------------------------------------------------- */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/poppins-300.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/poppins-400.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-600.woff2") format("woff2");
}

:root {
  --primary: #ba0013;
  --primary-container: #e31e24;
  --on-surface: #1a1c1c;
  --on-surface-variant: #5d3f3c;
  --surface: #f9f9f9;
  --surface-lowest: #ffffff;
  --surface-container: #eeeeee;
  --surface-dim: #dadada;
  --outline: #926f6b;
  --outline-variant: #e7bdb8;
  --error: #ba1a1a;
  --success: #2e7d32;

  --sp-xs: 4px;
  --sp-base: 8px;
  --sp-sm: 12px;
  --sp-md: 24px;
  --sp-lg: 48px;
  --sp-xl: 80px;
  --gutter: 16px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Poppins, with a geometric-leaning fallback stack so the page still reads
     close to intended in the instant before the webfont paints. */
  --font:
    "Poppins", "Century Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: 64px;
  font: 400 16px/1.6 var(--font);
  color: var(--on-surface);
  background: var(--surface);
  background: radial-gradient(
    circle at top left,
    #ffffff 0%,
    #f9f9f9 50%,
    #fdf5f5 100%
  );
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- header --------------------------------------------------------------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--surface-dim);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .topbar {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
}

/* The supplied SVG had ~74% empty padding baked into its viewBox, so it needed
   a huge height just to look normal. The viewBox is now cropped to the artwork,
   which means this height is real lettering — 32px here reads about twice the
   size that 60px did before, and it sits comfortably in the 64px bar. */
.topbar__logo {
  display: block;
  height: 32px;
  width: auto;
}

/* Wordmark stand-in until the real logo file lands. */
.topbar__wordmark {
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}

/* --- layout --------------------------------------------------------------- */
.main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--sp-lg) var(--gutter) var(--sp-md);
}

.footer {
  flex-shrink: 0;
  padding: var(--sp-md) var(--gutter) var(--sp-lg);
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
}

/* A credit, not a claim on the page — quieter than the copyright above it. */
.footer__powered {
  margin-top: 6px !important;
  font-size: 10.5px !important;
  letter-spacing: 0.06em !important;
  color: #a39c9b !important;
}

.footer__powered a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  padding-bottom: 1px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.footer__powered a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* --- hero ----------------------------------------------------------------- */
.hero {
  text-align: center;
  margin-bottom: var(--sp-lg);
}

/* No forced ratio: index.php reads the real dimensions off the file and sets
   aspect-ratio inline, so whatever image gets dropped in shows uncropped and
   still reserves its exact space before it loads (no layout shift). */
.hero__cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-md);
  background: var(--surface-container);
}

/* "Welcome to" stacked above the drawn wordmark, centred as one lockup. */
.hero__title {
  margin: 0 0 var(--sp-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  font-weight: 300;
}

.hero__welcome {
  font-size: clamp(30px, 8vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Capped so the wordmark stays a signature rather than stretching edge to edge.
   340px left roughly 1px of margin on a 375px phone, which reads as overflow;
   300px keeps clear air either side and still lands ~26px tall at ~13.5:1. */
.hero__wordmark {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
}

/* Type fallback when FullLogo.svg is absent. */
.hero__brand {
  font-size: clamp(22px, 6vw, 30px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero p {
  margin: 0 auto;
  /* 30ch was tuned for Inter; Poppins is wider and pushed this to four lines
     with "profile." orphaned on the last one. 34ch brings it back to three. */
  max-width: 34ch;
  font-size: 17px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--on-surface-variant);
}

/* --- card ----------------------------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--surface-container);
  border-radius: var(--radius-lg);
  padding: var(--sp-md) var(--sp-md) var(--sp-lg);
  box-shadow:
    0 24px 48px -24px rgba(26, 28, 28, 0.16),
    0 2px 6px rgba(26, 28, 28, 0.04);
}

@supports (backdrop-filter: blur(6px)) {
  .card {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}

/* --- form ----------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--sp-md);
}

.field__label {
  margin-bottom: var(--sp-base);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  transition: color 0.2s ease;
}

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

.field input {
  /* 16px minimum: anything smaller makes iOS Safari zoom the viewport on
     focus, which at a booth reads as the page breaking. */
  font: 400 16px/1.5 var(--font);
  color: var(--on-surface);
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--surface-dim);
  border-radius: 0;
  background: transparent;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.field input::placeholder {
  color: #b4adac;
}

.field input:focus {
  outline: none;
  border-bottom-color: var(--primary);
  box-shadow: 0 1px 0 0 var(--primary);
}

.field--invalid input {
  border-bottom-color: var(--error);
}
.field--invalid input:focus {
  box-shadow: 0 1px 0 0 var(--error);
}
.field--invalid .field__label {
  color: var(--error);
}

.field__error {
  min-height: 0;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--error);
}

.field__error:empty {
  margin-top: 0;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- consent -------------------------------------------------------------- */
.consent {
  display: flex;
  gap: var(--sp-sm);
  align-items: flex-start;
  margin: var(--sp-md) 0 var(--sp-sm);
  font-size: 13px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  cursor: pointer;
}

.consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.privacy {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #8a8483;
}

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-base);
  width: 100%;
  min-height: 52px; /* comfortable target for a thumb, standing up */
  padding: 15px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: 600 13px/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

.btn--primary {
  background: var(--on-surface);
  color: #fff;
}

.btn--secondary {
  background: var(--surface-lowest);
  border-color: var(--on-surface);
  color: var(--on-surface);
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(186, 0, 19, 0.55);
  }
  .btn--secondary:hover {
    background: var(--on-surface);
    color: #fff;
  }
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: eme-spin 0.7s linear infinite;
}

@keyframes eme-spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-wrap {
  margin-top: var(--sp-md);
}

/* The way past the form. Present and easy to hit, but visually subordinate to
   the submit button above it — an escape hatch, not a second call to action. */
.btn-skip {
  display: block;
  width: 100%;
  margin-top: var(--sp-sm);
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  font: 400 13px/1 var(--font);
  letter-spacing: 0.02em;
  color: #8a8483;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(0, 0, 0, 0.18);
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

@media (hover: hover) {
  .btn-skip:hover {
    color: var(--on-surface);
    text-decoration-color: var(--on-surface);
  }
}

.btn-skip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.btn-skip[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* --- form-level error ----------------------------------------------------- */
.form-error {
  margin: 0 0 var(--sp-md);
  padding: 12px 14px;
  border-left: 3px solid var(--error);
  border-radius: var(--radius-sm);
  background: #fdecea;
  color: #93000a;
  font-size: 13.5px;
  line-height: 1.55;
}

/* --- success -------------------------------------------------------------- */
.success {
  text-align: center;
  padding: var(--sp-sm) 0;
}

.success__mark {
  width: 60px;
  height: 60px;
  margin: 0 auto var(--sp-md);
  color: var(--primary);
}

.success h2 {
  margin: 0 0 var(--sp-base);
  font-size: 27px;
  font-weight: 300;
}

.success p {
  margin: 0 auto var(--sp-md);
  max-width: 34ch;
  font-weight: 300;
  color: var(--on-surface-variant);
}

.success__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
}

.success__note {
  margin: var(--sp-md) 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #8a8483;
}

.is-hidden {
  display: none !important;
}

/* --- motion --------------------------------------------------------------- */
.fade-in {
  animation: eme-fade 0.45s ease both;
}

@keyframes eme-fade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover {
    transform: none;
  }
}

/* --- small phones --------------------------------------------------------- */
@media (max-width: 380px) {
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .card {
    padding: var(--sp-md) 18px var(--sp-md);
  }
}
