/* KNova Link — Marketing + shared UI */
:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --ink: #000000;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #000000;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --hero-glow: rgba(0, 0, 0, 0.04);
  --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
  --nav-h: 4rem;
}

[data-theme='dark'] {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --ink: #fafafa;
  --muted: #9ca3af;
  --line: #262626;
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --hero-glow: rgba(255, 255, 255, 0.06);
  --card-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body[data-page="home"],
body[data-page="pricing"] {
  padding-top: var(--nav-h);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(72rem, 92vw); margin: 0 auto; }

/* ─── Nav ─── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}
.site-nav .inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: .55rem;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-size: .85rem; font-weight: 800;
}
.nav-links { display: none; gap: 1.5rem; font-size: .92rem; font-weight: 500; }
.nav-links a { opacity: .75; transition: opacity .2s; }
.nav-links a:hover, .nav-links a.active { opacity: 1; }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.15rem; border-radius: .75rem; font-size: .88rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-sm { padding: .45rem .75rem; font-size: .78rem; }
.icon-btn {
  width: 2.25rem; height: 2.25rem; border-radius: .6rem;
  border: 1px solid var(--line); background: var(--bg-elevated);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.select-sm {
  border: 1px solid var(--line); background: var(--bg-elevated); color: var(--ink);
  border-radius: .6rem; padding: .4rem .55rem; font-size: .78rem; cursor: pointer;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

/* ─── Hero 3D ─── */
.hero {
  padding: 4rem 0 5rem;
  perspective: 1200px;
  overflow: hidden;
}
.hero-grid {
  display: grid; gap: 3rem; align-items: center;
}
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.1fr .9fr; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elevated);
  font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 1.05; letter-spacing: -.03em; margin: 0 0 1rem;
}
.hero h1 span { color: var(--muted); display: block; }
.hero-lead { font-size: 1.1rem; color: var(--muted); max-width: 34rem; margin-bottom: 1.75rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.5rem; }
.hero-trust { font-size: .82rem; color: var(--muted); }

.hero-visual { position: relative; min-height: 320px; }
.card-3d {
  position: relative; transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.card-3d-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  transform: rotateX(8deg) rotateY(-12deg);
}
.card-3d-float {
  position: absolute; inset: auto;
  width: 46%; padding: 1rem; border-radius: 1rem;
  background: var(--bg-elevated); border: 1px solid var(--line);
  box-shadow: var(--card-shadow);
  animation: float3d 6s ease-in-out infinite;
}
.card-3d-float.a { top: 8%; right: -2%; animation-delay: 0s; }
.card-3d-float.b { bottom: 6%; left: -4%; animation-delay: -2s; }

@keyframes float3d {
  0%, 100% { transform: translateY(0) rotateX(12deg) rotateY(8deg); }
  50% { transform: translateY(-12px) rotateX(6deg) rotateY(-6deg); }
}

/* ─── Sections scroll reveal 3D ─── */
.section { padding: 5rem 0; }
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); letter-spacing: -.02em; margin: 0 0 .75rem; }
.section-head p { color: var(--muted); margin: 0; }

.reveal-3d {
  opacity: 0; transform: translateY(40px) rotateX(12deg);
  transform-origin: center top;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
.reveal-3d.visible { opacity: 1; transform: translateY(0) rotateX(0); }

.grid-3 { display: grid; gap: 1.25rem; }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1.5rem;
  transition: transform .25s, box-shadow .25s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow); }
.feature-icon {
  width: 2.5rem; height: 2.5rem; border-radius: .65rem;
  background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 1rem;
}
.feature-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ─── Compare table ─── */
.compare-wrap { overflow-x: auto; }
.compare {
  width: 100%; border-collapse: collapse; min-width: 640px;
  background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden;
}
.compare th, .compare td { padding: 1rem 1.15rem; text-align: left; border-bottom: 1px solid var(--line); }
.compare th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.compare tr:last-child td { border-bottom: none; }
.compare .win { font-weight: 700; }

/* ─── Stats bars ─── */
.stats-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-box {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1.25rem; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.stat-label { font-size: .82rem; color: var(--muted); }
.bar-chart { margin-top: 2rem; display: grid; gap: .85rem; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr 3rem; gap: .75rem; align-items: center; font-size: .85rem; }
.bar-track { height: .55rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--ink); border-radius: 999px; width: 0; transition: width 1.2s ease; }
.reveal-3d.visible .bar-fill { width: var(--w, 50%); }

/* ─── Pricing ─── */
.pricing-grid { display: grid; gap: 1.25rem; align-items: stretch; }
@media (min-width: 960px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 1.25rem; padding: 2rem 1.5rem; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.price-card:hover { transform: translateY(-6px) rotateX(2deg); box-shadow: var(--card-shadow); }
.price-card.featured { border-color: var(--ink); box-shadow: var(--card-shadow); transform: scale(1.02); }
.price-name { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.price-amount { font-size: 3rem; font-weight: 800; letter-spacing: -.04em; margin: .5rem 0; }
.price-amount small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-perk { list-style: none; padding: 0; margin: 1.5rem 0; flex: 1; }
.price-perk li { padding: .45rem 0; font-size: .9rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.price-perk li strong { color: var(--ink); }
.permanent-banner {
  margin: 2rem 0; padding: 1.25rem 1.5rem; border-radius: 1rem;
  background: var(--ink); color: var(--bg); text-align: center; font-weight: 600;
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0; margin-top: 2rem;
  font-size: .85rem; color: var(--muted);
}
.footer-grid { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }

/* ─── URL hero input (landing) ─── */
.url-box {
  display: flex; flex-wrap: wrap; gap: .5rem; padding: .4rem;
  background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 1rem;
}
.url-box input {
  flex: 1; min-width: 200px; border: none; background: transparent;
  padding: .85rem 1rem; font-size: 1rem; color: var(--ink); outline: none;
}
.url-box input::placeholder { color: var(--muted); }

/* ─── Hero rotator ─── */
.hero-rotator-wrap { min-height: 2.6em; margin: 0 0 1rem; }
#hero-rotator {
  display: block;
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  transition: opacity .32s ease, transform .32s ease;
}
#hero-rotator.hero-rotator-exit { opacity: 0; transform: translateY(12px); }
#hero-rotator.hero-rotator-enter { opacity: 1; transform: translateY(0); }

/* ─── Guest shorten modal ─── */
.guest-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.35);
  display: grid; place-items: center; padding: 1rem;
  animation: backdropIn .2s ease-out;
}
.guest-modal {
  width: min(28rem, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
}
.guest-modal-head { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1.25rem; }
.guest-modal-icon {
  width: 2.5rem; height: 2.5rem; border-radius: .75rem;
  background: #ecfdf5; color: #047857;
  display: grid; place-items: center; font-weight: 700;
}
.guest-modal-head h2 { margin: 0; font-size: 1.15rem; }
.guest-modal-head p { margin: .25rem 0 0; font-size: .85rem; color: var(--muted); }
.guest-modal-url {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: .85rem; padding: 1rem; margin-bottom: .85rem;
}
.guest-modal-url label {
  display: block; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: .35rem;
}
.guest-modal-url p { margin: 0; font-weight: 600; word-break: break-all; font-size: .95rem; }
.guest-watermark { margin-top: .5rem !important; font-size: .78rem !important; font-weight: 500 !important; color: var(--muted) !important; }
.guest-modal-note { font-size: .82rem; color: var(--muted); margin: 0 0 1.25rem; line-height: 1.5; }
.guest-modal-note a { text-decoration: underline; }
.guest-modal-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.guest-modal-actions .btn { flex: 1; min-width: 120px; }

/* ─── App shell (sin depender solo de Tailwind) ─── */
body[data-page="app"] { background: #fafafa; color: #000; }
[data-theme="dark"] body[data-page="app"] { background: #0a0a0a; color: #fafafa; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(10px);
}
.app-header-inner {
  max-width: 72rem; margin: 0 auto; padding: 0 1rem;
  height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
}
.app-main { flex: 1; }
.app-card {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 1rem; padding: 1.5rem;
}
.app-input {
  width: 100%; border: 1px solid var(--line); border-radius: .75rem;
  padding: .85rem 1rem; font-size: .95rem; background: var(--bg); color: var(--ink);
}
.app-muted { color: var(--muted); }
.app-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

/* ─── Auth form (app, sin depender de Tailwind) ─── */
.auth-wrap { max-width: 28rem; margin: 0 auto; padding: 3rem 1rem 4rem; }
.auth-card { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 1rem; padding: 1.5rem; }
.auth-tabs { display: flex; border: 1px solid var(--line); border-radius: .75rem; padding: .25rem; margin-bottom: 1.25rem; background: var(--bg); }
.auth-tab { flex: 1; padding: .6rem; border: none; background: transparent; border-radius: .5rem; cursor: pointer; font-weight: 600; font-size: .88rem; }
.auth-tab.active { background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.auth-field { width: 100%; border: 1px solid var(--line); border-radius: .75rem; padding: .75rem 1rem; margin-bottom: .85rem; background: var(--bg); color: var(--ink); font-size: .95rem; }
.auth-submit { width: 100%; background: var(--ink); color: var(--bg); border: none; border-radius: .75rem; padding: .85rem; font-weight: 600; cursor: pointer; }
.auth-submit:disabled { opacity: .6; cursor: wait; }
.auth-google { width: 100%; border: 1px solid var(--line); background: var(--bg-elevated); border-radius: .75rem; padding: .85rem; font-weight: 600; cursor: pointer; margin-bottom: 1rem; }
.auth-error { color: #b91c1c; font-size: .88rem; margin-bottom: .75rem; }
.auth-error.hidden { display: none; }
