/* status.nxtsolution.app. Tokens and faces copied from the site's src/style.css and
   src/fonts.css (latin subsets only) so this page looks like nxtsolution.app without
   depending on it. */

@font-face {
  font-family: 'Saira';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 100% 116%;
  font-display: swap;
  src: url('/fonts/saira-normal-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Saira';
  font-style: italic;
  font-weight: 400 800;
  font-stretch: 100% 116%;
  font-display: swap;
  src: url('/fonts/saira-italic-var-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/barlow-normal-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/barlow-normal-500-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/barlow-normal-600-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-normal-400-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-normal-500-latin.woff2') format('woff2');
}

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

/* The admin page toggles blocks with `hidden`; .form and label set their own display. */
[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --carbon: #0b0909;
  --pit: #141011;
  --pit-2: #1c1718;
  --seam: rgba(255, 228, 228, 0.08);
  --seam-strong: rgba(255, 228, 228, 0.16);
  --smoke: #a09597;
  --chalk: #f6f1ef;
  --nxt-red: #e6000f;
  --nxt-red-hot: #ff2b38;

  --up: #a9d14e;
  --slow: #d9a12b;
  --down: #ff2b38;
  --maint: #5b9cf0;
  --none: rgba(255, 228, 228, 0.1);

  --font-display: 'Saira', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

html {
  background: var(--carbon);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--carbon);
  color: var(--chalk);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, p, ul, ol {
  margin: 0;
}

a {
  color: inherit;
}

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

::selection {
  background: var(--nxt-red);
  color: #fff;
}

.wrap {
  width: min(100% - 32px, 880px);
  margin-inline: auto;
}

/* Status colour: every block carries one s-* class and reads --c. */
.s-up { --c: var(--up); }
.s-slow { --c: var(--slow); }
.s-down { --c: var(--down); }
.s-maint { --c: var(--maint); }
.s-unknown { --c: var(--smoke); }

/* Top bar */
.top {
  border-bottom: 1px solid var(--seam);
}

.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  display: block;
  height: 28px;
  width: auto;
  flex: none;
}

.brand span {
  padding-left: 0.9rem;
  border-left: 1px solid var(--seam-strong);
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
  font-stretch: 112%;
  color: var(--smoke);
  white-space: nowrap;
}

.site-link {
  color: var(--smoke);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-link:hover {
  color: var(--chalk);
}

/* Live dot: a solid dot with a ring that keeps expanding out of it. */
.dot {
  position: relative;
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--c);
  animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.dot.still::after {
  content: none;
}

.dot-lg {
  width: 14px;
  height: 14px;
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.55; }
  80%, 100% { transform: scale(2.8); opacity: 0; }
}

/* Headline banner */
.banner {
  position: relative;
  margin-top: clamp(2rem, 6vw, 3.5rem);
  padding: 1.6rem 1.5rem 1.7rem 1.9rem;
  background: var(--pit);
  border: 1px solid var(--seam);
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
}

.banner::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--c);
}

/* Hazard stripes sliding along the banner while something is down or in maintenance. */
.banner.s-down::after,
.banner.s-maint::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(-56deg, transparent 0 22px, color-mix(in srgb, var(--c) 5%, transparent) 22px 44px);
  background-size: 200% 100%;
  animation: stripes 3s linear infinite;
}

@keyframes stripes {
  to { background-position: -106px 0; }
}

.banner h1 {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.6vw, 2.3rem);
  font-style: italic;
  font-weight: 800;
  font-stretch: 116%;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.banner .affected {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--c);
}

.banner .meta {
  margin-top: 0.5rem;
  color: var(--smoke);
  font-size: 0.95rem;
}

.banner .meta a {
  color: var(--chalk);
  text-underline-offset: 3px;
}

/* Fills up over the 10 minutes between two checks, then starts again. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--seam);
}

.progress i {
  display: block;
  height: 100%;
  background: var(--c);
  transform-origin: left;
  animation: fill 600s linear infinite;
}

@keyframes fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Sections */
.block {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
}

.block h2 {
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.4vw, 1.8rem);
  font-style: italic;
  font-weight: 800;
  font-stretch: 116%;
  line-height: 1.05;
}

.empty {
  color: var(--smoke);
}

/* Services */
.svc-list {
  list-style: none;
  padding: 0;
  background: var(--pit);
  border: 1px solid var(--seam);
  border-radius: 8px;
}

.svc {
  padding: 1.25rem 1.25rem 1rem;
}

.svc + .svc {
  border-top: 1px solid var(--seam);
}

.svc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.svc-name {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.svc-note {
  color: var(--smoke);
  font-size: 0.9rem;
}

.svc-state {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem 0.6rem;
  padding-top: 0.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c);
  white-space: nowrap;
}

.svc-state .dot {
  margin-right: 0.1rem;
}

.svc-ms {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--smoke);
}

/* 90 slanted day bars, like the NXT mark's speed lines. */
.bars {
  display: flex;
  gap: 2px;
  height: 34px;
  margin-top: 1rem;
  padding: 0 4px;
}

.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 1px;
  background: var(--bc);
  transform: skewX(-14deg);
  transform-origin: bottom;
  transition: filter 0.15s ease;
}

.bar:hover {
  filter: brightness(1.45);
}

.b-none { --bc: var(--none); }
.b-up { --bc: var(--up); }
.b-maint { --bc: var(--maint); }
.b-minor { --bc: var(--slow); }
.b-down { --bc: var(--down); }

.first .bar {
  animation: bar-in 0.7s cubic-bezier(0.16, 0.84, 0.3, 1) both;
  animation-delay: calc(var(--i) * 7ms);
}

.bar.today,
.first .bar.today {
  animation: today 2.4s ease-in-out infinite;
}

@keyframes bar-in {
  from { transform: skewX(-14deg) scaleY(0); }
  to { transform: skewX(-14deg) scaleY(1); }
}

@keyframes today {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.svc-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--smoke);
}

.svc-foot > span:nth-child(2) {
  text-align: center;
}

.tip {
  position: fixed;
  z-index: 10;
  max-width: calc(100vw - 32px);
  padding: 0.4rem 0.65rem;
  background: var(--pit-2);
  border: 1px solid var(--seam-strong);
  border-radius: 6px;
  font-size: 0.85rem;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}

/* Maintenances */
.maint {
  background: var(--pit);
  border: 1px solid var(--seam);
  border-radius: 8px;
  overflow: hidden;
}

.maint + .maint {
  margin-top: 1rem;
}

.maint-active {
  position: relative;
}

.maint-active::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: repeating-linear-gradient(-56deg, var(--c) 0 10px, transparent 10px 20px);
  background-size: 200% 100%;
  animation: stripes 2s linear infinite;
}

.maint-head {
  padding: 1.4rem 1.5rem 1.3rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c);
}

.tag .dot {
  width: 8px;
  height: 8px;
}

.maint h3 {
  margin: 0.55rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 700;
  font-stretch: 112%;
  line-height: 1.15;
  text-wrap: balance;
}

.window,
.affects {
  color: var(--smoke);
  font-size: 0.93rem;
}

.updates {
  list-style: none;
  padding: 1.2rem 1.5rem 1.4rem;
  border-top: 1px solid var(--seam);
  background: #100c0d;
}

.updates li {
  position: relative;
  padding-left: 1.4rem;
}

.updates li + li {
  margin-top: 1.1rem;
}

.updates li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  background: var(--c);
  transform: skewX(-14deg);
}

.updates li + li::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: -0.9rem;
  height: 1.1rem;
  width: 1px;
  background: var(--seam-strong);
}

.updates time {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--smoke);
}

.msg p {
  margin-top: 0.3rem;
  font-size: 0.97rem;
  overflow-wrap: anywhere;
}

/* History */
.history {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--seam);
}

.history > li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--seam);
}

.history > li > time {
  padding-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--smoke);
}

.history strong {
  display: block;
  font-weight: 600;
}

.history strong::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 0.6rem 0.12rem 0;
  background: var(--c);
  transform: skewX(-14deg);
}

.history span {
  color: var(--smoke);
  font-size: 0.93rem;
}

.history summary {
  cursor: pointer;
  list-style: none;
}

.history summary::-webkit-details-marker {
  display: none;
}

.history summary span::after {
  content: ' Voir le détail';
  color: var(--chalk);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.history details[open] summary span::after {
  content: ' Masquer';
}

.history details .maint {
  margin-top: 0.8rem;
}

/* Footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  margin-top: clamp(3rem, 8vw, 4.5rem);
  padding: 1.6rem 0 2.2rem;
  border-top: 1px solid var(--seam);
  color: var(--smoke);
  font-size: 0.85rem;
}

/* Admin */
.admin-title {
  margin-top: clamp(2rem, 6vw, 3rem);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-style: italic;
  font-weight: 800;
  font-stretch: 116%;
  line-height: 1.05;
}

.flash {
  margin-top: 1rem;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--c, var(--up));
  background: var(--pit);
}

.form {
  display: grid;
  gap: 1.1rem;
  max-width: 640px;
  margin-top: 1.6rem;
}

.form h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 800;
  font-stretch: 116%;
}

.form label,
.form legend {
  display: grid;
  gap: 0.4rem;
  font-weight: 500;
}

.form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.form input:not([type='checkbox']),
.form textarea,
.inline-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  background: var(--pit);
  border: 1px solid var(--seam-strong);
  border-radius: 6px;
  color: var(--chalk);
  font: inherit;
  font-weight: 400;
}

.form textarea,
.inline-form textarea {
  resize: vertical;
}

.form input:focus,
.form textarea:focus,
.inline-form textarea:focus {
  outline: none;
  border-color: var(--nxt-red);
}

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin-top: 0.5rem;
}

.boxes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
}

.boxes input {
  width: 18px;
  height: 18px;
  accent-color: var(--nxt-red);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1.4rem;
  margin-top: 1.4rem;
}

.form .actions {
  margin-top: 0.3rem;
}

/* Slanted buttons, same as the site's .btn. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.7rem;
  background: none;
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  font-weight: 700;
  font-stretch: 112%;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 4px;
  transform: skewX(-14deg);
  transition: background-color 0.2s ease;
}

.btn-red::before {
  background: var(--nxt-red);
}

.btn-red:hover::before {
  background: var(--nxt-red-hot);
}

.btn-ghost::before {
  border: 1px solid var(--seam-strong);
  background: rgba(255, 255, 255, 0.02);
}

.btn-ghost:hover::before {
  background: rgba(255, 255, 255, 0.06);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.link-btn {
  padding: 0;
  background: none;
  border: 0;
  color: var(--smoke);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--chalk);
}

.link-btn.danger:hover {
  color: var(--down);
}

.admin-card + .admin-card {
  margin-top: 1rem;
}

.inline-form {
  display: grid;
  gap: 0.8rem;
  padding: 1.1rem 1.5rem 1.4rem;
  border-top: 1px solid var(--seam);
}

.inline-form .actions {
  margin-top: 0;
}

@media (max-width: 640px) {
  .bar:nth-child(-n + 60) {
    display: none;
  }

  /* Only the percentage stays under the 30 bars left on a phone. */
  .svc-foot > span:first-child,
  .svc-foot > span:last-child {
    display: none;
  }

  .svc-foot > span:nth-child(2) {
    text-align: left;
  }

  .history > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .row {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-link {
    display: none;
  }
}

@media (max-width: 400px) {
  .brand span {
    font-size: 0.9rem;
  }

  .svc-head {
    flex-direction: column;
    gap: 0.4rem;
  }

  .svc-state {
    justify-content: flex-start;
  }
}

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

  .progress {
    display: none;
  }
}
