/* Nodify AI — Claude-inspired, dependency-free light theme. */

:root {
  --bg: #F5F4EE;
  --sidebar: #EBE9E1;
  --surface: #FFFFFF;
  --ink: #24221E;
  --muted: #77736B;
  --line: #DCD8CE;
  --accent: #C46945;
  --accent-dark: #A55132;
  --user: #EAE7DE;
  --code: #F0EEE7;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.mt { margin-top: 16px; }
.spacer { flex: 1; }

/* Auth -------------------------------------------------------------------- */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, #FFFDF8 0%, var(--bg) 60%);
}
.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 24px 60px rgba(50, 42, 30, 0.08);
}
.auth-brand { font-size: 20px; margin-bottom: 10px; }
.auth-sub { color: var(--muted); margin: 0 0 28px; line-height: 1.55; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; border: 0; background: none; padding: 12px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.auth-tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.auth-form { display: grid; gap: 16px; }
.auth-form label, .form-grid label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.auth-form input, .input, .search {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 11px 12px; outline: none;
}
.auth-form input:focus, .input:focus, .search:focus { border-color: var(--accent); }
.auth-message { margin-top: 16px; min-height: 20px; font-size: 13px; color: var(--accent-dark); }
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input { flex: 1; }

.primary, .secondary, .send, .new-chat {
  border: 1px solid transparent; border-radius: 10px; padding: 11px 16px;
  font-weight: 600;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-dark); }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.wide { width: 100%; }

/* Shell ------------------------------------------------------------------- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 276px; flex: 0 0 276px; background: var(--sidebar);
  border-right: 1px solid var(--line); padding: 20px 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.brand { font-family: var(--mono); font-weight: 700; letter-spacing: 0.18em; font-size: 14px; padding: 0 8px; }
.brand-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-right: 8px;
  border: 1px solid var(--ink); border-radius: 7px; font-size: 13px; letter-spacing: 0;
}
.brand-light { color: var(--muted); font-weight: 500; }
.new-chat { background: var(--ink); color: #fff; width: 100%; text-align: left; }
.search { background: transparent; }
.side-nav { display: grid; gap: 2px; }
.side-nav button {
  text-align: left; border: 0; background: transparent; padding: 9px 10px;
  border-radius: 8px; color: var(--muted); font-size: 14px;
}
.side-nav button:hover { background: rgba(255,255,255,0.55); color: var(--ink); }
.side-nav button.active { background: var(--surface); color: var(--ink); font-weight: 600; }
.side-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); padding: 8px 10px 0; }
.conversation-list { flex: 1; overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.conv-item {
  display: flex; gap: 6px; align-items: center; border-radius: 8px;
}
.conv-item button.conv-open {
  flex: 1; text-align: left; border: 0; background: transparent; padding: 9px 8px;
  border-radius: 8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-item:hover button.conv-open { background: rgba(255,255,255,0.55); color: var(--ink); }
.conv-item.active button.conv-open { color: var(--ink); font-weight: 600; }
.conv-del { border: 0; background: none; color: var(--muted); padding: 6px 8px; border-radius: 6px; }
.conv-del:hover { color: var(--accent-dark); background: rgba(255,255,255,0.6); }
.account-box {
  border-top: 1px solid var(--line); padding-top: 12px; display: flex;
  justify-content: space-between; align-items: center; gap: 8px;
}
.account-email { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-btn { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 6px; }
.text-btn:hover { color: var(--accent-dark); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: 0 0 56px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 22px; background: rgba(245,244,238,0.9);
}
.model-select {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 7px 10px; font-family: var(--mono); font-size: 12px;
}
.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; color: var(--muted);
}
.icon-btn { border: 0; background: none; font-size: 18px; }
.mobile-only { display: none; }

.view { display: none; flex: 1; min-height: 0; overflow-y: auto; }
.view.active { display: flex; flex-direction: column; }

/* Chat -------------------------------------------------------------------- */
.chat-log { flex: 1; overflow-y: auto; padding: 40px 24px 20px; }
.empty-state { max-width: 720px; margin: 14vh auto 0; text-align: center; color: var(--muted); }
.empty-mark {
  width: 46px; height: 46px; margin: 0 auto 18px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 12px; font-family: var(--mono); color: var(--ink);
}
.empty-state h1 { font-size: 26px; font-weight: 500; color: var(--ink); margin: 0 0 10px; }
.empty-state p { margin: 0; }
.msg { max-width: 760px; margin: 0 auto 26px; line-height: 1.7; }
.msg.user {
  background: var(--user); border-radius: 16px 16px 4px 16px;
  padding: 12px 16px; margin-left: auto; width: fit-content; max-width: 80%;
}
.msg.assistant { white-space: normal; }
.msg-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 8px; text-transform: uppercase;
}
.msg pre {
  background: var(--code); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow-x: auto; font-family: var(--mono); font-size: 13px;
}
.msg code { font-family: var(--mono); font-size: 0.9em; background: var(--code); padding: 2px 5px; border-radius: 4px; }
.msg pre code { background: none; padding: 0; }
.typing::after { content: "▍"; animation: blink 1s steps(2, start) infinite; color: var(--accent); }
@keyframes blink { to { visibility: hidden; } }

.composer-wrap { padding: 10px 24px 18px; background: linear-gradient(180deg, rgba(245,244,238,0), var(--bg) 22%); }
.composer {
  max-width: 780px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 16px;
  display: flex; align-items: flex-end; gap: 10px; box-shadow: 0 10px 30px rgba(50,42,30,0.06);
}
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent;
  max-height: 180px; line-height: 1.5; padding: 5px 0;
}
.send { background: var(--ink); color: #fff; white-space: nowrap; }
.send.stop { background: var(--accent-dark); }
.composer-note { text-align: center; color: var(--muted); font-size: 11px; margin-top: 9px; }

/* Generic panels ---------------------------------------------------------- */
.view:not(#view-chat) { padding: 36px 40px 60px; }
.view-head { max-width: 900px; margin-bottom: 24px; }
.view-head h2 { font-size: 24px; font-weight: 600; margin: 0 0 6px; }
.view-head p { color: var(--muted); margin: 0; }
.panel {
  max-width: 900px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
}
.panel h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; }
.stat-grid { max-width: 900px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat strong { font-family: var(--mono); font-size: 18px; }
.bar { max-width: 900px; height: 8px; border-radius: 999px; background: var(--code); overflow: hidden; margin-bottom: 22px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; }
.table { display: grid; gap: 0; }
.table-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center;
}
.table-row.head { color: var(--muted); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.table-row:last-child { border-bottom: 0; }
.mono { font-family: var(--mono); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .wide-field { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; }
.form-grid label.check { display: flex; align-items: center; gap: 8px; }
.form-grid label.check input { width: auto; }
.new-key {
  margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--code);
  font-family: var(--mono); font-size: 13px; word-break: break-all;
}
.node-list { display: grid; gap: 12px; }
.node { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.node:last-child { border-bottom: 0; }
.node-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #4E8C6A; margin-right: 8px; }
.plan-cards { max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.plan.featured { border-color: var(--accent); }
.plan .price { font-family: var(--mono); font-size: 32px; margin: 12px 0; }
.plan .price span { font-size: 13px; color: var(--muted); }
.plan ul { padding-left: 18px; line-height: 1.9; color: var(--muted); font-size: 13px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 13px; z-index: 50; box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

/* Public landing ---------------------------------------------------------- */
.landing {
  min-height: 100vh;
  background: radial-gradient(circle at 82% 6%, #FFFDF8 0%, var(--bg) 42%);
}
.landing-nav {
  max-width: 1180px; margin: 0 auto; padding: 22px 32px;
  display: flex; align-items: center; gap: 24px;
}
.landing .brand { padding: 0; }
.landing-links { display: flex; gap: 22px; margin-left: auto; }
.landing-links a {
  color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap;
}
.landing-links a:hover { color: var(--ink); }
.landing-actions { display: flex; align-items: center; gap: 8px; }
.primary.small { padding: 8px 14px; font-size: 13px; }
.primary.large, .secondary.large { padding: 14px 22px; font-size: 15px; }

.hero {
  max-width: 1180px; margin: 0 auto; padding: 70px 32px 90px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px; align-items: center;
}
.eyebrow {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--accent-dark); text-transform: uppercase; margin-bottom: 18px;
}
.hero h1, .section-head h2, .final-cta h2, .api-copy h2 {
  font-weight: 500; letter-spacing: -0.03em;
}
.hero h1 { font-size: clamp(40px, 5.2vw, 66px); line-height: 1.05; margin: 0 0 22px; }
.hero-sub {
  font-size: 17px; line-height: 1.7; color: var(--muted);
  max-width: 560px; margin: 0 0 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-note { font-size: 12px; color: var(--muted); margin-top: 14px; }
.hero-points {
  display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px;
  font-size: 12px; color: var(--muted);
}
.hero-points b { color: var(--ink); font-family: var(--mono); }

.hero-preview {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(50, 42, 30, 0.10); overflow: hidden;
}
.preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.preview-title { font-size: 13px; font-weight: 600; }
.preview-pill {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted);
}
.preview-body { padding: 26px 22px; min-height: 276px; display: grid; align-content: start; gap: 16px; }
.preview-msg { font-size: 14px; line-height: 1.6; }
.preview-user {
  background: var(--user); padding: 12px 14px; border-radius: 14px 14px 4px 14px;
  max-width: 80%; margin-left: auto;
}
.preview-assistant { max-width: 88%; }
.preview-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--muted); margin-bottom: 6px;
}
.preview-quiet { color: var(--muted); }
.preview-composer {
  margin: 0 18px 18px; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 15px; display: flex; justify-content: space-between;
  color: var(--muted); font-size: 13px;
}
.preview-composer b { color: var(--ink); }

.landing-section { max-width: 1180px; margin: 0 auto; padding: 84px 32px; border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.15; margin: 0 0 14px; }
.section-head p { color: var(--muted); line-height: 1.7; margin: 0; }
.section-head p b { color: var(--ink); }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.model-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.model-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.model-card h3 { font-size: 15px; margin: 0; }
.weight {
  font-family: var(--mono); font-size: 10px; border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 8px; color: var(--muted); white-space: nowrap;
}
.model-card p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; flex: 1; }
.model-meta {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--muted);
  font-family: var(--mono); border-top: 1px solid var(--line); padding-top: 10px;
}

.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step, .feature-grid .feature { background: var(--surface); }
.step {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.step-num { font-family: var(--mono); font-size: 12px; color: var(--accent); margin-bottom: 26px; }
.step h3, .feature h3 { font-size: 16px; margin: 0 0 8px; }
.step p, .feature p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 28px; }
.feature { padding: 20px 4px; border-top: 1px solid var(--ink); }

.pricing-section { background: linear-gradient(180deg, rgba(255,255,255,0.45), transparent); }
.pricing-section .plan-cards { max-width: 100%; }
.pricing-section .plan { padding: 28px; display: flex; flex-direction: column; }
.pricing-section .plan .price { font-size: 40px; }
.pricing-section .plan button { width: 100%; margin-top: auto; }
.plan-note { font-size: 11px; color: var(--muted); margin-top: 10px; }
.pricing-foot {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 22px; font-size: 12px; color: var(--muted); line-height: 1.6;
}
.pricing-foot b { color: var(--ink); }

.api-section { display: grid; grid-template-columns: 1fr 1.1fr; gap: 50px; align-items: center; }
.api-copy h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.15; margin: 0 0 14px; }
.api-copy p { color: var(--muted); line-height: 1.7; }
.clean-list { list-style: none; padding: 0; margin: 22px 0 26px; }
.clean-list li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.code-card {
  margin: 0; background: var(--ink); color: #F5F4EE; border-radius: 16px;
  padding: 24px; overflow-x: auto; font-family: var(--mono); font-size: 12px; line-height: 1.7;
}

.faq-list { max-width: 820px; border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-list summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--muted); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { color: var(--muted); line-height: 1.7; margin: 14px 0 0; }
.faq-list .mono { font-size: 12px; }

.final-cta {
  max-width: 1180px; margin: 0 auto 80px; padding: 70px 32px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
}
.final-cta h2 { font-size: clamp(30px, 3.6vw, 46px); margin: 0 0 12px; }
.final-cta p { color: var(--muted); margin: 0 0 26px; }
.final-cta .hero-cta { justify-content: center; }
.landing-footer {
  max-width: 1180px; margin: 0 auto; padding: 24px 32px 40px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--muted); font-size: 12px; border-top: 1px solid var(--line);
}
.landing-footer .brand { color: var(--ink); }

.auth-card { position: relative; }
.auth-back { position: absolute; top: 14px; right: 16px; }

@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 12px 0 40px rgba(0,0,0,.12); }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-block; }
  .view:not(#view-chat) { padding: 24px 18px 50px; }
  .stat-grid, .plan-cards, .form-grid { grid-template-columns: 1fr; }
  .chat-log { padding: 24px 14px 12px; }
  .composer-wrap { padding: 8px 12px 12px; }
  .msg.user { max-width: 92%; }

  .landing-nav { flex-wrap: wrap; padding: 18px; gap: 14px; }
  .landing-links { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-top: 4px; }
  .hero { grid-template-columns: 1fr; padding: 44px 18px 60px; gap: 40px; }
  .hero-preview { transform: none; }
  .landing-section { padding: 60px 18px; }
  .model-grid, .step-grid, .feature-grid, .pricing-foot { grid-template-columns: 1fr; }
  .api-section { grid-template-columns: 1fr; gap: 28px; }
  .final-cta { margin: 0 18px 50px; padding: 48px 20px; }
  .landing-footer { flex-direction: column; align-items: flex-start; padding: 24px 18px 34px; }
}
