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

:root {
  --bg:      #080810;
  --bg2:     #0e0e1a;
  --bg3:     #141424;
  --card:    #111120;
  --border:  rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.13);
  --accent:  #6c63ff;
  --accent2: #a78bfa;
  --cyan:    #22d3ee;
  --gold:    #fbbf24;
  --green:   #34d399;
  --red:     #f87171;
  --text:    #ededf5;
  --text2:   #9896b8;
  --text3:   #4f4d6a;
  --glow:    rgba(108,99,255,0.22);
  --radius:  14px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

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

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--cyan) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex; gap: 2rem; align-items: center;
  list-style: none;
}
.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: 0.875rem; font-weight: 400;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent);
  color: #fff; border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.nav-cta:hover { opacity: 0.88; transform: translateY(-1px); }

.hamburger {
  display: none; flex-direction: column; gap: 5px; cursor: pointer;
  background: none; border: none; padding: 4px;
}
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text2); border-radius: 2px;
  transition: all 0.3s;
}

/* ─── HERO ─── */
#hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 100px 2rem 60px;
  position: relative;
}
.hero-glow {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  padding: 0.4rem 1rem; border-radius: 100px;
  font-size: 0.8rem; color: var(--accent2);
  margin-bottom: 2rem;
  animation: fadeUp 0.6s ease both;
}
.hero-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

h1.hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  animation: fadeUp 0.7s 0.1s ease both;
}
.hero-title .grad {
  background: linear-gradient(135deg, var(--accent2), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 560px;
  color: var(--text2);
  font-size: clamp(1rem, 2vw, 1.1rem);
  font-weight: 300;
  margin-bottom: 2.5rem;
  animation: fadeUp 0.7s 0.2s ease both;
}
.hero-btns {
  display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center;
  animation: fadeUp 0.7s 0.3s ease both;
}
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 0.8rem 2rem;
  border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; font-weight: 500; cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 0 30px rgba(108,99,255,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(108,99,255,0.5); }
.btn-outline {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2); padding: 0.8rem 2rem;
  border-radius: 10px; font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem; cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--accent2); color: var(--text); }

.hero-stats {
  display: flex; gap: 3rem; margin-top: 4rem;
  animation: fadeUp 0.7s 0.4s ease both;
}
.stat { text-align: center; }
.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem; font-weight: 700;
  background: linear-gradient(135deg, var(--text), var(--text2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SECTION COMMON ─── */
section { position: relative; z-index: 1; }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent2);
  margin-bottom: 0.75rem;
}
.section-label::before {
  content: ''; display: block; width: 20px; height: 1px; background: var(--accent2);
}

h2.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-desc { color: var(--text2); max-width: 520px; font-weight: 300; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.section-pad { padding: 100px 0; }

/* ─── FEATURES ─── */
#features { background: var(--bg2); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem; margin-top: 3rem;
}
.feat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color 0.3s, transform 0.2s;
  cursor: default;
}
.feat-card:hover {
  border-color: rgba(108,99,255,0.4);
  transform: translateY(-3px);
}
.feat-icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 1rem;
}
.feat-icon.purple { background: rgba(108,99,255,0.15); }
.feat-icon.cyan   { background: rgba(34,211,238,0.12); }
.feat-icon.gold   { background: rgba(251,191,36,0.12); }
.feat-icon.green  { background: rgba(52,211,153,0.12); }
.feat-card h3 {
  font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 600;
  margin-bottom: 0.5rem;
}
.feat-card p { color: var(--text2); font-size: 0.88rem; line-height: 1.65; }
.feat-badge {
  display: inline-block; margin-top: 0.75rem;
  padding: 0.25rem 0.7rem; border-radius: 100px;
  font-size: 0.72rem; font-weight: 500;
}
.feat-badge.new { background: rgba(52,211,153,0.12); color: var(--green); }
.feat-badge.pro { background: rgba(251,191,36,0.1); color: var(--gold); }

/* ─── MAIN APP ─── */
#app { background: var(--bg); }

.app-wrapper {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  min-height: 640px;
}

/* Left Panel */
.app-left {
  display: flex; flex-direction: column; gap: 1rem;
}

.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem; font-weight: 600;
  color: var(--text2); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ''; display: block; width: 3px; height: 14px;
  background: var(--accent); border-radius: 2px;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border2);
  border-radius: 10px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(108,99,255,0.05);
}
.upload-area input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.upload-area p { font-size: 0.85rem; color: var(--text2); }
.upload-area strong { color: var(--accent2); }

.file-types {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem;
}
.file-type-tag {
  padding: 0.2rem 0.6rem; border-radius: 6px;
  font-size: 0.72rem; font-weight: 500;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text3);
}

/* Text input */
.text-input-area {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  padding: 0.9rem 1rem;
  resize: none; min-height: 130px;
  transition: border-color 0.2s;
  outline: none;
}
.text-input-area:focus { border-color: rgba(108,99,255,0.5); }
.text-input-area::placeholder { color: var(--text3); }

/* Options */
.options-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.option-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 0.55rem 0.8rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer; transition: all 0.2s;
  font-size: 0.8rem; color: var(--text2);
  user-select: none;
}
.option-chip input { display: none; }
.option-chip:has(input:checked) {
  border-color: var(--accent);
  background: rgba(108,99,255,0.1);
  color: var(--text);
}
.option-dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid currentColor; flex-shrink: 0;
  transition: background 0.2s;
}
.option-chip:has(input:checked) .option-dot { background: var(--accent); border-color: var(--accent); }

/* Language select */
select.lang-select {
  width: 100%;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  padding: 0.6rem 0.9rem; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239896b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
select.lang-select:focus { border-color: rgba(108,99,255,0.5); }

/* Generate button */
#generateBtn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; border: none;
  padding: 0.95rem; border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#generateBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108,99,255,0.5);
}
#generateBtn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Right Panel — Output */
.app-right {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.output-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 1rem 1.1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem; font-weight: 500;
  color: var(--text3); background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn:hover { color: var(--text2); }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent); }

.output-body {
  flex: 1; padding: 1.75rem;
  overflow-y: auto; position: relative;
  min-height: 400px;
}

/* Empty state */
.empty-state {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 1rem;
}
.empty-icon {
  font-size: 3rem; opacity: 0.3;
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.empty-state h3 { font-family: 'Syne', sans-serif; font-size: 1.1rem; color: var(--text2); }
.empty-state p { font-size: 0.85rem; color: var(--text3); max-width: 260px; }

/* Loading */
.loading-state {
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 1.5rem; height: 100%;
  position: absolute; inset: 0;
}
.loading-state.show { display: flex; }
.loader-ring {
  width: 48px; height: 48px; border-radius: 50%;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state p { color: var(--text2); font-size: 0.9rem; }
.loading-steps { display: flex; flex-direction: column; gap: 0.5rem; }
.load-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; color: var(--text3);
}
.load-step.done { color: var(--green); }
.load-step.active { color: var(--text2); }

/* Output content */
.output-content { display: none; }
.output-content.show { display: block; }

.output-section { margin-bottom: 2rem; }
.output-section-title {
  font-family: 'Syne', sans-serif; font-size: 0.85rem; font-weight: 600;
  color: var(--accent2); text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 8px;
}
.output-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.output-text {
  color: var(--text2); font-size: 0.9rem; line-height: 1.75;
  white-space: pre-wrap;
}
.highlight-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.highlight-item:last-child { border-bottom: none; }
.hi-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.hi-text { font-size: 0.88rem; color: var(--text2); }

/* Flashcards */
.flashcard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.flashcard {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.25rem;
  cursor: pointer; transition: all 0.2s;
}
.flashcard:hover { border-color: var(--accent2); transform: translateY(-2px); }
.fc-q { font-size: 0.82rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.fc-a { font-size: 0.8rem; color: var(--text3); transition: color 0.2s; }
.flashcard:hover .fc-a { color: var(--text2); }

/* Mind map simple */
.mindmap-node {
  background: rgba(108,99,255,0.15); border: 1px solid rgba(108,99,255,0.35);
  border-radius: 8px; padding: 0.5rem 1rem;
  font-size: 0.82rem; display: inline-block;
  margin: 0.25rem; color: var(--accent2);
}
.mindmap-center {
  background: var(--accent); color: #fff;
  border-radius: 10px; padding: 0.6rem 1.4rem;
  font-family: 'Syne', sans-serif; font-weight: 600;
  font-size: 0.9rem; display: inline-block; margin-bottom: 1rem;
}
.mindmap-wrap { text-align: center; }

/* Copy btn */
.copy-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 0.45rem 1rem;
  border-radius: 7px; font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.copy-btn:hover { border-color: var(--border2); color: var(--text); }

/* ─── CHATBOT ─── */
#chatbot { background: var(--bg2); }

.chat-wrapper {
  max-width: 760px; margin: 3rem auto 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
}
.chat-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.chat-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.chat-info h3 {
  font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 600;
}
.chat-info p { font-size: 0.78rem; color: var(--green); }
.chat-status { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse 2s infinite; }

.chat-messages {
  padding: 1.5rem; min-height: 320px; max-height: 420px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 1rem;
}
.msg {
  display: flex; gap: 10px; align-items: flex-start;
  animation: fadeUp 0.3s ease;
}
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
}
.msg.ai .msg-avatar { background: linear-gradient(135deg, var(--accent), var(--cyan)); }
.msg.user .msg-avatar { background: var(--bg3); border: 1px solid var(--border2); color: var(--text2); }
.msg-bubble {
  max-width: 75%; padding: 0.75rem 1rem;
  border-radius: 14px; font-size: 0.88rem; line-height: 1.6;
}
.msg.ai .msg-bubble {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); border-top-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--accent); color: #fff;
  border-top-right-radius: 4px;
}

.chat-input-row {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 0.75rem; align-items: flex-end;
}
#chatInput {
  flex: 1; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 0.75rem 1rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  outline: none; resize: none; max-height: 120px;
  transition: border-color 0.2s;
}
#chatInput:focus { border-color: rgba(108,99,255,0.5); }
#chatInput::placeholder { color: var(--text3); }
#sendBtn {
  background: var(--accent); color: #fff;
  border: none; width: 42px; height: 42px; border-radius: 10px;
  cursor: pointer; transition: all 0.2s; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
#sendBtn:hover:not(:disabled) { opacity: 0.85; transform: scale(1.05); }
#sendBtn:disabled { opacity: 0.5; cursor: not-allowed; }

.chat-suggestions {
  padding: 0 1.25rem 1rem;
  display: flex; flex-wrap: wrap; gap: 0.5rem;
}
.sug-chip {
  padding: 0.35rem 0.85rem; border-radius: 100px;
  border: 1px solid var(--border); background: var(--bg3);
  font-size: 0.78rem; color: var(--text2); cursor: pointer;
  transition: all 0.2s;
}
.sug-chip:hover { border-color: var(--accent2); color: var(--text); }

/* ─── HOW IT WORKS ─── */
#how { background: var(--bg); }
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem; margin-top: 3rem; position: relative;
}
.step-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.5rem;
  text-align: center; transition: transform 0.2s, border-color 0.2s;
}
.step-card:hover { transform: translateY(-4px); border-color: var(--border2); }
.step-num {
  font-family: 'Syne', sans-serif; font-size: 2.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}
.step-card h3 {
  font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 600;
  margin-bottom: 0.5rem;
}
.step-card p { font-size: 0.85rem; color: var(--text2); }

/* ─── SKILLS SECTION ─── */
#skills { background: var(--bg2); }
.skills-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem; margin-top: 3rem;
}
.skill-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.skill-card h3 {
  font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 600;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 8px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag {
  padding: 0.3rem 0.75rem; border-radius: 6px;
  font-size: 0.78rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2);
}

/* ─── FOOTER ─── */
footer {
  background: var(--bg); border-top: 1px solid var(--border);
  padding: 2.5rem 2rem; text-align: center;
}
footer p { color: var(--text3); font-size: 0.82rem; }
footer strong { color: var(--accent2); }

/* ─── API KEY MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 18px; padding: 2.5rem;
  max-width: 460px; width: 100%;
  transform: translateY(20px); transition: transform 0.3s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal h2 { font-family: 'Syne', sans-serif; font-size: 1.3rem; margin-bottom: 0.5rem; }
.modal p { color: var(--text2); font-size: 0.88rem; margin-bottom: 1.5rem; }
.modal input[type=text] {
  width: 100%; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 0.85rem 1rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  outline: none; margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.modal input[type=text]:focus { border-color: rgba(108,99,255,0.5); }
.modal-note {
  font-size: 0.78rem; color: var(--text3); margin-bottom: 1.5rem;
  padding: 0.75rem; background: var(--bg3); border-radius: 8px;
  border-left: 3px solid var(--accent);
}
.modal-btns { display: flex; gap: 0.75rem; }
.modal-btns button { flex: 1; }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 9998;
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 10px; padding: 0.9rem 1.25rem;
  font-size: 0.85rem; color: var(--text);
  display: flex; align-items: center; gap: 8px;
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s; max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(52,211,153,0.4); }
.toast.error { border-color: rgba(248,113,113,0.4); }

/* ─── RESPONSIVE ─── */

/* Tablet landscape (900px–1100px) */
@media (max-width: 1100px) {
  .container { padding: 0 1.25rem; }
  .app-wrapper { grid-template-columns: 300px 1fr; }
}

/* Tablet portrait (640px–900px) */
@media (max-width: 900px) {
  .app-wrapper { grid-template-columns: 1fr; }
  .app-right { min-height: 520px; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 2rem; }
  .section-pad { padding: 72px 0; }
  .chat-wrapper { max-width: 100%; }
}

/* Mobile (max 640px) */
@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; top: 64px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem; z-index: 999;
  }
  .nav-links.open li { border-bottom: 1px solid var(--border); }
  .nav-links.open a { display: block; padding: 0.85rem 0; font-size: 0.9rem; }
  .nav-links.open .nav-cta { width: 100%; margin: 0.5rem 0; text-align: center; padding: 0.75rem; }
  .hamburger { display: flex; }

  h1.hero-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .hero-sub { font-size: 0.95rem; }
  .hero-stats { gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
  .hero-btns { flex-direction: column; align-items: center; width: 100%; }
  .hero-btns button { width: 100%; max-width: 300px; }
  #hero { padding: 90px 1.25rem 48px; }

  .features-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .section-pad { padding: 56px 0; }

  .options-grid { grid-template-columns: 1fr 1fr; }
  .app-right { min-height: 460px; }
  .output-tabs { gap: 0; }
  .tab-btn { padding: 0.85rem 0.7rem; font-size: 0.75rem; }

  .modal { padding: 1.5rem; border-radius: 14px; }
  .modal h2 { font-size: 1.1rem; }
  .modal-btns { flex-direction: column; }
  .modal-btns button { width: 100%; }

  .chat-messages { min-height: 260px; max-height: 340px; }
  .msg-bubble { max-width: 88%; font-size: 0.85rem; }
  .chat-suggestions { gap: 0.4rem; }
  .sug-chip { font-size: 0.75rem; padding: 0.3rem 0.7rem; }

  .toast { bottom: 1rem; right: 1rem; left: 1rem; max-width: 100%; font-size: 0.82rem; }
  .flashcard-grid { grid-template-columns: 1fr; }

  h2.section-title { font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero-glow { width: 300px; height: 300px; }
}

/* Small mobile (max 400px) */
@media (max-width: 400px) {
  .options-grid { grid-template-columns: 1fr; }
  .hero-stats .stat-num { font-size: 1.4rem; }
  .tab-btn { padding: 0.75rem 0.5rem; font-size: 0.72rem; }
  .panel-card { padding: 1.1rem; }
}
