/* AO Signet – landing page (v2): "the writing desk".
   Oat-coloured cotton paper, a sage leather blotter, iron-gall ink that goes on blue
   and dries blue-black, an oxblood fountain pen and a teacher's vermilion pencil for
   the handwritten notes. Loaded on the sign-in page only; the app keeps its seal. */
@font-face { font-family: 'Fraunces'; src: url('../fonts/Fraunces-VariableFont.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/Fraunces-Italic-VariableFont.ttf') format('truetype'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('../fonts/Caveat-VariableFont.ttf') format('truetype'); font-weight: 400 700; font-display: swap; }

body.page-signin {
  --oat: #efe8dc; --oat-2: #e6ddcd;
  --bg: var(--oat); --bg-2: var(--oat-2); --paper: #fbf8f1; --card: #fffdf8;
  --ink: #23222a; --ink-2: #4f4b47; --ink-3: #6e6861;
  --iron: #2b3f9e;          /* fresh iron-gall ink */
  --iron-dry: #1d1b3a;
  --vermilion: #c2412d;     /* the red pencil */
  --sage: #6f8a6b; --sage-deep: #4f6a4d;
  --oxblood: #7a2834;
  --gold-text: var(--iron); --gold: var(--iron); --gold-hi: var(--iron);
  --line: rgba(35, 34, 42, .13); --line-2: rgba(35, 34, 42, .24);
  --focus: #2b3f9e;
  --shadow: 0 1px 1px rgba(60, 45, 25, .06), 0 10px 26px -14px rgba(60, 45, 25, .35);
  --shadow-lg: 0 2px 0 rgba(60, 45, 25, .04), 0 28px 60px -32px rgba(60, 45, 25, .55);
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;
  --fibre: 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='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .27 0 0 0 0 .2 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background: var(--fibre), var(--oat);
  color: var(--ink);
}
[data-theme="dark"] body.page-signin {
  --bg: #121a17; --bg-2: #18221e; --paper: #1d2823; --card: #19231f;
  --ink: #efe7d8; --ink-2: #cbc2b2; --ink-3: #a59d8f;
  --iron: #a9b8ff; --vermilion: #ff8a6b;
  --gold-text: var(--iron); --gold: var(--iron); --gold-hi: var(--iron);
  --line: rgba(239, 231, 216, .14); --line-2: rgba(239, 231, 216, .26);
  --focus: #a9b8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 30px -12px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, .85);
  background: var(--fibre), radial-gradient(1200px 700px at 30% 10%, #1b2822 0, #121a17 60%, #0e1412 100%);
}

/* ---- letterhead: just ink on paper ---- */
.page-signin .letterhead { background: transparent; color: var(--ink); box-shadow: none; position: relative; }
.page-signin .letterhead::after { content: ''; position: absolute; left: 22px; right: 22px; bottom: 0; height: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 6' preserveAspectRatio='none'%3E%3Cpath d='M1 3.4C60 2.2 120 4.4 200 3.1S330 2 399 3.6' fill='none' stroke='%2323222a' stroke-opacity='.35' stroke-width='1.2'/%3E%3C/svg%3E") center / 100% 100% no-repeat; max-width: 1180px; margin: 0 auto; }
[data-theme="dark"] .page-signin .letterhead::after { filter: invert(1); opacity: .7; }
.page-signin .brand-word { font-family: var(--display); font-weight: 600; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 48; letter-spacing: -.01em; font-size: 1.65rem; }
.page-signin .brand-word em { color: var(--iron); font-weight: 400; }
.nib-mark { width: 34px; height: 34px; flex: none; }
.nib-mark .nm-nib { fill: var(--ink); }
.nib-mark .nm-slit { stroke: var(--bg); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.nib-mark .nm-hole { fill: var(--bg); }
.nib-mark .nm-drop { fill: var(--iron); }
.brand:hover .brand-nib { transform: rotate(-12deg) translateY(-1px); }
.brand-nib { transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% 85%; }
.mini-nib { width: 30px; height: 30px; }

/* sun/moon toggle in paper and ink */
.page-signin .tt-track { background: linear-gradient(180deg, #d9cfbd, #ece4d4); box-shadow: inset 0 1px 3px rgba(60, 45, 25, .35), 0 0 0 1px rgba(35, 34, 42, .18); }
.page-signin .tt-knob { background: radial-gradient(circle at 36% 30%, #fffdf6 0, #f1e8d6 60%, #ddd0b8 100%); color: var(--vermilion); box-shadow: 0 1px 3px rgba(60, 45, 25, .45); }
[data-theme="dark"] .page-signin .tt-track { background: linear-gradient(180deg, #24312b, #2d3c35); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6), 0 0 0 1px rgba(239, 231, 216, .18); }
[data-theme="dark"] .page-signin .tt-knob { background: radial-gradient(circle at 36% 30%, #f7f1e4 0, #e3d8c2 70%); color: #2b3f9e; }

/* ---- type ---- */
.page-signin h1, .page-signin h2 { font-family: var(--display); font-variation-settings: 'SOFT' 50, 'opsz' 96; font-weight: 560; letter-spacing: -.015em; }
.page-signin main { max-width: 1240px; padding-top: 26px; }
.signin-v2 { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 46px; }
.hand-note { font-family: var(--hand); font-size: 1.45rem; color: var(--vermilion); margin: 0 0 4px; transform: rotate(-1.2deg); transform-origin: left; }
.v2-title { font-size: clamp(2.6rem, 5vw, 4.1rem); line-height: .98; margin: 0 0 .3em; text-wrap: balance; }
.v2-you { position: relative; font-style: italic; font-weight: 400; color: var(--iron); white-space: nowrap; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 96; }
.v2-underline { position: absolute; left: -4%; right: -6%; width: 110%; bottom: -.14em; height: .28em; overflow: visible; }
.v2-underline path { fill: none; stroke: var(--vermilion); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: v2ink 1s .35s cubic-bezier(.6, 0, .3, 1) forwards; }
@keyframes v2ink { to { stroke-dashoffset: 0; } }
.v2-lede { font-size: 1.12rem; color: var(--ink-2); max-width: 50ch; margin-bottom: 18px; }

/* ---- the desk ---- */
.hero { margin: 0; position: relative; }
.blotter { position: relative; aspect-ratio: 8 / 5; border-radius: 10px; container-type: inline-size;
  background: var(--fibre), radial-gradient(120% 90% at 30% 20%, #87a183 0, var(--sage) 45%, var(--sage-deep) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), inset 0 2px 0 rgba(255, 255, 255, .18), 0 24px 44px -26px rgba(40, 50, 30, .75); overflow: hidden; }
.blotter::before { content: ''; position: absolute; inset: 1.6cqw; border: 1px dashed rgba(255, 250, 235, .35); border-radius: 6px; pointer-events: none; }
.blotter::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(135deg, rgba(48, 30, 18, .55) 0 7cqw, transparent 7cqw) top left / 50% 50% no-repeat, linear-gradient(225deg, rgba(48, 30, 18, .55) 0 7cqw, transparent 7cqw) top right / 50% 50% no-repeat, linear-gradient(45deg, rgba(48, 30, 18, .55) 0 7cqw, transparent 7cqw) bottom left / 50% 50% no-repeat, linear-gradient(315deg, rgba(48, 30, 18, .55) 0 7cqw, transparent 7cqw) bottom right / 50% 50% no-repeat; }
[data-theme="dark"] .blotter { background: var(--fibre), radial-gradient(120% 90% at 30% 20%, #3f5541 0, #2c3e2f 50%, #1d2a20 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4), 0 30px 60px -30px rgba(0, 0, 0, .9); }
.sheet { position: absolute; left: 6.5%; top: 6.8%; width: 87%; height: 87.2%; z-index: 1; color: #2a2620;
  background: var(--fibre), linear-gradient(180deg, #fdfaf2, #f6efe0); border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 .6cqw 1.6cqw -.4cqw rgba(30, 30, 20, .45), 0 0 0 1px rgba(80, 60, 30, .08); }
[data-theme="dark"] .sheet { background: var(--fibre), linear-gradient(180deg, #ece3d0, #e2d7c0); }
.sheet-kicker { position: absolute; left: 8%; top: 7%; margin: 0; font: 600 1.55cqw/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: #8a7f6c; }
.sheet-copy { position: absolute; left: 8%; right: 30%; top: 13.5%; margin: 0; font: 400 2.05cqw/1.45 var(--display); color: #3b362e; }
.sheet-faint { top: 29%; color: #7d7465; font-style: italic; }
.sheet-line { position: absolute; left: 13%; right: 10%; top: 71.5%; height: 1px; background: rgba(42, 38, 32, .55); }
.sheet-x { position: absolute; left: 9.4%; top: 64%; font: 400 3.4cqw/1 var(--display); color: rgba(42, 38, 32, .7); }
.sheet-label { position: absolute; left: 13%; top: 84%; font: 600 1.3cqw/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: #8a7f6c; }
.sheet-date { position: absolute; right: 7%; top: 84%; font: 600 1.3cqw/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: #8a7f6c; display: flex; gap: .8cqw; align-items: end; }
.sheet-date i { display: block; width: 12cqw; height: 1px; background: rgba(42, 38, 32, .35); }
.sheet-note { position: absolute; left: 1.6%; top: 47%; font: 600 2.7cqw/1 var(--hand); color: var(--vermilion); transform: rotate(-9deg); }
.sheet-arrow { position: absolute; left: 4.2%; top: 53%; width: 4.6cqw; height: 4.6cqw; transform: rotate(-4deg); overflow: visible; }
.sheet-arrow path { fill: none; stroke: var(--vermilion); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .sheet-note { color: #c2412d; }
[data-theme="dark"] .sheet-arrow path { stroke: #c2412d; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; display: block; pointer-events: none; }

.hero-caps { position: relative; min-height: 2.2em; margin-top: 12px; font: 600 1.6rem/1.1 var(--hand); }
.cap { position: absolute; left: 4px; top: 0; transition: none; }
.cap-1 { color: var(--ink-3); font-weight: 500; }
.cap-2 { color: var(--vermilion); opacity: 0; }
.hero-tools { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 2px; }
.hero-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font: 600 .92rem/1 var(--sans); cursor: pointer; touch-action: manipulation; }
.hero-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.hero-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-toggle .ht-play { display: none; fill: currentColor; stroke-width: 1.4; }
.hero-toggle[aria-pressed="true"] .ht-play { display: inline; }
.hero-toggle[aria-pressed="true"] .ht-pause { display: none; }
.hero-gif { font-weight: 600; color: var(--iron); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.hero-gif::before { content: '↓ '; }

/* ---- the sign-in card: a good index card ---- */
.page-signin .signin-card { border-radius: 6px; padding: 34px 32px 28px; border-color: var(--line); background: var(--fibre), var(--card); }
.page-signin .signin-card::before { inset: 0 0 auto 0; height: 0; border: 0; border-top: 2px solid var(--vermilion); border-radius: 6px 6px 0 0; opacity: .85; }
.page-signin .signin-card h2 { font-size: 2.05rem; }
.page-signin .btn-provider { border-radius: 10px; background: transparent; }
.page-signin .btn-provider:hover { border-color: var(--iron); }
.page-signin .btn-provider .ic.pv { stroke: var(--ink-2); }
.page-signin .btn-gold { color: #fbf8f1; background: var(--iron); border-color: var(--iron); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 8px 18px -10px rgba(43, 63, 158, .9); }
.page-signin .btn-gold:hover { background: #22337f; box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 12px 22px -10px rgba(43, 63, 158, .9); }
[data-theme="dark"] .page-signin .btn-gold { color: #14152a; background: #b9c6ff; border-color: #b9c6ff; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .9); }
[data-theme="dark"] .page-signin .btn-gold:hover { background: #d0d9ff; }
.page-signin .magic { border-radius: 10px; background: transparent; }
.page-signin .magic summary { color: var(--iron); }
.page-signin .pill-muted { background: rgba(35, 34, 42, .07); color: var(--ink-2); }
[data-theme="dark"] .page-signin .pill-muted { background: rgba(239, 231, 216, .1); }
.page-signin .made { font-family: var(--hand); font-size: 1.3rem; letter-spacing: 0; color: var(--ink-2); }
.page-signin .colophon { border-top-style: dashed; }

@media (max-width: 900px) {
  .signin-v2 { grid-template-columns: 1fr; gap: 26px; }
  .hero { max-width: 640px; }
}
@media (max-width: 700px) {
  .page-signin main { padding-top: 14px; }
  .hand-note { font-size: 1.25rem; }
  .v2-title { font-size: clamp(2.3rem, 11vw, 3rem); }
  .v2-lede { font-size: 1.04rem; }
  .blotter { border-radius: 8px; }
  .hero-caps { font-size: 1.35rem; min-height: 2.4em; }
  .page-signin .signin-card { padding: 26px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .v2-underline path { stroke-dashoffset: 0; animation: none; }
}
