/* Norris Construction Hub: shared look for every teammate.
   Deep river greens and blues, chrome accents, big type and big targets. */

:root {
  --river-abyss: #061a1e;
  --river-deep: #0a2328;
  --river: #0f3438;
  --river-mid: #15474a;
  --current: #1d5f5d;
  --moss: #2c6b4f;
  --mist: #cfe3de;
  --text: #f2f7f5;
  --text-soft: #b9cfca;
  --text-faint: #86a39d;
  --chrome-1: #f7fafa;
  --chrome-2: #b9c6c8;
  --chrome-3: #7d8d91;
  --chrome: linear-gradient(135deg, var(--chrome-1) 0%, var(--chrome-2) 45%, #e9eff0 55%, var(--chrome-3) 100%);
  --salmon: #ff8a73;
  --salmon-deep: #f0624a;
  --chartreuse: #d4f53c;
  --go: #34d17a;
  --wait: #ffcf3d;
  --stop: #ff5a4c;
  --panel: rgba(9, 34, 38, 0.82);
  --panel-line: rgba(207, 227, 222, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --tap: 60px;
  --font: "Barlow", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Bahnschrift", "Arial Narrow", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--river-abyss); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(44, 107, 79, 0.35), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(29, 95, 93, 0.45), transparent 60%),
    linear-gradient(180deg, var(--river-deep) 0%, var(--river-abyss) 100%);
}
body.modal-open { overflow: hidden; }

/* A slow river current drifting behind everything (pure decoration, never in the way). */
body::before {
  content: ""; position: fixed; z-index: -1; top: 0; bottom: 0; left: 0; width: calc(100% + 640px);
  pointer-events: none; opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='260' viewBox='0 0 640 260'%3E%3Cg fill='none' stroke='%23cfe3de' stroke-linecap='round'%3E%3Cpath stroke-opacity='0.07' stroke-width='1.5' d='M0 40 C80 28 160 52 240 40 S400 28 480 40 S600 52 640 40'/%3E%3Cpath stroke-opacity='0.05' stroke-width='1' d='M0 95 C80 85 160 105 240 95 S400 85 480 95 S600 105 640 95'/%3E%3Cpath stroke-opacity='0.08' stroke-width='2' d='M0 150 C90 136 170 164 260 150 S420 136 500 150 S610 164 640 150'/%3E%3Cpath stroke-opacity='0.04' stroke-width='1' d='M0 205 C80 195 160 215 240 205 S400 195 480 205 S600 215 640 205'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 640px 260px;
  animation: current 70s linear infinite;
  will-change: transform;
}
@keyframes current { from { transform: translateX(-640px); } to { transform: translateX(0); } }

/* Tape-measure rule: a craftsman's touch */
.tape-rule {
  height: 16px; margin: 6px 0 26px; border-bottom: 2px solid rgba(207, 227, 222, 0.35);
  background:
    repeating-linear-gradient(90deg, rgba(212, 245, 60, 0.85) 0 2px, transparent 2px 96px) left bottom / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, rgba(207, 227, 222, 0.55) 0 1.5px, transparent 1.5px 48px) left bottom / 100% 11px no-repeat,
    repeating-linear-gradient(90deg, rgba(207, 227, 222, 0.3) 0 1px, transparent 1px 12px) left bottom / 100% 6px no-repeat;
}

a { color: var(--chartreuse); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.01em; line-height: 1.15; margin: 0 0 0.4em; }
p { margin: 0 0 0.75em; }

:focus-visible { outline: 3px solid var(--chartreuse); outline-offset: 3px; border-radius: 6px; }

.screen {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 16px 64px;
  animation: screen-in 0.22s ease-out;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

/* ---------- Buttons: big, obvious, glove-friendly ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap);
  padding: 12px 24px;
  border-radius: 14px;
  border: 2px solid transparent;
  font: 700 19px/1.1 var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #ff9b86, var(--salmon-deep));
  color: #2a0d07;
  box-shadow: 0 6px 18px rgba(240, 98, 74, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary {
  background: rgba(207, 227, 222, 0.08);
  border-color: rgba(207, 227, 222, 0.35);
  color: var(--text);
}
.btn-secondary:hover { background: rgba(207, 227, 222, 0.14); }
.btn-quiet {
  background: transparent;
  border-color: rgba(207, 227, 222, 0.25);
  color: var(--text-soft);
}
.btn-quiet:hover { color: var(--text); border-color: rgba(207, 227, 222, 0.5); }
.btn-danger { background: transparent; border-color: rgba(255, 90, 76, 0.6); color: #ffb3ab; }
.btn-big { min-height: 76px; font-size: 24px; padding: 16px 32px; border-radius: 18px; }
.btn-block { width: 100%; }

/* ---------- Hub home ---------- */
.hub-header { margin: 12px 0 0; }
.hub-kicker {
  font: 700 15px/1 var(--font); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--chartreuse); margin-bottom: 10px;
}
.hub-title { font-size: clamp(44px, 7vw, 76px); font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; line-height: 0.95; margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #dfe8e9 48%, #9fb0b3 52%, #f2f6f6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hub-sub { color: var(--text-soft); font-size: 21px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.tile {
  position: relative;
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  min-height: 190px;
}
.tile-active {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, rgba(29, 95, 93, 0.9), rgba(10, 35, 40, 0.95));
  border: 1px solid rgba(207, 227, 222, 0.3);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tile-active:hover { transform: translateY(-2px); border-color: var(--chartreuse); }
.tile-mark {
  flex: 0 0 auto; width: 150px; height: 120px; border-radius: 24px;
  background: radial-gradient(circle at 50% 40%, rgba(29, 95, 93, 0.9), rgba(3, 16, 18, 0.6));
  border: 1px solid rgba(207, 227, 222, 0.18);
  display: grid; place-items: center;
}
.tile-mark:empty::after { content: "360"; font: 800 38px/1 var(--font-display); color: var(--chrome-1); }
.tile-name { font: 800 44px/1 var(--font-display); margin-bottom: 6px; letter-spacing: 0.01em; }
.tile-title { display: block; font: 600 18px/1.3 var(--font); color: var(--chartreuse); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 4px; }
.tile-tagline { color: var(--text-soft); font-size: 19px; }
.tile-cta { margin-top: 14px; font-weight: 700; color: var(--salmon); font-size: 20px; }
.tile-stage {
  display: inline-block; margin-bottom: 8px; padding: 4px 12px; border-radius: 999px;
  font: 800 14px/1.3 var(--font); letter-spacing: 0.12em; text-transform: uppercase;
  background: rgba(0, 0, 0, 0.3); color: var(--text-soft); border: 1px solid rgba(207, 227, 222, 0.22);
}
.tile-soon { opacity: 0.62; }
.tile-soon .tile-name { font-size: 32px; }
.tile-badge {
  display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px;
  font: 700 14px/1.4 var(--font); letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(207, 227, 222, 0.12); color: var(--text-soft);
}
.hub-footer { margin-top: 28px; display: flex; justify-content: center; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  transform: translate(-50%, 20px);
  opacity: 0; visibility: hidden;
  max-width: min(560px, calc(100vw - 32px));
  padding: 16px 22px; border-radius: 14px;
  background: #e9f5f1; color: #082024; font-weight: 600; font-size: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
#toast[data-tone="error"] { background: #ffe1dc; color: #4a0f08; }

/* ---------- Pop-up windows ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 14, 16, 0.72);
  display: grid; place-items: center; padding: 16px;
  animation: fade-in 0.15s ease-out;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px); overflow: auto;
  background: linear-gradient(180deg, #123d40, #0b282c);
  border: 1px solid rgba(207, 227, 222, 0.25);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop-in 0.2s ease-out;
}
.modal-title { font-size: 30px; }
.modal-body { font-size: 20px; color: var(--text-soft); }
.modal-body p { color: var(--text); }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.modal-actions .btn { min-width: 140px; }
@keyframes fade-in { from { opacity: 0; } }
.modal-backdrop.still, .modal-backdrop.still .modal { animation: none; }
.wt-slide { animation: slide-in 0.2s ease-out; }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* Walkthrough */
.walkthrough .modal-actions { justify-content: space-between; }
.walkthrough .modal-actions .btn-primary { flex: 1; min-height: 72px; font-size: 22px; }
.wt-step { font: 700 14px/1 var(--font); letter-spacing: 0.18em; text-transform: uppercase; color: var(--chartreuse); margin: 4px 0 14px; }
.wt-dots { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }
.wt-dots span { width: 12px; height: 12px; border-radius: 50%; background: rgba(207, 227, 222, 0.25); }
.wt-dots span.on { background: var(--salmon); }
.wt-lights { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.wt-lights li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, 0.2); color: var(--text); }
.wt-lights b { display: block; font-family: var(--font-display); font-size: 21px; letter-spacing: 0.04em; }
.wt-lights .dot { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; margin-top: 2px; }

.friendly-error { max-width: 560px; margin: 40px auto; }

@media (max-width: 640px) {
  body { font-size: 18px; }
  .screen { padding-top: 18px; }
  .tile-active { flex-direction: column; align-items: flex-start; }
  .tile-mark { width: 96px; height: 96px; }
  .modal { padding: 22px; }
  .walkthrough .modal-actions { flex-direction: column-reverse; }
  .walkthrough .modal-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- welcome + lock screen ---------- */
.welcome-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.welcome-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); color: var(--text); }
.welcome-steps b { display: block; font-size: 19px; }
.wl-step { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--chartreuse); color: #0a2328; font: 800 17px/1 var(--font-display); }
.lock-screen { min-height: 100vh; display: grid; place-items: center; }
.lock-card {
  width: min(460px, 100%); display: grid; gap: 14px; justify-items: stretch; text-align: center;
  padding: 30px 26px; border-radius: 24px; background: var(--panel); border: 1px solid var(--panel-line); box-shadow: var(--shadow);
}
.lock-icon { width: 96px; height: 96px; border-radius: 22px; justify-self: center; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.lock-card .hub-kicker { margin: 4px 0 0; }
.lock-title { font: 800 34px/1 var(--font-display); text-transform: uppercase; margin: 0; }
.lock-sub { color: var(--text-soft); margin: 0; }
.lock-card input {
  min-height: 64px; padding: 12px 16px; border-radius: 14px; text-align: center;
  border: 2px solid rgba(207, 227, 222, 0.3); background: rgba(3, 16, 18, 0.6); color: var(--text); font: 700 24px var(--font); letter-spacing: 0.1em;
}
.lock-card input:focus { outline: none; border-color: var(--chartreuse); }
.lock-err { margin: 0; color: #ffb3ab; font-weight: 700; }
