/* ==========================================================================
   timeline.css — homepage "The clock starts the day you sell" (#how).
   Markup in index.html, behaviour in assets/js/timeline.js.
   One 180-day scale. Both clocks start at day 0 and run as two lanes, so every
   label, dot and tick shares the same x-axis. The scale stays horizontal on
   phones; the dates live in the two deadline cards below it.
   ========================================================================== */

.dlt { --id: var(--accent); --ex: var(--brass); background: var(--paper-2); border-block: 1px solid var(--line); }

.dlt-head { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(1.5rem, 5vw, 6rem); align-items: end; margin-bottom: var(--s-7); }
.dlt-head h2 { font-size: var(--fs-2xl); line-height: 1.06; letter-spacing: -.02em; color: var(--ink); margin: 0; text-wrap: balance; max-width: 13ch; }
.dlt-lede p { color: var(--ink-2); font-size: var(--fs-base); line-height: 1.65; margin: 0; max-width: 60ch; }
.dlt-lede strong { color: var(--ink); }
.dlt-lede .dlt-aside { margin-top: 1rem; font-size: .93rem; color: var(--ink-3); padding-left: 1rem; border-left: 2px solid var(--brass); }
.dlt-more { display: inline-block; margin-top: 1.2rem; }

.dlt-panel { position: relative; background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(1.25rem, .8rem + 2.2vw, 2.5rem); box-shadow: var(--shadow-2); }

/* ---- Closing date + hint (JS only) ---- */
.dlt-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .8rem 2rem; margin-bottom: var(--s-5); }
.dlt-date { display: grid; gap: .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.dlt-date input { font: 500 1rem/1.2 var(--font-sans); color: var(--ink); letter-spacing: 0; text-transform: none; min-height: 48px; min-width: 12.5rem;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: .55rem .8rem; background: var(--paper); }
.dlt-date input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(12, 74, 134, .14); }
.dlt-hint { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--ink-3); max-width: 34ch; text-align: right; }
.dlt-hint strong { color: var(--accent); }
.dlt-panel:not(.is-live) :is(.dlt-bar, .dlt-range, .dlt-cursor, .dlt-chip) { display: none; }

/* ---- The scale: chip · two lanes · ruler, all on one x-axis ---- */
.dlt-stage { padding-inline: clamp(.9rem, 2vw, 1.6rem); }
.dlt-scale { position: relative; isolation: isolate; padding-top: 5.4rem; --p: .25; --a: 1; --b: 1; }
.dlt-panel.is-live .dlt-scale { cursor: ew-resize; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.dlt-panel:not(.is-live) .dlt-scale { padding-top: 0; }
.dlt-range { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.dlt-lane { position: relative; }
.dlt-lane + .dlt-lane { margin-top: 1.15rem; }
.dlt-lane p { position: relative; z-index: 3; display: flex; align-items: baseline; gap: .55rem; width: fit-content; margin: 0 0 .5rem; padding-right: .5rem; white-space: nowrap; line-height: 1.2;
  background: var(--surface-1); /* the cursor line passes behind the lane names */ }
.dlt-lane p b { font-size: .88rem; font-weight: 650; color: var(--ink); }
.dlt-lane p span { font-size: .78rem; color: var(--ink-4); }
.dlt-lane p b::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .5rem; border-radius: 50%; background: var(--c); vertical-align: .08em; }
.dlt-lane-id { --c: var(--id); --v: var(--a); }
.dlt-lane-ex { --c: var(--ex); --v: var(--b); }
.dlt-rail { position: relative; height: 8px; }
.dlt-lane-id .dlt-rail { width: 25%; }
.dlt-track { position: absolute; inset: 0; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.dlt-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--c); transform: translateX(calc((var(--v) - 1) * 100%)); }
.dlt-end { position: absolute; z-index: 2; right: -9px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--c);
  transition: background-color .25s, box-shadow .45s var(--ease-out), transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.dlt-end::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) scale(.4); opacity: 0; transition: opacity .2s, transform .4s var(--ease-out); }
.dlt-lane.is-done .dlt-end { background: var(--c); transform: scale(1.12); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 16%, transparent); }
.dlt-lane.is-done .dlt-end::after { opacity: 1; transform: rotate(45deg); }

/* Tax-return due date, when it lands before day 180. */
.dlt-tax { position: absolute; left: calc(var(--x, 1) * 100%); top: -5px; bottom: -5px; width: 2px; margin-left: -1px; border-radius: 2px; background: var(--danger); }
.dlt-tax span { position: absolute; top: calc(100% + 4px); right: -2px; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--danger); white-space: nowrap; }

.dlt-ticks { display: block; width: 100%; height: 14px; margin-top: 1.5rem; overflow: visible; }
.dlt-ticks path { fill: none; stroke: var(--ink); vector-effect: non-scaling-stroke; }
.dlt-ticks .t1 { stroke-width: 1; opacity: .2; }
.dlt-ticks .t5 { stroke-width: 1; opacity: .42; }
.dlt-ticks .t45 { stroke-width: 1.5; opacity: .85; }

.dlt-today { position: absolute; z-index: 1; top: 5.4rem; bottom: 0; left: calc(var(--t, 0) * 100%); width: 0; border-left: 1.5px dashed var(--danger); margin-left: -.75px; pointer-events: none; }
.dlt-today span { position: absolute; bottom: 100%; left: 0; transform: translateX(-50%); padding-bottom: 2px; font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--danger); white-space: nowrap; }

.dlt-cursor { position: absolute; z-index: 1; top: 4.7rem; bottom: -11px; left: calc(var(--p) * 100%); width: 0; margin-left: -.75px; border-left: 1.5px solid var(--ink); pointer-events: none; }
.dlt-cursor::after { content: ""; position: absolute; left: -.75px; bottom: 0; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; border: 1.5px solid var(--ink); box-shadow: var(--shadow-2);
  background: linear-gradient(var(--ink), var(--ink)) 8px 50% / 1.5px 8px no-repeat, linear-gradient(var(--ink), var(--ink)) 12.5px 50% / 1.5px 8px no-repeat, #fff;
  transition: transform .25s var(--ease-out), box-shadow .25s; }
.dlt-scale:hover .dlt-cursor::after, .dlt.is-dragging .dlt-cursor::after { transform: scale(1.12); }
.dlt-range:focus-visible ~ .dlt-cursor::after { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--accent); }

.dlt-chip { --half: 4.9rem; position: absolute; z-index: 4; top: 0; left: clamp(var(--half), calc(var(--p) * 100%), calc(100% - var(--half))); transform: translateX(-50%);
  width: 11.4rem; padding: .55rem .7rem .6rem; border-radius: var(--r-sm); background: var(--night); color: #fff; text-align: center; line-height: 1.2;
  box-shadow: 0 16px 30px -18px rgba(14, 27, 43, .7); pointer-events: none; display: grid; gap: .12rem; }
.dlt-chip small { font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #9FC0E3; font-variant-numeric: tabular-nums; }
.dlt-chip b { color: #fff; font-family: var(--font-display); font-size: 1.12rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.dlt-chip span { font-size: .74rem; color: #B7C2CF; min-height: 1.2em; }

.dlt-nums { position: relative; height: 3.9rem; margin-top: .9rem; }
.dlt-nums button { position: absolute; top: 0; left: calc(var(--pos) * 100%); transform: translateX(-50%); display: grid; justify-items: center; min-width: 3.4rem; min-height: 44px;
  padding: .1rem .3rem; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; border-radius: var(--r-xs); -webkit-tap-highlight-color: transparent; }
.dlt-nums b { font-family: var(--font-display); font-weight: 450; font-size: clamp(1.7rem, 1.4rem + 1vw, 2.3rem); line-height: 1; letter-spacing: -.01em; transition: color .2s, transform .3s var(--ease-out); }
.dlt-nums span { margin-top: .25rem; font-size: .6rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-4); }
.dlt-nums button:hover b, .dlt-nums button.is-active b { color: var(--accent); }
.dlt-nums button:hover b { transform: translateY(-2px); }
.dlt-nums button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.dlt-panel:not(.is-live) .dlt-nums button { pointer-events: none; }

/* ---- Entrance (JS adds .is-in when the panel scrolls into view) ---- */
.dlt-panel.is-live .dlt-ticks { clip-path: inset(-4px 100% -4px -4px); }
.dlt.is-in .dlt-panel.is-live .dlt-ticks { clip-path: inset(-4px -4px -4px -4px); transition: clip-path 1200ms var(--ease-out); }
.dlt-panel.is-live :is(.dlt-lane, .dlt-chip, .dlt-cursor) { opacity: 0; }
.dlt.is-in .dlt-panel.is-live :is(.dlt-lane, .dlt-chip, .dlt-cursor) { opacity: 1; transition: opacity 600ms var(--ease-out); }
.dlt.is-in .dlt-panel.is-live .dlt-lane-ex { transition-delay: 120ms; }
.dlt.is-in .dlt-panel.is-live :is(.dlt-chip, .dlt-cursor) { transition-delay: 320ms; }

/* ---- The two deadlines, in words ---- */
.dlt-deadlines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.dlt-deadline { padding: 1.1rem 1.25rem 1.2rem; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line);
  transition: border-color .3s, background-color .3s, box-shadow .3s; }
.dlt-deadline-id { --c: var(--id); } .dlt-deadline-ex { --c: var(--ex); }
.dlt-deadline.is-active { background: #fff; border-color: var(--c); box-shadow: var(--shadow-2); }
.dlt-deadline p { margin: 0; }
.dlt-k { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.dlt-when { font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); line-height: 1.15; color: var(--ink); margin: .35rem 0 .45rem !important; letter-spacing: -.01em; }
.dlt-sub { font-size: .88rem; line-height: 1.5; color: var(--ink-2); }
.dlt-sub .warn { color: var(--danger); font-weight: 600; }
.dlt-foot { margin: var(--s-4) 0 0; font-size: .88rem; }
.dlt-foot a { color: var(--accent); font-weight: 600; }

@media (max-width: 899px) { .dlt-ticks .t1 { display: none; } }
@media (max-width: 760px) {
  .dlt-head { grid-template-columns: 1fr; align-items: start; margin-bottom: var(--s-6); }
  .dlt-hint { text-align: left; max-width: none; }
  .dlt-date, .dlt-date input { width: 100%; }
  .dlt-deadlines { grid-template-columns: 1fr; }
  .dlt-stage { padding-inline: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dlt-end, .dlt-end::after, .dlt-nums b, .dlt-cursor::after, .dlt-deadline { transition: none; }
  .dlt.is-in .dlt-panel.is-live :is(.dlt-ticks, .dlt-lane, .dlt-chip, .dlt-cursor) { transition: none; }
}
