/* 6000 thoughts — the website. Paper and ink, like the app: an egg-white desk, tilted sheets,
   two inks (yours and theirs), handwriting for the words that matter, and outlines drawn by hand. */

/* Caveat is the app's everyday hand (OFL). A variable font: one file, every weight. */
@font-face { font-family: "Caveat"; src: url("/fonts/Caveat.ttf") format("truetype"); font-weight: 400 700; font-display: swap; }

:root {
  --desk: #F7F2E7;
  --desk-deep: #EDE7D9;
  --paper: #FDFCF8;
  --paper-back: #F4EFE3;
  --mine: #6B35B5;        /* violet: your ink */
  --mine-soft: #5F4A93;
  --theirs: #B3263E;      /* red: their ink */
  --text: #2A2735;
  --text-soft: #5E596B;
  --rule: rgba(95, 74, 147, 0.18);
  --shadow: rgba(30, 30, 70, 0.10);
  --hand: "Caveat", "Bradley Hand", cursive;
  --hand-2: "Caveat", "Bradley Hand", cursive;
  --serif: "Iowan Old Style", "Palatino Linotype", ui-serif, "New York", Georgia, serif;
  color-scheme: light dark;
}

/* Night: the desk goes dark, the paper doesn't. Ink on paper always stays ink. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --desk: #161A33; --desk-deep: #10142B;
    --mine: #CDA8FF; --mine-soft: #B8A6E8; --theirs: #FF9AAB;
    --text: #E9E6F5; --text-soft: #B3AECB; --rule: rgba(205, 168, 255, 0.2); --shadow: rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --desk: #161A33; --desk-deep: #10142B;
  --mine: #CDA8FF; --mine-soft: #B8A6E8; --theirs: #FF9AAB;
  --text: #E9E6F5; --text-soft: #B3AECB; --rule: rgba(205, 168, 255, 0.2); --shadow: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--desk);
  /* a little grain, like the desk in the app */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--mine); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px dashed var(--mine); outline-offset: 4px; border-radius: 4px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ---------- top and bottom ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--mine); }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 3px 10px var(--shadow); }
.brand span { font-family: var(--hand); font-size: 28px; line-height: 1; }
.top nav { display: flex; gap: 22px; }
.top nav a { font-family: var(--hand); font-size: 23px; color: var(--mine-soft); text-decoration: none; position: relative; }
.top nav a[aria-current="page"], .top nav a:hover { color: var(--mine); }
.top nav a[aria-current="page"]::after, .top nav a:hover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C14 2 26 9 40 5 C54 2 66 9 80 5 C94 2 106 8 118 4' fill='none' stroke='%236B35B5' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.foot { padding: 56px 0 40px; color: var(--text-soft); font-size: 15px; }
.foot .row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between; border-top: 1px dashed var(--rule); padding-top: 22px; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--text-soft); }
.foot .hand { font-family: var(--hand); font-size: 22px; color: var(--mine-soft); }

/* ---------- paper ---------- */
/* A sheet: torn-straight edges (never a rounded box), a soft shadow, a slight tilt. */
.sheet-wrap { filter: drop-shadow(0 12px 18px var(--shadow)) drop-shadow(0 2px 3px var(--shadow)); }
.sheet {
  background: var(--paper);
  color: #2A2735;
  clip-path: polygon(0.5% 1.1%, 24% 0.4%, 51% 1%, 77% 0.2%, 99.5% 0.8%, 99.1% 27%, 99.8% 52%, 99.3% 78%, 99.7% 99.4%, 73% 99.8%, 48% 99.1%, 22% 99.9%, 0.3% 99.2%, 0.8% 74%, 0.1% 49%, 0.7% 23%);
  position: relative;
}
.sheet::before { /* the plane's folds, as faint creases */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(60,50,40,.06) 50%, transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(50% - .5px), rgba(60,50,40,.05) 50%, transparent calc(50% + .5px)),
    linear-gradient(135deg, transparent calc(50% - .5px), rgba(60,50,40,.035) 50%, transparent calc(50% + .5px));
}
.sheet.linen { background: #F7F1E4; }
.sheet.grid {
  background-color: #FBF9F3;
  background-image: linear-gradient(rgba(107,53,181,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(107,53,181,.07) 1px, transparent 1px);
  background-size: 18px 18px;
}
.ink-mine { color: #6B35B5; }
.ink-theirs { color: #B3263E; }
.hand { font-family: var(--hand); font-weight: normal; }

/* ---------- hand-drawn outlines ---------- */
.loop { position: relative; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.loop svg { position: absolute; inset: -8px -14px; width: calc(100% + 28px); height: calc(100% + 16px); overflow: visible; pointer-events: none; }
.loop path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s cubic-bezier(.6,.1,.3,1) forwards; animation-delay: var(--d, .4s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.wavy { display: inline-block; position: relative; white-space: nowrap; }
.wavy svg { position: absolute; left: -2%; width: 104%; bottom: -0.32em; height: .45em; overflow: visible; }
.wavy path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.08fr .92fr; gap: 40px; align-items: center; padding: 30px 0 70px; position: relative; }
.kicker { font-family: var(--hand-2); color: var(--mine-soft); font-size: 24px; margin: 0 0 6px; }
.hero h1 { font-family: var(--hand); font-weight: normal; color: var(--mine); font-size: clamp(54px, 7.6vw, 96px); line-height: .95; margin: 0 0 22px; letter-spacing: -.5px; font-weight: 500; }
.hero h1 .ink-theirs { color: var(--theirs); }
.lede { font-size: 21px; max-width: 30ch; color: var(--text); margin: 0 0 34px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 34px 40px; }
.cta { font-family: var(--hand); font-size: 28px; color: var(--mine); padding: 10px 30px; line-height: 1; }
.cta small { font-family: var(--serif); font-size: 14px; color: var(--text-soft); display: block; margin-top: 6px; letter-spacing: .2px; }
.quiet { font-family: var(--hand); font-size: 23px; color: var(--mine-soft); }


/* the plane that flies across the top of the page, once */
.flight { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.flight .trail { fill: none; stroke: var(--theirs); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 0.006 0.018; opacity: .55; }
.flight .plane { offset-path: path("M -40 380 C 180 300 260 60 560 110 S 900 40 1180 -40"); offset-rotate: auto; animation: fly 2.6s cubic-bezier(.45,.05,.35,1) .5s both; }
@keyframes fly { from { offset-distance: 0%; opacity: 1; } 92% { opacity: 1; } to { offset-distance: 100%; opacity: 0; } }

section.band { padding: 70px 0; }
.section-title { font-family: var(--hand); font-weight: normal; color: var(--mine); font-size: clamp(40px, 5.2vw, 60px); line-height: 1; margin: 0 0 14px; font-weight: 500; }
.section-lede { color: var(--text-soft); max-width: 46ch; margin: 0 0 44px; font-size: 19px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.step .sheet { padding: 26px 26px 30px; min-height: 260px; }
.step:nth-child(1) { transform: rotate(-1.6deg); }
.step:nth-child(2) { transform: rotate(1.1deg) translateY(18px); }
.step:nth-child(3) { transform: rotate(-.6deg); }
.step .num { font-family: var(--hand-2); color: #8C86A0; font-size: 18px; }
.step h3 { font-family: var(--hand); font-weight: 500; font-size: 38px; line-height: 1; margin: 4px 0 12px; color: #6B35B5; }
.step p { margin: 0; font-size: 17px; color: #4A4656; }
.step .doodle { height: 54px; margin-bottom: 10px; color: #6B35B5; }
.step .doodle path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tally { text-align: center; padding: 90px 0; }
.tally p { font-family: var(--hand); font-size: clamp(34px, 4.6vw, 54px); color: var(--mine-soft); margin: 0; line-height: 1.1; }
.tally .wavy { color: var(--mine); }
.tally small { display: block; font-family: var(--serif); font-size: 17px; color: var(--text-soft); margin-top: 18px; }

.widgets { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 54px; align-items: center; }

.private { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: center; }
.envelope .sheet { padding: 34px 34px 38px; transform: rotate(1.2deg); }
.envelope .sheet p { margin: 0 0 12px; font-size: 17px; color: #4A4656; }
.envelope .cipher { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: #8C86A0; word-break: break-all; line-height: 1.5; margin: 14px 0 0; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 14px 0 14px 34px; position: relative; border-bottom: 1px dashed var(--rule); }
.facts li::before { content: ""; position: absolute; left: 2px; top: 22px; width: 18px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 14'%3E%3Cpath d='M2 7 C5 9 6 11 8 12 C11 7 14 4 18 2' fill='none' stroke='%236B35B5' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .facts li::before { filter: invert(1) hue-rotate(180deg) brightness(1.3); } }

.closing { text-align: center; padding: 80px 0 30px; }
.closing h2 { font-family: var(--hand); font-weight: 500; font-size: clamp(48px, 6vw, 76px); color: var(--mine); margin: 0 0 30px; line-height: .9; }

/* ---------- the desk: the pile, the postmark, a widget ---------- */
.desk { position: relative; justify-self: center; width: min(460px, 100%); aspect-ratio: 460 / 500; }
.desk .sheet-wrap { position: absolute; }
.pile-b1 { inset: 12% 6% 10% 12%; transform: rotate(5deg); }
.pile-b2 { inset: 10% 10% 12% 8%; transform: rotate(-3.5deg); }
.pile-b1 .sheet, .pile-b2 .sheet, .pile-top .sheet { width: 100%; height: 100%; }
.pile-top { inset: 9% 8% 13% 9%; transform: rotate(-1deg); }
.pile-note { display: flex; flex-direction: column; justify-content: center; padding: 12% 12% 14%; background: #FBF8F1; }
.note-text { font-family: var(--hand); color: #B3263E; font-size: clamp(27px, 6.6vw, 36px); line-height: 1.12; margin: 0; }
.note-sig { font-family: var(--hand); color: #B3263E; font-size: clamp(20px, 4.6vw, 25px); text-align: right; margin: 18px 0 0; }

/* The countdown: a postmark pressed on the desk in their ink, the day you meet round the top. */
.stamp { position: absolute; right: 2%; top: 1%; width: 21%; transform: rotate(-9deg); color: var(--theirs); opacity: .9; overflow: visible; }
.stamp .ring { fill: none; stroke: currentColor; }
.stamp text { fill: currentColor; font: 700 8.6px ui-rounded, "SF Pro Rounded", system-ui, sans-serif; letter-spacing: 1.2px; }
.stamp .num { font-size: 27px; font-weight: 800; letter-spacing: -.5px; }
.stamp circle:not(.ring) { fill: currentColor; }
.desk .hero-widget { position: absolute; left: -3%; bottom: 0; width: 38%; transform: rotate(-5deg); }

/* ---------- widgets, drawn the way the app draws them ---------- */
.widget { container-type: inline-size; position: relative; width: 100%; min-height: 0; overflow: hidden; background: #F3F0EB; color: #B3263E; font-family: var(--hand);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 16px 34px -12px rgba(20,24,60,.38), 0 2px 6px rgba(20,24,60,.12); display: flex; flex-direction: column; }
.widget p { margin: 0; }
.widget .w-status { color: #5F4A93; line-height: 1.05; }
.widget .w-body { flex: 1; display: flex; align-items: center; }
.widget .w-plane { flex: none; }
.widget .w-plane path { fill: #FDFCF8; stroke: #B3263E; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.widget.small { aspect-ratio: 1; border-radius: 13.5%; }
.widget.small .w-status { padding: 11cqw 11cqw 0; }
.widget.small .w-body { padding: 0 11cqw 10cqw; }
.widget.small .w-status { font-size: 12.5cqw; }
.widget.small .w-body { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 5cqw; font-size: 17cqw; line-height: 1; }
.widget.small .w-plane { width: 26cqw; }
.widget.small.short .w-body { align-items: center; justify-content: center; font-size: 22cqw; }
.widget.medium { aspect-ratio: 338 / 158; border-radius: 7% / 15%; }
.widget.medium .w-status { padding: 5.2cqw 6cqw 0; }
.widget.medium .w-body { padding: 0 6cqw 4.6cqw 7cqw; }
.widget.medium .w-sig { padding: 0 6cqw 4.6cqw; }
.widget.medium .w-status { font-size: 6cqw; }
.widget.medium .w-body { gap: 7cqw; font-size: 9cqw; }
.widget.medium .w-plane { width: 10cqw; }
.widget.medium.note .w-body { font-size: 6.9cqw; line-height: 1.12; align-items: flex-start; padding-top: 2.4cqw; padding-bottom: 0; }
.widget .w-sig { text-align: right; font-size: 5.6cqw; line-height: 1; }

.homescreen { position: relative; border-radius: 40px; padding: 26px 22px 30px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 420px; justify-self: center; width: 100%;
  background: radial-gradient(120% 80% at 10% 0%, #CFE3EE 0%, transparent 55%), linear-gradient(165deg, #A9C8DD 0%, #5574B8 48%, #24316F 100%);
  box-shadow: 0 30px 60px -24px rgba(20,24,60,.45); transform: rotate(-1.2deg); }
.home-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.icons { display: grid; grid-template-columns: 1fr 1fr; gap: 18%; padding: 6%; }
.icons i { aspect-ratio: 1; border-radius: 26%; background: rgba(255,255,255,.28); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

/* ---------- the legal and help pages: one long sheet on the desk ---------- */
.doc { padding: 10px 0 30px; }
.doc .sheet-wrap { max-width: 780px; margin: 0 auto; }
.doc .sheet { padding: clamp(28px, 6vw, 64px) clamp(22px, 6vw, 72px) clamp(34px, 6vw, 70px); clip-path: polygon(3px 4px, 30% 1px, 62% 5px, calc(100% - 2px) 0, calc(100% - 4px) 33%, 100% 66%, calc(100% - 3px) calc(100% - 2px), 64% 100%, 31% calc(100% - 4px), 1px 100%, 4px 66%, 0 33%); }
.doc .sheet::before { display: none; }
.doc h1 { font-family: var(--hand); font-weight: 500; color: #6B35B5; font-size: clamp(46px, 7vw, 66px); line-height: 1; margin: 0 0 8px; }
.doc .meta { color: #8C86A0; font-size: 15px; margin: 0 0 32px; }
.doc .summary { font-size: 19px; color: #3B3746; padding: 4px 0 22px; border-bottom: 1px dashed rgba(95,74,147,.25); margin-bottom: 8px; }
.doc h2 { font-family: var(--serif); font-size: 21px; color: #2A2735; margin: 38px 0 8px; font-weight: 700; letter-spacing: -.1px; }
.doc h2 .n { font-family: var(--hand); font-weight: normal; color: #B3263E; font-size: 25px; margin-right: 8px; }
.doc h3 { font-size: 17px; margin: 22px 0 4px; color: #2A2735; }
.doc p, .doc li { color: #3B3746; font-size: 17px; }
.doc ul { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc a { color: #6B35B5; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 14px 0 6px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 10px 10px 0; border-bottom: 1px dashed rgba(95,74,147,.22); color: #3B3746; }
.doc th { font-weight: 700; color: #2A2735; }
.doc .table-scroll { overflow-x: auto; }
.doc .note { font-family: var(--hand); color: #B3263E; font-size: 22px; line-height: 1.1; margin: 26px 0 0; }
.doc details { border-bottom: 1px dashed rgba(95,74,147,.22); padding: 14px 0; }
.doc summary { cursor: pointer; font-weight: 700; color: #2A2735; list-style: none; position: relative; padding-right: 30px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; position: absolute; right: 4px; top: -4px; font-family: var(--hand); font-size: 30px; color: #6B35B5; transition: transform .2s; }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p { margin: 10px 0 2px; }
.contact-card { margin: 34px 0 4px; padding: 22px 0 0; border-top: 1px dashed rgba(95,74,147,.25); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 10px; gap: 70px; }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .step:nth-child(2) { transform: rotate(1.1deg); }
  .step .sheet { min-height: 0; }
  .widgets, .private { grid-template-columns: 1fr; gap: 40px; }
  section.band { padding: 50px 0; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .top nav { gap: 14px; }
  .top nav a { font-size: 23px; }
  .brand span { font-size: 27px; }
  .lede { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .draw path { animation: none; stroke-dashoffset: 0; }
  .flight { display: none; }
}
