:root {
  color-scheme: light;
  --ink: #171813;
  --muted: #77786f;
  --line: rgba(27, 29, 22, 0.1);
  --paper: #f5f3ec;
  --card: rgba(255, 255, 252, 0.72);
  --accent: #ff5c35;
  --accent-deep: #e94822;
  --green: #356d55;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 24, 19, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 19, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  width: 460px;
  height: 460px;
  top: -230px;
  left: 57%;
  background: rgba(255, 117, 75, 0.12);
}

.ambient-two {
  width: 360px;
  height: 360px;
  top: 460px;
  left: -240px;
  background: rgba(109, 145, 118, 0.09);
}

.site-header, main, footer { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 740;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--ink);
}

.brand-mark svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #45a675; box-shadow: 0 0 0 4px rgba(69, 166, 117, 0.1); }

.hero { text-align: center; padding: 78px 0 72px; }

.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: var(--accent-deep); font-size: 11px; font-weight: 760; letter-spacing: 0.12em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; }

h1 { margin: 20px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 7vw, 82px); line-height: 0.98; letter-spacing: -0.055em; font-weight: 500; }
h1 span { color: var(--accent); font-style: italic; }

.hero-copy { max-width: 550px; margin: 25px auto 31px; color: #62635b; font-size: 16px; line-height: 1.75; }

.url-form { width: min(720px, 100%); margin: 0 auto; text-align: left; }

.input-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border: 1px solid rgba(27, 29, 22, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.87);
  box-shadow: 0 18px 50px rgba(54, 49, 38, 0.08), 0 2px 8px rgba(54, 49, 38, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.input-shell:focus-within { border-color: rgba(255, 92, 53, 0.48); box-shadow: 0 20px 55px rgba(54, 49, 38, 0.1), 0 0 0 4px rgba(255, 92, 53, 0.08); }
.input-shell.is-invalid { border-color: #bd4a35; }

.link-icon { width: 20px; height: 20px; color: #999a91; flex: 0 0 auto; }
.link-icon svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.input-shell input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.input-shell input::placeholder { color: #aaa99f; }

.submit-button {
  min-height: 48px;
  padding: 0 12px 0 18px;
  border: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  transition: transform 140ms var(--ease-out), background-color 180ms ease;
}

.submit-button:active { transform: scale(0.97); }
.submit-button:disabled { cursor: wait; opacity: 0.68; }
.submit-button kbd { border: 1px solid rgba(255,255,255,.18); border-radius: 5px; padding: 2px 6px; color: rgba(255,255,255,.65); font-family: inherit; font-size: 11px; }

.form-footer { min-height: 26px; display: flex; justify-content: space-between; padding: 9px 5px 0; color: #96978e; font-size: 11px; }
.form-error { color: #a63e2a; }

.workspace {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 590px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,252,.46);
  box-shadow: 0 30px 90px rgba(53, 48, 36, 0.08);
  backdrop-filter: blur(16px);
}

.queue-panel { padding: 27px 20px; border-right: 1px solid var(--line); background: rgba(239, 237, 228, 0.5); }
.section-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 5px 20px; }
.section-kicker { margin: 0 0 5px; color: #9b9b91; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.count-badge { min-width: 23px; height: 23px; padding: 0 7px; display: grid; place-items: center; border-radius: 99px; color: #686961; background: rgba(23,24,19,.06); font-size: 10px; font-weight: 700; }

.queue-list { display: grid; gap: 7px; }
.queue-item { width: 100%; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid transparent; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease, transform 140ms var(--ease-out); }
.queue-item:active { transform: scale(.98); }
.queue-item.is-active { background: rgba(255,255,252,.8); border-color: rgba(27,29,22,.09); box-shadow: 0 5px 18px rgba(49,45,35,.05); }
.queue-item-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: #dce9df; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.queue-item-content { min-width: 0; display: grid; gap: 4px; }
.queue-item-content strong, .queue-item-content small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-item-content strong { font-size: 12px; font-weight: 680; }
.queue-item-content small { color: #92938a; font-size: 9px; }
.queue-item-state { width: 7px; height: 7px; border-radius: 50%; background: #45a675; }
.queue-item[data-status="processing"] .queue-item-state { border: 1.5px solid rgba(255,92,53,.2); border-top-color: var(--accent); background: none; animation: spin .7s linear infinite; }
.queue-item[data-status="queued"] .queue-item-state { background: #b7b7ae; }
.queue-item[data-status="error"] .queue-item-state { background: #bd4a35; }

.queue-empty { padding: 36px 10px; text-align: center; color: #77786f; font-size: 12px; }
.queue-empty p { color: #aaa99f; font-size: 10px; }

.result-panel { padding: 40px clamp(25px, 5vw, 66px); background: rgba(255,255,252,.55); }
.result-enter { animation: result-in 260ms var(--ease-out) both; }

.welcome-view, .error-view { min-height: 500px; display: grid; place-content: center; justify-items: center; text-align: center; }
.welcome-view h2, .error-view h2 { margin: 8px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 500; }
.welcome-view > p:last-child, .error-view > p { max-width: 390px; margin: 0; color: #85867d; font-size: 12px; line-height: 1.7; }
.welcome-mark, .error-mark { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 15px; color: var(--green); background: rgba(53,109,85,.09); font-family: Georgia, serif; font-size: 24px; }
.error-mark { color: #a63e2a; background: rgba(166,62,42,.08); }
.error-view a { margin-top: 18px; color: var(--accent-deep); font-size: 11px; text-underline-offset: 3px; }

.result-topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.source-tag { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .09em; }
.source-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.reading-time { color: #9a9a91; font-size: 10px; }

.article-title { margin: 19px 0 10px; max-width: 700px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 4vw, 43px); font-weight: 500; line-height: 1.13; letter-spacing: -.035em; }
.article-source { margin: 0; color: #919188; font-size: 11px; }
.article-source a { color: inherit; text-underline-offset: 3px; }

.summary-block { margin: 30px 0 25px; padding: 21px 23px; border-left: 2px solid var(--accent); background: rgba(255, 92, 53, .045); }
.summary-block span, .mindmap-heading span { color: var(--accent-deep); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.summary-block p { margin: 9px 0 0; color: #4d4e47; font-size: 14px; line-height: 1.75; }

.key-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 34px; }
.point { padding: 14px; border: 1px solid rgba(27,29,22,.07); border-radius: 11px; background: rgba(255,255,255,.4); }
.point b { display: block; color: var(--accent); font-family: Georgia, serif; font-size: 19px; font-weight: 500; }
.point p { margin: 7px 0 0; color: #686961; font-size: 10px; line-height: 1.5; }

.mindmap-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mindmap-heading h3 { margin: 0; font-size: 14px; }
.mindmap-heading span { color: #9d9d94; }

.mindmap { position: relative; min-height: 200px; display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 48px; align-items: center; padding: 15px 0; }
.mindmap-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mindmap-lines path { fill: none; stroke: rgba(53,109,85,.22); stroke-width: 1.3; stroke-dasharray: 3 3; }
.node-column { display: grid; gap: 14px; z-index: 1; }
.map-node { padding: 11px 13px; border: 1px solid rgba(27,29,22,.08); border-radius: 10px; background: rgba(255,255,252,.92); box-shadow: 0 5px 16px rgba(45,42,34,.04); font-size: 10px; line-height: 1.35; }
.map-node small { display: -webkit-box; margin-top: 3px; overflow: hidden; color: #96968d; font-size: 8px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.map-node.root { padding: 20px; color: white; border: 0; border-radius: 16px; background: var(--green); box-shadow: 0 14px 30px rgba(53,109,85,.18); text-align: center; font-family: Georgia, serif; font-size: 17px; }

.images-section { margin-top: 35px; }
.article-images { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.article-image { position: relative; min-width: 0; overflow: hidden; border: 1px solid rgba(27,29,22,.08); border-radius: 11px; color: var(--ink); background: rgba(255,255,252,.72); text-decoration: none; transition: transform 160ms var(--ease-out), border-color 160ms ease; }
.article-image:active { transform: scale(.98); }
.article-image img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; background: rgba(23,24,19,.04); }
.article-image span { display: block; overflow: hidden; padding: 9px 10px; color: #77786f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.processing-view { min-height: 500px; display: grid; place-items: center; text-align: center; }
.processing-inner { width: min(390px, 100%); }
.processing-orbit { position: relative; width: 84px; height: 84px; margin: 0 auto 25px; border: 1px solid rgba(53,109,85,.14); border-radius: 50%; }
.processing-orbit::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(53,109,85,.18); border-radius: 50%; }
.processing-orbit::after { content: ""; position: absolute; width: 9px; height: 9px; top: -5px; left: 50%; border-radius: 50%; background: var(--accent); transform: translateX(-50%); animation: orbit 1.3s linear infinite; transform-origin: 0 47px; }
.processing-inner h2 { margin: 0; font-family: Georgia, serif; font-size: 29px; font-weight: 500; }
.processing-inner > p { color: #85867d; font-size: 12px; }
.step-list { display: grid; gap: 8px; margin-top: 24px; text-align: left; }
.step { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 9px; color: #9b9b92; background: rgba(23,24,19,.03); font-size: 10px; }
.step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c5c5bd; }
.step.done { color: var(--green); }
.step.done::before { background: #45a675; }
.step.active { color: var(--ink); background: rgba(255,92,53,.06); }
.step.active::before { border: 1px solid rgba(255,92,53,.25); border-top-color: var(--accent); background: transparent; animation: spin .7s linear infinite; }

footer { display: flex; justify-content: space-between; padding: 32px 0 45px; color: #a1a198; font-size: 10px; }
.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; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit { to { transform: translateX(-50%) rotate(360deg); } }
@keyframes result-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (hover: hover) and (pointer: fine) {
  .submit-button:hover { background: #2d2e28; }
  .queue-item:not(.is-active):hover { background: rgba(255,255,252,.45); }
  .article-image:hover { transform: translateY(-2px); border-color: rgba(27,29,22,.16); }
}

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  .hero { padding: 55px 0 52px; }
  .hero-copy { font-size: 14px; }
  .submit-button span { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .queue-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 15px; }
  .queue-list { display: flex; overflow-x: auto; padding-bottom: 2px; }
  .queue-item { min-width: 225px; }
  .result-panel { padding: 32px 21px; }
  .key-points { grid-template-columns: 1fr; }
  .article-images { grid-template-columns: 1fr 1fr; }
  .mindmap { grid-template-columns: 1fr; gap: 10px; }
  .mindmap-lines { display: none; }
  .node-column { grid-template-columns: 1fr 1fr; }
  .map-node.root { order: -1; }
}

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