/* hasaiwipedouthumanityyet.com */

:root {
  --bg: #fafaf9;
  --fg: #111110;
  --muted: #6b6b68;
  --faint: #737370;
  --border: #e4e4e0;
  --green: #1a7f4b;
  --neon: #2bff6f;
  --warn: #e5322d;
  --neon-glow: rgba(43, 255, 111, 0.55);
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 46rem;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

h1, h2, h3, p, dl, dd {
  margin: 0;
}

/* Skip link */

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.5rem 0.75rem;
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-120%);
  transition: transform 120ms;
  z-index: 10;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Status dot */

.dot {
  display: inline-block;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 6px 1px var(--neon-glow);
  margin-right: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -0.05em;
}

.dot-neutral {
  background: var(--faint);
  box-shadow: none;
}

.answer-note .dot,
.status-row .dot:not(.dot-neutral) {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 6px 1px var(--neon-glow), 0 0 0 0 rgba(43, 255, 111, 0.6);
  }
  50% {
    box-shadow: 0 0 14px 4px var(--neon-glow), 0 0 0 8px rgba(43, 255, 111, 0);
  }
}

/* Hero */

main {
  flex: 1;
  padding-block: 4rem 3rem;
}

.hero {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

h1 {
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 30ch;
  margin-inline: auto;
}

.answer {
  font-size: clamp(7rem, 32vw, 20rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  margin-top: 1rem;
  margin-right: -0.05em;
  text-transform: uppercase;
}

.answer-note {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 1.75rem;
}

.answer-note .dot {
  margin-right: 0.625rem;
}

.last-checked {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* Forecast */

.forecast {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.countdown {
  font-size: 1.125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.countdown-days {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  vertical-align: -0.1em;
  margin-right: 0.1em;
  animation: warn 9s linear infinite;
  animation-delay: -7.7s; /* start just before the flash so it fires on load */
}

/* A brief double flash in warning red every nine seconds. */
@keyframes warn {
  0%, 88% { color: var(--fg); text-shadow: none; }
  89%, 91% { color: var(--warn); text-shadow: 0 0 12px rgba(229, 50, 45, 0.35); }
  92%, 93% { color: var(--fg); text-shadow: none; }
  94%, 96% { color: var(--warn); text-shadow: 0 0 12px rgba(229, 50, 45, 0.35); }
  97%, 100% { color: var(--fg); text-shadow: none; }
}

.countdown sup {
  font-size: 0.7em;
  line-height: 0;
  color: var(--muted);
}

.countdown-note {
  font-size: 0.8125rem;
  color: var(--faint);
  margin-top: 0.5rem;
  line-height: 1.2;
}

/* Sections */

section + section {
  padding-top: 3rem;
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Split-flap display */

.flap-display {
  display: inline-flex;
  gap: 0.2rem;
  perspective: 800px;
  --flap-size: 4.25rem;
  --flap-bg: #1c1c1a;
  --flap-seam: #050505;
  --flap-fg: #f4f4f1;
}

.flap-large {
  --flap-size: 3.5rem;
}

.flap {
  position: relative;
  display: inline-block;
  width: 0.72em;
  height: 1.3em;
  font-size: var(--flap-size);
  font-weight: 600;
  line-height: 1.3em;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  background: var(--flap-seam);
  border-radius: 0.09em;
  color: var(--flap-fg);
  text-align: center;
  transform-style: preserve-3d;
}

.half {
  position: absolute;
  left: 0;
  width: 100%;
  height: calc(50% - 0.5px);
  overflow: hidden;
  background: var(--flap-bg);
  backface-visibility: hidden;
}

.half b {
  display: block;
  height: 1.3em;
  line-height: 1.3em;
  font-weight: inherit;
}

.top {
  top: 0;
  border-radius: 0.09em 0.09em 0 0;
  transform-origin: 50% 100%;
}

.bottom {
  bottom: 0;
  border-radius: 0 0 0.09em 0.09em;
  transform-origin: 50% 0;
}

.bottom b {
  margin-top: calc(-0.65em - 0.5px);
}

.flip-top,
.flip-bottom {
  visibility: hidden;
}

.flipping .flip-top {
  visibility: visible;
  animation: flip-top 140ms ease-in forwards;
}

.flipping .flip-bottom {
  visibility: visible;
  animation: flip-bottom 140ms ease-out forwards;
}

@keyframes flip-top {
  0% { transform: rotateX(0); }
  50%, 100% { transform: rotateX(-90deg); }
}

@keyframes flip-bottom {
  0%, 50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0); }
}

/* Uptime rows */

.uptime {
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.uptime-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 2.5rem 1rem;
  padding-top: 1rem;
}

.uptime-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
}

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

.logo {
  width: 5rem;
  height: 5rem;
  flex: none;
  object-fit: contain;
}

.stat-label {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
}

.stat-meta {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--faint);
}

/* Incidents and components, side by side on wider screens */

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem 2rem;
  padding-top: 3rem;
}

.two-col > section {
  padding-top: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 40rem) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Incident board */

.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}

.board-title {
  padding: 0.875rem 1rem;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
}

.incident-note {
  padding: 0 1rem 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* Components table */

.status-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.status-row {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  text-align: left;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.status-row dt {
  font-weight: 500;
}

.status-row dd {
  color: var(--muted);
  text-align: right;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 3rem;
}

.footer-primary {
  font-size: 0.9375rem;
  font-weight: 500;
}

.footer-small {
  font-size: 0.8125rem;
  color: var(--faint);
  margin-top: 0.5rem;
}

.footer-credit {
  margin-top: 1.5rem;
  font-size: 0.8125rem;
}

.footer-credit a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
}

.footer-credit a:hover {
  color: var(--fg);
  border-color: var(--fg);
}

.footer-credit .icon {
  flex: none;
}

/* Focus */

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

/* Reduced motion */

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

/* Small screens */

@media (max-width: 480px) {
  main {
    padding-block: 2.5rem 2rem;
  }

  .hero {
    padding-bottom: 2.5rem;
  }

  .answer {
    font-size: clamp(6rem, 47vw, 11rem);
  }

  .flap-display {
    --flap-size: 3rem;
    gap: 0.15rem;
  }

  .flap-large {
    --flap-size: 3.5rem;
  }

  .logo {
    width: 3.75rem;
    height: 3.75rem;
  }

  .uptime-main {
    gap: 1rem;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .status-row dd {
    text-align: left;
  }
}
