:root {
  --ink: #111;
  --ink2: #2b2b2b;
  --paper: #f1efea;
  --gray: #6b6b6b;
  --rule: #c9c6bf;
}
* {
  box-sizing: border-box;
  margin: 0;
}
html,
body {
  background: var(--paper);
  color: var(--ink);
}
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: 'Cormorant Garamond', Georgia, serif;
  background-image: radial-gradient(rgba(0, 0, 0, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
}
.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--ink2);
}
header,
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 5vw, 3rem);
  border-bottom: 1px solid var(--ink);
}
footer {
  border-top: 1px solid var(--ink);
  border-bottom: 0;
  margin-top: auto;
}
main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 5vw, 3rem);
}
.card {
  text-align: left;
}
svg.gauge {
  width: 72px;
  height: 50px;
  display: block;
  margin: 0 0 1rem;
}
@keyframes swing {
  0%,
  100% {
    transform: rotate(-28deg);
  }
  45% {
    transform: rotate(18deg);
  }
  55% {
    transform: rotate(12deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .needle,
  .dot {
    animation: none;
  }
}
h1 {
  font-weight: 600;
  font-size: clamp(3.2rem, 8vw, 5.6rem);
  letter-spacing: 0.01em;
  line-height: 1;
}
.morse {
  margin: 1rem 0 0;
  line-height: 1.4;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  color: #3a3a3a;
  font-size: clamp(0.7rem, 2.4vw, 0.9rem);
  letter-spacing: 0.1em;
  word-spacing: 0.4em;
}
.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.4rem 0;
  color: var(--ink);
  max-width: 320px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink);
}
.lede {
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.35;
  max-width: 28ch;
}
.anchor {
  margin-top: 1rem;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink2);
  max-width: 40ch;
  line-height: 1.45;
}
.cta {
  margin-top: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.05rem 2rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  box-shadow: 5px 5px 0 var(--rule);
}
.cta:hover {
  background: #000;
}
.cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  animation: blink 1.6s infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}
.cta[data-state='connecting'] {
  background: var(--ink2);
  cursor: progress;
}
.cta[data-state='connecting'] .dot {
  animation-duration: 0.5s;
}
.cta[data-state='live'] {
  background: var(--paper);
  color: var(--ink);
}
.cta[data-state='live'] .dot {
  background: var(--ink);
  animation-duration: 1s;
}
.status {
  min-height: 1.2em;
  margin-top: 0.9rem;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--gray);
}
.invite {
  margin-top: 0.6rem;
  color: var(--ink2);
  font-size: 1.1rem;
}
figure {
  margin: 0;
}
.art {
  display: block;
  width: 100%;
  height: auto;
  background: #f1efea;
  box-shadow: 8px 8px 0 var(--rule);
}
.art .needle,
.art .wheel {
  transform-box: view-box;
}
.art .needle {
  animation: swing 6s ease-in-out infinite;
}
.art .wheel {
  animation: turn 40s linear infinite;
}
@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .art .needle,
  .art .wheel {
    animation: none;
  }
}
@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
  }
  .card {
    text-align: center;
  }
  .divider {
    margin-left: auto;
    margin-right: auto;
  }
  .lede,
  .anchor {
    margin-left: auto;
    margin-right: auto;
  }
}

a {
  color: inherit;
  text-underline-offset: 4px;
}
nav {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  font-size: 1.1rem;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--ink);
  background: transparent;
  padding: 0.55rem 0.9rem;
  color: var(--ink);
}
button:hover {
  background: #e4e6dc;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #52674a;
  outline-offset: 4px;
}
h1 {
  margin: 1rem 0;
}
h1 em {
  color: #52674a;
}
h2 {
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  font-weight: 500;
  line-height: 1.1;
  margin: 0.5rem 0 1.2rem;
}
h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 1.3rem 0 0.7rem;
}
.fine {
  font-family: Georgia, serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #666;
  margin-top: 1.2rem;
}
.shelf {
  width: min(1120px, 100%);
  margin: auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}
section {
  padding: 3rem 0;
  border-top: 1px solid #aaa;
}
section p {
  font-size: 1.2rem;
  line-height: 1.45;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 1.6rem;
}
.entry {
  border: 1px solid #aaa;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  overflow-wrap: anywhere;
}
.entry h3 {
  margin: 0.6rem 0;
  font-size: 1.7rem;
  line-height: 1.15;
}
.entry p {
  font-size: 1.05rem;
}
.entry .meta {
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #52674a;
}
.entry .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.entry details {
  margin: 1rem 0 0;
}
.entry details p {
  font-size: 1rem;
}
.entry .source {
  display: block;
  font-size: 1rem;
  margin-top: 0.6rem;
}
.entry.kept {
  border: 3px double #52674a;
}
.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.filters button {
  font-size: 0.9rem;
  border-color: #aaa;
}
.filters [aria-pressed='true'] {
  background: #52674a;
  color: white;
}
label {
  display: block;
  font-size: 1.15rem;
  margin: 1rem 0 0.5rem;
}
input,
textarea {
  display: block;
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #aaa;
  border-radius: 0;
  background: #f8f6f0;
  color: #111;
  font-size: 1.1rem;
}
textarea {
  resize: vertical;
}
input:focus,
textarea:focus {
  outline: 2px solid #52674a;
  outline-offset: 2px;
}
details {
  margin: 1rem 0;
}
summary {
  cursor: pointer;
  font-size: 1.2rem;
}
details button {
  margin-top: 0.7rem;
}
#notice:not(:empty) {
  padding: 1rem;
  border-left: 3px solid #52674a;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}
#recommendation:not(:empty) {
  margin-top: 1.5rem;
}
#recommendation .entry {
  border: 3px double #52674a;
}
#memory-draft {
  background: #e8ecdf;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
#memory-draft button {
  margin-top: 0.8rem;
}
.memory {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  border-bottom: 1px solid #ccc;
  padding: 1rem 0;
}
.memory p {
  white-space: pre-wrap;
}
dialog {
  width: min(480px, calc(100% - 2rem));
  padding: 2rem;
  border: 1px solid #111;
  background: #f1efea;
  color: #111;
  margin: auto;
}
dialog::backdrop {
  background: #1118;
}
.close {
  float: right;
  font-size: 1.5rem;
  border: 0;
  padding: 0 0.4rem;
}
dialog h2 {
  font-size: 2.5rem;
}
dialog button[type='submit'] {
  margin-top: 1rem;
  width: 100%;
  background: #111;
  color: #f1efea;
}
dialog p {
  font-size: 1.1rem;
  margin: 0.8rem 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
#call-status {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0;
  line-height: 1.5;
}
#folio-status {
  color: #52674a;
}
#signout {
  margin-top: 1rem;
}
@media (max-width: 650px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    display: block;
  }
  nav {
    gap: 0.7rem;
    font-size: 0.95rem;
  }
  header {
    padding: 1rem;
  }
  main {
    padding-top: 2rem;
  }
  main figure {
    max-width: 520px;
  }
  .memory {
    display: block;
  }
  .cta {
    font-size: 0.8rem;
  }
  .entry {
    padding: 1.2rem;
  }
}

.needle {
  transform-origin: 468px 198px;
}
.wheel {
  transform-origin: 178px 250px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--ink);
  padding: 0.2rem 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  background: var(--paper);
}
.chip button {
  border: 0;
  background: none;
  padding: 0 0.2rem;
  cursor: pointer;
}
.add-topic {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.add-topic input {
  flex: 1 1 14rem;
}

.category {
  margin: 2rem 0;
}
.category-head {
  border-top: 1px solid var(--ink);
  padding-top: 0.8rem;
  margin-bottom: 0.8rem;
}
.category-head h3 {
  margin: 0 0 0.2rem;
}
.category-head p {
  margin: 0;
  color: var(--gray);
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.tabs [aria-selected='true'] {
  background: var(--ink);
  color: var(--paper);
}
.meter {
  height: 4px;
  border: 1px solid var(--ink);
  margin: 0.6rem 0 0.3rem;
  max-width: 24rem;
}
.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}
#for-you {
  margin: 1.5rem 0;
}

.call-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  padding: 0.8rem 1.2rem;
  box-shadow: 3px 3px 0 var(--ink2);
}
.call-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--paper);
  border: 1.6px solid var(--ink);
  outline: 0.7px solid var(--ink);
  outline-offset: 4px;
  padding: 1.2rem;
  box-shadow: 6px 6px 0 rgba(17, 17, 17, 0.15);
}
.call-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.call-panel .close {
  position: static;
}
.call-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.call-log {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.call-entry {
  border-top: 1px solid var(--ink);
  padding-top: 0.8rem;
}
.call-entry .takeaways {
  margin: 0.4rem 0;
  padding-left: 1.2rem;
}
.call-entry .next-step {
  font-style: italic;
}
.call-entry details {
  margin: 0.4rem 0;
}

.badge {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.4rem;
}
.filters.types {
  margin-top: 0.5rem;
}
.box {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}
.box input {
  font-size: 1.25rem;
}
.box button {
  white-space: nowrap;
}
.answer {
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.answer .cites {
  margin: 0.5rem 0 0;
  padding-left: 1.4rem;
}
.prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.8rem 0 1.4rem;
}
.prompt {
  color: inherit;
  text-underline-offset: 3px;
}
.review {
  display: grid;
  gap: 1rem;
}
.strip > .mono {
  margin-bottom: 0.4rem;
}
.browse {
  margin: 1.5rem 0;
}
.browse summary {
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}
.labels {
  display: flex;
  gap: 0.35rem;
}
.labels .badge {
  margin: 0;
}
.entry .who {
  font-style: italic;
}
.entry details .mono {
  margin-top: 0.6rem;
}
@media (max-width: 640px) {
  .box {
    flex-direction: column;
  }
}
@media (min-width: 900px) {
  .strip .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* A quiet call surface, with an explicit account step and visible keyboard focus. */
.call-panel {
  border: 1px solid var(--ink);
  outline: 0;
  box-shadow: none;
  padding: 1.4rem;
}
.call-panel h2 {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0;
}
.call-panel h2 span {
  white-space: nowrap;
}
.call-panel .call-description {
  font-size: 1.3rem;
  line-height: 1.4;
  margin: 1rem 0;
}
.call-panel .status {
  font-size: 0.75rem;
  line-height: 1.6;
}
.call-panel .close,
#close-signin {
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}
.call-panel-head {
  gap: 0.7rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
}
.call-panel :focus-visible,
dialog :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}
#call-title:focus {
  outline: none;
}
.call-controls .cta {
  max-width: 100%;
  white-space: normal;
}
.call-panel-head {
  position: sticky;
  top: -1.4rem;
  background: var(--paper);
  z-index: 2;
}
.call-panel .call-controls {
  position: sticky;
  bottom: -1.4rem;
  background: var(--paper);
  padding: 0.6rem 0;
  z-index: 1;
}

/* Conversation entry is separate from the preserved legacy workspace. */
.conversation-open #workspace,
.conversation-open #resume,
.conversation-open #talk-area .card > .fine {
  display: none;
}
.call-panel {
  width: min(30rem, calc(100vw - 2rem));
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-height: calc(100dvh - 2rem);
}
.call-panel .fine {
  line-height: 1.45;
}
.call-panel .cta {
  margin-top: 0;
}
.call-privacy {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
}
.call-privacy summary {
  cursor: pointer;
  font-size: 1rem;
}
.call-privacy p {
  margin-top: 0.6rem;
}
#call-context {
  color: var(--gray);
  margin-bottom: 1rem;
}
#call-status:empty {
  display: none;
}
@media (max-width: 480px) {
  .call-panel {
    padding: 1rem;
  }
  .call-panel-head {
    top: -1rem;
  }
  .call-panel .call-controls {
    bottom: -1rem;
  }
  .call-controls .cta {
    flex: 1;
    justify-content: center;
  }
}

.conversation-open #talk-area {
  visibility: hidden;
}
.conversation-open > .shelf.fine {
  display: none;
}
.conversation-entry #talk-area,
.conversation-entry #workspace,
.conversation-entry footer,
.conversation-entry header [href='#folio'],
.conversation-entry header #account {
  display: none;
}
.conversation-entry .call-panel {
  position: relative;
  inset: auto;
  transform: none;
  margin: clamp(2rem, 8vh, 5rem) auto;
  padding: clamp(1.25rem, 4vw, 2rem);
  max-height: none;
  overflow: visible;
}
.conversation-entry .call-panel-head,
.conversation-entry .call-controls {
  position: static;
}
.call-panel:has(#talk[data-state='live']) .call-description,
.call-panel:has(#talk[data-state='connecting']) .call-description {
  display: none;
}

/* Carry the research journal's quiet type and controls into conversation. */
body {
  background-image: radial-gradient(#191a1706 0.7px, transparent 0.7px);
  background-size: 4px 4px;
}
.call-panel {
  background: var(--paper);
  border-top: 3px double var(--ink);
}
.call-panel .cta {
  box-shadow: none;
  border-radius: 0;
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  min-height: 44px;
}
.call-panel h2 {
  font-weight: 500;
  font-size: 2.5rem;
  letter-spacing: -0.025em;
}
.call-panel .status {
  color: #4d4e47;
}
.call-panel .cta:disabled {
  cursor: not-allowed;
}

/* Keep the expanded public navigation usable beside legacy account controls. */
body > header {
  flex-wrap: wrap;
}
body > header nav {
  flex-wrap: wrap;
}
body > header nav a,
body > header nav button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 650px) {
  body > header {
    align-items: flex-start;
    flex-direction: column;
  }
  body > header nav {
    gap: 0.6rem 1rem;
    font-size: 1rem;
  }
}
