/* =========================================================
   Site theme variables
   ========================================================= */

:root,
.quarto-dark {
  --site-ink: #eef2f6;
  --site-muted: #9ca8b4;
  --site-line: #303944;
  --site-panel: #151c23;
  --site-hero-start: #151c23;
  --site-hero-end: #0d1117;
}

.quarto-light {
  --site-ink: #17212b;
  --site-muted: #59636e;
  --site-line: #dfe4e8;
  --site-panel: #f5f7f8;
  --site-hero-start: #ffffff;
  --site-hero-end: #f3f6f7;
}

body {
  color: var(--site-ink);
}


/* =========================================================
   Global site elements
   ========================================================= */

.navbar-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

blockquote {
  border-left-width: 4px;
  font-size: 1.18rem;
}


/* =========================================================
   Homepage hero and featured cards
   ========================================================= */

.hero {
  max-width: 980px;
  margin: 3rem auto 4rem;
  padding: 3.25rem 3rem;
  border: 1px solid var(--site-line);
  border-radius: 1.25rem;
  background: linear-gradient(
    145deg,
    var(--site-hero-start) 0%,
    var(--site-hero-end) 100%
  );
}

.hero h1 {
  max-width: 780px;
  margin-top: 0.65rem;
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 720px;
  margin: 1.5rem 0 2rem;
  color: var(--site-muted);
  font-size: 1.2rem;
}

.hero-kicker {
  color: var(--site-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 4rem;
}

.featured-card {
  min-height: 220px;
  padding: 1.6rem;
  border: 1px solid var(--site-line);
  border-radius: 0.9rem;
}

.featured-card h3 {
  margin-top: 0;
}

.metric-card {
  margin: 0.5rem 0 1.5rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--site-line);
  border-radius: 0.9rem;
  background: var(--site-panel);
}

.metric-card .metric-label,
.metric-card .metric-note {
  color: var(--site-muted);
}


/* =========================================================
   Survey / anonymity visualisation
   ========================================================= */

.anonymity-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.metric {
  padding: 1.25rem;
  border: 1px solid var(--site-line);
  border-radius: 0.8rem;
  background: var(--site-panel);
}

.metric-label {
  margin-bottom: 0.35rem;
  color: var(--site-muted);
  font-size: 0.82rem;
}

.metric-value {
  margin-top: 0.2rem;
  font-size: 1.8rem;
  font-weight: 600;
}

.metric-unit {
  color: var(--site-muted);
  font-size: 0.8rem;
}

.anonymity-verdict {
  margin: 1rem 0 2rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid currentColor;
  background: var(--site-panel);
}

.survey-box {
  margin: 2rem 0;
  border: 1px solid var(--site-line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--site-panel);
}

.survey-heading,
.survey-row {
  display: grid;
  grid-template-columns: 140px minmax(220px, 1fr) 180px;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
}

.survey-heading {
  border-bottom: 1px solid var(--site-line);
  color: var(--site-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.survey-row {
  border-bottom: 1px solid var(--site-line);
}

.survey-row:last-child {
  border-bottom: none;
}

.survey-label {
  font-weight: 600;
}

.survey-pct {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 160px;
}

.survey-row > div,
.survey-heading > div {
  min-width: 0;
}

.survey-row form,
.survey-row select,
.survey-row input {
  width: 100%;
  margin: 0;
}


/* =========================================================
   Category / tag pills
   ========================================================= */

.quarto-category,
.listing-category {
  padding: 0.25rem 0.6rem !important;
  border-radius: 999px !important;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none !important;
}

body.quarto-light .quarto-category,
body.quarto-light .listing-category {
  color: #39424c !important;
  background: #f1f3f5 !important;
  border: 1px solid #d5dbe0 !important;
}

body.quarto-dark .quarto-category,
body.quarto-dark .listing-category {
  color: #f5f7fa !important;
  background: #26313c !important;
  border: 1px solid #596978 !important;
}


/* =========================================================
   Watermark visual essay
   ========================================================= */

.wm-choice-stack {
  display: grid;
  gap: 0.7rem;
  margin: 1.5rem 0 2rem;
}

.wm-choice-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.25rem 0;
}

.wm-context {
  opacity: 0.85;
}

.wm-chip {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 999px;
  font-size: 0.92rem;
}

.wm-keyed {
  border-width: 2px;
  font-weight: 650;
}

.wm-note {
  margin: 1.2rem 0 2rem;
  padding: 0.8rem 1rem;
  border-left: 3px solid currentColor;
  opacity: 0.85;
}

.wm-evidence-wrap {
  margin: 1rem 0 2rem;
}

.wm-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 72px;
  margin: 1rem 0 1.4rem;
  align-content: flex-start;
}

.wm-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.wm-dot-hit {
  background: currentColor;
}

.wm-dot-miss {
  opacity: 0.18;
}

.wm-meter-block {
  max-width: 620px;
}

.wm-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

.wm-meter {
  height: 12px;
  margin: 0.4rem 0 0.5rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 999px;
}

.wm-meter-fill {
  height: 100%;
  background: currentColor;
  transition: width 160ms ease;
}

.wm-meter-caption {
  font-size: 0.9rem;
  opacity: 0.75;
}

.wm-meter-detail {
  opacity: 0.7;
}

.wm-key-flow {
  display: grid;
  grid-template-columns:
    minmax(0, 0.9fr)
    auto
    minmax(0, 1.35fr)
    auto
    minmax(0, 0.9fr);
  gap: 0.8rem;
  align-items: stretch;
  margin: 1.5rem 0 2rem;
}

.wm-public-card,
.wm-private-card,
.wm-question-card {
  padding: 1.1rem;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 12px;
}

.wm-doc-icon,
.wm-key-icon {
  margin: 0.35rem 0 0.7rem;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 1.5rem;
  opacity: 0.8;
}

.wm-flow-arrow {
  align-self: center;
  font-size: 1.5rem;
  opacity: 0.4;
}

.wm-observer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  padding: 0.65rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.wm-observer-row:first-of-type {
  margin-top: 0.25rem;
}

.wm-two-view {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.wm-view-card {
  padding: 1.2rem;
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 12px;
}

.wm-view-kicker {
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.6;
}

.wm-view-arrow {
  font-size: 1.8rem;
  opacity: 0.45;
}

.wm-bitline {
  margin: 0.3rem 0 0.8rem;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
}

.wm-muted {
  font-size: 0.92rem;
  opacity: 0.7;
}


/* =========================================================
   Live watermark detector
   ========================================================= */

.wm-live-summary {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.wm-live-score-card,
.wm-live-stat {
  padding: 1.2rem;
  border: 1px solid var(--site-line);
  border-radius: 0.8rem;
  background: var(--site-panel);
}

.wm-live-score-label {
  margin: 0.25rem 0 0.8rem;
  font-size: 1.8rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.wm-live-meter {
  width: 100%;
  height: 0.55rem;
  margin-bottom: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--site-line);
}

.wm-live-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  transition: width 180ms ease;
}

.wm-live-stat-value {
  margin: 0.2rem 0;
  font-size: 1.8rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}


/* =========================================================
   "Can you erase it?" interactive controls
   ========================================================= */

.wm-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.wm-action-button {
  appearance: none;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--wm-control-border);
  border-radius: 0.55rem;
  color: var(--wm-control-text);
  background: var(--wm-control-bg);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 80ms ease;
}

.wm-action-button:hover {
  background: var(--wm-control-hover);
  border-color: var(--wm-control-border-hover);
}

.wm-action-button:active {
  transform: translateY(1px);
}

.wm-action-button:focus-visible,
.wm-editor:focus-visible {
  outline: 2px solid var(--wm-focus);
  outline-offset: 2px;
}

.wm-action-button-primary {
  color: var(--wm-primary-text);
  background: var(--wm-primary-bg);
  border-color: var(--wm-primary-bg);
}

.wm-action-button-primary:hover {
  color: var(--wm-primary-text);
  background: var(--wm-primary-hover);
  border-color: var(--wm-primary-hover);
}

.wm-editor {
  display: block;
  width: 100%;
  min-height: 18rem;
  box-sizing: border-box;
  padding: 1rem 1.05rem;
  border: 1px solid var(--wm-control-border);
  border-radius: 0.75rem;
  color: var(--wm-editor-text);
  background: var(--wm-editor-bg);
  caret-color: var(--wm-editor-text);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.6;
  resize: vertical;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.wm-editor:hover {
  border-color: var(--wm-control-border-hover);
}

.wm-editor:focus {
  border-color: var(--wm-focus);
  box-shadow: 0 0 0 3px var(--wm-focus-ring);
}

.wm-editor::selection {
  color: var(--wm-selection-text);
  background: var(--wm-selection-bg);
}


/* =========================================================
   Watermark control colours by Quarto theme
   ========================================================= */

body.quarto-light {
  --wm-editor-bg: #ffffff;
  --wm-editor-text: #17212b;

  --wm-control-bg: #f1f3f5;
  --wm-control-hover: #e4e8ec;
  --wm-control-text: #26313c;
  --wm-control-border: #c9d0d6;
  --wm-control-border-hover: #8d99a5;

  --wm-primary-bg: #26313c;
  --wm-primary-hover: #101820;
  --wm-primary-text: #ffffff;

  --wm-focus: #56687a;
  --wm-focus-ring: rgb(86 104 122 / 18%);

  --wm-selection-bg: #26313c;
  --wm-selection-text: #ffffff;
}

body.quarto-dark {
  --wm-editor-bg: #0d1117;
  --wm-editor-text: #eef2f6;

  --wm-control-bg: #202a34;
  --wm-control-hover: #2b3742;
  --wm-control-text: #eef2f6;
  --wm-control-border: #465463;
  --wm-control-border-hover: #778797;

  --wm-primary-bg: #eef2f6;
  --wm-primary-hover: #ffffff;
  --wm-primary-text: #17212b;

  --wm-focus: #aebdca;
  --wm-focus-ring: rgb(174 189 202 / 20%);

  --wm-selection-bg: #dbe4ec;
  --wm-selection-text: #17212b;
}


/* =========================================================
   Responsive adjustments
   ========================================================= */

@media (max-width: 760px) {
  .hero {
    margin: 2rem auto 3rem;
    padding: 2.4rem 1.4rem;
  }

  .featured-grid,
  .wm-live-summary {
    grid-template-columns: 1fr;
  }

  .wm-choice-row {
    grid-template-columns: 1fr auto auto;
  }

  .wm-two-view,
  .wm-key-flow {
    grid-template-columns: 1fr;
  }

  .wm-view-arrow,
  .wm-flow-arrow {
    text-align: center;
    transform: rotate(90deg);
  }

  .wm-observer-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

@media (max-width: 700px) {
  .survey-heading {
    display: none;
  }

  .survey-row,
  .anonymity-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .wm-button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wm-action-button {
    width: 100%;
  }
}

/* =========================================================
   Essay listing polish
   ========================================================= */

/* Give the tags some space below the listing title */
.quarto-listing .listing-categories {
  margin-top: 0.55rem;
}

/* Mobile listing controls */
@media (max-width: 760px) {
  .quarto-listing .listing-actions-group {
    width: 100%;
  }

  .quarto-listing .listing-actions-group .input-group {
    width: 100%;
    max-width: none;
  }

  .quarto-listing .listing-filter {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }
}