:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-subtle: #f0f4f9;
  --text: #101828;
  --muted: #526175;
  --line: #d5dde8;
  --accent: #276f53;
  --accent-hover: #1c5b43;
  --accent-soft: #e8f3ee;
  --success: #087a55;
  --success-soft: #e8f7f1;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow-sm: 0 8px 24px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, 0.13);
  --radius-sm: 8px;
  --radius: 8px;
  --shell: 1180px;
}

* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
p { line-height: 1.65; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { margin-top: 0; letter-spacing: 0; }
h1 { margin-bottom: 20px; font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 0.98; }
h2 { margin-bottom: 12px; font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.12; }
h3 { margin-bottom: 8px; font-size: 1.15rem; }

.shell {
  width: min(var(--shell), calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: min(var(--shell), calc(100% - 40px));
  min-height: 76px;
  margin-inline: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(39, 111, 83, 0.22);
}
.brand-small .brand-mark, .app-brand .brand-mark {
  width: 34px;
  height: 34px;
}
.site-header nav, .site-footer nav, .header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.site-header nav a, .site-footer nav a, .text-button, .text-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  text-decoration: none;
}
.site-header nav a, .text-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 0 12px;
}
.site-header nav a:hover, .text-button:hover, .text-link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.header-actions { justify-self: end; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.button:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 8px 20px rgba(39, 111, 83, 0.2);
  transform: translateY(-1px);
}
.button-small { min-height: 40px; padding-inline: 14px; font-size: 0.9rem; }
.button-large { min-height: 52px; width: 100%; }

.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  align-items: center;
  gap: clamp(36px, 7vw, 96px);
  padding-block: 60px 84px;
}
.hero-copy { max-width: 680px; }
.hero-lede {
  max-width: 610px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 28px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  list-style: none;
}
.trust-list li::before {
  content: "+";
  margin-right: 7px;
  color: var(--success);
  font-weight: 900;
}

.creator-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(22px, 4vw, 32px);
  box-shadow: var(--shadow-lg);
}
.card-heading {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}
.card-heading h2 { margin-bottom: 0; }
.mock-note {
  display: grid;
  gap: 16px;
}
.mock-note-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mock-note-top span {
  font-size: 1.1rem;
  font-weight: 850;
}
.mock-note-top small {
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  padding: 5px 10px;
  font-weight: 800;
}
.mock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mock-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 750;
}
.mock-editor {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfa;
  padding: 18px;
  color: var(--muted);
}
.mock-editor strong { color: var(--text); }

.proof-strip {
  border-block: 1px solid var(--line);
  background: var(--surface);
}
.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-block: 22px;
}
.proof-grid > div {
  display: grid;
  gap: 3px;
  padding-inline: 28px;
  text-align: center;
}
.proof-grid > div + div { border-left: 1px solid var(--line); }
.proof-grid span { color: var(--muted); font-size: 0.85rem; }

.section { padding-block: clamp(72px, 10vw, 120px); }
.section-intro { max-width: 680px; margin-bottom: 44px; }
.section-intro > p:last-child { margin-bottom: 0; color: var(--muted); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-grid article {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.feature-grid .number {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 50px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.83rem;
  font-weight: 900;
}
.feature-grid p, .workflow-list p, .faq-grid p { margin: 0; color: var(--muted); }

.workflow-section {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: start;
}
.workflow-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.workflow-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}
.workflow-list li > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}
.workflow-list strong { display: block; margin-bottom: 4px; }

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.faq-grid details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.faq-grid summary {
  cursor: pointer;
  font-weight: 850;
}
.faq-grid details p { margin-top: 12px; }

.cta-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(24px, 5vw, 42px);
  box-shadow: var(--shadow-sm);
}
.cta-section h2 { margin-bottom: 0; }
.cta-section .button { width: auto; }

.site-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding-block: 44px;
  color: var(--muted);
}
.site-footer p { margin: 0; }
.site-footer .text-link { padding: 0; }

.modal {
  width: min(460px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow-lg);
}
.modal::backdrop { background: rgba(16, 24, 40, 0.42); }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
}
.modal-header h2 { margin-bottom: 0; }
.login-form {
  display: grid;
  gap: 11px;
  padding: 0 24px 24px;
}
label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 800;
}
input, textarea {
  width: 100%;
  border: 1px solid #b8c4d3;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
input {
  min-height: 48px;
  padding: 0 14px;
}
textarea {
  padding: 12px 14px;
  resize: vertical;
}
input:hover, textarea:hover { border-color: #8190a5; }
input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(39, 111, 83, 0.13);
}
.password-field {
  display: flex;
  align-items: center;
  border: 1px solid #b8c4d3;
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.password-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(39, 111, 83, 0.13);
}
.password-field input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.password-field button {
  align-self: stretch;
  border: 0;
  background: #fff;
  color: var(--accent);
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 800;
}
.form-error {
  margin: 0 24px 24px;
  border: 1px solid rgba(180, 35, 24, 0.28);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  padding: 13px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
}

.app-shell { min-height: 100vh; }
.notes-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 100vh;
}
.sidebar-header, .editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.icon-button, .danger {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  padding: 8px 11px;
  font-weight: 800;
}
.danger { color: var(--danger); }
.search-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  padding: 12px 16px;
}
#newNoteButton, #saveButton {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  font-weight: 850;
}
.tag-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 12px;
}
.tag-strip button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  padding: 6px 10px;
  white-space: nowrap;
}
.tag-strip button.active {
  color: #fff;
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.notes-list { overflow-y: auto; padding: 8px; }
.note-row {
  width: 100%;
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  padding: 12px;
  text-align: left;
}
.note-row:hover, .note-row.active {
  background: var(--accent-soft);
  border-color: var(--line);
}
.note-row strong, .note-row small, .note-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-row small, .note-row span { color: var(--muted); font-size: 12px; }
.empty { padding: 20px; color: var(--muted); text-align: center; }
.export-link {
  padding: 15px 16px;
  border-top: 1px solid var(--line);
  color: var(--accent-hover);
  font-weight: 750;
  text-decoration: none;
}
.editor {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}
.title-input {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 26px;
  font-weight: 850;
}
.editor-actions { display: flex; align-items: center; gap: 8px; }
.save-state { color: var(--muted); font-size: 13px; min-width: 74px; text-align: right; }
.tags-input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 18px;
}
.editor-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
#contentInput {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  resize: none;
  padding: 22px;
  line-height: 1.6;
}
.preview {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  padding: 22px;
  background: #fbfcfa;
  line-height: 1.65;
}
.preview pre { overflow-x: auto; background: var(--surface-subtle); padding: 12px; border-radius: var(--radius-sm); }
.preview code { background: var(--surface-subtle); padding: 2px 4px; border-radius: 4px; }
.preview a { color: var(--accent-hover); }

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }
  .public-nav { display: none !important; }
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 44px 64px;
  }
  .workflow-section, .feature-grid, .faq-grid {
    grid-template-columns: 1fr;
  }
  .proof-grid {
    grid-template-columns: 1fr;
  }
  .proof-grid > div {
    padding-block: 14px;
  }
  .proof-grid > div + div {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .notes-view { grid-template-columns: 1fr; }
  .sidebar { min-height: 44vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .notes-list { max-height: 32vh; }
  .editor { min-height: 56vh; }
  .editor-header { align-items: stretch; flex-direction: column; }
  .editor-actions { justify-content: space-between; }
  .editor-grid { grid-template-columns: 1fr; grid-template-rows: minmax(320px, 50vh) minmax(220px, auto); }
  .preview { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .shell, .site-header { width: min(var(--shell), calc(100% - 28px)); }
  .site-header { gap: 12px; }
  .header-actions .text-button { display: none; }
  h1 { font-size: clamp(2.35rem, 15vw, 3.8rem); }
  .creator-card, .cta-section { padding: 20px; }
  .cta-section { align-items: stretch; flex-direction: column; }
  .cta-section .button { width: 100%; }
}
