/* ------------------------------------------------------------------
   OTTO design tokens — neon / dark / 3D
------------------------------------------------------------------ */
:root {
  --bg: #0A0E1A;
  --bg-raised: #121729;
  --bg-panel: #161C33;
  --line: #262E4D;
  --text: #EAEBF7;
  --text-soft: #A8ADCC;
  --muted: #6C7299;

  --cyan: #2DE2E6;
  --cyan-deep: #14A8AC;
  --magenta: #FF2DAF;
  --magenta-deep: #C7128B;
  --violet: #8B5CF6;
  --amber: #FFB800;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(139, 92, 246, 0.12), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(45, 226, 230, 0.10), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--text);
}

p { margin: 0 0 1em; color: var(--text-soft); }
a { color: inherit; }

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

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

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------
   3D neon buttons
------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(3px); }

.btn-primary {
  color: #06101A;
  background: linear-gradient(180deg, #4CF0F4 0%, var(--cyan) 55%, var(--cyan-deep) 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.5) inset,
    0 -3px 0 rgba(6, 30, 32, 0.35) inset,
    0 6px 0 var(--cyan-deep),
    0 10px 22px rgba(45, 226, 230, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.4) inset,
    0 -2px 0 rgba(6, 30, 32, 0.35) inset,
    0 2px 0 var(--cyan-deep),
    0 4px 10px rgba(45, 226, 230, 0.3);
}

.btn-ghost {
  color: var(--text);
  background: linear-gradient(180deg, #1B2140 0%, #141935 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 6px 0 #090C1C,
    0 10px 20px rgba(0,0,0,0.4);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--magenta); color: var(--magenta); }
.btn-ghost:active {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 2px 0 #090C1C,
    0 4px 10px rgba(0,0,0,0.35);
}

.btn-lg { padding: 15px 28px; font-size: 1.02rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ------------------------------------------------------------------
   Header / footer (landing)
------------------------------------------------------------------ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  text-decoration: none; color: var(--text);
}
.brand-mark { color: var(--cyan); display: inline-flex; filter: drop-shadow(0 0 6px rgba(45,226,230,0.7)); }

.main-nav { display: flex; align-items: center; gap: 24px; }
.main-nav a:not(.btn) { text-decoration: none; font-weight: 500; color: var(--text-soft); font-size: 0.95rem; }
.main-nav a:not(.btn):hover { color: var(--cyan); }

.nav-link-btn {
  background: none; border: none; font-family: var(--font-body); font-weight: 500;
  font-size: 0.95rem; color: var(--text-soft); cursor: pointer; padding: 0;
}
.nav-link-btn:hover { color: var(--cyan); }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; margin-top: 40px; }
.footer-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: var(--muted); }
.footer-row a { text-decoration: none; font-weight: 600; color: var(--cyan); }

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------ */
.hero { padding: 76px 0 90px; }
.hero-row { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; perspective: 1400px; }
.kicker { font-size: 0.95rem; color: var(--magenta); font-weight: 600; margin-bottom: 14px; text-shadow: 0 0 12px rgba(255,45,175,0.5); }

.hero h1 { font-size: clamp(2.6rem, 5vw, 4rem); margin-bottom: 22px; }

.hero-3d {
  font-size: clamp(3.2rem, 6.4vw, 5.4rem);
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-4deg);
  transition: transform 0.2s ease-out;
  color: var(--text);
  text-shadow:
    1px 1px 0 var(--violet),
    2px 2px 0 var(--violet),
    3px 3px 0 #6D3FD1,
    4px 4px 12px rgba(139, 92, 246, 0.55),
    0 0 30px rgba(45, 226, 230, 0.25);
}
@media (prefers-reduced-motion: reduce) { .hero-3d { transition: none; } }

.hero-cycle-wrap { display: inline-block; min-width: 1px; overflow: hidden; vertical-align: top; }
.hero-cycle { display: inline-block; color: var(--cyan); text-shadow: 0 0 18px rgba(45,226,230,0.7); }
.hero-cycle.is-swapping { animation: cycle-flip 0.5s ease; }
@keyframes cycle-flip {
  0%   { transform: translateY(0) rotateX(0deg); opacity: 1; }
  45%  { transform: translateY(-14px) rotateX(70deg); opacity: 0; }
  55%  { transform: translateY(14px) rotateX(-70deg); opacity: 0; }
  100% { transform: translateY(0) rotateX(0deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .hero-cycle.is-swapping { animation: none; } }

.hero-sub { font-size: 1.08rem; max-width: 46ch; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
}
.peg {
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  border-left: 4px solid var(--cyan);
  box-shadow: 0 0 0 1px var(--line) inset, 0 8px 18px rgba(0,0,0,0.35);
}
.peg-image, .peg-resize, .peg-sum { border-left-color: var(--magenta); }
.peg-icon { font-size: 1.5rem; filter: drop-shadow(0 0 6px rgba(255,255,255,0.25)); }
.peg-label { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }

/* ------------------------------------------------------------------
   Tools section
------------------------------------------------------------------ */
.tools { padding: 40px 0 90px; }
.tools h2 { font-size: 2rem; }
.section-sub { max-width: 60ch; margin-bottom: 40px; }

.tool-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tool-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 24px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { transform: translateY(-3px); }
.tool-card.accent-cyan { border-left-color: var(--cyan); }
.tool-card.accent-cyan:hover { border-color: var(--cyan); box-shadow: 0 0 24px rgba(45,226,230,0.25); }
.tool-card.accent-magenta { border-left-color: var(--magenta); }
.tool-card.accent-magenta:hover { border-color: var(--magenta); box-shadow: 0 0 24px rgba(255,45,175,0.25); }
.tool-card.accent-violet { border-left-color: var(--violet); }
.tool-card.accent-violet:hover { border-color: var(--violet); box-shadow: 0 0 24px rgba(139,92,246,0.25); }
.tool-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.tool-card p { font-size: 0.94rem; margin-bottom: 0; }

/* ------------------------------------------------------------------
   How it works
------------------------------------------------------------------ */
.how { padding: 10px 0 100px; }
.how-row { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.how h2 { font-size: 1.9rem; }
.how-diagram {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-panel); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 32px 20px;
}
.node {
  background: var(--bg-raised); color: var(--text);
  border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; min-width: 120px;
  border: 1px solid var(--line);
}
.node span { display: block; font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.node-accent { border-bottom: 3px solid var(--cyan); box-shadow: 0 0 20px rgba(45,226,230,0.2); }
.arrow { color: var(--violet); font-size: 1.3rem; }

/* ------------------------------------------------------------------
   Live demo section (landing page)
------------------------------------------------------------------ */
.demo { padding: 10px 0 100px; }
.demo h2 { font-size: 1.9rem; }
.demo-panel {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 22px; max-width: 640px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.demo-config { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.demo-config label { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.demo-config input {
  font-family: var(--font-body); font-size: 0.9rem; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-panel); color: var(--text);
}
.demo-chat-window { height: 260px; }

/* ------------------------------------------------------------------
   Sign-in modal (Google only)
------------------------------------------------------------------ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6, 8, 18, 0.75);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: var(--bg-raised); border-radius: var(--radius-md); padding: 32px;
  max-width: 380px; width: 100%; position: relative;
  border: 1px solid var(--line); border-top: 3px solid var(--cyan);
  box-shadow: 0 0 40px rgba(45,226,230,0.15), 0 20px 60px rgba(0,0,0,0.5);
}
.modal h2 { font-size: 1.4rem; }
.modal p { font-size: 0.9rem; }

.google-btn-slot { margin-top: 16px; min-height: 44px; display: flex; justify-content: center; }
.google-config { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.google-config label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.google-config input {
  width: 100%; font-family: var(--font-body); font-size: 0.85rem; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-panel); color: var(--text); margin-bottom: 8px;
}
.google-config-hint { font-size: 0.76rem; color: var(--muted); margin: 0; }

.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer;
}
.modal-close:hover { color: var(--text); }

/* ------------------------------------------------------------------
   Dashboard shell
------------------------------------------------------------------ */
.dashboard-body { background: var(--bg); }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  color: var(--text);
  padding: 24px 18px;
  display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand-sidebar { color: var(--text); margin-bottom: 4px; }

.tool-nav { display: flex; flex-direction: column; gap: 4px; }
.tool-nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: var(--text-soft);
  font-family: var(--font-body); font-size: 0.93rem; font-weight: 500;
  padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer;
  text-align: left; border-left: 3px solid transparent;
}
.tool-nav-item:hover { background: rgba(45,226,230,0.06); color: var(--text); }
.tool-nav-item.is-active {
  background: rgba(45,226,230,0.10); color: var(--text);
  border-left-color: var(--cyan);
  box-shadow: 0 0 16px rgba(45,226,230,0.1) inset;
}
.tn-icon { font-size: 1.05rem; }

.sidebar-footer { margin-top: auto; font-size: 0.82rem; }
.sidebar-footer label { display: block; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.sidebar-footer input {
  width: 100%; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-raised); color: var(--text);
  font-family: var(--font-body); font-size: 0.85rem;
}
.sidebar-hint { color: var(--muted); margin: 8px 0 0; font-size: 0.78rem; }

.panel-area { padding: 40px 44px; max-width: 780px; }
.panel { display: none; }
.panel.is-active { display: block; }

.panel-head h1 { font-size: 1.8rem; margin-bottom: 6px; }
.panel-head p { margin-bottom: 28px; }

/* ------------------------------------------------------------------
   Forms (shared across tool panels)
------------------------------------------------------------------ */
.tool-form {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 22px; margin-bottom: 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.tool-form label { font-size: 0.85rem; font-weight: 600; color: var(--text-soft); margin-top: 10px; }
.tool-form label:first-child { margin-top: 0; }

.tool-form input[type="text"],
.tool-form input[type="number"],
.tool-form input[type="file"],
.tool-form textarea,
.tool-form select {
  font-family: var(--font-body); font-size: 0.95rem; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-panel); color: var(--text); resize: vertical;
}
.tool-form input:focus, .tool-form textarea:focus, .tool-form select:focus {
  border-color: var(--cyan);
}
.tool-form textarea { min-height: 90px; }
.tool-form button { margin-top: 16px; align-self: flex-start; }

.dim-row { display: flex; gap: 14px; }
.dim-row > div { flex: 1; display: flex; flex-direction: column; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 500; color: var(--text-soft); margin-top: 12px; }
.checkbox-row input { width: auto; }

/* ------------------------------------------------------------------
   Results / chat
------------------------------------------------------------------ */
.result-box {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 22px; min-height: 80px;
}
.empty-state { color: var(--muted); font-size: 0.92rem; margin: 0; }

.result-box img { max-width: 100%; border-radius: var(--radius-sm); display: block; margin-bottom: 14px; }

.idea-list { margin: 0; padding-left: 22px; }
.idea-list li { margin-bottom: 8px; }

.chat-window {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 20px; height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px;
}
.chat-msg { max-width: 80%; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.94rem; line-height: 1.5; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, var(--violet), var(--magenta)); color: #fff; }
.chat-msg.bot { align-self: flex-start; background: var(--bg-panel); border: 1px solid var(--line); }
.chat-msg.pending { color: var(--muted); font-style: italic; }

.chat-form { display: flex; gap: 10px; }
.chat-form input {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--bg-raised); color: var(--text);
}
.chat-form input:focus { border-color: var(--cyan); }

.error-text { color: #FF6B6B; font-size: 0.88rem; margin-top: 10px; }

.download-link { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--cyan); text-decoration: none; }
.download-link:hover { text-decoration: underline; }

.qr-canvas-wrap { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: var(--radius-sm); max-width: 240px; }

.pw-output {
  font-family: 'Space Grotesk', monospace; font-size: 1.1rem; letter-spacing: 0.03em;
  background: var(--bg-panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; word-break: break-all; color: var(--cyan);
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 880px) {
  .hero-row, .how-row { grid-template-columns: 1fr; }
  .tool-list { grid-template-columns: repeat(2, 1fr); }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tool-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-footer { width: 100%; }
  .panel-area { padding: 28px 20px; max-width: 100%; }
}
@media (max-width: 560px) {
  .tool-list { grid-template-columns: 1fr; }
  .main-nav { gap: 12px; }
  .main-nav a:not(.btn), .nav-link-btn { display: none; }
}
