/* ═════════════════════════════════════════════════════════════════
   Notebook Aesthetic — Cells, typography, layout
   Based on direction-notebook.jsx reference
   ═════════════════════════════════════════════════════════════════ */

/* Root: apply tokens + base styles */
body.notebook {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  padding: var(--pad);
  min-height: 100vh;
}

/* ── Topbar / Navigation ────────────────────────────────── */
.nb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.nb-topbar a {
  color: var(--ink);
  text-decoration: none;
  margin-left: 18px;
  transition: color 0.15s;
}

.nb-topbar a:hover {
  color: var(--accent);
}

/* ── Tweaks menu ────────────────────────────────────────── */
.nb-tweaks-btn {
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.nb-tweaks-btn:hover {
  color: var(--accent);
}

.nb-tweaks-menu {
  position: fixed;
  top: 60px;
  right: var(--pad);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nb-tweaks-panel {
  padding: 16px;
  font-family: var(--mono);
  font-size: 11px;
  min-width: 200px;
}

.nb-tweaks-section {
  margin-bottom: 16px;
}

.nb-tweaks-section:last-child {
  margin-bottom: 0;
}

.nb-tweaks-label {
  display: block;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.nb-tweaks-swatches {
  display: flex;
  gap: 8px;
}

.nb-swatch {
  width: 24px;
  height: 24px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.nb-swatch:hover {
  transform: scale(1.1);
  border-color: var(--ink);
}

.nb-swatch.active {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper);
}

.nb-tweaks-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper);
}

.nb-density-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.nb-density-btn:last-child {
  border-right: none;
}

.nb-density-btn:hover {
  color: var(--ink);
}

.nb-density-btn.active {
  background: var(--ink);
  color: var(--paper);
}

.nb-dark-toggle {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
}

.nb-dark-toggle:hover {
  color: var(--ink);
}

.nb-dark-toggle.active {
  background: var(--ink);
  color: var(--paper);
}

/* ── Hero / Main heading ────────────────────────────────── */
.nb-h1 {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0 0 8px;
  max-width: 880px;
}

.nb-h1 .nb-accent {
  color: var(--accent);
}

.nb-lede {
  font-size: 18px;
  line-height: 1.55;
  max-width: 680px;
  color: var(--ink);
  margin: 0 0 var(--gap);
}

.nb-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: var(--gap);
}

.nb-meta b {
  color: var(--ink);
  font-weight: 500;
}

/* ── Cell structure ────────────────────────────────────── */
.nb-cell {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}

.compact .nb-cell {
  padding: 12px 0;
}

.nb-gutter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: start;
}

.nb-cellnum {
  color: var(--accent);
  font-weight: 500;
}

.nb-kind {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nb-body {
  /* flex container for when content varies */
}

.nb-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ── Section headings (inside cells) ────────────────────── */
.nb-h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 12px;
}

.nb-p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 12px;
  max-width: 740px;
}

/* ── Featured projects grid ────────────────────────────── */
.nb-feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.compact .nb-feat-grid {
  grid-template-columns: 1fr;
}

.nb-feat {
  border: 1px solid var(--rule);
  padding: 18px;
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.15s;
  cursor: pointer;
}

.nb-feat:hover {
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.nb-feat-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

.nb-feat-title {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  min-height: 44px;
}

.nb-feat-blurb {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}

.nb-feat-foot {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--rule);
  display: flex;
  justify-content: space-between;
}

/* ── Input / Controls ───────────────────────────────────── */
.nb-input {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 6px 10px;
  color: var(--ink);
}

.nb-input:focus {
  outline: none;
  border-color: var(--accent);
}

.nb-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.nb-chip:hover {
  color: var(--ink);
  border-color: var(--ink-2);
}

.nb-chip.on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.nb-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Code block / Pre ───────────────────────────────────── */
.nb-pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  background: var(--paper-2);
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-x: auto;
}

.nb-pre .c {
  color: var(--ink-2);
}

.nb-pre .k {
  color: var(--accent);
}

.nb-pre .s {
  color: var(--ink);
}

/* ── Archive table ──────────────────────────────────────– */
.nb-archive {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

.nb-archive th {
  text-align: left;
  font-weight: 400;
  color: var(--ink-2);
  border-bottom: 1px solid var(--rule);
  padding: 8px 10px 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.nb-archive td {
  padding: 12px 10px 12px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.nb-archive td.t {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
}

.nb-archive tr:hover td {
  background: var(--paper-2);
}

/* ── Results / filter feedback ──────────────────────────── */
.nb-results {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  margin: 8px 0 0;
}

.nb-results b {
  color: var(--accent);
}

/* ── Writing list ───────────────────────────────────────– */
.nb-writing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compact .nb-writing-grid {
  grid-template-columns: 1fr;
}

.nb-writing-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--rule);
  padding: 8px 0;
}

.nb-writing-item-left {
  flex: 1;
}

.nb-writing-title {
  font-size: 14px;
  font-weight: 500;
}

.nb-writing-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  margin-top: 2px;
}

.nb-writing-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

/* ── About / Experience ─────────────────────────────────– */
.nb-about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.compact .nb-about-grid {
  grid-template-columns: 1fr;
}

.nb-about-text {
  font-size: 15px;
  line-height: 1.65;
}

.nb-experience-list {
  display: flex;
  flex-direction: column;
}

.nb-experience-item {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--rule);
}

.nb-experience-item:first-child {
  border-top: none;
}

.nb-exp-role {
  color: var(--ink);
}

.nb-exp-company {
  color: var(--ink-2);
}

.nb-exp-dates {
  color: var(--ink-2);
}

/* ── Contact section ────────────────────────────────────– */
.nb-contact-grid {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.nb-contact-email {
  font-size: 16px;
}

.nb-contact-email .nb-at {
  color: var(--accent);
}

.nb-contact-socials {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
}

.nb-contact-socials a {
  color: var(--ink);
  text-decoration: none;
  margin: 0 4px;
}

.nb-contact-socials a:hover {
  color: var(--accent);
}

/* ── Footer ────────────────────────────────────────────– */
.nb-foot {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.compact .nb-foot {
  margin-top: 28px;
  padding-top: 14px;
}

/* ── Responsive adjustments ────────────────────────────– */
@media (max-width: 768px) {
  :root {
    --pad: 24px;
    --gap: 20px;
  }

  .nb-h1 {
    font-size: 40px;
  }

  .nb-feat-grid {
    grid-template-columns: 1fr;
  }

  .nb-about-grid {
    grid-template-columns: 1fr;
  }

  .nb-writing-grid {
    grid-template-columns: 1fr;
  }
}
