/* Cantinarr — cantina-at-night. Palette lifted straight from the app's design system. */

@font-face {
  font-family: 'Fraunces';
  src: url('/static/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/static/fonts/schibsted-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/static/fonts/plexmono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/static/fonts/plexmono-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0F0A04;
  --bg-2: #14100A;
  --surface: #1C1510;
  --surface-2: #2A1F14;
  --border: #332818;
  --ink: #F0F0F0;
  --muted: #9E918A;
  --gold: #E5A00D;
  --gold-bright: #FFC549;
  --on-gold: #1C1510;
  --available: #4CAF50;
  --requested: #FFA726;
  --downloading: #42A5F5;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Schibsted Grotesk', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* overflow-x on BOTH html and body: iOS Safari pans sideways otherwise.
   clip (no scroll mechanism at all) with hidden as the older-browser fallback. */
html { scroll-behavior: smooth; background: #0F0A04; overflow-x: hidden; overflow-x: clip; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* positioned so the absolutely-placed .lamp glows are clipped by body's overflow */
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}

/* film grain */
body::before {
  content: '';
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .04;
}

::selection { background: var(--gold); color: var(--on-gold); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; border-radius: 4px; }

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

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ambient lamplight */
.lamp {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  max-width: 100vw;
}
.lamp-hero {
  top: -260px; left: 50%;
  width: 1400px; height: 900px;
  transform: translateX(-58%);
  background: radial-gradient(closest-side, rgba(229, 160, 13, .13), rgba(229, 160, 13, .05) 45%, transparent 72%);
}
.lamp-get {
  top: -120px; left: 50%;
  width: 1000px; height: 700px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(229, 160, 13, .1), transparent 70%);
}

/* ---------- nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.nav-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.brand img { border-radius: 8px; }
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: .01em;
}
.wordmark .arr {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(229, 160, 13, .55);
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--gold-bright); text-decoration: none; }
.nav-links .gh { display: inline-flex; color: var(--muted); }
.nav-links .gh:hover { color: var(--gold); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
  padding-top: 84px;
  padding-bottom: 96px;
}

.kicker {
  font-family: var(--mono);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--gold);
  margin-bottom: 18px;
}

h1 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 620;
  font-size: clamp(2.7rem, 5.6vw, 4.35rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  margin-bottom: 22px;
}
h1 em {
  font-style: normal;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(229, 160, 13, .5), 0 0 46px rgba(229, 160, 13, .28);
}

.lede { font-size: 1.13rem; color: var(--muted); max-width: 34em; }
.lede.center { margin: 0 auto; }

.hero-note { margin-top: 20px; font-size: .95rem; color: var(--muted); }

/* store badges */
.stores { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.store {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: #17110B;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 18px 11px 15px;
  color: var(--ink);
  cursor: default;
}
.store-mark { width: 26px; height: 26px; color: var(--ink); flex: none; }
.store-text { display: flex; flex-direction: column; line-height: 1.25; }
.store-sub { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.store-big { font-size: 1.02rem; font-weight: 700; }
.soon-chip {
  position: absolute;
  top: -9px; right: -10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .6rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  background: var(--gold);
  color: var(--on-gold);
  border-radius: 999px;
  padding: 2px 8px;
  transform: rotate(3deg);
  box-shadow: 0 0 16px rgba(229, 160, 13, .45);
}

/* hero phones */
.hero-visual { position: relative; height: 640px; }
.phone {
  position: absolute;
  width: 330px;
  border-radius: 46px;
  border: 1px solid #3A2D1C;
  background: #000;
  padding: 10px;
  overflow: hidden;
}
.phone img { border-radius: 37px; }
.phone-front {
  left: 6%; top: 34px;
  transform: rotate(-2.2deg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .65), 0 0 90px rgba(229, 160, 13, .13);
  z-index: 2;
}
.phone-back {
  left: 46%; top: 76px;
  transform: rotate(4.5deg) scale(.94);
  opacity: .55;
  filter: brightness(.75) saturate(.9);
  z-index: 1;
}
.phone::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 46px;
  background: linear-gradient(200deg, rgba(255, 255, 255, .07), transparent 30%);
  pointer-events: none;
}

.float-chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(28, 21, 16, .78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  animation: bob 7s ease-in-out infinite alternate;
}
.float-chip i {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: none;
}
.chip-available { top: 96px; left: -18px; color: #A5D6A7; }
.chip-available i { background: var(--available); box-shadow: 0 0 12px var(--available); }
.chip-requested { top: 300px; right: -6px; color: #FFD59A; animation-delay: 1.4s; }
.chip-requested i { background: var(--requested); box-shadow: 0 0 12px var(--requested); }
.chip-downloading { bottom: 88px; left: 2px; color: #A9D4F8; animation-delay: 2.6s; }
.chip-downloading i { background: var(--downloading); box-shadow: 0 0 12px var(--downloading); }

@keyframes bob {
  from { transform: translateY(-5px); }
  to { transform: translateY(7px); }
}

/* entrance */
.rise {
  opacity: 0;
  transform: translateY(16px);
  animation: rise .8s cubic-bezier(.2, .7, .2, 1) forwards;
}
.d1 { animation-delay: .08s; }
.d2 { animation-delay: .18s; }
.d3 { animation-delay: .3s; }
.d4 { animation-delay: .42s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.shown { opacity: 1; transform: none; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 13px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marq 46s linear infinite;
}
.marquee-track span {
  font-family: var(--mono);
  font-weight: 600;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: color-mix(in srgb, var(--gold) 75%, var(--muted));
  white-space: nowrap;
}
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
section { position: relative; padding: 104px 0; }

.section-title {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin-bottom: 20px;
  max-width: 18em;
}

/* how-it-works trio */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.tcard, .fcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 28px;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .35s, box-shadow .35s;
}
.tcard:hover, .fcard:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4), 0 0 34px rgba(229, 160, 13, .07);
}
.tnum {
  display: block;
  font-family: var(--display);
  font-weight: 550;
  font-size: 1.7rem;
  color: var(--gold);
  text-shadow: 0 0 16px rgba(229, 160, 13, .45);
  margin-bottom: 14px;
}
.tcard h3, .fcard h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.32rem;
  letter-spacing: .005em;
  margin-bottom: 10px;
}
.tcard p, .fcard p { color: var(--muted); font-size: .98rem; }

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: 999px;
  padding: 3px 10px;
  margin: 2px 1px 0;
  border: 1px solid;
}
.p-available { color: var(--available); border-color: color-mix(in srgb, var(--available) 45%, transparent); }
.p-requested { color: var(--requested); border-color: color-mix(in srgb, var(--requested) 45%, transparent); }
.p-downloading { color: var(--downloading); border-color: color-mix(in srgb, var(--downloading) 45%, transparent); }

/* features */
.features { padding-top: 0; }
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }

/* ---------- mcp band ---------- */
.mcp {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.mcp-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.mcp-copy p { color: var(--muted); margin-bottom: 16px; max-width: 32em; }
.mcp-copy p:last-child { margin-bottom: 0; }

.chatcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.chat-bubble {
  background: var(--surface-2);
  border-radius: 16px 16px 4px 16px;
  padding: 14px 18px;
  font-size: .98rem;
  max-width: 88%;
  margin-left: auto;
  margin-bottom: 18px;
}
.chat-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 18px;
}
.tool-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--surface-2);
  border-radius: 7px;
  flex: none;
}
.tool-tile img { border-radius: 4px; }
.tool-name strong { color: var(--gold); font-weight: 600; }
.tool-tick { margin-left: auto; color: var(--available); }
.chat-reply p { font-size: .98rem; color: var(--ink); }
.chatcard figcaption { margin-top: 18px; font-size: .8rem; color: var(--muted); }

/* ---------- self-host ---------- */
.sh-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 56px;
  align-items: center;
}
.sh-copy p { color: var(--muted); max-width: 30em; }
.sh-list { list-style: none; margin-top: 22px; display: grid; gap: 10px; }
.sh-list li { padding-left: 22px; position: relative; color: var(--muted); font-size: .98rem; }
.sh-list li::before { content: '▸'; position: absolute; left: 0; color: var(--gold); }
.sh-list code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 1px 7px;
}

.terminal {
  background: #120D07;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); }
.term-title { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.copy-btn {
  margin-left: auto;
  font-family: var(--mono);
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.copy-btn:hover { background: var(--gold); color: var(--on-gold); }
.terminal pre {
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.75;
  color: var(--ink);
}
.terminal .y { color: var(--gold); }
.terminal .g { color: #A5D6A7; }
.terminal .c { color: var(--muted); }

/* ---------- get panel ---------- */
.get { overflow: hidden; text-align: center; }
.get-panel { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.get-sign {
  border-radius: 22px;
  filter: drop-shadow(0 0 34px rgba(229, 160, 13, .35));
  animation: sway 7s ease-in-out infinite alternate;
  transform-origin: 50% -20%;
  margin-bottom: 26px;
}
@keyframes sway {
  from { transform: rotate(-1.6deg); }
  to { transform: rotate(1.6deg); }
}
.get .section-title { max-width: none; }
.get-ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 32px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .98rem;
  border-radius: 13px;
  padding: 13px 24px;
  text-decoration: none !important;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, border-color .3s;
}
.btn-gold {
  background: var(--gold);
  color: var(--on-gold);
  box-shadow: 0 6px 26px rgba(229, 160, 13, .3);
}
.btn-gold:hover { color: var(--on-gold); transform: translateY(-2px); box-shadow: 0 10px 36px rgba(229, 160, 13, .45); }
.btn-ghost { border: 1px solid var(--border); color: var(--ink); }
.btn-ghost:hover { color: var(--gold-bright); border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); transform: translateY(-2px); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 48px;
  padding-bottom: 8px;
}
.foot-tag { color: var(--muted); font-size: .9rem; margin-top: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 22px; }
.foot-links a { color: var(--muted); font-size: .95rem; }
.foot-links a:hover { color: var(--gold-bright); }
.foot-small { color: var(--muted); font-size: .8rem; padding-top: 26px; padding-bottom: 44px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 56px; gap: 26px; }
  .hero-visual { height: 680px; max-width: 480px; margin: 12px auto 0; width: 100%; }
  .phone { width: 290px; }
  .phone-front { left: 2%; }
  .phone-back { left: 44%; }
  .mcp-grid, .sh-grid { grid-template-columns: 1fr; gap: 36px; }
  .trio, .fgrid { grid-template-columns: 1fr 1fr; }
  section { padding: 84px 0; }
}
@media (max-width: 680px) {
  .nav-links a:not(.gh) { display: none; }
  .trio, .fgrid { grid-template-columns: 1fr; }
  .hero-visual { height: 640px; }
  .phone-back { display: none; }
  .phone-front { left: 50%; top: 0; transform: translateX(-50%) rotate(-1.6deg); }
  .chip-available { left: 2px; }
  .chip-requested { right: 2px; }
  .stores { gap: 10px; }
  .store { padding: 9px 14px 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .float-chip, .get-sign, .marquee-track { animation: none; }
  .tcard, .fcard, .btn { transition: none; }
}
