/* ============================================
   qr.takk.space — Web3 / DeFi Dark Aesthetic
   True void + orange energy + glass morphism
   ============================================ */

/* ==================== Tokens ==================== */
:root {
  --bg: #030304;
  --surface: #0F1115;
  --fg: #FFFFFF;
  --muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.1);
  --border-hover: rgba(247, 147, 26, 0.5);
  --orange: #F7931A;
  --orange-dark: #EA580C;
  --gold: #FFD600;
  --glow-orange: rgba(234, 88, 12, 0.5);
  --glow-soft: rgba(247, 147, 26, 0.15);

  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1280px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
}

/* ==================== Reset ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==================== Background effects ==================== */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-size: 50px 50px;
  background-image:
    linear-gradient(to right, rgba(30, 41, 59, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 41, 59, 0.5) 1px, transparent 1px);
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 70%);
}

.glow-blob {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(120px);
}

.glow-blob-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -100px;
  background: var(--orange);
  opacity: 0.07;
}

.glow-blob-2 {
  width: 400px;
  height: 400px;
  bottom: 10%;
  left: -100px;
  background: var(--gold);
  opacity: 0.04;
}

/* ==================== Container ==================== */
.container {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .container { padding: 0 32px; }
}

@media (min-width: 1024px) {
  .container { padding: 0 48px; }
}

/* ==================== Nav ==================== */
.nav {
  padding: 14px 0;
  position: relative;
  z-index: 10;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-icon {
  color: var(--orange);
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: color 200ms, border-color 200ms, background 200ms;
}

.nav-link:hover {
  color: var(--fg);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ==================== Hero ==================== */
.hero {
  padding: 24px 0 32px;
}

@media (min-width: 768px) {
  .hero { padding: 32px 0 40px; }
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-layout {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

@media (min-width: 1024px) {
  .hero-layout { gap: 80px; }
}

/* Hero left */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(247, 147, 26, 0.1);
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  margin-bottom: 16px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(to right, var(--orange), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 480px;
}

@media (min-width: 768px) {
  .hero-subtitle { font-size: 1.1rem; }
}

/* Hero input */
.hero-input-group {
  margin-bottom: 16px;
}

.input-wrapper {
  position: relative;
  margin-bottom: 8px;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 44px 16px 16px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  outline: none;
  transition: border-color 200ms, box-shadow 200ms;
}

.input-wrapper input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.input-wrapper input:focus {
  border-bottom-color: var(--orange);
  box-shadow: 0 10px 20px -10px var(--glow-orange);
}

.input-wrapper input.invalid {
  border-bottom-color: #ef4444;
}

.clear-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.error-msg {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #ef4444;
  margin-bottom: 8px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(to right, var(--orange-dark), var(--orange));
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 0 20px -5px var(--glow-orange);
  transition: transform 300ms, box-shadow 300ms;
  min-height: 44px;
  margin-top: 12px;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 0 30px -5px rgba(247, 147, 26, 0.6);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

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

/* Options */
.options-panel {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(15, 17, 21, 0.5);
}

.options-panel summary {
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.options-panel summary::before { content: "+ "; color: var(--orange); }
.options-panel[open] summary::before { content: "- "; }
.options-panel summary::-webkit-details-marker { display: none; }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.option label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 4px;
}

.option select,
.option input[type="color"] {
  width: 100%;
  padding: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg);
  cursor: pointer;
}

.option input[type="color"] {
  height: 36px;
  padding: 2px;
}

/* ==================== QR Card (right side) ==================== */
.hero-right {
  display: flex;
  justify-content: center;
}

.qr-card {
  background: rgba(15, 17, 21, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 50px -10px var(--glow-soft);
  transition: border-color 300ms, box-shadow 300ms;
}

.qr-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 60px -10px rgba(247, 147, 26, 0.2);
}

.qr-card-inner {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Placeholder */
.qr-placeholder {
  color: #bbb;
  text-align: center;
}

.qr-placeholder-icon {
  margin-bottom: 12px;
  opacity: 0.3;
}

.qr-placeholder-icon svg { stroke: #999; }

.qr-placeholder p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #999;
}

/* Result */
.qr-result canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Download area */
.download-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.download-buttons {
  display: flex;
  gap: 8px;
}

.btn-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
  min-height: 44px;
}

.btn-download:hover {
  border-color: var(--orange);
  background: rgba(247, 147, 26, 0.1);
}

.btn-download:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.btn-copy-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  color: var(--orange);
  border: 1px solid rgba(247, 147, 26, 0.3);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 200ms, border-color 200ms;
  min-height: 44px;
}

.btn-copy-link:hover {
  background: rgba(247, 147, 26, 0.1);
  border-color: var(--orange);
}

.btn-copy-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.ttl-notice {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
  opacity: 0.6;
}

.btn-generate {
  width: 100%;
  margin-top: 16px;
}

.btn-generate:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.copy-feedback {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--orange);
  margin-top: 10px;
  animation: fade-out 1.5s ease forwards;
}

@keyframes fade-out {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ==================== Sections ==================== */
.section {
  padding: 80px 0;
  position: relative;
}

@media (min-width: 768px) {
  .section { padding: 96px 0; }
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 48px;
}

@media (min-width: 768px) {
  .section-title { margin-bottom: 64px; }
}

/* ==================== Features ==================== */
.features-section {
  background: var(--surface);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 300ms, border-color 300ms, box-shadow 300ms;
  cursor: default;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 0 30px -10px rgba(247, 147, 26, 0.2);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(234, 88, 12, 0.15);
  border: 1px solid rgba(234, 88, 12, 0.4);
  border-radius: 12px;
  margin-bottom: 16px;
  color: var(--orange);
  transition: box-shadow 300ms;
}

.feature-card:hover .feature-icon-wrap {
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.4);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}


/* ==================== How it works ==================== */
.how-section {
  background: var(--bg);
}

.steps-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

@media (min-width: 768px) {
  .steps-grid {
    flex-direction: row;
    justify-content: center;
    gap: 0;
  }
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  width: 100%;
  max-width: 300px;
  position: relative;
  transition: border-color 300ms;
}

.step-card:hover {
  border-color: var(--border-hover);
}

/* Corner accents */
.step-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 20px;
  height: 20px;
  border-top: 2px solid var(--orange);
  border-left: 2px solid var(--orange);
  border-radius: var(--radius-lg) 0 0 0;
  pointer-events: none;
}

.step-card::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 20px;
  height: 20px;
  border-bottom: 2px solid var(--orange);
  border-right: 2px solid var(--orange);
  border-radius: 0 0 var(--radius-lg) 0;
  pointer-events: none;
}

.step-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(to right, var(--orange-dark), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  box-shadow: 0 0 20px -5px var(--glow-orange);
}

.step-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

.step-connector {
  width: 2px;
  height: 32px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .step-connector {
    width: 48px;
    height: 2px;
    background: linear-gradient(to right, var(--orange), transparent);
  }
}

/* ==================== Ad ==================== */
.ad-section { padding: 16px 0; }

/* ==================== Footer ==================== */
.footer {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 200ms;
}

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

/* ==================== Utilities ==================== */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ==================== Accessibility ==================== */
button, a, [role="button"] {
  min-height: 44px;
  min-width: 44px;
}

input, select, textarea {
  font-size: max(16px, 1rem);
}

/* ==================== Reduced motion ==================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .glow-blob { display: none; }
}
