:root {
  color-scheme: light dark;
  --bg: #fff;
  --ink: #000;
  --muted: #6e6e73;
  --line: rgba(0,0,0,.12);
  --pill: rgba(0,0,0,.05);
  --hl: #ffcc47;
  --gap: clamp(88px, 11vw, 136px); /* the one space between sections */
  --button: #000;
  --button-ink: #fff;
  --button-hover: #333;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --hand: "La Belle Aurore", "Bradley Hand", cursive;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0e; --ink: #f2f2f2; --muted: #98989d; --line: rgba(255,255,255,.14); --pill: rgba(255,255,255,.08);
    --button: #f2f2f2; --button-ink: #000; --button-hover: #d1d1d6;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.top, footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 20px 24px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; }
.brand img { border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
main { padding: 0 24px; }
main > section { max-width: 1180px; margin: 0 auto; }
main > section + section { margin-top: var(--gap); }

h1 { font-size: clamp(40px, 5.4vw, 76px); font-weight: 700; letter-spacing: -.035em; line-height: 1; text-wrap: balance; }

.download {
  margin-top: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px;
  background: var(--button); color: var(--button-ink); font-size: 17px; font-weight: 500; letter-spacing: -.01em; text-decoration: none;
}
.download svg { width: 16px; height: 16px; fill: currentColor; margin-top: -2px; }
.download { transition: background-color .2s ease; }
.download:hover { background: var(--button-hover); }

/* handwriting */
.hand { font-family: var(--hand); font-size: clamp(20px, 2.2vw, 30px); line-height: 1.3; letter-spacing: .01em; }
.x { position: relative; display: inline-block; }
.strike { position: absolute; left: -6%; top: 38%; width: 112%; height: 26%; overflow: visible; }
.strike path { fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* hero: the question, and a collage of living pictures */
.hero { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding-top: clamp(8px, 3vh, 40px); }
.collage { position: relative; height: clamp(420px, 46vw, 600px); }
.tile { position: absolute; overflow: hidden; background: #ddd; box-shadow: 0 0 0 1px var(--line); }
.tile video { display: block; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .5s ease; }
@media (hover: hover) { .tile:hover video { filter: none; } }
.tile.color video { filter: none; }
.t1 { right: 0; top: 9%; width: 76%; height: 60%; }
.t2 { left: 8%; top: 50%; width: 30%; height: 30%; z-index: 1; }
.t3 { left: 30%; top: 69%; width: 42%; height: 31%; z-index: 2; }
.ruler { position: absolute; left: 14%; top: 9%; height: 41%; display: flex; flex-direction: column; justify-content: space-between; list-style: none; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ruler li::after { content: ""; display: inline-block; width: 8px; height: 1.5px; margin-left: 5px; vertical-align: middle; background: currentColor; }
.ruler li { text-align: right; }
.c1, .c2 { position: absolute; z-index: 3; pointer-events: none; }
.c1 { right: 3%; top: 13%; transform: rotate(-4deg); font-size: clamp(22px, 2.6vw, 36px); color: #111; }
.c2 { left: 28%; top: -1%; transform: rotate(2deg); }

/* what it does: the Folium window, drawn to the app's own sizes and colors (macOS 26) */
.features { text-align: center; }
.app { max-width: 952px; height: clamp(440px, 46vw, 560px); margin: 0 auto; }
.tabs { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 24px; }
.tabs button { position: relative; padding: 9px 16px; border-radius: 999px; font-size: 15px; color: var(--muted); white-space: nowrap; transition: color .25s ease, background-color .25s ease; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px; border-radius: 1px; background: currentColor; opacity: .5; transform-origin: 0; transform: scaleX(0); }
.tabs.run button[aria-selected="true"]::after { animation: fill var(--dur, 4.5s) linear forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.tabs .pause { width: 36px; height: 36px; padding: 0; margin-left: 6px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.pause svg { width: 12px; height: 12px; fill: currentColor; }
.pause .pl, .paused .pause .pz { display: none; }
.paused .pause .pl { display: inline; }

.app {
  --w-bg: #fff; --w-text: #000; --w-icon: #000; --w-label: rgba(0,0,0,.72); --w-sec: rgba(0,0,0,.5); --w-ph: rgba(0,0,0,.63);
  --w-hover: rgba(0,0,0,.08); --w-on: rgba(0,0,0,.18); --w-sel: #b3d7ff; --w-edge: rgba(0,0,0,.14);
  --w-menu: rgba(246,246,246,.94); --w-box: #e0dfdf; --w-field: #f0efef; --w-card: #eae9e9; --w-btn: rgba(0,0,0,.1);
  --w-accent: #3478f6; --w-pop: rgba(250,250,250,.96);
  --w-shadow: 0 0 0 .5px rgba(0,0,0,.22), 0 22px 70px rgba(0,0,0,.18);
  --p-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 10px 30px rgba(0,0,0,.18);
}
@media (prefers-color-scheme: dark) {
  .app {
    --w-bg: #1e1e1e; --w-text: #fff; --w-icon: #fff; --w-label: rgba(255,255,255,.72); --w-sec: rgba(255,255,255,.55); --w-ph: rgba(255,255,255,.55);
    --w-hover: rgba(255,255,255,.12); --w-on: rgba(255,255,255,.18); --w-sel: #3f638b; --w-edge: rgba(255,255,255,.14);
    --w-menu: rgba(40,40,40,.94); --w-box: #555554; --w-field: #2e2e2e; --w-card: #2a2b29; --w-btn: rgba(255,255,255,.1);
    --w-pop: rgba(30,30,30,.97);
    --w-shadow: 0 0 0 .5px rgba(255,255,255,.2), 0 22px 70px rgba(0,0,0,.6);
    --p-shadow: 0 0 0 .5px rgba(255,255,255,.18), 0 10px 30px rgba(0,0,0,.5);
  }
}
.frame { position: relative; width: 100%; border-radius: 26px; background: var(--w-bg); color: var(--w-icon); box-shadow: var(--w-shadow); text-align: left; font-family: var(--sans); -webkit-user-select: none; user-select: none; }
.page { position: absolute; inset: 52px 0 0; overflow: auto; border-radius: 0 0 26px 26px; padding: 20px 26px 40px; scrollbar-width: thin; }
.sym { display: block; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.s-textformat { --m: url(assets/sym/textformat.png); width: 23px; height: 15px; }
.s-chev9 { --m: url(assets/sym/chev9.png); width: 10px; height: 7px; }
.s-chev10 { --m: url(assets/sym/chev10.png); width: 11px; height: 8px; }
.s-bold { --m: url(assets/sym/bold.png); width: 14px; height: 15px; }
.s-italic { --m: url(assets/sym/italic.png); width: 13px; height: 15px; }
.s-highlighter { --m: url(assets/sym/highlighter.png); width: 21px; height: 20px; }
.s-flame { --m: url(assets/sym/flame.png); width: 13px; height: 16px; }
.s-flame.on { --m: url(assets/sym/flame-fill.png); }
.s-clock { --m: url(assets/sym/clock.png); width: 17px; height: 17px; }
.s-folder { --m: url(assets/sym/folder.png); width: 22px; height: 18px; }
.s-timer { --m: url(assets/sym/timer.png); width: 20px; height: 20px; }
.s-check { --m: url(assets/sym/check.png); width: 15px; height: 14px; }
.s-xmark10 { --m: url(assets/sym/xmark10.png); width: 11px; height: 11px; }
.s-xmark17 { --m: url(assets/sym/xmark17.png); width: 18px; height: 17px; }
.s-plus17 { --m: url(assets/sym/plus17.png); width: 19px; height: 18px; }
.s-tray17 { --m: url(assets/sym/tray17.png); width: 24px; height: 23px; }
.s-trash14 { --m: url(assets/sym/trash14.png); width: 16px; height: 18px; }

/* the toolbar row: 52pt tall, starts 100pt in after the window buttons, ends 25pt from the edge */
.bar { position: relative; z-index: 3; height: 52px; display: flex; align-items: center; gap: 9px; padding: 0 25px 0 100px; }
.lights { position: absolute; left: 19px; top: 19px; display: flex; gap: 9px; }
.lights i { width: 14px; height: 14px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.14); }
.lights i:nth-child(2) { background: #febc2e; }
.lights i:nth-child(3) { background: #28c840; }
.anchor { position: relative; display: flex; }
.group { display: flex; align-items: center; }
.tb { display: flex; align-items: center; height: 30px; padding: 1px 2px; border-radius: 8px; color: var(--w-icon); transition: background-color .12s ease; }
.tb:hover, .tb[aria-expanded="true"] { background: var(--w-hover); }
.tb:focus-visible { outline: 2px solid var(--w-accent); outline-offset: 0; }
.tb.ico { width: 32px; justify-content: center; }
.tb.ico.on { background: linear-gradient(var(--w-on), var(--w-on)) center / 28px 28px no-repeat; }
.tb.ico.on:hover { background-color: var(--w-hover); }
.font { gap: 7px; font-size: 15px; font-weight: 500; }
.dot { width: 24px; justify-content: center; }
.dot i { width: 11px; height: 11px; border-radius: 50%; background: var(--hlc, #ffcc47); box-shadow: inset 0 0 0 1px rgba(128,128,128,.4); }
.grow { flex: 1; }
.streak { display: flex; align-items: center; gap: 3px; margin-right: 4px; color: var(--w-sec); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.streak.done { color: var(--w-label); }
.streak.bump #streakn { display: inline-block; animation: bump .4s ease-out; }
@keyframes bump { 40% { transform: scale(1.3); } }
.daily { gap: 5px; padding: 1px 6px; color: var(--w-label); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.timer { font: 15px ui-monospace, "SF Mono", Menlo, monospace; color: var(--w-sec); }
.session .streak, .session #b-timer { display: none; }
.session .timer[hidden] { display: inline; }

/* the page: Georgia 21 with 8pt between lines and 14pt between paragraphs, 31pt in */
.text { min-height: 100%; padding: 0 5px; font: 21px/32px Georgia, "Times New Roman", serif; color: var(--w-text); outline: none; cursor: text; caret-color: var(--w-text); -webkit-user-select: text; user-select: text; }
.text::selection, .text *::selection { background: var(--w-sel); }
.text:empty::before { content: attr(data-ph); color: var(--w-ph); }
.text div + div, .text p + p { margin-top: 14px; }
.text [style*="background-color"]:not([style*="transparent"]) { color: #000; }
.text .fake-sel { background: var(--w-sel); }

/* the font menu, each name in its own face */
.menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 196px; padding: 5px; border-radius: 12px; background: var(--w-menu); box-shadow: var(--p-shadow); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); opacity: 0; visibility: hidden; transform: translateY(-3px); transition: opacity .14s ease, transform .14s ease, visibility 0s .14s; }
.menu.open { opacity: 1; visibility: visible; transform: none;  transition-delay: 0s; }
.menu button { transition: background-color .08s ease; display: flex; align-items: center; gap: 4px; width: 100%; height: 26px; padding: 0 12px 0 5px; border-radius: 7px; font-size: 15px; color: var(--w-text); white-space: nowrap; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--w-accent); color: #fff; outline: none; }
.menu .ck { visibility: hidden; transform: scale(.85); }
.menu [aria-checked="true"] .ck { visibility: visible; }

/* the highlight colors, in a popover under the dot */
.pop { position: absolute; top: calc(100% + 11px); left: 50%; display: flex; opacity: 0; visibility: hidden; transition: opacity .14s ease, transform .14s ease, visibility 0s .14s; gap: 6px; padding: 10px; border-radius: 20px; background: var(--w-pop); box-shadow: var(--p-shadow); transform: translate(-50%, -3px); }
.pop::before { content: ""; position: absolute; top: -7px; left: 50%; width: 16px; height: 8px; background: inherit; clip-path: path("M0 8 C5 8 6 0 8 0 C10 0 11 8 16 8 Z"); transform: translateX(-50%); }
.pop.open { opacity: 1; visibility: visible; transform: translate(-50%, 0);  transition-delay: 0s; }
.pop button { position: relative; width: 28px; height: 28px; border-radius: 50%; }
.pop button::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--c); }
.pop button.on { box-shadow: inset 0 0 0 1.5px var(--w-label); }

/* the daily time: a box with one time field, like the app's NSDatePicker */
.tbox { position: absolute; top: calc(100% + 4px); left: 0; opacity: 0; visibility: hidden; transform: translateY(-3px); transition: opacity .14s ease, transform .14s ease, visibility 0s .14s; padding: 8px; border-radius: 10px; background: var(--w-box); box-shadow: var(--p-shadow); }
.tbox.open { opacity: 1; visibility: visible; transform: none;  transition-delay: 0s; }
.field { display: flex; align-items: center; width: 95px; height: 26px; padding: 0 9px; border-radius: 5px; background: var(--w-field); font-size: 15px; font-variant-numeric: tabular-nums; color: var(--w-text); white-space: pre; outline: none; cursor: default; }
.seg { padding: 0 1px; border-radius: 3px; outline: none; }
.seg.sel { background: #0a82ff; color: #fff; }

/* the daily card, top right */
.card { position: absolute; z-index: 4; top: 64px; right: 16px; width: 300px; padding: 14px; border-radius: 16px; background: var(--w-card); box-shadow: inset 0 0 0 1px var(--w-edge), var(--p-shadow); color: var(--w-text); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .2s, transform .2s, visibility 0s .2s; }
.card .ch { display: flex; align-items: center; gap: 6px; color: var(--w-sec); font-size: 12px; }
.card .ch img { border-radius: 4px; }
.card .ch b { flex: 1; font-weight: 600; }
.card p { margin: 12px 0; font-size: 14px; font-weight: 500; }
.card .cb { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.card .cb span { padding: 6px 12px; border-radius: 8px; }
.card .pri { background: var(--w-accent); color: #fff; }
.card .sec { background: var(--w-btn); }
.card .skip { margin-left: auto; padding: 0; font-size: 12px; font-weight: 400; color: var(--w-sec); }

/* your writing: the files sheet, centered over the window */
.lib { position: absolute; z-index: 5; left: 50%; top: 50%; width: 528px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); padding: 19px; border-radius: 26px; background: var(--w-bg); color: var(--w-text); box-shadow: var(--w-shadow); display: flex; flex-direction: column; gap: 10px; opacity: 0; visibility: hidden; transform: translate(-50%, -48%) scale(.98); transition: opacity .2s ease, transform .2s ease, visibility 0s .2s; }
.lib.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%);  transition-delay: 0s; }
.lh { display: flex; align-items: center; }
.lh b { font-size: 20px; font-weight: 600; }
.hb { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--w-icon); }
.hb:hover { background: var(--w-hover); }
.lib ol { list-style: none; overflow: auto; min-height: 0; }
.lib li { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 8px; cursor: default; transition: background-color .12s ease; }
.lib li:hover { background: var(--w-hover); }
.lib li span { flex: 1; min-width: 0; }
.lib li b { display: block; font-size: 17px; font-weight: 400; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib li time { display: block; margin-top: 4px; font-size: 13px; line-height: 16px; color: var(--w-sec); }
.lib li .trash { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: #ad3d42; color: #fff; opacity: 0; transition: opacity .12s ease; }
.lib li:hover .trash { opacity: 1; }

/* each moment opens one piece */
[data-state="streak"] .card { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* writing finishes a thought: four lines in one hand, each a little off true, as on paper */
.sheet { max-width: 720px; margin: 0 auto; }
.sheet .hand { width: max-content; font-size: clamp(20px, 4vw, 50px); line-height: 1.45; white-space: nowrap; transform-origin: 0 60%; }
.sheet p:nth-child(1) { transform: rotate(-.6deg); }
.sheet p:nth-child(2) { margin-left: 7%; transform: rotate(.35deg) translateY(-2px); }
.sheet p:nth-child(3) { margin-left: 2%; transform: rotate(-.25deg); }
.sheet p:nth-child(4) { margin-left: 3.5%; transform: rotate(.5deg) translateY(1px); }
.marker { margin: 0 -.08em; padding: 0 .08em; border-radius: .12em; background: linear-gradient(var(--hl), var(--hl)) no-repeat 0 50% / 100% 92%; color: #000; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* once the font is in, the crossing-out and the marker are redrawn as pen and highlighter strokes at the words' real size */
.marker .hl { position: absolute; left: -.14em; top: 0; z-index: -1; overflow: visible; pointer-events: none; }
.sheet.drawn .marker { position: relative; background: none; }
.sheet.drawn .strike path { vector-effect: none; }

footer { margin-top: var(--gap); padding-top: 18px; padding-bottom: 24px; border-top: 1px solid var(--line); max-width: 1132px; padding-left: 0; padding-right: 0; width: calc(100% - 48px); font-size: 13px; color: var(--muted); }
footer .brand { color: var(--ink); font-size: 14px; }
footer span a { color: var(--ink); text-underline-offset: 3px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .pitch { text-align: center; }
  .collage { height: clamp(340px, 90vw, 520px); }
  .t1 { width: 84%; }
  .t2 { left: 0; width: 38%; }
  .t3 { left: 24%; width: 58%; }
  .ruler { left: 4%; }
}
/* narrower windows: the app drops the font's name below 850pt; phones get the window at 80% */
@media (max-width: 900px) {
  .fname { display: none; }
  .bar { gap: 7px; }
}
@media (max-width: 640px) {
  .app { zoom: .8; height: 470px; }
  .app .lights, #b-files { display: none; }
  .bar { padding-left: 14px; padding-right: 14px; }
  .page { padding-left: 9px; padding-right: 9px; }
  .c1 { top: 11%; font-size: 20px; }
  .tabs { justify-content: flex-start; overflow-x: auto; margin: 20px -24px 0; padding: 0 24px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
}
