/* Plandeck, the room. "Wet ink, dry ink": cool calendar paper, one ink for every word and control, and the
   project hues as the only colour. A plan is wet ink, saturated and still changeable; the past is the same hue
   settled into the paper. The one red is the present. Type is the app's own: Hanken Grotesk, JetBrains Mono for
   clock times. */

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('/assets/worlds/fonts/hanken-grotesk-vf-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/assets/worlds/fonts/jetbrains-mono-vf-latin.woff2') format('woff2');
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #f7f8fb;
  --sheet: #ffffff;
  --ink: #16161a;
  --ink-2: #5a5a63;
  --ink-3: #8b8b95;
  --faint: #a9a9b2;
  --border: #ececef;
  --hair: rgb(22 22 26 / 0.07);
  --grid: rgb(22 22 26 / 0.045);
  --now: #e5484d;
  --amber: #b6601a;
  --violet: #6b53d6; --violet-d: #3f2f94;
  --blue: #3b78d8; --blue-d: #1f4a94;
  --amb: #a8691a; --amb-d: #6a3f0c;
  --gutter: clamp(20px, 5vw, 80px);
  --max: 1280px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hour: 46px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.55;
  font-weight: 400;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid rgb(22 22 26 / 0.55); outline-offset: 2px; border-radius: 8px; }

h1, h2, h3 { font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 4.4vw, 3.9rem); line-height: 1.02; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.55rem, 2.5vw, 2.25rem); line-height: 1.12; letter-spacing: -0.03em; max-width: 17em; }
h3 { font-size: 1.1rem; line-height: 1.3; letter-spacing: -0.012em; }
p { max-width: 58ch; text-wrap: pretty; }
.wrap { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; }

/* ---------- Bar ---------- */
.pd-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; min-height: 68px;
  font-size: 15.5px; font-weight: 500;
}
.pd-bar .world-exit { justify-self: start; color: var(--ink-2); }
.pd-bar .world-lang { justify-self: end; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: flex-end; color: var(--ink-2); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; }
@media (hover: hover) { .pd-bar .world-exit:hover, .pd-bar .world-lang:hover { color: var(--ink); } }
.pd-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16.5px; letter-spacing: -0.012em; }
.pd-mark { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.pd-mark i { width: 8px; height: 8px; border-radius: 2.5px; background: var(--ink); }
.pd-mark i:nth-child(2) { opacity: 0.55; }
.pd-mark i:nth-child(3) { opacity: 0.28; }

/* ---------- Hero ---------- */
.pd-hero { padding: clamp(36px, 8vh, 84px) 0 clamp(64px, 11vh, 120px); }
.pd-hero__top { display: grid; justify-items: center; text-align: center; gap: 20px; }
.pd-lede { font-size: clamp(1.06rem, 1.25vw, 1.2rem); line-height: 1.55; color: var(--ink-2); max-width: 34em; }
.pd-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.pd-hero .pd-act { justify-content: center; margin-top: 6px; }
.pd-status { display: inline-flex; align-items: flex-start; gap: 9px; font-size: 15px; line-height: 1.45; color: var(--ink-2); text-align: left; }
.pd-status::before { content: ''; width: 7px; height: 7px; margin-top: 0.5em; border-radius: 50%; background: var(--amber); flex: none; }

.pd-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px;
  background: var(--ink); color: #fff; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 16px; letter-spacing: -0.005em;
  transition: transform 120ms var(--ease-out), background-color 120ms ease;
}
.pd-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .pd-btn:hover { background: #2a2a30; } }
.pd-btn:focus-visible { outline-offset: 3px; border-radius: 999px; }

/* ---------- The deck: a list and a week. One task makes the trip. ---------- */
.pd-deck {
  position: relative; display: grid; grid-template-columns: 250px minmax(0, 1fr);
  max-width: 1040px; margin: clamp(40px, 7vh, 72px) auto 0;
  background: var(--sheet); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 1px 2px rgb(22 22 26 / 0.04), 0 18px 48px -18px rgb(22 22 26 / 0.16);
  overflow: clip;
}
.pd-side { position: relative; z-index: 2; background: var(--paper); border-right: 1px solid var(--border); padding: 22px 16px; min-width: 0; }
.pd-proj { display: flex; align-items: center; gap: 9px; padding: 0 10px 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.006em; }
.pd-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--violet); }
.pd-tasks { display: grid; gap: 2px; }
.pd-task { position: relative; font-size: 14px; line-height: 1.35; }
.pd-task__in { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px 8px 8px; }
.pd-grip { width: 6px; height: 12px; flex: none; background: radial-gradient(circle, var(--faint) 0.9px, transparent 1.3px) 0 0 / 3px 4px; }
.pd-task[data-from] .pd-task__in { opacity: 0.3; }
.pd-ghost {
  position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 9px; width: max-content; max-width: 100%; min-height: 38px; padding: 8px 14px 8px 11px;
  border-radius: 11px; background: #fff; box-shadow: 0 0 0 1px var(--border), 0 12px 24px -6px rgb(22 22 26 / 0.28);
  white-space: nowrap; opacity: 0; pointer-events: none;
}

.pd-cal { position: relative; min-width: 0; padding: 0 10px 10px; }
.pd-days { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); align-items: center; height: 46px; border-bottom: 1px solid var(--hair); }
.pd-days span { text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.pd-days span b { font-family: var(--mono); font-weight: 400; font-size: 11px; margin-left: 5px; }
.pd-days span.is-today { color: var(--ink); }
.pd-grid {
  position: relative; height: calc(var(--rows) * var(--hour));
  display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  background: repeating-linear-gradient(180deg, var(--grid) 0 1px, transparent 1px var(--hour));
}
.pd-col { position: relative; border-left: 1px solid var(--hair); min-width: 0; }
.pd-col:first-child { border-left: 0; }
.pd-col.is-today { background: rgb(22 22 26 / 0.025); }

/* Blocks. A task block has a dry layer and a wet layer; the wet one is clipped from the top down to the now-line
   (--cut), so a block the present has passed is dry, and the one it is crossing is both. */
.pd-block {
  position: absolute; left: 3px; right: 3px; top: calc(var(--s) * var(--hour) + 1px); height: calc(var(--d) * var(--hour) - 2px);
  border-radius: 8px; overflow: hidden; font-size: 12.5px; line-height: 16px;
}
.pd-block b { display: block; padding: 5px 8px; font-weight: 500; overflow: hidden; overflow-wrap: anywhere; max-height: 100%; }
.pd-block--event { background: rgb(22 22 26 / 0.05); box-shadow: inset 0 0 0 1px rgb(22 22 26 / 0.07); color: var(--ink-2); }
.pd-block--event.is-past { background: rgb(22 22 26 / 0.03); color: var(--ink-3); }
.pd-block--task { background: color-mix(in srgb, var(--c) 11%, #fff); color: var(--cd); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--c) 55%, #fff); }
.pd-block--task > b { padding-left: 10px; }
.pd-wet { position: absolute; inset: 0; background: var(--c); color: #fff; clip-path: inset(var(--cut, 0%) 0 0 0); border-radius: inherit; }
.pd-wet b { font-weight: 600; }

.pd-now { --dd: var(--day); position: absolute; left: 0; right: 0; top: calc(var(--t) * var(--hour)); height: 0; z-index: 1; }
.pd-now__all { position: absolute; left: 0; right: 0; top: -0.75px; height: 1.5px; background: rgb(229 72 77 / 0.22); }
.pd-now__today { position: absolute; top: -0.75px; height: 1.5px; background: var(--now); left: calc(var(--dd) * 100% / var(--n, 5)); width: calc(100% / var(--n, 5)); }
.pd-now__today::before { content: ''; position: absolute; left: -3.5px; top: -2.75px; width: 7px; height: 7px; border-radius: 50%; background: var(--now); }

/* The trip, one slow loop. Without it (no script, reduced motion) the picture rests on its last frame. */
.pd-deck.is-live .pd-task[data-from] .pd-task__in { animation: pd-leave 8s linear infinite; }
.pd-deck.is-live .pd-ghost { animation: pd-carry 8s linear infinite; }
.pd-deck.is-live .pd-block[data-land] { animation: pd-land 8s linear infinite; }
.pd-deck.is-paused *, .pd-deck.is-hidden * { animation-play-state: paused !important; }
@keyframes pd-leave { 0%, 12% { opacity: 1; } 17%, 93% { opacity: 0.3; } 100% { opacity: 1; } }
@keyframes pd-carry {
  0%, 12% { opacity: 0; transform: translate3d(0, 0, 0) scale(1); }
  17% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.03); animation-timing-function: cubic-bezier(0.65, 0, 0.25, 1); }
  33% { opacity: 1; transform: translate3d(var(--dx, 0), var(--dy, 0), 0) scale(1.03); }
  37%, 100% { opacity: 0; transform: translate3d(var(--dx, 0), var(--dy, 0), 0) scale(1); }
}
@keyframes pd-land {
  0%, 32% { opacity: 0; transform: scale(0.96); animation-timing-function: var(--ease-out); }
  38%, 93% { opacity: 1; transform: none; }
  98%, 100% { opacity: 0; transform: none; }
}

/* ---------- Two beats ---------- */
.pd-beats { background: var(--sheet); border-block: 1px solid var(--border); }
.pd-beat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 96px); align-items: start; padding: clamp(56px, 10vh, 104px) 0; }
.pd-beat + .pd-beat { border-top: 1px solid var(--hair); }
.pd-beat p { font-size: clamp(1.04rem, 1.2vw, 1.14rem); line-height: 1.6; color: var(--ink-2); padding-top: 0.3em; }
/* one block, with the present halfway through it */
.pd-ink { margin-top: 28px; max-width: 30em; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px 10px; font-size: 13.5px; line-height: 1.3; color: var(--ink-2); }
.pd-ink__bar { grid-column: 1 / -1; position: relative; height: 44px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--violet) 12%, #fff) 50%, var(--violet) 50%); box-shadow: inset 3px 0 0 color-mix(in srgb, var(--violet) 55%, #fff); }
.pd-ink__bar i { position: absolute; left: 50%; top: -7px; bottom: -7px; width: 1.5px; margin-left: -0.75px; background: var(--now); }
.pd-ink__bar i::before { content: ''; position: absolute; left: -2.75px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--now); }
.pd-ink__k:last-child { text-align: right; }
.pd-ink__k--now { color: var(--now); font-weight: 600; }

/* ---------- FAQ ---------- */
.pd-faq { padding: clamp(64px, 11vh, 120px) 0; }
.pd-faq__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 96px); align-items: start; }
.pd-faq__list { border-top: 1px solid var(--hair); }
.pd-faq details { border-bottom: 1px solid var(--hair); }
.pd-faq summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 60px; padding: 14px 0; }
.pd-faq summary::-webkit-details-marker { display: none; }
.pd-faq summary h3 { font-weight: 560; }
.pd-faq summary::after { content: ''; flex: none; width: 12px; height: 12px; background: linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat; transition: transform 200ms var(--ease-out); }
.pd-faq details[open] summary::after { transform: rotate(45deg); }
.pd-faq details p { padding: 0 0 20px; color: var(--ink-2); font-size: 16.5px; line-height: 1.6; }
@supports (interpolate-size: allow-keywords) {
  .pd-faq { interpolate-size: allow-keywords; }
  .pd-faq details::details-content { height: 0; overflow: clip; transition: height 240ms var(--ease-out), content-visibility 240ms allow-discrete; }
  .pd-faq details[open]::details-content { height: auto; }
  @media (prefers-reduced-motion: reduce) { .pd-faq details::details-content { transition: none; } }
}

/* ---------- Last ---------- */
.pd-last { padding: clamp(64px, 11vh, 120px) 0 clamp(80px, 14vh, 150px); background: var(--sheet); border-top: 1px solid var(--border); text-align: center; }
.pd-last .wrap { display: grid; justify-items: center; }
.pd-last p { margin-top: 14px; font-size: clamp(1.04rem, 1.2vw, 1.14rem); line-height: 1.6; color: var(--ink-2); }
.pd-last .pd-act { margin-top: 28px; }
.pd-last__blocks { display: grid; grid-template-columns: 22px 22px; gap: 4px; margin-bottom: 28px; }
.pd-last__blocks i { width: 22px; height: 22px; border-radius: 7px; background: var(--violet); }
.pd-last__blocks i:nth-child(2) { background: #a99bec; }
.pd-last__blocks i:nth-child(3) { background: #c9bff5; }

.world-colophon { width: min(var(--max), calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 26px 0 34px; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; font-size: 14.5px; color: var(--ink-2); }
.world-colophon p { margin: 0; max-width: none; }
.world-colophon nav a { min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: 3px; }

/* ---------- Arrival: the page fades up from the paper, and the week settles a beat later ---------- */
@keyframes pd-rise { from { opacity: 0; transform: translateY(26px); } }
html.is-arriving .pd-deck { animation: pd-rise 900ms var(--ease-out) 180ms both; }

/* ---------- Narrow ---------- */
@media (max-width: 860px) {
  body { font-size: 17px; }
  .pd-beat, .pd-faq__grid { grid-template-columns: 1fr; }
  .pd-status { text-align: left; }
  .pd-deck { grid-template-columns: 1fr; }
  .pd-side { border-right: 0; border-bottom: 1px solid var(--border); padding: 16px 12px 12px; }
  .pd-tasks { grid-template-columns: 1fr 1fr; }
  [data-wide] { display: none; }
  .pd-cal { --n: 3; padding: 0 6px 6px; }
  .pd-now { --dd: var(--day-m); }
  .world-colophon { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  :root { --hour: 42px; }
  .pd-tasks { grid-template-columns: 1fr; }
  .pd-ink { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html.is-arriving .pd-deck { animation: none; }
  .pd-btn, .pd-faq summary::after { transition: none; }
}
