/* ==========================================================================
   LAMP Login — design tokens
   ========================================================================== */
:root {
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --accent: #34e0a1;
  --on-accent: #062a1e;

  --bg: #edf3f0;
  --surface: #ffffff;
  --surface-2: #dde8e3;
  --text: #0c1a17;
  --muted: #4d5f59;
  --line: rgba(12, 26, 23, 0.14);
  --dot: rgba(12, 26, 23, 0.17);
  --accent-text: #0a7350;
  --glow: rgba(52, 224, 161, 0.38);
  --shadow: 0 1px 2px rgba(12, 26, 23, 0.06), 0 6px 18px rgba(12, 26, 23, 0.07);
  --shadow-lift: 0 4px 8px rgba(12, 26, 23, 0.08), 0 22px 44px rgba(12, 26, 23, 0.16);
  --danger: #a3241c;
  --danger-bg: #fbe9e6;
  --ok: #17603f;
  --ok-bg: #e3f3e6;

  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1311;
    --surface: #111c19;
    --surface-2: #182622;
    --text: #e8f2ee;
    --muted: #98aba4;
    --line: rgba(255, 255, 255, 0.11);
    --dot: rgba(255, 255, 255, 0.09);
    --accent-text: #34e0a1;
    --glow: rgba(52, 224, 161, 0.2);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 4px 10px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.5);
    --danger: #ff9b8f;
    --danger-bg: rgba(255, 110, 96, 0.12);
    --ok: #8adf9e;
    --ok-bg: rgba(110, 220, 140, 0.12);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a1311;
  --surface: #111c19;
  --surface-2: #182622;
  --text: #e8f2ee;
  --muted: #98aba4;
  --line: rgba(255, 255, 255, 0.11);
  --dot: rgba(255, 255, 255, 0.09);
  --accent-text: #34e0a1;
  --glow: rgba(52, 224, 161, 0.2);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 4px 10px rgba(0, 0, 0, 0.45), 0 24px 48px rgba(0, 0, 0, 0.5);
  --danger: #ff9b8f;
  --danger-bg: rgba(255, 110, 96, 0.12);
  --ok: #8adf9e;
  --ok-bg: rgba(110, 220, 140, 0.12);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0;
}

p {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-text);
}

code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* ==========================================================================
   Living background: dot grid + pulsing corner glow
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1.1px, transparent 1.6px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
}

.bg__glow {
  position: absolute;
  top: -28vmax;
  right: -26vmax;
  width: 64vmax;
  height: 64vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  will-change: transform, opacity;
  animation: glow-pulse 7s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
  from {
    transform: scale(0.88);
    opacity: 0.55;
  }
  to {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  margin-right: auto;
}

.brand__slash {
  color: var(--accent-text);
}

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a {
  text-decoration: none;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav a:hover::after {
  transform: scaleX(1);
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}

.theme-toggle:hover {
  transform: rotate(-18deg) scale(1.06);
}

.theme-toggle:active {
  transform: scale(0.94);
}

/* Moon by default; sun when the page is dark. */
.theme-toggle__icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset -6px -3px 0 0 var(--text);
  transition: transform 0.4s var(--ease);
}

.is-dark .theme-toggle__icon {
  box-shadow: none;
  background: var(--accent);
  transform: scale(0.8);
  outline: 3px dotted var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Buttons: lift, press, shadow, ripple, moving arrow
   ========================================================================== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.35rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  box-shadow: 0 2px 0 rgba(12, 26, 23, 0.22);
  transition: transform 0.18s var(--ease);
}

/* A bigger shadow that fades in on hover (opacity only). */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 14px 30px -6px var(--glow), 0 6px 12px rgba(12, 26, 23, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:active::before {
  opacity: 0.3;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  color: var(--on-accent);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

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

.btn--block {
  width: 100%;
}

.btn__icon {
  display: inline-block;
  font-family: var(--font-mono);
  transition: transform 0.22s var(--ease);
}

.btn:hover .btn__icon {
  transform: translate(3px, -3px);
}

.btn__ink {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.28;
  transform: scale(0);
  animation: ripple 0.65s ease-out forwards;
}

@keyframes ripple {
  to {
    transform: scale(22);
    opacity: 0;
  }
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease);
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card--hover:hover {
  transform: translateY(-6px);
}

.card--hover:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

.hero__title {
  font-size: clamp(2.9rem, 9vw, 5.6rem);
  text-transform: uppercase;
  line-height: 0.92;
  margin-top: 1rem;
}

.mark {
  display: inline-block;
  margin-block: 0.04em;
  padding: 0.02em 0.12em 0;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 6px;
  transform: rotate(-1.5deg);
}

.hero__lead {
  max-width: 34rem;
  margin-top: 1.25rem;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  color: var(--muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.stack li {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

/* Access pass card */
.pass {
  overflow: hidden;
  max-width: 380px;
  width: 100%;
  justify-self: center;
  transform: rotate(2deg);
}

.pass.card--hover:hover {
  transform: rotate(0deg) translateY(-6px);
}

.pass__strip {
  display: flex;
  justify-content: space-between;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 0.72rem/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.pass__body {
  padding: 1.4rem 1.2rem 1.2rem;
}

.pass__who {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pass__name {
  font-family: var(--font-head);
  font-size: 1.9rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}

.pass__handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.pass__barcode {
  height: 34px;
  margin-top: 1.1rem;
  background: repeating-linear-gradient(90deg, var(--text) 0 2px, transparent 2px 5px, var(--text) 5px 6px, transparent 6px 10px);
  opacity: 0.8;
  border-radius: 3px;
}

/* Key–value rows (pass + dashboard) */
.record {
  margin: 1.2rem 0 0;
  display: grid;
  gap: 0.1rem;
}

.record > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.8rem;
}

.record dt {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.record dd {
  margin: 0;
  font-family: var(--font-mono);
  text-align: right;
  overflow-wrap: anywhere;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--ok);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ==========================================================================
   Stats band
   ========================================================================== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

@media (min-width: 760px) {
  .stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat {
  padding: 1.4rem 1.2rem;
  background: var(--surface);
}

.stat__value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat__unit {
  font-size: 0.5em;
  color: var(--accent-text);
  margin-left: 0.15em;
}

.stat__label {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding-block: clamp(3.5rem, 9vw, 6rem) 0;
}

.section__head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section__title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  text-transform: uppercase;
  margin-top: 0.6rem;
}

.section__lead {
  margin-top: 0.9rem;
  color: var(--muted);
}

/* Features */
.features {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  padding: 1.5rem;
}

.feature__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-text);
}

.feature h3 {
  font-size: 1.6rem;
  text-transform: uppercase;
  margin-top: 0.7rem;
}

.feature p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Flow steps */
.flow {
  display: grid;
  gap: 0.75rem;
  counter-reset: step;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 900px) {
  .flow {
    grid-template-columns: repeat(4, 1fr);
  }
}

.flow li {
  padding: 1.2rem 1.2rem 1.3rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.flow li::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-text);
}

.flow strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.35rem;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.flow span {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ==========================================================================
   Demo + auth forms (shared by the static demo and the PHP app)
   ========================================================================== */
.demo {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .demo {
    grid-template-columns: 1fr 1fr;
  }
}

.demo__note {
  display: grid;
  gap: 0.6rem;
  padding: 1.2rem 1.3rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.demo__note strong {
  color: var(--text);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1.4rem;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

.tab {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 600 0.95rem/1 var(--font-body);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 65px);
  padding: 2.5rem 16px 4rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(1.4rem, 5vw, 2.2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
}

.auth-card__title {
  font-size: clamp(2.1rem, 7vw, 2.8rem);
  text-transform: uppercase;
  margin: 0.4rem 0 1.4rem;
}

.auth-card__switch {
  margin-top: 1.3rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.auth-card__switch a,
.link-button {
  color: var(--text);
  font-weight: 600;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field__hint {
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.3 var(--font-body);
  transition: border-color 0.2s ease;
}

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

.field input:focus-visible {
  outline-offset: 1px;
  border-color: var(--accent);
}

.form .btn {
  margin-top: 0.4rem;
}

.alert {
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem 1rem;
  border-left: 4px solid currentColor;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  font-weight: 500;
  animation: pop-in 0.3s var(--ease);
}

.alert--error {
  color: var(--danger);
  background: var(--danger-bg);
}

.alert--success {
  color: var(--ok);
  background: var(--ok-bg);
  margin-bottom: 1rem;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.profile .auth-card__title {
  margin: 0;
  overflow-wrap: anywhere;
}

.profile__meta {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--on-accent);
  color: var(--accent);
  border: 3px solid var(--accent);
  font: 700 1.6rem/1 var(--font-head);
}

.record + form,
.record + .btn {
  margin-top: 1.5rem;
}

[hidden] {
  display: none !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ==========================================================================
   Scroll reveal (only when JS is running)
   ========================================================================== */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0s);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Reduced motion: no movement at all
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .btn:hover,
  .card--hover:hover,
  .theme-toggle:hover,
  .pass,
  .pass.card--hover:hover {
    transform: none;
  }

  .ripple {
    display: none;
  }
}
