@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@400;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,600&display=swap");

/* ─── Reset ────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0 !important;
}

/* ─── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --primary: #f0ff00; /* Electric Sulfur */
  --surface: #0a0a0a; /* Deep Onyx */
  --on-surface: #f5f5f3; /* Bone White */
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  
  --font-display: "Newsreader", serif;
  --font-body: "Lexend", sans-serif;
  
  /* Remove all soft variables/transitions */
  --muted: rgba(245, 245, 243, 0.5);
  --border-color: var(--on-surface);
}

/* ─── Base ─────────────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}


/* ─── Focus ────────────────────────────────────────────────────────────────── */
:focus {
  outline: none;
}

:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 0;
}

input:focus-visible,
textarea:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 0;
}

button:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 0;
  background: var(--primary) !important;
  color: #000 !important;
}


/* ─── Main layout ──────────────────────────────────────────────────────────── */
main {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 0;
  align-items: start;
  flex: 1;
}

.apparatus-zone {
  background-color: var(--surface-container);
  border-left: 2px solid var(--surface-container-high);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

/* ─── Reading pane ─────────────────────────────────────────────────────────── */
.reading-pane {
  padding: 4rem 4rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.book-header {
  border-bottom: 4px solid var(--surface-container);
  padding-bottom: 2rem;
}

.book-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: 1rem;
}

.book-meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.meta-sep {
  margin: 0 1em;
  color: var(--muted);
}

/* ─── Paragraph items ──────────────────────────────────────────────────────── */
.paragraphs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.paragraph-item {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 2rem;
  align-items: start;
  padding: 2.5rem 2rem;
  cursor: pointer;
  border-left: 4px solid transparent;
  background-color: transparent;
  transition: none;
}

.paragraph-item:hover {
  background-color: var(--surface-container);
}

.paragraph-item:focus {
  outline: none;
  border-left-color: var(--primary);
  background-color: var(--surface-container);
}

.paragraph-item.is-active {
  background-color: var(--surface-container);
  border-left-color: var(--primary);
}

.para-number {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 0.25rem;
  user-select: none;
}

.paragraph-item.is-active .para-number {
  color: var(--primary);
}

.paragraph-item p {
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--on-surface);
  font-weight: 400;
}

/* ─── Reading hint ─────────────────────────────────────────────────────────── */
.reading-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 2rem;
}

.reading-hint kbd {
  background: var(--surface-container-high);
  padding: 0.2em 0.5em;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

/* ─── Notes column ─────────────────────────────────────────────────────────── */
.notes-container {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-bottom: 4px solid var(--surface-container-high);
}

.notes-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.notes-container h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--on-surface);
}

.notes-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.notes-hint kbd {
  background: var(--surface-container-high);
  padding: 0.2em 0.5em;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
}

.notes-empty {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.6;
}

/* ─── Note cards ───────────────────────────────────────────────────────────── */
.note {
  background: var(--surface-container-high);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-left: 4px solid var(--primary);
}


.note-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.note-para-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--primary);
}

.note-content {
  font-family: var(--font-body);
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--on-surface);
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  margin-top: 0.5rem;
}

.note-footer time {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-body);
}

.note-delete-btn {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--muted);
  padding: 0.4em 0.8em;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.note-delete-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ─── Form section ─────────────────────────────────────────────────────────── */
.form-section {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  padding-bottom: 1rem;
}

.active-para-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  min-height: 1.4em;
  font-weight: 700;
}

/* ─── Form elements ────────────────────────────────────────────────────────── */
.input-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface);
}

textarea {
  width: 100%;
  height: 9em;
  min-height: 4em;
  padding: 1.25rem;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid var(--on-surface);
  background: var(--surface-container-high);
  color: var(--on-surface);
  resize: vertical;
  line-height: 1.6;
}

textarea[aria-invalid="true"] {
  border-color: #ff5555;
}



button[type="submit"] {
  background: var(--on-surface);
  color: var(--surface);
  border: none;
  padding: 1.5rem 2rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

button[type="submit"]:hover {
  background: var(--primary);
  color: #000;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.form-actions button {
  flex: 1;
}

#submit {
  flex-basis: 100%;
}

.btn-secondary {
  background: transparent;
  color: var(--on-surface);
  border: 2px solid var(--on-surface);
  padding: 1.5rem 2rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
}

.btn-secondary:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.btn-secondary kbd {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface);
  padding: 0.2em 0.5em;
  margin-left: 0.5em;
  text-transform: none;
}


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

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
  }

  .apparatus-zone {
    border-left: none;
    border-top: 4px solid var(--surface-container-high);
    position: static;
    height: auto;
    overflow-y: visible;
  }

  .reading-pane,
  .notes-container,
  .form-section {
    padding: 3rem 1.5rem;
  }
}
