/* The Notes spot, in the V3 FORMAT (Sam, 2026-11-11: "the notes app exactly as it was in V3 ... keep all the V4 content ... only the format changes").
   This is V3's css/note.css: a copy of Apple Notes in dark mode. Desktop = the iCloud Notes three-pane layout. Phone = the iPhone Notes list, then the note.
   Colours and sizes follow Notes (the yellow is Notes' own accent, as it was in V3); the note surface is a little darker than stock (Sam's call, V3).
   What is V4's: the list itself (js/notes.js), the torn stubs that locked notes show as, and the font rule below.

   THE FONT (Sam, 2026-11-11): the closest thing to Apple's. On Apple devices that is the system font itself (-apple-system / BlinkMacSystemFont = San Francisco).
   Everywhere else (Windows, Android) it is Inter, bundled in fonts/ (SIL Open Font Licence: fonts/Inter-LICENSE.txt), which is only downloaded when the Apple font is not
   there. system-ui is deliberately NOT ahead of Inter: on Windows and Android it would resolve to Segoe UI or Roboto and Inter would never be used. */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-700.woff2") format("woff2"); font-weight: 700; font-display: block; }

:root {
  --note-bg: #050505;       /* the note: a touch darker than the site's near-black */
  --note-text: #ffffff;
  --note-dim: #8e8e93;
  --note-accent: #ffd60a;   /* Notes yellow, dark mode */
  --note-hair: #1c1c1e;
  --bar-bg: #3a3a44;        /* iCloud top bar */
  --side-bg: #232328;       /* folders */
  --list-bg: #1b1b20;       /* note list */
  --sel-bg: #3b3b45;        /* selected row */
  --row-bg: var(--list-bg); /* what is behind a row: the torn-away part of a stub is this colour */
  --font-ios: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html, body.notes-page { height: 100%; }
body.notes-page { background: #000; font-family: var(--font-ios); color: var(--note-text); overflow: hidden; line-height: 1.3; -webkit-font-smoothing: antialiased; }
.fi { display: inline-flex; align-items: center; }
.fi svg { width: 20px; height: 20px; }

.app { display: grid; grid-template-rows: auto 1fr; height: 100%; background: var(--list-bg); }
.app a:hover, .app a:focus-visible, .app button:hover, .app button:focus-visible { text-decoration: none; }
.app :focus-visible { outline: 2px solid var(--note-accent); outline-offset: -2px; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 10px; background: var(--bar-bg); color: var(--note-accent); }
.topbar a, .topbar button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 0 10px; color: var(--note-accent); font: 17px var(--font-ios); background: none; border: 0; }
.topbar a:visited { color: var(--note-accent); }
.topbar a:hover, .topbar a:focus-visible, .topbar button:hover, .topbar button:focus-visible { background: none; }
.app-title { font: 700 20px var(--font-ios); color: var(--note-accent); margin-right: auto; }
.backlist { display: none !important; }

/* ---------- panes ---------- */
.panes { display: grid; grid-template-columns: 240px 320px 1fr; grid-template-rows: minmax(0, 1fr); min-height: 0; }      /* the one row is held to the screen, so a long list scrolls inside its own pane and can always be reached */
.folders { background: var(--side-bg); padding: 10px; display: flex; flex-direction: column; justify-content: space-between; overflow: auto; }
.folders ul { list-style: none; margin: 0; padding: 0; }
.folders li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; font: 600 15px var(--font-ios); }
.folders li.sel { background: var(--sel-bg); }
.folders .fi { color: var(--note-accent); }
.newfolder { display: flex; align-items: center; gap: 6px; color: var(--note-accent); font: 600 14px var(--font-ios); padding: 8px 4px 4px; }

.list { background: var(--list-bg); padding: 10px; overflow-y: auto; min-height: 0; border-inline: 1px solid #111; }
.bigtitle { display: none; }
.search { display: flex; align-items: center; gap: 8px; background: #3a3a42; border-radius: 9px; padding: 0 10px; min-height: 36px; margin-bottom: 8px; color: var(--note-dim); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--note-text); font: 15px var(--font-ios); min-height: 34px; -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--note-dim); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.sec { display: flex; align-items: center; gap: 8px; margin: 12px 8px 6px; color: var(--note-text); font: 700 14px var(--font-ios); }
.sec[hidden], .item[hidden] { display: none; }
.item { position: relative; display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; background: none; border: 0; color: var(--note-text); font-family: var(--font-ios); }
a.item:visited { color: var(--note-text); }
a.item:hover { background: #26262c; }
a.item.sel, a.item.sel:hover { background: var(--sel-bg); }
.item .t { display: block; font: 700 15px/1.3 var(--font-ios); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t.scratch { font: 400 21px/19.5px var(--font-scratch); letter-spacing: .04em; }                /* .schizophria. is the one title written in scratch (same row height as the others) */
.item .m { display: flex; gap: 8px; align-items: center; margin-top: 2px; font: 14px/1.3 var(--font-ios); color: var(--note-dim); white-space: nowrap; overflow: hidden; }
.item .m b { color: var(--note-text); font-weight: 700; }
.item .m span { overflow: hidden; text-overflow: ellipsis; }
.item .f { display: flex; gap: 6px; align-items: center; margin-top: 2px; font: 13px var(--font-ios); color: var(--note-dim); }
.item .f svg { width: 14px; height: 14px; }
.count { display: none; }

/* A LOCKED NOTE IS A TORN STUB (V4; Sam, 2026-11-10): what is left of a page torn out of the notebook, held at the binding on the left; its right edge is the tear.
   The row keeps V3's three lines (name, date, folder) on what is left of the paper. The .tear drawing sits over the stub's right end: its .gone shape is the colour of
   what is behind the row (the paper that is no longer there), its line is the torn edge. Nothing here is a link or a button, and nothing responds to a pointer. */
.item.locked { padding: 0; cursor: default; }
.stub { position: relative; display: inline-flex; flex-direction: column; max-width: 100%; padding: 9px 0 9px 11px; overflow: hidden; vertical-align: top;
  background: repeating-linear-gradient(180deg, transparent 0 17px, #17171a 17px 18px), var(--note-bg); }
.tear { position: absolute; right: 0; top: 0; width: 1.5rem; height: 100%; pointer-events: none; }
.tear .gone { fill: var(--row-bg); stroke: none; }
.tear polyline { fill: none; stroke: #6a6a72; stroke-width: 1.3; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* SCRATCHED OUT AND WITHERED (Sam, 2026-11-11: "page 17", "page 59", "page 12"; "same treatment as the Events caution tape"). The name is faded, and Sam's drawn X
   (events-x) is stretched over the NAME'S OWN box exactly as it is over EVENTS on the homepage (css/home.css .ev-x): it overshoots the word a little on every side and
   its cut edges fade out. Not a link, not a button, nothing answers a pointer. */
.item.scratched { cursor: default; padding-top: 15px; padding-bottom: 13px; }      /* room for the X to overshoot the name without touching the row above */
.item.scratched .x-row { display: block; }
.item.scratched .t { overflow: visible; }
.item.scratched .f { opacity: .4; }
.x-wrap { position: relative; display: inline-block; }
.x-word { opacity: .42; }
.x-mark { position: absolute; left: -16%; right: -16%; top: -42%; bottom: -42%; pointer-events: none; opacity: .9; }
.x-mark picture, .x-mark img { display: block; width: 100%; height: 100%; max-width: none; object-fit: fill; }
.x-mark img { -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(180deg, transparent, #000 13%, #000 87%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(180deg, transparent, #000 13%, #000 87%, transparent); mask-composite: intersect; }

/* ---------- editor ---------- */
.editor { background: var(--note-bg); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.etools { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; color: var(--note-accent); min-height: 48px; }
.etools .mid, .etools .right { display: inline-flex; gap: 18px; align-items: center; }
.etools .aa { font: 600 16px var(--font-ios); }
.escroll { flex: 1; overflow-y: auto; min-height: 0; padding: 0 30px 40px; overscroll-behavior: contain; }

/* the document, and TFD: a Notes checklist */
.doc { max-width: 720px; padding-top: 6px; font-size: 17px; line-height: 22px; }
.plain .ptitle { margin: 12px 0 14px; font: 700 28px/1.2 var(--font-ios); }
.check { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 6px 0; text-align: left; background: none; border: 0; color: var(--note-text); font: 17px/22px var(--font-ios); -webkit-tap-highlight-color: transparent; }
.check:hover, .check:focus-visible { background: none; }
.check .box { flex: none; width: 22px; height: 22px; margin-top: 0; border: 2px solid var(--note-accent); border-radius: 50%; display: grid; place-items: center; color: #000; }
.check .box svg { width: 13px; height: 13px; opacity: 0; }
.check.done .box { background: var(--note-accent); }
.check.done .box svg { opacity: 1; }
.check.done .tx { color: var(--note-dim); }
.check .scr { font-size: 1.12em; letter-spacing: .02em; }

.toolbar { display: none; }

/* ---------- phone layout: the list, then the note ---------- */
@media (max-width: 859px) {
  :root { --row-bg: #1c1c1e; }
  .app { background: #000; }
  .topbar { background: #000; min-height: 44px; }
  .app-title, .folders, .etools { display: none; }
  .panes { grid-template-columns: 1fr; }
  .list, .editor { grid-area: 1 / 1; }
  .list { background: #000; padding: 4px 16px 30px; border: 0; }
  .bigtitle { display: block; margin: 0 0 8px; font: 700 34px var(--font-ios); }
  .search { background: #1c1c1e; }
  .item { background: #1c1c1e; border-radius: 0; padding: 11px 14px; border-top: 1px solid #000; }
  a.item:hover, a.item.sel, a.item.sel:hover { background: #1c1c1e; }
  .item .t { font-size: 16px; }
  .item .t.scratch { font-size: 22px; line-height: 20.8px; }
  .item.locked { padding: 0; }
  .stub { padding: 11px 0 11px 14px; }
  .count { display: block; text-align: center; color: var(--note-dim); font: 13px var(--font-ios); margin: 18px 0 0; }
  .app[data-view="list"] .editor { display: none; }
  .app[data-view="note"] .list { display: none; }
  .app[data-view="note"] .ret { display: none; }
  .app[data-view="note"] .backlist { display: inline-flex !important; }
  .escroll { padding: 0 20px 30px; }
  .toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 26px 10px; background: var(--note-bg); border-top: 1px solid var(--note-hair); pointer-events: none; }
  .toolbar svg { width: 26px; height: 26px; color: var(--note-accent); }
}

html[data-contrast="high"] .tear polyline { stroke: #fff; }
html[data-contrast="high"] { --note-dim: #cfcfcf; }
