/* reme-auth sign-in page — warm carbon, memory gold, hairlines only */

@font-face {
  font-family: "Instrument Serif";
  src: url("/login/static/fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/login/static/fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/login/static/fonts/geist-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: oklch(0.185 0.008 83);
  --bg-deep: oklch(0.155 0.008 83);
  --fg: oklch(0.93 0.012 88);
  --fg-dim: oklch(0.2 0.008 83);
  --muted: oklch(0.71 0.012 88);
  --faint: oklch(0.63 0.012 88);
  --line: oklch(0.29 0.008 83);
  --line-strong: oklch(0.38 0.01 83);
  --accent: oklch(0.79 0.11 79);
  --accent-soft: oklch(0.79 0.11 79 / 0.16);
  --accent-glow: oklch(0.79 0.11 79 / 0.35);
  --danger: oklch(0.68 0.19 28);

  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Geist", "Inter", system-ui, -apple-system, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --radius: 3px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
}

/* ---- bars ---- */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  font-size: 12px;
  letter-spacing: 0.015em;
  color: var(--muted);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.bar--top {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.bar--bottom {
  bottom: 0;
  border-top: 1px solid var(--line);
}

.bar .meta {
  color: var(--faint);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  transition: background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.status[data-state="live"] .dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.status[data-state="down"] .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px oklch(0.68 0.19 28 / 0.16);
}

/* ---- stage ---- */

.stage {
  min-height: 100dvh;
  max-width: 1200px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 11fr) 1px minmax(0, 9fr);
  padding-top: 56px;
  padding-bottom: 56px;
}

.identity {
  align-self: center;
  justify-self: end;
  text-align: right;
  max-width: 620px;
  padding: clamp(24px, 4vw, 56px) clamp(20px, 3.5vw, 56px);
}

.wordmark {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(58px, 7.5vw, 100px);
  line-height: 0.95;
  letter-spacing: -0.015em;
}

.wordmark .re {
  color: var(--muted);
}

.wordmark .me {
  color: var(--fg);
}

.tagline {
  margin: var(--space-4) 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(18px, 1.7vw, 22px);
  color: var(--muted);
}

.sub {
  margin: var(--space-5) 0 0 auto;
  max-width: 44ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--faint);
}

/* ---- spine + memory trace (the one bold move) ---- */

.spine {
  position: relative;
  background: var(--line);
}

.trace {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, var(--accent) 24%, var(--accent) 100%);
  opacity: 0.9;
  transform-origin: top;
  animation: draw-y 1.15s var(--ease) 0.25s both;
}

.trace::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 18px 2px var(--accent-glow);
  animation: node-in 0.6s var(--ease) 1.25s both;
}

@keyframes draw-y {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes node-in {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ---- access form ---- */

.access {
  align-self: center;
  justify-self: start;
  width: min(100%, 420px);
  padding: clamp(24px, 4vw, 56px) clamp(20px, 3.5vw, 56px);
}

.label {
  display: block;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.field {
  position: relative;
}

.field input {
  width: 100%;
  padding: 13px 76px 13px 14px;
  background: color-mix(in oklab, var(--bg-deep) 62%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 0.04em;
  caret-color: var(--accent);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.field input::placeholder {
  color: var(--faint);
  letter-spacing: 0.01em;
}

.field input:hover {
  border-color: var(--line-strong);
}

.field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.error input {
  border-color: var(--danger);
}

.ghost {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px 8px;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 150ms var(--ease);
}

.ghost:hover {
  color: var(--fg);
}

.ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.err {
  min-height: 17px;
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--danger);
}

.submit {
  width: 100%;
  margin-top: 10px;
  padding: 13px 16px;
  background: var(--fg);
  color: var(--fg-dim);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 150ms var(--ease), transform 100ms var(--ease),
    opacity 150ms var(--ease);
}

.submit:hover {
  background: color-mix(in oklab, var(--fg) 90%, white);
}

.submit:active {
  transform: translateY(1px);
}

.submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.submit[aria-busy="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--faint);
}

/* ---- responsive ---- */

@media (max-width: 900px) {
  .stage {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: none;
  }

  .spine {
    display: none;
  }

  .identity {
    align-self: flex-start;
    justify-self: start;
    text-align: left;
    max-width: 100%;
    padding-bottom: var(--space-2);
  }

  .identity::after {
    content: "";
    display: block;
    width: 72px;
    height: 1px;
    margin-top: var(--space-4);
    background: linear-gradient(90deg, var(--accent), transparent);
    transform-origin: left;
    animation: draw-x 1.1s var(--ease) 0.25s both;
  }

  @keyframes draw-x {
    from {
      transform: scaleX(0);
    }
    to {
      transform: scaleX(1);
    }
  }

  .sub {
    margin-left: 0;
    max-width: 52ch;
  }

  .access {
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    max-width: 440px;
    padding-top: var(--space-5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trace,
  .trace::after,
  .identity::after {
    animation: none;
  }
}
