/*
 * UGC Dashboard Portal — Underground Construction Co., Inc.
 *
 * Palette and type follow the UCCo 2024 brand guidelines, NOT Quanta corporate:
 *   Neutral Black  #221f1f   Pantone Neutral Black C
 *   Red            #cd0a1b   Pantone 1795 C
 *   Deep red       #a3171c   Pantone 7621 C
 *   Cool Gray 1    #dad9d7
 *   Cool Gray 8    #838383
 * There is deliberately no orange or yellow in the brand palette — those are
 * used here only for construction imagery and barricade tape, where they read
 * as real-world safety colour. See --hiviz / --safety-orange below.
 *
 * Typeface is Proxima Nova (Regular / Bold). It's licensed and not vendored,
 * and the strict CSP blocks font CDNs, so we fall back through the closest
 * widely-available geometric humanist sans. If Proxima Nova is ever self-hosted
 * in src/fonts/, add @font-face here and it takes over with no other changes.
 *
 * Dark ground throughout — this reads as a wall-mounted jobsite board.
 */

:root {
  --black: #221f1f;
  --red: #cd0a1b;
  --deep: #a3171c;
  --gray1: #dad9d7;
  --gray8: #838383;
  --white: #fff;

  /* Site-kit illustration colours. NEITHER is a UCCo brand colour — the
     palette has no yellow or orange. They're scoped strictly to construction
     imagery, where they read as real-world safety colour rather than
     branding: traffic control devices are safety orange, plant is equipment
     yellow. Never use these for plates, type, rules or structure. */
  --hiviz: #f2b52b;
  --safety-orange: #ef6c24;

  /* dark-ground working tones, derived from Neutral Black */
  --ground: #1c1a1a;
  --panel: #2a2727;
  --panel-hi: #333030;
  --rule: #3a3737;
  --rule-hi: #4a4747;

  --sans: 'Proxima Nova', 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

  /* Barricade tape. Yellow/black, as it comes off the roll. */
  --tape: repeating-linear-gradient(
    45deg,
    var(--hiviz) 0 9px,
    var(--black) 9px 18px
  );
}

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--white);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Tape across the very top of the page — the whole portal is a work site. */
body::before {
  content: '';
  display: block;
  height: 8px;
  background-image: var(--tape);
}

.portal {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 26px 90px;
}

/* ---------- board: categories as columns, left to right ----------
   Each category is a column; its dashboards stack downward inside it. On
   narrow screens the columns collapse to a single stack. */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 26px 20px;
  align-items: start;
  margin-top: 34px;
}

/* ---------- header ---------- */

.portal__header {
  padding-bottom: 26px;
}

/* White-knockout lockup, sat above the identity rule. Height drives the size and
   width stays auto so the mark keeps its exact proportions; the width/height
   attributes on the <img> carry the intrinsic ratio, so nothing shifts on load. */
.brandmark {
  display: block;
  height: 96px;
  width: auto;
  max-width: 100%;
  margin-top: 26px;
}

.identity {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  min-height: 30px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--gray8);
}

.identity__who {
  text-transform: lowercase;
}

.identity__signout {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule-hi);
  border-radius: 0;
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray1);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.identity__signout:hover {
  color: var(--red);
  border-color: var(--red);
}

.identity__signout:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ---------- hero: slash band + title ----------
   The diagonal slash is UCCo's own graphic device, taken from the margin of
   every page of the 2024 brand guidelines. Drawn with a repeating gradient so
   there's no image request and nothing for the CSP to block. */

.hero {
  display: flex;
  position: relative;
  margin-top: 26px;
  border: 1px solid var(--rule);
  overflow: hidden;
}

/* The UCCo mark repeats across the full width of the hero behind the title,
   cropped by the hero's overflow. Faint enough to read as ground texture
   rather than a second logo competing with the lockup above. */
.hero__watermark {
  position: absolute;
  inset: 0;
  background-image: url('icon-ucco-white.png');
  background-repeat: repeat-x;
  background-position: left center;
  background-size: auto 300px;
  opacity: 0.07;
  pointer-events: none;
}

.hero__band {
  flex: none;
  width: 64px;
  color: var(--red);
  background-image: repeating-linear-gradient(
    -58deg,
    currentColor 0 3px,
    transparent 3px 11px
  );
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* Mirrored band closing the other end. */
.hero__band--end {
  background-image: repeating-linear-gradient(
    58deg,
    currentColor 0 3px,
    transparent 3px 11px
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 44px 36px 40px;
  text-align: center;
}

.hero__rule {
  width: 110px;
  margin: 20px auto 0;
  border-top: 3px solid var(--red);
}

.portal__header h1 {
  margin: 0;
  font-size: clamp(36px, 6.2vw, 72px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.portal__header h1 span {
  display: block;
  color: var(--red);
}

.portal__lede {
  max-width: 58ch;
  margin: 20px auto 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--gray1);
}

/* ---------- under construction notice ----------
   The company builds underground utilities for a living, so the pun is the
   point — but it stays dry rather than jokey. Barricade tape wraps the block
   and a row of site kit sits alongside. */

/* Tape wraps the notice: bands down both ends (the ::before and ::after), plus
   runs along the top and bottom drawn as background layers so they keep the
   diagonal pattern rather than flattening to a solid bar. */
.construction {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  padding: 20px 0;
  background-color: var(--panel);
  background-image: var(--tape), var(--tape);
  background-size: 100% 5px, 100% 5px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.construction::before,
.construction::after {
  content: '';
  flex: none;
  align-self: stretch;
  width: 22px;
  background-image: var(--tape);
}

/* Kit at both ends with the notice centred between them. The right-hand row is
   a true mirror: same kit in reverse order, flipped horizontally so the plant
   faces back in towards the text rather than away off the edge. */
.construction__icons {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.construction__icons--end {
  transform: scaleX(-1);
}

/* Banner kit follows the same rule as the tile scene: plant is equipment
   yellow, traffic control is safety orange. */
.construction__icon {
  flex: none;
  width: 58px;
  height: 58px;
  fill: none;
  stroke: var(--hiviz);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.construction__icon--traffic {
  stroke: var(--safety-orange);
}

/* Secondary kit sits smaller so the row has a lead. */
.construction__icon--muted {
  width: 46px;
  height: 46px;
  opacity: 0.9;
}

.construction p {
  flex: 1;
  margin: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.3;
  color: var(--gray1);
}

.construction strong {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--white);
}

/* "under(ground) construction" — the company name hiding inside the notice.
   Infrared makes the second reading visible without breaking the first. */
.construction__pun {
  color: var(--red);
}

/* ---------- filter ---------- */

.tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.filter {
  flex: 1;
  max-width: 420px;
}

.filter input {
  width: 100%;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--white);
  outline: none;
}

.filter input::placeholder {
  color: var(--gray8);
}

.filter input:focus {
  border-color: var(--red);
}

.hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gray8);
}

/* ---------- category columns ---------- */

.group {
  min-width: 0;
}

.group__heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray8);
}

.group__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* ---------- placards ---------- */

/* Tiles stack vertically within their category column. */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* Plate colour cycles through the UCCo palette; category sets it. */
.tile {
  position: relative;
  display: block;
  min-height: 124px;
  padding: 15px 16px 16px;
  background: var(--plate, var(--deep));
  color: var(--white);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s;
}

[data-category='Compliance'] .tile { --plate: var(--red); }
[data-category='Finance'] .tile { --plate: var(--deep); }
[data-category='Forms'] .tile { --plate: var(--gray8); }
[data-category='Operations'] .tile { --plate: var(--red); }
[data-category='People'] .tile { --plate: var(--gray8); }
[data-category='Insights & Adoption'] .tile { --plate: var(--deep); }

a.tile:hover {
  transform: translateY(-4px);
}

a.tile:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -4px;
}

.tile__code {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  opacity: 0.8;
}

.tile h2 {
  margin: 8px 0 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.tile p {
  margin: 6px 0 0;
  max-width: 27ch;
  font-size: 11.5px;
  line-height: 1.45;
  opacity: 0.88;
  position: relative;
  z-index: 1;
}

/* Brand icon ghosted off the corner. Deliberately oversized — it bleeds past
   two edges so it reads as a graphic mark rather than a small badge. */
.tile__ghost {
  position: absolute;
  right: -26px;
  bottom: -30px;
  width: 168px;
  height: 168px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.16;
  pointer-events: none;
}

/* Tape along the top and bottom edges of the work-in-progress plate, on top of
   the hatch fill. */
.tile--wip {
  background-color: var(--panel);
  background-image: var(--tape), var(--tape);
  background-size: 100% 5px, 100% 5px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
  border: 1px dashed var(--rule-hi);
  padding: 20px 16px 82px;
  min-height: 190px;
}

.tile__scene {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.62;
  pointer-events: none;
  z-index: 1;
}

.scene__ground {
  stroke: var(--gray8);
}

.scene__plant {
  stroke: var(--hiviz);
}

.scene__traffic {
  stroke: var(--safety-orange);
}

.tile--wip .tile__ghost {
  display: none;
}

/* Work in progress: the plate reads as unfinished rather than carrying a small
   marker — bare panel instead of the category colour, dashed edge, barricade
   hatch, and a work-site scene along the foot. Still clickable: the app
   exists, it just isn't done. */
.tile--wip::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(242, 181, 43, 0.14) 0 10px,
    transparent 10px 20px
  );
  pointer-events: none;
  z-index: 0;
}

.tile--wip .tile__code,
.tile--wip h2 {
  color: var(--gray1);
}

.tile--wip p {
  color: var(--gray8);
  opacity: 1;
}

.tile--wip .tile__ghost {
  stroke: var(--hiviz);
  opacity: 0.34;
}

.tile__badge--wip {
  border: 0;
  background: var(--hiviz);
  color: var(--black);
  font-weight: 700;
  padding: 3px 9px;
  letter-spacing: 0.14em;
}

.tile--wip .tile__ghost,
.tile--pending .tile__ghost {
  width: 190px;
  height: 190px;
  right: -34px;
  bottom: -36px;
}

.tile--pending .tile__ghost {
  stroke: var(--safety-orange);
  opacity: 0.32;
}

.tile--pending {
  opacity: 0.45;
  cursor: default;
}

.tile__badge {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 10px;
  padding: 2px 7px;
  border: 1px solid currentColor;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ---------- notices ---------- */

.notice {
  margin: 36px 0 0;
  padding: 16px 18px;
  background: var(--panel);
  border-left: 3px solid var(--red);
  font-size: 14px;
  color: var(--gray1);
}

/* ---------- footer ----------
   Empty for now — kept as the closing rule under the board. */

.portal__footer {
  margin-top: 60px;
  border-top: 1px solid var(--rule);
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .portal {
    padding: 0 18px 60px;
  }

  /* The lockup is wide — hold it back on a phone so it doesn't eat the fold. */
  .brandmark {
    height: 56px;
    margin-top: 18px;
  }

  .hero__band {
    width: 40px;
  }

  .hero__watermark {
    background-size: auto 190px;
  }

  .hero__inner {
    padding: 28px 20px 26px;
  }

  /* Single stack on phones. */
  .board {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
