/*
 * The server-rendered pages of lootfront.app: the shell the landing page builds on (landing.css adds the
 * rest), terms, privacy and the error pages. Plain CSS, one neutral ramp, one accent. The dashboard app
 * has its own Tailwind build with the same tokens, see platform/dashboard/src/index.css.
 */
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/_lootfront/fonts/hanken-grotesk-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/_lootfront/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --black: #000;
  --bg: #050505;
  --surface: #09090a;
  --card: #0c0c0d;
  --raised: #151517;
  --hover: #1c1c1f;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f5;
  --text-2: #a3a3a3;
  --text-3: #737373;
  --accent: #f5a524;
  --amber: #f5a524;
  --amber-ink: #150f04;
  --ok: #4cc38a;
  --live: #4cc38a;
  --bad: #e5484d;
  --face: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-sm: 6px;
  --r: 10px;
  --r-card: 14px;
  --page: 1200px;
  --gutter: 32px;
  /* a hairline lit from above, the border of raised surfaces */
  --edge: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.05) 40%,
    rgba(255, 255, 255, 0.04)
  );
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/22px var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

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

.wrap {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mt-32 {
  margin-top: 32px;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
}

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

.topbar .wrap {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.logo svg {
  display: block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.topnav a,
.topnav button.link {
  white-space: nowrap;
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  transition: color 150ms var(--ease);
}

.topnav a:hover,
.topnav button.link:hover {
  color: var(--text);
}

.topnav form {
  margin: 0;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--raised);
}

/* ---------- buttons and fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--raised);
  color: var(--text);
  font: 500 14px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    transform 120ms var(--ease);
}

.btn:hover {
  background: var(--hover);
}

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

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

button.link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font: 400 14px/22px var(--sans);
  transition: border-color 150ms var(--ease);
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.input.mono {
  font-family: var(--mono);
  font-size: 13px;
}

/* ---------- the signature: a status dot next to a store address ---------- */
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}

/*
 * Store sketch: a drawing of the theme's home page in its own default colours (--g ground, --a primary),
 * set per theme in /_lootfront/themes.css. Stands in for a screenshot.
 * TODO: real screenshots once the themes ship one (themes/<name>/screenshot.png).
 */
.sketch {
  --g: var(--surface);
  --a: #888;
  display: grid;
  gap: 8px;
  padding: 16px;
  aspect-ratio: 16 / 10;
  align-content: start;
  min-width: 0;
  overflow: hidden;
  background: var(--g);
  border-bottom: 1px solid var(--line);
}

.sketch-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 12px;
}

.sketch-bar b {
  width: 36px;
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.7);
}

.sketch-bar i {
  width: 20px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.sketch-bar u {
  margin-left: auto;
  width: 28px;
  height: 10px;
  border-radius: 3px;
  background: var(--a);
}

.sketch-hero {
  display: grid;
  gap: 6px;
  align-content: center;
  height: 64px;
  padding: 0 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
}

.sketch-hero b {
  width: 46%;
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
}

.sketch-hero i {
  width: 30%;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
}

.sketch-hero u {
  width: 52px;
  height: 12px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--a);
}

.sketch-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.sketch-grid span {
  display: grid;
  align-content: end;
  gap: 4px;
  height: 52px;
  padding: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.sketch-grid span::before {
  content: '';
  height: 4px;
  width: 70%;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.sketch-grid span::after {
  content: '';
  height: 8px;
  border-radius: 2px;
  background: var(--a);
}

.footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}

.footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer a {
  text-decoration: none;
}

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

/* ---------- terms and privacy ---------- */
.prose {
  margin-top: 32px;
  color: var(--text-2);
}

.prose h2 {
  margin: 32px 0 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 24px;
  font-weight: 500;
}

.prose p + p,
.prose ul {
  margin-top: 12px;
}

.prose ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.prose strong {
  color: var(--text);
  font-weight: 500;
}

.legal-date {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- simple pages: errors, "not here" ---------- */
.narrow {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
}

.page-title {
  font-size: 36px;
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.page-lead {
  margin-top: 12px;
  color: var(--text-2);
}

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  .topbar .wrap {
    gap: 12px;
  }

  .topnav {
    gap: 16px;
  }

  .topnav .wide-only {
    display: none;
  }

  .topbar .wrap > .logo {
    flex: none;
  }

  .narrow {
    padding-top: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
  }
}

/* ---------- a plain underlined link set like a button ---------- */
.text-link {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: 500 15px / 1.5 var(--face);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color 150ms var(--ease);
}

.text-link:hover {
  text-decoration-color: currentColor;
}
