/* ════════════════════════════════════════
   ASSIGNMINT — style.css
   Editorial / dashboard design
════════════════════════════════════════ */

/* ── RESET & TOKENS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:       #0d0d0d;
  --ink-soft:  #444;
  --ink-muted: #888;
  --paper:     #fafaf7;
  --white:     #ffffff;
  --accent:    #1a6b3c;
  --accent-lt: #e8f5ee;
  --accent-dk: #0f4226;
  --rule:      #e0e0d8;
  --radius:    10px;
  --mono:      'DM Mono', monospace;
  --serif:     'Playfair Display', Georgia, serif;
  --sans:      'DM Sans', system-ui, sans-serif;
  --shadow:    0 2px 16px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ════════════════════════════════════════
   LANDING NAV
════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 60px;
  background: rgba(250,250,247,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}
.brand-icon { color: var(--accent); font-size: 14px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: background .2s;
}
.nav-cta:hover { background: var(--accent-dk); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink);
  padding: 4px 8px;
}

@media (max-width: 640px) {
  .navbar { padding: 0 20px; }
  .menu-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    border-bottom: 1px solid var(--rule);
    padding: 12px 20px 20px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .nav-cta { margin-top: 8px; width: 100%; text-align: center; }
}

/* ════════════════════════════════════════
   HERO
════════════════════════════════════════ */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 100px 40px 80px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 900;
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 24px;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 18px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 32px;
}

.hero-input-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 32px;
  min-height: 42px;
  min-width: 320px;
  max-width: 100%;
}
.typing-label { color: var(--ink-muted); font-weight: 500; }
.typing-text { color: var(--ink); font-family: var(--mono); font-size: 13px; }
.typing-cursor::after {
  content: '|';
  color: var(--accent);
  animation: blink .7s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-actions { margin-bottom: 16px; }

.hero-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 500;
  font-family: var(--sans);
  cursor: pointer;
  transition: background .2s, transform .15s;
  box-shadow: 0 4px 20px rgba(26,107,60,.25);
}
.hero-btn:hover {
  background: var(--accent-dk);
  transform: translateY(-1px);
}

.hero-badge {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ════════════════════════════════════════
   MARQUEE
════════════════════════════════════════ */
.marquee-strip {
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--white);
  padding: 12px 0;
}
.marquee-track {
  display: flex;
  gap: 20px;
  width: max-content;
  animation: marquee 22s linear infinite;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.marquee-track span:nth-child(even) { color: var(--rule); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ════════════════════════════════════════
   SECTION SHARED
════════════════════════════════════════ */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 52px;
}
.section-head {
  margin-bottom: 0;
}

/* ════════════════════════════════════════
   HOW IT WORKS
════════════════════════════════════════ */
.how-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: box-shadow .2s;
}
.step:hover { box-shadow: var(--shadow); }

.step-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}
.step h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}
.step p { font-size: 15px; color: var(--ink-soft); line-height: 1.6; }

@media (max-width: 768px) {
  .steps-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   FEATURES
════════════════════════════════════════ */
.features-section {
  background: var(--ink);
  color: var(--white);
  padding: 100px 40px;
}
.features-section .section-title { color: var(--white); }
.features-section .section-label { color: #7de0a4; }
.features-section .section-head { max-width: 1080px; margin: 0 auto 52px; }

.features-grid {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 32px 24px;
  transition: background .2s;
}
.feature:hover { background: rgba(255,255,255,.08); }

.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--white);
}
.feature p { font-size: 14px; color: rgba(255,255,255,.6); line-height: 1.6; }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   EXAMPLES
════════════════════════════════════════ */
.examples-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 100px 40px;
}
.examples-section .section-head { margin-bottom: 52px; }

.examples-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.example-input, .example-output {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.example-output { background: var(--accent-lt); border-color: #b2d9c0; }

.ex-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-lt);
  border-radius: 100px;
  padding: 2px 10px;
  margin-bottom: 14px;
}
.example-output .ex-tag { background: #c8e8d6; }

.example-input p, .example-output p {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.5;
}
.example-input strong, .example-output strong { color: var(--ink); }

@media (max-width: 640px) {
  .examples-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════
   CTA
════════════════════════════════════════ */
.cta {
  text-align: center;
  padding: 100px 40px;
  background: var(--accent-lt);
  border-top: 1px solid #b2d9c0;
}
.cta h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  margin-bottom: 12px;
}
.cta p {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 32px;
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 48px 40px;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
}
.footer-tagline { font-size: 14px; margin-bottom: 8px; }
.footer-copy { font-size: 12px; }

/* ════════════════════════════════════════
   REVEAL ANIMATIONS
════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════
   APP PAGE
════════════════════════════════════════ */
#app-page { min-height: 100vh; display: flex; flex-direction: column; }

/* App navbar */
.app-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
}
.app-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.view-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}
.back-btn {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-family: var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.back-btn:hover { border-color: var(--ink); color: var(--ink); }

/* App layout */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 56px);
}

/* Sidebar */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--rule);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--sans);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.side-link:hover { background: var(--accent-lt); color: var(--ink); }
.side-link.active { background: var(--accent-lt); color: var(--accent-dk); font-weight: 600; }
.side-icon { font-size: 16px; }

/* Main */
.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--paper);
}

/* App views */
.app-view { display: none; padding: 32px; }
.app-view.active-view { display: block; }

/* ── Gen layout ── */
.gen-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  max-width: 1200px;
}

/* Form panel */
.form-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px;
  align-self: start;
}
.panel-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}

.field {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.req { color: var(--accent); }
.field-help { font-size: 12px; color: var(--ink-muted); margin-top: 4px; }

.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  resize: vertical;
}
.field input[type="text"]:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(26,107,60,.1);
  background: var(--white);
}

.field input[type="file"] {
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.generate-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: background .2s, transform .15s;
  margin-top: 8px;
}
.generate-btn:hover:not(:disabled) {
  background: var(--accent-dk);
  transform: translateY(-1px);
}
.generate-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Output panel */
.output-panel {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.output-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  color: var(--ink-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.output-state h3 {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.output-state p { font-size: 14px; }

/* Loading */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--ink-soft); }
.dots { animation: dotpulse 1.2s steps(4,end) infinite; }
@keyframes dotpulse {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* Result */
#result-output { display: flex; flex-direction: column; height: 100%; }

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.doc-title-input {
  border: none;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  outline: none;
  flex: 1;
  min-width: 0;
}
.doc-title-input:focus {
  border-bottom: 1px solid var(--accent);
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--sans);
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.action-btn:hover { border-color: var(--ink); background: var(--paper); }
.action-btn--ghost { color: var(--ink-muted); }
.action-btn--ghost:hover { color: var(--ink); }

.output-text {
  padding: 28px 32px;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  overflow-y: auto;
  flex: 1;
}
.output-text h1 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--rule);
}
.output-text h2 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 28px 0 10px;
  color: var(--ink);
}
.output-text h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 20px 0 8px;
}
.output-text p { margin-bottom: 14px; }
.output-text ul { margin: 0 0 14px 20px; }
.output-text li { margin-bottom: 4px; }
.output-text strong { font-weight: 700; }

/* ── History view ── */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.view-header h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.history-item {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.history-item h3 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.history-item p {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 6px;
  line-height: 1.5;
}
.history-item button {
  margin-right: 8px;
  margin-top: 10px;
  padding: 5px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--sans);
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  transition: border-color .15s;
}
.history-item button:hover { border-color: var(--accent); color: var(--accent); }

/* ── Profile view ── */
.profile-form {
  max-width: 520px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 24px;
}

/* ════════════════════════════════════════
   RESPONSIVE — APP
════════════════════════════════════════ */
@media (max-width: 900px) {
  .gen-layout { grid-template-columns: 1fr; }
  .output-panel { min-height: 400px; }
}

@media (max-width: 640px) {
  .app-layout { flex-direction: column; height: auto; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    overflow-x: auto;
  }
  .side-link { white-space: nowrap; flex-shrink: 0; }
  .app-main { overflow-y: unset; }
  .app-view { padding: 16px; }
  .how-section, .features-section,
  .examples-section, .hero, .cta { padding-left: 20px; padding-right: 20px; }
  .result-toolbar { flex-direction: column; align-items: flex-start; }
}

/* ════════════════════════════════════════
   PRINT
════════════════════════════════════════ */
@media print {
  .navbar, .sidebar, .app-navbar, .result-toolbar,
  .footer, .hero, .marquee-strip { display: none !important; }
  body { background: #fff; }
  .output-text { padding: 0; }
}