/* title typeface: EB Garamond (self-hosted; latin + greek + polytonic greek) */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/eb-garamond-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

body {
  font-family: sans-serif;
  max-width: 1080px;
  margin: 40px auto;
  padding: 0 16px;
  color: #000;
  background: #fff;
}
textarea {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
  font-variant-ligatures: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
}
.small { color: #000; font-size: .85em; margin-left: 8px; }
hr { margin: 18px 0; }
.box {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.success {
  background: #e8f8e8;
  border: 1px solid #7c7;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: bold;
  overflow-wrap: anywhere;
}
.error { color: #000; margin: 12px 0; }
summary { cursor: pointer; }
.stages h3 {
  position: relative;
  font-size: .9em;
  margin: 12px 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stages pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.blue { color: #0b5fff; }

/* hover-only info tooltip (no click/toggle state) */
.info {
  display: inline-flex;
  align-items: center;
  cursor: help;
  font-weight: normal;
  outline: none;
}
.info .icon {
  font-size: 1.1em;
  line-height: 1;
  color: #000;
}
.info:hover .icon,
.info:focus-visible .icon { color: #0b5fff; }
.info .tip {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 10;
  box-sizing: border-box;
  width: max-content;
  max-width: min(340px, 100%);
  margin-top: 4px;
  padding: 8px 10px;
  font-size: .9em;
  font-weight: normal;
  line-height: 1.4;
  color: #000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.info:hover .tip,
.info:focus-visible .tip { visibility: visible; opacity: 1; }
.info .tip b { font-weight: 700; }
.info .tip code {
  background: #f1f1f1;
  border-radius: 3px;
  padding: 0 3px;
}
.info .tip .ex { display: block; margin-top: 4px; color: #000; }
iframe {
  display: block;
  width: 100%;
  height: 120px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  background: #f6f6f3;
  margin-top: 6px;
}

/* tag that survived a filter stage */
.tag-pass { color: #000; font-weight: normal; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* title block */
.brand { margin: 8px 0 22px; }
.brand h1 {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3rem, 12vw, 4.75rem);
  line-height: 1;
  letter-spacing: -.01em;
  margin: 0;
}
.brand h1 .sub {
  font-family: inherit;
  font-size: clamp(1.5rem, 5.5vw, 2.1rem);
  letter-spacing: 0;
  color: #000;
}

/* single column: input, then filter stages, then result + rendered note */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.col-main > :first-child, .col-stages > :first-child { margin-top: 0; }
.col-stages { margin-top: 14px; }
.col-stages .box { margin-top: 0; }
.col-stages:empty::before {
  content: "Filter stages appear here";
  display: block;
  border: 1px dashed #ddd;
  border-radius: 8px;
  padding: 10px 14px;
  color: #000;
  font-size: .9em;
}

/* rendered note: paper note card */
.preview { margin: 14px 0 10px; }
.note-card {
  position: relative;
  border: 1px solid #bbb;
  background: #f6f6f3;
  box-shadow: 0 3px 0 #e2e2de;
}
.note-head {
  padding: 8px 14px;
  background: #fbfbf8;
  border-bottom: 1px dashed #bbb;
}
.note-card iframe { height: 56px; margin-top: 0; border: 0; transition: height .15s ease; }
@media (prefers-reduced-motion: reduce) { .note-card iframe { transition: none; } }

/* automatic dark mode: follows the visitor's system setting, no toggle */
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  body { color: #ececec; background: #111214; }
  textarea { color: #ececec; background: #1b1d21; border: 1px solid #3a3d44; }
  textarea:focus-visible { outline: 2px solid #6ea0ff; outline-offset: 1px; }
  hr { border: 0; border-top: 1px solid #3a3d44; }
  button { color: #ececec; background: #2a2d33; border: 1px solid #4a4e57; border-radius: 4px; padding: 2px 10px; cursor: pointer; }
  button:hover { background: #343840; }
  .small, .error, .brand h1 .sub, .info .icon, .info .tip, .info .tip .ex,
  .tag-pass, .col-stages:empty::before { color: #ececec; }
  .box { border-color: #3a3d44; }
  .success { color: #ececec; background: #12301a; border-color: #3d7a4d; }
  .blue, .info:hover .icon, .info:focus-visible .icon { color: #6ea0ff; }
  .info .tip {
    background: #1d1f24;
    border-color: #454a54;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .55);
  }
  .info .tip code { background: #2a2d33; }
  iframe { border-color: #3a3d44; background: #1b1d21; }
  .col-stages:empty::before { border-color: #3a3d44; }
  .note-card { border-color: #4a4e57; background: #1b1d21; box-shadow: 0 3px 0 #25272c; }
  .note-head { background: #202328; border-bottom-color: #4a4e57; }
}
