:root {
  --bg: #f5f4ee;
  --bg-warm: #fbf8f1;
  --ink: #14231f;
  --ink-soft: #2f3f39;
  --muted: #64736c;
  --muted-light: #8a978f;
  --line: rgba(20, 35, 31, 0.12);
  --line-strong: rgba(20, 35, 31, 0.2);
  --card: #fffdf8;
  --accent: #1d5c4a;
  --accent-deep: #113d31;
  --accent-soft: #e3f0e8;
  --accent-tint: rgba(29, 92, 74, 0.08);
  --coral: #e96a4b;
  --coral-soft: #fbe8e2;
  --amber: #d99a3e;
  --shadow-sm: 0 1px 2px rgba(20, 35, 31, 0.05), 0 8px 24px rgba(20, 35, 31, 0.05);
  --shadow-md: 0 2px 4px rgba(20, 35, 31, 0.04), 0 20px 50px rgba(20, 35, 31, 0.09);
  --shadow-lg: 0 30px 80px rgba(20, 35, 31, 0.14);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 35, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 35, 31, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 46px 46px, 46px 46px, auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(245, 244, 238, 0.2), rgba(245, 244, 238, 0.92) 78%);
  z-index: 0;
}

.page-glow {
  position: fixed;
  inset: -20% -10% auto;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 46% 58% at 18% 28%, rgba(29, 92, 74, 0.16), transparent 68%),
    radial-gradient(ellipse 40% 54% at 82% 18%, rgba(233, 106, 75, 0.12), transparent 66%),
    radial-gradient(ellipse 35% 40% at 55% 6%, rgba(217, 154, 62, 0.1), transparent 72%);
  filter: blur(10px);
  z-index: 0;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  width: min(1220px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fffdf8;
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: 0 6px 16px rgba(17, 61, 49, 0.24);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.68);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e9e6b;
  box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.15);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(46, 158, 107, 0.15); }
  50% { box-shadow: 0 0 0 6px rgba(46, 158, 107, 0.06); }
}

/* ---------- Hero ---------- */

main {
  position: relative;
  z-index: 1;
}

.hero {
  width: min(1220px, calc(100% - 3rem));
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(3.5rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.eyebrow svg {
  width: 15px;
  height: 15px;
}

.hero h1 {
  margin: 1.4rem 0 1.2rem;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 7vw, 6.3rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.hero h1 em {
  color: var(--accent);
  font-style: italic;
}

.hero-lede {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 0.9rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.button svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.button-primary {
  color: #fffdf8;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(17, 61, 49, 0.2);
}

.button-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(17, 61, 49, 0.26);
}

.button-primary:hover svg {
  transform: translateX(3px);
}

.button-quiet {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.button-quiet:hover {
  background: rgba(255, 253, 248, 0.8);
  transform: translateY(-2px);
}

.hero-metrics {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin: 2.6rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
}

.hero-metrics div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-metrics dt {
  font-family: var(--serif);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink);
}

.hero-metrics dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ---------- Hero preview ---------- */

.hero-visual {
  position: relative;
  padding: 1.4rem 0.5rem;
  perspective: 1200px;
}

.paper-preview {
  position: relative;
  z-index: 2;
  padding: 1.35rem;
  border: 1px solid rgba(20, 35, 31, 0.1);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.4deg);
  backdrop-filter: blur(16px);
  animation: float-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(24px) rotate(2.5deg); }
  to { opacity: 1; transform: translateY(0) rotate(1.4deg); }
}

.paper-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.preview-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-dots {
  display: flex;
  gap: 0.3rem;
}

.preview-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
}

.preview-title-line {
  height: 10px;
  width: 78%;
  margin-bottom: 0.6rem;
  border-radius: 6px;
  background: var(--ink);
  opacity: 0.82;
}

.preview-title-line.short {
  width: 46%;
  background: var(--line-strong);
}

.preview-section {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.preview-section:last-of-type {
  border-bottom: 0;
}

.preview-index {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
}

.preview-section strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.preview-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.muted-preview {
  opacity: 0.55;
}

.preview-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1rem;
}

.preview-footer span {
  margin-right: 0.2rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.preview-footer i {
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 600;
}

.floating-card {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(20, 35, 31, 0.08);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
  animation: float 6s ease-in-out infinite;
}

.floating-card-top {
  top: 2%;
  right: -2%;
}

.floating-card-bottom {
  bottom: 2%;
  left: -4%;
  animation-delay: -3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.floating-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.floating-icon.amber {
  background: #fbf0dc;
  color: var(--amber);
}

.floating-icon svg {
  width: 16px;
  height: 16px;
}

.floating-card strong {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
}

.floating-card div span {
  display: block;
  margin-top: 0.05rem;
  color: var(--muted);
  font-size: 0.65rem;
}

/* ---------- Workspace ---------- */

.workspace {
  width: min(1040px, calc(100% - 3rem));
  margin: 0 auto;
  scroll-margin-top: 2rem;
}

.input-card {
  position: relative;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

.input-card-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.section-kicker {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--coral);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.input-card-heading h2,
.how-heading h2,
.empty-state h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.input-card-heading p {
  max-width: 310px;
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: right;
}

.mode-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.28rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(20, 35, 31, 0.035);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.mode-tab svg {
  width: 17px;
  height: 17px;
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 1px 4px rgba(20, 35, 31, 0.1);
}

.mode-pane {
  margin-top: 1.2rem;
}

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 230px;
  padding: 2.2rem 1.5rem;
  border: 1.5px dashed rgba(20, 35, 31, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(29, 92, 74, 0.06), transparent 65%),
    rgba(255, 253, 248, 0.6);
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(29, 92, 74, 0.11), transparent 68%),
    rgba(255, 253, 248, 0.9);
}

.dropzone.dragover {
  transform: scale(1.005);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(29, 92, 74, 0.35);
  background: var(--accent-tint);
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 1rem;
  border-radius: 16px;
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.dropzone-icon svg {
  width: 25px;
  height: 25px;
}

.dropzone-copy strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
}

.dropzone-copy span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.dropzone-limit {
  position: absolute;
  right: 1rem;
  bottom: 0.9rem;
  color: var(--muted-light);
  font-size: 0.68rem;
}

.file-clear {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
}

.file-clear:hover {
  color: var(--coral);
  border-color: rgba(233, 106, 75, 0.4);
}

.file-clear svg {
  width: 14px;
  height: 14px;
}

.format-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.9rem;
}

.format-chip {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.6);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.paste-field textarea {
  width: 100%;
  min-height: 220px;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.65;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.paste-field textarea::placeholder {
  color: var(--muted-light);
}

.paste-field textarea:focus,
.ask-row input:focus {
  outline: none;
  border-color: rgba(29, 92, 74, 0.55);
  box-shadow: 0 0 0 4px rgba(29, 92, 74, 0.09);
}

.paste-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
  color: var(--muted-light);
  font-size: 0.74rem;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
}

.text-button:hover {
  text-decoration: underline;
}

.form-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.4rem;
  padding-top: 1.3rem;
  border-top: 1px solid var(--line);
}

.depth-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.depth-options {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(20, 35, 31, 0.035);
}

.depth-option {
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.depth-option:hover {
  color: var(--ink);
}

.depth-option.is-active {
  background: var(--card);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(20, 35, 31, 0.1);
}

.submit-button {
  min-width: 190px;
  margin-left: auto;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.form-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0 0;
  color: var(--muted-light);
  font-size: 0.72rem;
  line-height: 1.5;
}

.form-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(233, 106, 75, 0.28);
  border-radius: 14px;
  background: var(--coral-soft);
  color: #7a2f1d;
}

.error-banner > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 0.1rem;
}

.error-banner strong {
  display: block;
  font-size: 0.84rem;
}

.error-banner p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
}

.error-close {
  margin-left: auto;
  padding: 0 0.2rem;
  border: 0;
  background: transparent;
  color: #7a2f1d;
  font-size: 1.2rem;
  line-height: 1;
}

/* ---------- Progress ---------- */

.progress-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem 1rem;
  align-items: center;
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(29, 92, 74, 0.16);
  border-radius: 16px;
  background: var(--accent-tint);
}

.progress-orb {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #75c6a2, var(--accent));
  box-shadow: 0 0 0 6px rgba(29, 92, 74, 0.08);
}

.progress-orb span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 253, 248, 0.35);
  border-top-color: #fffdf8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-copy strong {
  display: block;
  font-size: 0.86rem;
}

.progress-copy p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.progress-track {
  grid-column: 2 / -1;
  height: 4px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: rgba(29, 92, 74, 0.13);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 8%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #5cae8b);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.progress-steps {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.progress-steps li {
  position: relative;
  color: var(--muted-light);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-steps li.is-active {
  color: var(--accent);
}

.progress-steps li.is-done {
  color: var(--ink-soft);
}

/* ---------- Empty state ---------- */

.empty-state {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  margin-top: 1.4rem;
  padding: clamp(1.6rem, 4vw, 2.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.5);
}

.empty-art {
  position: relative;
  height: 220px;
}

.empty-sheet {
  position: absolute;
  width: 150px;
  height: 190px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.sheet-back {
  top: 20px;
  left: 26px;
  transform: rotate(-8deg);
  opacity: 0.55;
}

.sheet-front {
  top: 6px;
  left: 46px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 24px 18px;
  transform: rotate(3deg);
}

.sheet-line {
  height: 6px;
  border-radius: 4px;
  background: rgba(20, 35, 31, 0.12);
}

.sheet-line.accent {
  background: var(--accent);
  opacity: 0.7;
}

.w-45 { width: 45%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-80 { width: 80%; }
.w-90 { width: 90%; }

.empty-spark {
  position: absolute;
  top: 12px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
  animation: float 5s ease-in-out infinite;
}

.empty-state p {
  max-width: 600px;
  margin: 0.7rem 0 1.3rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.empty-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.empty-tags span {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

/* ---------- Results ---------- */

.result-panel {
  margin-top: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.9);
  box-shadow: var(--shadow-md);
  animation: result-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes result-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.result-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.result-meta {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink-soft);
  font-size: 0.74rem;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--accent);
}

.result-overview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.overview-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--muted-light);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.keyword {
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(29, 92, 74, 0.16);
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
}

.result-stats {
  display: flex;
  gap: 1.4rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 62px;
}

.result-stats strong {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
}

.result-stats span {
  color: var(--muted);
  font-size: 0.65rem;
}

.sections {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.section-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.6);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: section-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@keyframes section-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-card:hover {
  border-color: rgba(29, 92, 74, 0.26);
  background: var(--card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.section-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.section-card:nth-child(3n + 2) .section-index {
  background: var(--coral-soft);
  color: var(--coral);
}

.section-card:nth-child(3n + 3) .section-index {
  background: #fbf0dc;
  color: #a97427;
}

.section-body h3 {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-body p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.68;
}

.section-meta {
  align-self: start;
  padding-top: 0.15rem;
  color: var(--muted-light);
  font-size: 0.64rem;
  white-space: nowrap;
}

.combined {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 35, 31, 0.025);
}

.combined summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.combined summary::-webkit-details-marker {
  display: none;
}

.combined summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.combined[open] summary svg {
  transform: rotate(180deg);
}

.combined p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.7;
  white-space: pre-line;
}

/* ---------- Ask ---------- */

.ask-card {
  margin-top: 1.4rem;
  padding: 1.25rem;
  border: 1px solid rgba(29, 92, 74, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(29, 92, 74, 0.08), transparent 60%),
    rgba(255, 253, 248, 0.6);
}

.ask-heading {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.ask-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.ask-icon svg {
  width: 19px;
  height: 19px;
}

.ask-heading h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}

.ask-heading p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.ask-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.ask-row input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.84rem;
}

.ask-row input::placeholder {
  color: var(--muted-light);
}

.ask-button {
  padding: 0.8rem 1.3rem;
  border-radius: 11px;
}

.suggested-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}

.suggested-questions button {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.suggested-questions button:hover {
  border-color: rgba(29, 92, 74, 0.35);
  background: var(--accent-tint);
  color: var(--accent);
}

.answer {
  margin-top: 0.9rem;
}

.answer:empty {
  display: none;
}

.answer-card {
  padding: 0.95rem 1rem;
  border: 1px solid rgba(29, 92, 74, 0.16);
  border-radius: 12px;
  background: var(--card);
  animation: section-in 0.35s ease both;
}

.answer-card strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.answer-card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
}

.answer-card small {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted-light);
  font-size: 0.66rem;
}

.answer-card.is-error {
  border-color: rgba(233, 106, 75, 0.3);
  background: var(--coral-soft);
}

.answer-card.is-error strong {
  color: #7a2f1d;
}

/* ---------- How it works ---------- */

.how-it-works {
  width: min(1040px, calc(100% - 3rem));
  margin: clamp(3rem, 7vw, 6rem) auto 0;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--line);
}

.how-heading {
  max-width: 560px;
  margin-bottom: 2rem;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.how-grid article {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.45);
}

.how-number {
  display: block;
  margin-bottom: 1.4rem;
  color: var(--coral);
  font-family: var(--serif);
  font-size: 1.3rem;
}

.how-grid h3 {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 3rem));
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding: 1.8rem 0 2.2rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.brand.small .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.brand.small .brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand.small .brand-name {
  font-size: 1.3rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer > span {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 0.7rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-visual {
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(3.4rem, 11vw, 5.4rem);
  }

  .how-grid {
    grid-template-columns: 1fr;
  }

  .empty-state {
    grid-template-columns: 190px 1fr;
  }

  .result-topbar {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .site-header,
  .hero,
  .workspace,
  .how-it-works,
  .site-footer {
    width: calc(100% - 2rem);
  }

  .site-nav {
    display: none;
  }

  .privacy-pill {
    margin-left: auto;
  }

  .hero {
    padding-top: 3rem;
  }

  .hero-metrics {
    gap: 1.2rem;
  }

  .hero-metrics dt {
    font-size: 1.45rem;
  }

  .floating-card-top {
    right: -0.5rem;
  }

  .floating-card-bottom {
    left: -0.5rem;
  }

  .input-card-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .input-card-heading p {
    text-align: left;
  }

  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-button {
    width: 100%;
    margin-left: 0;
  }

  .empty-state {
    grid-template-columns: 1fr;
  }

  .empty-art {
    height: 180px;
    max-width: 220px;
  }

  .result-overview {
    grid-template-columns: 1fr;
  }

  .result-stats {
    padding-left: 0;
    padding-top: 1rem;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .section-card {
    grid-template-columns: 36px 1fr;
  }

  .section-meta {
    grid-column: 2;
    padding-top: 0;
  }

  .ask-row {
    grid-template-columns: 1fr;
  }

  .ask-button {
    width: 100%;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 0.7rem;
  }

  .site-footer > span {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .mode-tabs {
    display: flex;
    width: 100%;
  }

  .mode-tab {
    flex: 1;
    justify-content: center;
  }

  .result-actions {
    width: 100%;
  }

  .icon-button {
    flex: 1;
    justify-content: center;
  }

  .empty-tags span:nth-child(n + 5) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
