/* MarketingDays.app
   One stylesheet. Mobile-first. Budget: 45KB uncompressed.

   The magenta/turmeric/green triad is the priority scale, never decoration.
   Score 5 renders gulal, 3-4 haldi, 1-2 neem. The colour is the data.

   Depth is data too. This design language is physical planning stock:
   anchor content sits RAISED off the desk (card shadows, sticker chips,
   keyboard-key buttons); empty time is PRESSED IN (debossed gap weeks,
   inset inputs). Raised = act on this. Recessed = fill this. */

:root {
  --ink:    #14213D;
  --paper:  #FBFAF7;
  --gulal:  #D6006E;
  --haldi:  #E8B00A;
  --neem:   #2F6F5E;
  --rule:   #DDD8CE;
  --muted:  #6B7280;

  --ink-08: rgba(20, 33, 61, .08);
  --ink-04: rgba(20, 33, 61, .04);

  /* depth tokens */
  --stack:  rgba(20, 33, 61, .13);            /* hard card-stock edge */
  --card:   #FFFFFF;
  --raise:  3px 3px 0 var(--stack), 0 10px 22px rgba(20,33,61,.05);
  --raise-hi: 5px 5px 0 var(--stack), 0 14px 28px rgba(20,33,61,.08);
  --deboss: inset 0 2px 5px rgba(20,33,61,.10), inset 0 -1px 0 rgba(255,255,255,.7);
  --key-edge: #0B1329;                        /* button bottom edge */

  --f-display: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --t-xs: 14px;
  --t-sm: 16px;
  --t-md: 18px;
  --t-lg: 22px;
  --t-xl: 28px;
  --t-2xl: 40px;
  --t-3xl: 56px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --wrap: 1080px;
}

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-subset.woff2") format("woff2");
  font-weight: 600 800;
  font-stretch: 125%;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* faint desk falloff so raised cards have something to float over */
  background:
    radial-gradient(120% 60% at 50% 0%, #FFFEFB 0%, var(--paper) 68%);
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-sm);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Every figure on this site is a date or a count. Columns must align. */
table, .num, time, .score, .stat-v, .rw-date, .d-date {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

h1, h2, h3, .display {
  font-family: var(--f-display);
  font-weight: 700;
  font-stretch: 125%;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-lg); margin-top: var(--sp-7); }
h3 { font-size: var(--t-md); margin-top: var(--sp-5); }

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--ink);
  text-decoration-color: var(--gulal);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
a:hover { color: var(--gulal); }

:focus-visible {
  outline: 2px solid var(--gulal);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-3) var(--sp-4);
  z-index: 100;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------- masthead
   The header is the top sheet: content scrolls underneath its shadow. */

.masthead {
  position: relative;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 2px 0 rgba(20,33,61,.05), 0 8px 18px rgba(20,33,61,.05);
}
.masthead-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.brand {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: var(--t-md);
  letter-spacing: -.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--gulal); }
.brand-mark {
  color: var(--gulal);
  text-shadow: 1.5px 1.5px 0 rgba(214,0,110,.22);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2) var(--sp-4);
  font-size: var(--t-xs);
}
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }

/* ---------------------------------------------------------- breadcrumb */

.crumb {
  font-size: var(--t-xs);
  color: var(--muted);
  padding: var(--sp-4) 0 0;
}
.crumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.crumb li::after {
  content: "/";
  margin-left: var(--sp-2);
  color: var(--rule);
}
.crumb li:last-child::after { content: ""; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--gulal); text-decoration: underline; }

/* ---------------------------------------------------------- main */

main { padding: var(--sp-5) 0 var(--sp-8); }

.answer {
  font-size: var(--t-md);
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--gulal);
  border-radius: 3px;
  box-shadow: var(--raise);
  padding: var(--sp-3) var(--sp-4);
  margin: 0 0 var(--sp-6);
  max-width: 62ch;
}
.answer b { font-weight: 700; }

.lede { color: var(--muted); max-width: 62ch; }

/* ---------------------------------------------------------- quick facts
   Raised tiles: the month's vital numbers sit up off the desk. */

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin: 0 0 var(--sp-6);
}
.fact {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: var(--raise);
  padding: var(--sp-3) var(--sp-4);
  position: relative;
}
.fact::before {
  /* top accent stitch, ink by default; verdict tiles recolour via .v-* below */
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 3px;
  background: var(--ink);
  border-radius: 3px 3px 0 0;
}
.fact:has(.v-high)::before { background: var(--gulal); }
.fact:has(.v-normal)::before { background: var(--haldi); }
.fact:has(.v-low)::before { background: var(--neem); }
.fact-k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
.fact-v {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-lg);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.fact-v small {
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--t-xs);
  color: var(--muted);
  display: block;
  margin-top: 2px;
}

/* ---------------------------------------------------------- priority scale
   Score chips are stickers: rounded, lit from above, casting a small edge. */

.score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 var(--sp-2);
  border-radius: 5px;
  font-size: var(--t-xs);
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: 1px 1.5px 0 rgba(20,33,61,.22), inset 0 1px 0 rgba(255,255,255,.28);
}
.s5 { background: var(--gulal); }
.s4, .s3 { background: var(--haldi); color: var(--ink); }
.s2, .s1 { background: var(--neem); }

.chip {
  display: inline-block;
  padding: 2px var(--sp-2);
  border: 1px solid var(--rule);
  border-radius: 5px;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  box-shadow: 1px 1px 0 rgba(20,33,61,.10);
  white-space: nowrap;
}
.chip-state {
  border-color: var(--neem);
  color: var(--neem);
}
.chip-multi {
  border-color: var(--haldi);
  color: #8a6a00;
}

.verdict {
  font-weight: 700;
  text-transform: lowercase;
}
.v-high { color: var(--gulal); }
.v-normal { color: var(--haldi); }
.v-low { color: var(--neem); }

/* ---------------------------------------------------------- runway bar
   The signature element rides on a raised card, like a ribbon pinned
   to the top sheet of a production schedule. */

.runway {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--sp-4);
  margin: 0 0 var(--sp-6);
  background: var(--card);
  box-shadow: var(--raise);
}
.runway-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}
.runway svg { display: block; width: 100%; height: auto; }
/* The runway reflows vertically below 480px: tall variant on small
   screens, wide variant above. Both ship in the HTML; CSS picks one. */
.runway .rw-wide { display: none; }
.runway .rw-tall { display: block; max-width: 300px; }
.runway-note {
  font-size: var(--t-xs);
  color: var(--muted);
  margin: var(--sp-3) 0 0;
}

/* SVG internals, themed from tokens so the bar matches the priority scale */
.rw-track { fill: var(--ink-08); }
.rw-seg-brief { fill: var(--neem); }
.rw-seg-creative { fill: var(--haldi); }
.rw-seg-teaser { fill: #E8760A; }
.rw-seg-live { fill: var(--gulal); }
.rw-label {
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  fill: var(--ink);
}
.rw-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  fill: var(--muted);
}
.rw-today { stroke: var(--gulal); stroke-width: 2; stroke-dasharray: 3 2; }
.rw-tick { stroke: var(--ink); stroke-width: 1; }

/* ---------------------------------------------------------- tables */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--sp-6);
  font-size: var(--t-xs);
}
caption {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  padding-bottom: var(--sp-2);
}
th, td {
  text-align: left;
  padding: var(--sp-3) var(--sp-3) var(--sp-3) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}
tbody tr:hover { background: var(--ink-04); }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

.t-lock { color: var(--muted); }
.t-lock.early { color: var(--gulal); font-weight: 600; }

/* ---------------------------------------------------------- week strip
   Depth encodes the plan: anchor weeks sit flush on the card; gap weeks
   are pressed into it. An empty week is a recess you fill. */

.weeks {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  box-shadow: var(--raise);
  margin: 0 0 var(--sp-6);
  overflow: hidden;
}
.week {
  background: var(--card);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
}
.week:last-child { border-bottom: 0; }
.week-n {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-xs);
  min-width: 92px;
  color: var(--muted);
}
.week-d { flex: 1; min-width: 180px; }
.week-gap {
  background:
    repeating-linear-gradient(
      -45deg, transparent, transparent 6px, var(--ink-04) 6px, var(--ink-04) 12px
    ),
    #F4F2EC;
  box-shadow: var(--deboss);
}
.week-gap .week-d { color: var(--neem); font-weight: 600; }

/* ---------------------------------------------------------- blocks */

.block {
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--card);
  box-shadow: var(--raise);
  padding: var(--sp-4);
  margin: 0 0 var(--sp-6);
}
.block-spill { border-left: 4px solid var(--haldi); }
.block-shift { border-left: 4px solid var(--gulal); }
.block h2, .block h3 { margin-top: 0; }
.block ul { margin: 0; padding-left: var(--sp-5); }
.block li { margin-bottom: var(--sp-2); }

details {
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-3) 0;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
summary::marker { color: var(--gulal); }
details[open] summary { margin-bottom: var(--sp-3); }
.angles { margin: 0 0 var(--sp-3); padding-left: var(--sp-5); }
.hashes { font-size: var(--t-xs); color: var(--muted); word-break: break-word; }

.faq dt {
  font-weight: 700;
  margin-top: var(--sp-4);
}
.faq dd { margin: var(--sp-2) 0 0; color: var(--ink); }

/* ---------------------------------------------------------- link grids
   Index cards. They lift toward the hand on hover. */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-6);
  padding: 0;
  list-style: none;
}
.grid a {
  display: block;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--sp-3) var(--sp-4);
  text-decoration: none;
  min-height: 48px;
  background: var(--card);
  box-shadow: var(--raise);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.grid a:hover {
  border-color: var(--gulal);
  transform: translate(-2px, -2px);
  box-shadow: var(--raise-hi);
}
.grid a:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--stack);
}
.grid-k { display: block; font-weight: 700; }
.grid-v {
  display: block;
  font-size: var(--t-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-4);
  margin-top: var(--sp-6);
  font-size: var(--t-xs);
}

/* ---------------------------------------------------------- density strip */

.strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  margin: 0 0 var(--sp-6);
  align-items: end;
  min-height: 96px;
}
.strip-m {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-decoration: none;
}
.strip-bar {
  width: 100%;
  min-height: 3px;
  background: var(--rule);
  border-radius: 2px 2px 0 0;
  box-shadow: 1px 1px 0 rgba(20,33,61,.14);
}
.strip-m:hover .strip-bar { outline: 1px solid var(--ink); }
.strip-hi { background: var(--gulal); }
.strip-no { background: var(--haldi); }
.strip-lo { background: var(--neem); }
.strip-l {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.strip-c {
  font-family: var(--f-display);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- the tool
   The instrument itself: the most raised surface on the page.
   Inputs are pressed-in wells; the button is a physical key. */

.tool {
  border: 1px solid var(--ink);
  border-radius: 4px;
  padding: var(--sp-4);
  margin: 0 0 var(--sp-6);
  background: var(--card);
  box-shadow: 5px 5px 0 var(--stack), 0 16px 32px rgba(20,33,61,.07);
}
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: var(--sp-1);
}
select {
  width: 100%;
  min-height: 48px;
  font-size: 16px; /* below 16px iOS Safari zooms on focus */
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 var(--sp-3);
  box-shadow: var(--deboss);
}
select:focus-visible { border-color: var(--gulal); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--key-edge);
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: var(--t-sm);
  cursor: pointer;
  text-decoration: none;
  width: 100%;
  box-shadow: 0 3px 0 var(--key-edge), 0 6px 12px rgba(20,33,61,.18);
  transition: transform .08s ease, box-shadow .08s ease, background .12s ease;
}
.btn:hover { background: var(--gulal); border-color: #9C0050; box-shadow: 0 3px 0 #9C0050, 0 6px 12px rgba(214,0,110,.25); color: #fff; }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--key-edge); }
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--rule);
  width: auto;
  box-shadow: 0 2px 0 var(--rule), 0 4px 8px rgba(20,33,61,.06);
}
.btn-ghost:hover { background: var(--card); color: var(--gulal); border-color: var(--gulal); box-shadow: 0 2px 0 rgba(214,0,110,.4), 0 4px 8px rgba(214,0,110,.12); }
.btn-ghost:active { transform: translateY(2px); box-shadow: 0 0 0 var(--rule); }

.exports {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-6);
}

#out:empty { display: none; }
.out-empty {
  color: var(--muted);
  font-size: var(--t-xs);
  border-top: 1px solid var(--rule);
  padding-top: var(--sp-4);
}

/* Staggered row entry. The only entrance motion on the site. */
.stagger { animation: rise .18s ease-out backwards; }
@keyframes rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stagger { animation: none; }
  .grid a, .btn, .btn-ghost { transition: none; }
  .grid a:hover, .grid a:active,
  .btn:active, .btn-ghost:active { transform: none; }
}

.sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  padding-bottom: calc(var(--sp-2) + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--rule);
  box-shadow: 0 -2px 0 rgba(20,33,61,.05), 0 -8px 18px rgba(20,33,61,.07);
}
.sticky .btn { flex: 1; }

/* ---------------------------------------------------------- footer */

.foot {
  border-top: 1px solid var(--rule);
  padding: var(--sp-6) 0;
  font-size: var(--t-xs);
  color: var(--muted);
  background: linear-gradient(180deg, rgba(20,33,61,.03), transparent 24px);
}
.foot-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.foot h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin: 0 0 var(--sp-2);
  font-family: var(--f-body);
  font-weight: 600;
}
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin-bottom: var(--sp-1); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--gulal); text-decoration: underline; }

.sources {
  font-size: 12px;
  color: var(--muted);
}
.sources ul { padding-left: var(--sp-5); margin: var(--sp-2) 0 0; }

.note {
  font-size: var(--t-xs);
  color: var(--muted);
  border-left: 2px solid var(--rule);
  padding-left: var(--sp-3);
}

.vis-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------- 480+ */

@media (min-width: 480px) {
  h1 { font-size: var(--t-2xl); }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .btn { width: auto; }
  .controls { grid-template-columns: repeat(2, 1fr); }
  .runway .rw-wide { display: block; }
  .runway .rw-tall { display: none; }
}

/* ---------------------------------------------------------- 768+ */

@media (min-width: 768px) {
  body { font-size: var(--t-md); }
  h1 { font-size: var(--t-3xl); }
  h2 { font-size: var(--t-xl); }
  h3 { font-size: var(--t-lg); }
  table { font-size: var(--t-sm); }
  .facts { grid-template-columns: repeat(5, 1fr); }
  .controls { grid-template-columns: repeat(3, 1fr) auto; align-items: end; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .foot-cols { grid-template-columns: repeat(4, 1fr); }
  .sticky { display: none; }
}

/* ---------------------------------------------------------- 1024+ */

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------------------------------------------------------- stacked cards
   Below 768px day tables become cards. Never a horizontally scrolling table.
   Each row is its own raised card. */

@media (max-width: 767px) {
  .t-stack thead { display: none; }
  .t-stack, .t-stack tbody, .t-stack tr, .t-stack td { display: block; width: 100%; }
  .t-stack tr {
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--card);
    box-shadow: var(--raise);
    margin-bottom: var(--sp-3);
    padding: var(--sp-3);
  }
  .t-stack tr:hover { background: var(--card); }
  .t-stack td {
    border: 0;
    padding: var(--sp-1) 0;
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
  }
  .t-stack td::before {
    content: attr(data-k);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    flex: 0 0 auto;
  }
}

/* ---------------------------------------------------------- print */

@media print {
  body { background: #fff; }
  .masthead, .nav, .sticky, .exports, .pager, .foot { display: none; }
  .answer, .facts .fact, .runway, .weeks, .block, .grid a, .tool {
    box-shadow: none;
  }
  .runway, .block, table { break-inside: avoid; }
}
