/* Practical Note site styles, shared by every page. */
:root {
  --paper: #fbf7ee;
  --paper-2: #f4eedf;
  --card: #fffdf8;
  --ink: #1d2430;
  --ink-soft: #5a6272;
  --rule: #dde5f0;
  --margin: #e9a3a0;
  --blue: #2459d6;
  --on-blue: #ffffff;
  --blue-soft: #e6edfd;
  --highlight: #ffe58a;
  --green: #1f7a4a;
  --green-soft: #e3f3e9;
  --amber: #9a6a12;
  --amber-soft: #fbefd6;
  --line: #e6dfcf;
  --shadow: 0 1px 2px rgba(60, 45, 20, 0.06), 0 8px 24px rgba(60, 45, 20, 0.08);
  --fold: #efe4cb;
  --fold-2: #dccba4;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17191f;
    --paper-2: #1d2028;
    --card: #20242d;
    --ink: #ece7dc;
    --ink-soft: #a7a397;
    --rule: #2a3040;
    --margin: #7a4a4a;
    --blue: #7ea2ff;
    --on-blue: #0f1830;
    --blue-soft: #1f2a46;
    --highlight: #6b5a1c;
    --green: #6fd29b;
    --green-soft: #183326;
    --amber: #e6b65a;
    --amber-soft: #382c14;
    --line: #2e323c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --fold: #3c4456;
    --fold-2: #556079;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

/* Handwritten margin notes */
.note { font-family: Caveat, "Comic Sans MS", cursive; font-weight: 700; color: var(--blue); font-size: 1.45rem; line-height: 1.1; }

/* Header */
header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap; }
nav a { white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
nav { display: flex; gap: 22px; }
nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
nav a:hover { color: var(--ink); }

/* Hero: a sheet of ruled notebook paper */
.hero { padding: 64px 0 40px; }
.sheet {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 56px 40px 48px 96px;
  background-image:
    linear-gradient(to right, transparent 71px, var(--margin) 71px, var(--margin) 73px, transparent 73px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--rule) 35px, var(--rule) 36px);
  background-position: 0 0, 0 22px;
  overflow: hidden;
}
.sheet::before {
  /* punched holes */
  content: ""; position: absolute; left: 26px; top: 56px; width: 18px; height: calc(100% - 112px);
  background: radial-gradient(circle at 9px 9px, var(--paper-2) 7px, transparent 8px) 0 0 / 18px 120px repeat-y;
}
.sheet .note.tag { display: inline-block; transform: rotate(-2deg); margin-bottom: 10px; }
h1 { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: clamp(2.3rem, 5.6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 16ch; }
h1 mark { background: linear-gradient(transparent 58%, var(--highlight) 58%, var(--highlight) 92%, transparent 92%); color: inherit; padding: 0 2px; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 28px; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: var(--blue); color: var(--on-blue); text-decoration: none; font-weight: 700; padding: 13px 20px; border-radius: 12px; box-shadow: 0 2px 6px rgba(36, 89, 214, 0.25); }
.cta:hover { filter: brightness(1.06); }
.cta.ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--line); box-shadow: none; }
.doodle { position: absolute; right: 36px; bottom: 30px; transform: rotate(4deg); text-align: right; }
.doodle svg { display: block; margin: 4px 0 0 auto; }

/* Sections */
section { padding: 56px 0; }
.eyebrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
h2 { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -0.01em; margin: 0 0 8px; }
.sub { color: var(--ink-soft); margin: 0 0 28px; max-width: 60ch; }

/* App cards */
.apps { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; box-shadow: var(--shadow); }
.card.featured { border-top: 5px solid var(--blue); }
.card.next { background: transparent; border: 2px dashed var(--line); box-shadow: none; display: flex; flex-direction: column; justify-content: center; }
.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.app-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--blue); display: grid; place-items: center; flex: none; }
.app-name { font-family: Fraunces, Georgia, serif; font-weight: 800; font-size: 1.6rem; margin: 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.tag-pill { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-pill.live { background: var(--green-soft); color: var(--green); }
.tag-pill.soon { background: var(--amber-soft); color: var(--amber); }
.tag-pill.plain { background: var(--paper-2); color: var(--ink-soft); }
.card p { margin: 0 0 16px; }
.features { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.features li { display: flex; gap: 10px; align-items: flex-start; }
.features li::before { content: "✓"; color: var(--green); font-weight: 800; flex: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* House rules */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.rule { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); position: relative; }
.rule:nth-child(odd) { transform: rotate(-0.6deg); }
.rule:nth-child(even) { transform: rotate(0.5deg); }
.rule .pin { position: absolute; top: -8px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--margin); box-shadow: 0 2px 3px rgba(0,0,0,.15); }
.rule .note { font-size: 1.25rem; display: block; margin-bottom: 4px; }
.rule h3 { margin: 0 0 6px; font-size: 1.1rem; }
.rule p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Contact */
.contact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mail { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.mail .what { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.mail a { font-weight: 700; text-decoration: none; word-break: break-all; }
.mail .grow { flex: 1; min-width: 0; }
.copy { border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: 600 0.9rem Inter, system-ui, sans-serif; padding: 8px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.copy:hover { border-color: var(--blue); color: var(--blue); }
.copy.done { border-color: var(--green); color: var(--green); }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-soft); font-size: 0.9rem; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.foot .note { font-size: 1.2rem; color: var(--ink-soft); }

@media (max-width: 860px) {
  .apps, .contact { grid-template-columns: 1fr; }
  .rules { grid-template-columns: repeat(2, 1fr); }
  .doodle { display: none; }
}
@media (max-width: 560px) {
  .brand { font-size: 1.05rem; gap: 8px; }
  .brand img { width: 26px; height: 26px; }
  nav { gap: 12px; }
  nav a { font-size: 0.85rem; }
  .sheet { padding: 40px 22px 32px 52px; background-image:
    linear-gradient(to right, transparent 37px, var(--margin) 37px, var(--margin) 39px, transparent 39px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 35px, var(--rule) 35px, var(--rule) 36px); }
  .sheet::before { left: 10px; width: 16px; }
  .rules { grid-template-columns: 1fr; }
  .mail { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rule { transform: none !important; } }

/* ---------- Page flip (hero) ---------- */
.flip { perspective: 2200px; }
.flipper { display: grid; transition: transform 0.9s cubic-bezier(.3, .7, .2, 1); transform-style: preserve-3d; transform-origin: center center; }
.flipper > .sheet { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flipper > .sheet.back { transform: rotateY(180deg); }
.flip.flipped .flipper { transform: rotateY(-180deg); }
.corner {
  position: absolute; right: 0; bottom: 0; width: 92px; height: 92px; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(135deg, transparent 50%, var(--fold) 50%, var(--fold-2) 100%);
  border-top-left-radius: 14px; box-shadow: -3px -3px 8px rgba(60, 45, 20, 0.12);
  transition: width .25s ease, height .25s ease;
}
.corner:hover, .corner:focus-visible { width: 110px; height: 110px; }
.corner span { position: absolute; right: 10px; bottom: 10px; font-family: Caveat, cursive; font-weight: 700; font-size: 1.15rem; color: var(--blue); line-height: 1; text-align: right; }
.sheet.back .corner { right: auto; left: 0; background: linear-gradient(225deg, transparent 50%, var(--fold) 50%, var(--fold-2) 100%); border-top-left-radius: 0; border-top-right-radius: 14px; box-shadow: 3px -3px 8px rgba(60, 45, 20, 0.12); }
.sheet.back .corner span { right: auto; left: 10px; text-align: left; }
.todo { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; max-width: 560px; }
.todo label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 1.12rem; line-height: 36px; }
.todo input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 7px 0 0; flex: none; border: 2px solid var(--ink-soft); border-radius: 5px; display: grid; place-items: center; cursor: pointer; background: var(--card); }
.todo input:checked { border-color: var(--green); }
.todo input:checked::after { content: "✓"; font-family: Caveat, cursive; font-weight: 700; font-size: 1.6rem; color: var(--green); line-height: 1; margin-top: -6px; }
.todo input:checked + span { text-decoration: line-through; text-decoration-color: var(--green); text-decoration-thickness: 2px; color: var(--ink-soft); }
.todo .hand { font-family: Caveat, cursive; font-weight: 700; font-size: 1.5rem; color: var(--blue); }

/* ---------- Paper plane (contact) ---------- */
.plane-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.plane-btn { display: inline-flex; align-items: center; gap: 8px; font: 700 1rem Inter, system-ui, sans-serif; color: var(--blue); background: var(--card); border: 1.5px dashed var(--blue); border-radius: 12px; padding: 11px 16px; cursor: pointer; }
.plane-btn:hover { background: var(--blue-soft); }
.plane-msg { font-family: Caveat, cursive; font-weight: 700; font-size: 1.45rem; color: var(--green); opacity: 0; transform: translateY(6px); transition: opacity .4s ease, transform .4s ease; }
.plane-msg.show { opacity: 1; transform: none; }
.flying-plane { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; width: 44px; height: 44px; margin: -22px 0 0 -22px; }
.plane-trail { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 49; pointer-events: none; overflow: visible; }

@media (max-width: 560px) {
  .corner { width: 76px; height: 76px; }
  .corner span { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .flipper { transition: none; } }
/* Keep the hero doodle clear of the page corner. */
.flip .doodle { bottom: 116px; }
/* The flipping page and the flying plane shouldn't cause sideways scrolling. */
html, body { overflow-x: clip; }
/* Room for the "turn back" corner under the to-do list. */
.sheet.back { padding-bottom: 104px; }
