:root {
  --ink: #17212b;
  --muted: #66737b;
  --line: #d9dfdc;
  --paper: #fcf9f2;
  --panel: #fffefd;
  --soft-green: #e3eee9;
  --green: #367565;
  --orange: #ec6d4e;
  --orange-dark: #d85c3e;
  --shadow: 0 16px 45px rgba(29, 48, 43, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Manrope, Arial, sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header {
  min-height: 76px;
  padding: 0 7.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid rgba(217, 223, 220, 0.8);
  background: rgba(252, 249, 242, 0.9);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -0.8px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fffdf8; font-family: "DM Mono", monospace; font-size: 13px; }
.primary-nav { display: flex; align-items: center; gap: 25px; }
.primary-nav a { padding: 8px 0; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; transition: color 150ms ease; }
.primary-nav a:hover, .primary-nav a.active { color: var(--green); }
.nav-toggle { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

main { width: min(1120px, 85vw); margin: 0 auto; }

.hero { padding: 88px 0 50px; max-width: 750px; }
.eyebrow, .box-label { color: var(--green); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; letter-spacing: 1.25px; }
.eyebrow { margin: 0 0 14px; }
h1, h2 { margin: 0; letter-spacing: -2.7px; line-height: 1.07; }
h1 { font-size: clamp(41px, 6vw, 70px); font-weight: 800; }
h1 em { color: var(--green); font-style: normal; }
.hero-copy { max-width: 580px; margin: 24px 0 0; color: var(--muted); font-size: 16px; line-height: 1.75; }

.tool-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 46px; }
.tool-card { min-height: 96px; padding: 15px 13px; display: flex; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: transparent; transition: 160ms ease; }
.tool-card:hover { transform: translateY(-2px); border-color: #a9bbb3; background: #fffdf9; }
.tool-card.active { border-color: var(--green); background: var(--soft-green); box-shadow: 0 3px 0 rgba(54, 117, 101, 0.15); }
.tool-icon { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fffdf8; color: var(--green); font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; }
.tool-card strong, .tool-card small { display: block; }
.tool-card strong { font-size: 12px; font-weight: 800; letter-spacing: -0.25px; }
.tool-card small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.2; }

.workspace { margin-bottom: 90px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.workspace-heading .eyebrow { margin-bottom: 8px; }
h2 { font-size: clamp(25px, 3vw, 34px); }
.privacy-note { flex: 0 0 auto; padding-bottom: 4px; color: var(--muted); font-size: 11px; }
.lock { color: var(--green); font-size: 9px; }

.panel { min-height: 438px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.hidden { display: none; }
.editor-grid, .preview-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.code-box, .preview-frame-wrap { position: relative; display: block; min-height: 348px; overflow: hidden; border: 1px solid #e0e5e2; border-radius: 10px; background: #f6f7f4; }
.output-box { background: #fdfdfb; }
.box-label { display: block; position: absolute; z-index: 2; top: 15px; left: 16px; }
textarea { width: 100%; height: 100%; min-height: 348px; padding: 42px 16px 16px; display: block; resize: vertical; border: 0; outline: none; background: transparent; color: #31424a; font-family: "DM Mono", monospace; font-size: 12px; line-height: 1.7; }
textarea::placeholder { color: #a4aeab; }
#preview-output { width: 100%; height: 348px; margin-top: 32px; display: block; border: 0; background: white; }
.preview-code textarea { height: 348px; }

.panel-actions { min-height: 54px; padding: 14px 2px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.right-actions { display: flex; align-items: center; gap: 9px; }
.button { min-height: 36px; padding: 8px 13px; border-radius: 7px; font-size: 11px; font-weight: 700; transition: 150ms ease; }
.button.primary { border: 1px solid var(--orange); color: #fff; background: var(--orange); }
.button.primary:hover { border-color: var(--orange-dark); background: var(--orange-dark); }
.button.primary span { padding-left: 6px; font-size: 16px; line-height: 0; }
.button.secondary { border: 1px solid var(--line); color: #526168; background: #fffefd; }
.button.secondary:hover { border-color: #b6c1bc; background: #f7f8f5; }
.saved-text { color: var(--green); font-size: 10px; font-weight: 700; }

.meta-layout { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 18px; min-height: 398px; }
.meta-form { padding: 12px 6px; display: flex; flex-direction: column; gap: 15px; }
.meta-form label { color: #4f5c62; font-size: 11px; font-weight: 700; }
.meta-form input, .meta-form textarea { width: 100%; min-height: 38px; margin-top: 6px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; outline-color: var(--green); color: var(--ink); background: #fffefd; font-family: Manrope, Arial, sans-serif; font-size: 12px; }
.meta-form textarea { height: 75px; resize: vertical; }
.meta-form .button { align-self: flex-start; margin-top: auto; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.meta-output-box { min-height: 398px; }
.meta-output-box textarea { min-height: 398px; }
.meta-copy { position: absolute; z-index: 3; right: 12px; bottom: 12px; }

footer { width: min(1120px, 85vw); margin: 0 auto; padding: 24px 0 31px; display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-brand { display: flex; flex-direction: column; gap: 4px; }
.footer-brand strong { color: var(--ink); font-size: 12px; }
.footer-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 17px; }
.footer-nav a { color: var(--muted); font-size: 11px; text-decoration: none; }
.footer-nav a:hover { color: var(--green); }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 11px 15px; transform: translateY(20px); opacity: 0; border-radius: 8px; color: #fff; background: var(--ink); box-shadow: 0 8px 24px rgba(0,0,0,0.18); font-size: 12px; transition: 180ms ease; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }

.policy-page main { width: min(820px, 85vw); }
.policy-hero { padding: 76px 0 35px; border-bottom: 1px solid var(--line); }
.policy-hero h1 { max-width: 630px; font-size: clamp(39px, 5vw, 59px); }
.policy-hero p:last-child { max-width: 610px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.policy-content { padding: 39px 0 83px; }
.policy-content h2 { margin: 38px 0 12px; font-size: 22px; letter-spacing: -1.15px; }
.policy-content h2:first-child { margin-top: 0; }
.policy-content p, .policy-content li { color: #536168; font-size: 14px; line-height: 1.8; }
.policy-content p { margin: 0 0 14px; }
.policy-content ul { margin: 0 0 14px; padding-left: 22px; }
.policy-content a { color: var(--green); font-weight: 700; text-underline-offset: 3px; }
.policy-callout { margin: 25px 0; padding: 18px 19px; border-left: 3px solid var(--orange); border-radius: 0 9px 9px 0; background: #fff3ed; color: #705548; font-size: 13px; line-height: 1.65; }
.contact-card { max-width: 620px; padding: 26px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.contact-card h2 { margin-top: 0; }
.contact-email { display: inline-flex; align-items: center; gap: 9px; margin-top: 7px; padding: 10px 12px; border-radius: 8px; color: var(--green); background: var(--soft-green); font-family: "DM Mono", monospace; font-size: 12px; font-weight: 500; text-decoration: none; }

/* Note-taking app */
.notes-hero { min-height: 267px; padding: 69px 0 47px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.notes-hero h1 { font-size: clamp(40px, 5.5vw, 65px); }
.notes-hero h1 em { color: var(--orange); font-style: normal; }
.notes-hero p:last-child { max-width: 460px; margin: 17px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.local-badge { margin-bottom: 7px; padding: 10px 13px; border: 1px solid #cbded6; border-radius: 999px; color: var(--green); background: var(--soft-green); font-size: 11px; font-weight: 700; white-space: nowrap; }
.local-badge span { margin-right: 6px; font-size: 8px; }
.notes-app { min-height: 540px; display: grid; grid-template-columns: 315px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.notes-sidebar { min-width: 0; padding: 20px 13px 13px; border-right: 1px solid var(--line); background: #f7f8f5; }
.notes-sidebar-top { padding: 0 5px 17px; display: flex; align-items: center; justify-content: space-between; }
.notes-sidebar-top .eyebrow { margin: 0 0 7px; }
.notes-sidebar h2 { display: flex; align-items: center; gap: 7px; font-size: 21px; letter-spacing: -1px; }
.notes-sidebar h2 span { min-width: 19px; padding: 2px 5px; border-radius: 8px; color: var(--muted); background: #e4e8e4; font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: 0; text-align: center; }
.new-note-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; color: #fff; background: var(--orange); font-size: 23px; font-weight: 400; line-height: 1; transition: 150ms ease; }
.new-note-button:hover { background: var(--orange-dark); transform: translateY(-1px); }
.search-notes { height: 38px; margin: 0 3px 14px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid #dfe5e1; border-radius: 7px; color: #77847f; background: #fffefd; }
.search-notes span { font-size: 17px; line-height: 0; }
.search-notes input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.search-notes input::placeholder { color: #a0aaa6; }
.notes-list { max-height: 418px; overflow-y: auto; padding: 0 3px 6px; }
.note-item { width: 100%; margin: 0 0 5px; padding: 12px 11px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; transition: 140ms ease; }
.note-item:hover { background: #edf1ee; }
.note-item.selected { border-color: #d0dfd8; background: #e4eee9; }
.note-item-title { overflow: hidden; grid-column: 1 / 2; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.note-item-title i { margin-right: 3px; color: var(--orange); font-size: 10px; font-style: normal; }
.note-item-preview { overflow: hidden; grid-column: 1 / 3; color: #74817c; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.note-item-date { grid-column: 2 / 3; grid-row: 1; color: #88938f; font-family: "DM Mono", monospace; font-size: 8px; white-space: nowrap; }
.empty-search { margin: 18px 8px; color: var(--muted); font-size: 11px; text-align: center; }
.note-editor { min-width: 0; padding: 21px 29px 18px; display: flex; flex-direction: column; background: #fffefd; }
.editor-topbar { min-height: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.save-state { color: var(--green); font-family: "DM Mono", monospace; font-size: 10px; }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .text-button { border: 0; background: transparent; }
.icon-button { width: 29px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: #77847f; font-size: 20px; line-height: 1; }
.icon-button:hover { background: #f3f5f1; }
.icon-button.is-pinned { color: var(--orange); }
.text-button { padding: 7px 7px; border-radius: 5px; color: #9b675c; font-size: 10px; font-weight: 800; }
.text-button:hover { color: #bd4228; background: #fff0eb; }
.note-title { width: 100%; margin: 25px 0 10px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-family: Manrope, Arial, sans-serif; font-size: clamp(25px, 3vw, 34px); font-weight: 800; letter-spacing: -1.5px; }
.note-title::placeholder, .note-body::placeholder { color: #c2c9c4; }
.note-body { min-height: 270px; flex: 1; padding: 7px 0 12px; resize: none; color: #526168; font-family: Manrope, Arial, sans-serif; font-size: 14px; line-height: 1.85; }
.editor-bottom { padding-top: 13px; display: flex; justify-content: space-between; border-top: 1px solid #edf0ed; color: #98a19d; font-family: "DM Mono", monospace; font-size: 9px; }
.notes-reassurance { max-width: 760px; margin: 26px auto 81px; padding: 17px 20px; display: flex; align-items: center; gap: 13px; border: 1px solid #dde5e0; border-radius: 11px; color: #65736d; background: #f4f7f4; }
.reassurance-icon { width: 31px; height: 31px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; color: var(--green); background: #e2eee8; font-size: 15px; }
.notes-reassurance strong { color: var(--ink); font-size: 12px; }
.notes-reassurance p { margin: 3px 0 0; font-size: 11px; line-height: 1.55; }

@media (max-width: 860px) {
  .tool-picker { grid-template-columns: repeat(3, 1fr); }
  .meta-layout { grid-template-columns: 1fr; }
  .meta-output-box, .meta-output-box textarea { min-height: 280px; }
  .notes-hero { min-height: auto; padding: 60px 0 36px; }
  .notes-app { grid-template-columns: 260px minmax(0, 1fr); }
  .note-editor { padding: 21px 22px 18px; }
}

@media (max-width: 640px) {
  .site-header { position: relative; min-height: 65px; padding: 0 6vw; gap: 12px; }
  .nav-toggle { width: 38px; height: 34px; padding: 7px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 7px; background: #fffdfa; }
  .nav-toggle span:not(.sr-only) { display: block; height: 1.5px; border-radius: 2px; background: var(--ink); }
  .primary-nav { position: absolute; z-index: 10; top: calc(100% - 1px); right: 0; left: 0; padding: 9px 6vw 13px; display: none; flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); background: var(--paper); box-shadow: 0 12px 20px rgba(29, 48, 43, 0.06); }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 11px 0; }
  main, footer { width: min(100% - 32px, 560px); }
  .hero { padding: 58px 0 36px; }
  .hero-copy { font-size: 14px; }
  .tool-picker { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 34px; }
  .tool-card:last-child { grid-column: span 2; }
  .tool-card { min-height: 74px; padding: 10px; }
  .workspace-heading { display: block; }
  .privacy-note { display: block; margin-top: 13px; }
  .panel { padding: 10px; }
  .editor-grid, .preview-layout { grid-template-columns: 1fr; }
  .code-box, .preview-frame-wrap { min-height: 265px; }
  textarea, #preview-output { min-height: 265px; height: 265px; }
  .preview-code textarea { height: 265px; }
  .panel-actions { align-items: stretch; flex-direction: column; }
  .right-actions { justify-content: flex-end; flex-wrap: wrap; }
  footer { gap: 17px; flex-direction: column; }
  .footer-nav { justify-content: flex-start; }
  .policy-page main { width: min(100% - 32px, 560px); }
  .policy-hero { padding: 51px 0 27px; }
  .policy-content { padding: 32px 0 62px; }
  .form-columns { grid-template-columns: 1fr; }
  .notes-hero { padding: 50px 0 30px; align-items: flex-start; flex-direction: column; gap: 20px; }
  .notes-hero p:last-child { font-size: 13px; }
  .local-badge { margin: 0; }
  .notes-app { min-height: 620px; grid-template-columns: 1fr; }
  .notes-sidebar { max-height: 270px; padding: 15px 10px 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .notes-sidebar-top { padding-bottom: 11px; }
  .notes-list { max-height: 166px; }
  .note-editor { min-height: 365px; padding: 16px 18px 15px; }
  .note-title { margin: 18px 0 8px; }
  .note-body { min-height: 205px; font-size: 13px; }
  .notes-reassurance { margin: 18px 0 57px; padding: 14px; align-items: flex-start; }
}
