/* A+ client portal: Blueprint Technical palette */
:root {
  --paper: #e4e5e4; --sheet: #eceeee; --ink: #233446; --muted: #566779;
  --line: #b3c1ce; --fill: #7a93b2; --outline: #3a5470; --redline: #c4382c;
  --bar: #7a93b2; --bar-phase: #3a5470; --owner: #b0643a; --crit: #c4382c;
  --today: #c4382c; --row: rgba(122,147,178,.08);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151f2a; --sheet: #1a2633; --ink: #dde5ee; --muted: #97a8ba;
    --line: #2d3e50; --fill: #86a3c8; --outline: #c4d3e4; --redline: #ff6f61;
    --bar: #86a3c8; --bar-phase: #c4d3e4; --owner: #d4875c; --crit: #ff6f61;
    --today: #ff6f61; --row: rgba(134,163,200,.07); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top { border-bottom: 1px solid var(--line); background: var(--sheet); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { font: 500 18px var(--mono); text-decoration: none; letter-spacing: .01em; }
.brand b { color: var(--fill); -webkit-text-stroke: .6px var(--outline); font-weight: 500; }
.who { display: flex; align-items: center; gap: 12px; font: 13px var(--mono); color: var(--muted); }
.btn { font: 500 14px var(--mono); padding: 8px 14px; border: 1px solid var(--outline); background: var(--ink); color: var(--sheet); border-radius: 2px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn:focus-visible, .phase-row:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }

/* Title block */
.titleblock { display: grid; grid-template-columns: 2.4fr 1fr 1fr 1fr; border: 1px solid var(--outline); background: var(--sheet); margin: 28px 0 8px; }
.titleblock > div { padding: 10px 14px; border-left: 1px solid var(--line); min-width: 0; }
.titleblock > div:first-child { border-left: 0; }
.tb-label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tb-value { font: 500 15px var(--mono); overflow-wrap: anywhere; }
.titleblock h1 { margin: 2px 0 0; font: 500 clamp(20px, 2.6vw, 28px)/1.2 var(--mono); color: var(--fill); -webkit-text-stroke: .8px var(--outline); paint-order: stroke fill; }
.disclaimer { font-size: 14px; color: var(--muted); margin: 0 0 28px; }

h2 { font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 32px 0 12px; display: flex; align-items: center; gap: 12px; }
h2::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Milestones */
.milestones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--outline); background: var(--sheet); }
.ms { padding: 14px 16px; border-left: 1px solid var(--line); position: relative; }
.ms:first-child { border-left: 0; }
.ms .diamond { width: 12px; height: 12px; transform: rotate(45deg); background: var(--fill); border: 1.4px solid var(--outline); display: inline-block; margin-right: 8px; vertical-align: 1px; }
.ms.done .diamond { background: var(--outline); }
.ms-label { font: 500 14px var(--sans); }
.ms-date { font: 500 22px/1.3 var(--mono); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ms-rel { font: 12px var(--mono); color: var(--muted); }

/* Owner items */
.owner { list-style: none; padding: 0; margin: 0; border: 1px solid var(--outline); background: var(--sheet); }
.owner li { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.owner li:first-child { border-top: 0; }
.owner .when { font: 500 14px var(--mono); font-variant-numeric: tabular-nums; }
.owner .cnote { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 16px; }

/* Gantt */
.gantt-tools { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; font: 13px var(--mono); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 8px; margin-right: 6px; vertical-align: 1px; background: var(--bar); border: 1px solid var(--outline); }
.legend .lg-phase::before { background: var(--bar-phase); }
.legend .lg-owner::before { background: var(--owner); border-color: var(--owner); }
.legend .lg-crit::before { background: var(--bar); border: 2px solid var(--crit); }
.legend .lg-ms::before { width: 9px; height: 9px; transform: rotate(45deg); background: var(--fill); }
.gantt { border: 1px solid var(--outline); background: var(--sheet); overflow-x: auto; }
.g-inner { min-width: 860px; position: relative; }
.g-row { display: grid; grid-template-columns: var(--label-w, 320px) 1fr; border-top: 1px solid var(--line); min-height: 34px; }
.g-row.head { border-top: 0; position: sticky; top: 0; background: var(--sheet); z-index: 2; min-height: 30px; }
.g-label { padding: 7px 12px; font-size: 14px; position: sticky; left: 0; background: var(--sheet); z-index: 1; border-right: 1px solid var(--line); min-width: 0; }
.g-track { position: relative; }
.months { position: relative; height: 30px; }
.months span { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); padding: 6px 6px; font: 500 12px var(--mono); color: var(--muted); white-space: nowrap; }
.gridline { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); opacity: .55; pointer-events: none; }
.phase-row { cursor: pointer; background: var(--row); }
.phase-row .g-label { background: color-mix(in srgb, var(--sheet) 94%, var(--fill)); font: 500 14px var(--mono); display: flex; gap: 8px; align-items: baseline; }
.caret { display: inline-block; width: 10px; transition: transform .15s; color: var(--muted); }
.phase-row[aria-expanded="true"] .caret { transform: rotate(90deg); }
.phase-dates { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.task-row .g-label { padding-left: 30px; color: var(--ink); }
.task-row .t-meta { display: block; font: 12px var(--mono); color: var(--muted); }
.task-row .t-int { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar { position: absolute; top: 50%; height: 12px; transform: translateY(-50%); background: var(--bar); border: 1px solid var(--outline); border-radius: 1px; min-width: 3px; }
.phase-row .bar { height: 14px; background: var(--bar-phase); border-color: var(--bar-phase); }
.bar.owner { background: var(--owner); border-color: var(--owner); }
.bar.crit { border: 2px solid var(--crit); }
.mdiamond { position: absolute; top: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%) rotate(45deg); background: var(--fill); border: 1.4px solid var(--outline); }
.today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--today); z-index: 3; pointer-events: none; }
.today span { position: absolute; top: 2px; left: 4px; font: 500 11px var(--mono); color: var(--today); background: var(--sheet); padding: 0 3px; }
.hidden { display: none !important; }
.note-status { font: 13px var(--mono); color: var(--muted); margin: 10px 0 40px; }

/* Signed-out / list */
.panel { border: 1px solid var(--outline); background: var(--sheet); padding: 28px; margin: 48px auto; max-width: 560px; }
.panel h1 { font: 500 26px/1.2 var(--mono); margin: 0 0 8px; color: var(--fill); -webkit-text-stroke: .8px var(--outline); paint-order: stroke fill; }
.panel p { color: var(--muted); }
.plist { list-style: none; padding: 0; margin: 16px 0 0; }
.plist a { display: block; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; font: 500 15px var(--mono); }
.plist small { display: block; color: var(--muted); font: 12px var(--mono); }
.staff-flag { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--crit); color: var(--crit); padding: 2px 6px; }

@media (max-width: 820px) {
  .titleblock { grid-template-columns: 1fr 1fr; }
  .titleblock > div:first-child { grid-column: 1 / -1; }
  .titleblock > div:nth-child(2) { border-left: 0; }
  .titleblock > div:nth-child(n+2) { border-top: 1px solid var(--line); }
  .milestones { grid-template-columns: 1fr 1fr; }
  .ms:nth-child(3) { border-left: 0; }
  .ms:nth-child(n+3) { border-top: 1px solid var(--line); }
  .owner li { grid-template-columns: 1fr; gap: 2px; }
  .g-inner { --label-w: 200px; min-width: 720px; }
  .phase-dates { display: none; }
}
@media (max-width: 420px) { .who .email { display: none; } }
@media (prefers-reduced-motion: reduce) { .caret { transition: none; } }

/* Staff view switch */
.viewbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin: 0 0 8px; border: 1px dashed var(--crit); background: var(--sheet); font-size: 14px; }
.viewbar.client { border-color: var(--fill); }
.viewbar.client .staff-flag { border-color: var(--fill); color: var(--outline); }
.viewbar .btn { text-decoration: none; white-space: nowrap; }
.brand img { display: block; height: 40px; width: auto; }
@media (max-width: 520px) { .brand img { height: auto; width: min(273px, 48vw); } }

/* Section tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--outline); margin: 14px 0 18px; overflow-x: auto; }
.tabs a { font: 500 14px var(--mono); padding: 10px 16px; text-decoration: none; color: var(--muted); border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--sheet); border-color: var(--outline); }
.tabs a:hover { color: var(--ink); }

/* Gallery */
.g-group { font: 500 13px var(--mono); color: var(--ink); margin: 22px 0 10px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tile { position: relative; display: block; padding: 0; border: 1px solid var(--outline); background: var(--sheet); cursor: pointer; aspect-ratio: 3 / 2; overflow: hidden; text-align: left; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.tile:hover img { transform: scale(1.03); }
.tile:focus-visible { outline: 2px solid var(--fill); outline-offset: 2px; }
.tile-ph { display: grid; place-items: center; height: 100%; font: 500 18px var(--mono); color: var(--muted); }
.tile-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font: 13px/1.3 var(--sans); color: #fff; background: linear-gradient(transparent, rgba(20,30,40,.78)); }
.tile .play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(20,30,40,.65); color: #fff; font-size: 20px; padding-left: 4px; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(12,18,26,.985); display: flex; flex-direction: column; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; color: #eceeee; font: 14px var(--sans); }
.lb-bar small { color: #97a8ba; margin-left: 8px; font-family: var(--mono); }
.lb-bar .btn.ghost { color: #eceeee; border-color: #97a8ba; text-decoration: none; margin-right: 8px; }
.lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px 16px; }
.lb-stage img, .lb-stage video { max-width: calc(100% - 120px); max-height: 100%; object-fit: contain; background: #000; }
.lb-nav { background: transparent; border: 1px solid #566779; color: #eceeee; font-size: 28px; width: 48px; height: 64px; cursor: pointer; flex: none; }
.lb-nav:hover { background: rgba(255,255,255,.08); }
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile-cap { font-size: 11px; padding: 14px 6px 5px; }
  .lb-stage { position: relative; padding: 0 0 12px; }
  .lb-stage img, .lb-stage video { max-width: 100%; }
  .lb-nav { position: absolute; bottom: 20px; background: rgba(12,18,26,.7); }
  .lb-nav[data-a="prev"] { left: 8px; } .lb-nav[data-a="next"] { right: 8px; }
}
