@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg0: #070b12;
  --bg1: #101826;
  --bg2: #162033;
  --ink: #e8eef7;
  --muted: #8b9bb3;
  --line: rgba(232, 238, 247, 0.12);
  --card: rgba(18, 28, 44, 0.88);
  --card-solid: #121c2c;
  --pass: #3ecf8e;
  --warn: #f0b429;
  --fail: #ff6b6b;
  --skip: #6d7f99;
  --accent: #5ee0c4;
  --accent-2: #f0a46a;
  --glow: rgba(94, 224, 196, 0.18);
  --font: "DM Sans", "Segoe UI", sans-serif;
  --display: "Syne", "Avenir Next", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.theme-dark {
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(94, 224, 196, 0.12), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(240, 164, 106, 0.1), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0c1420);
  background-attachment: fixed;
}
a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  background: rgba(7, 11, 18, 0.65);
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo {
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}
.logo span { color: var(--accent); }

.hero-band {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-band::before {
  content: "";
  position: absolute;
  inset: auto -10% -40% -10%;
  height: 70%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(94, 224, 196, 0.08), transparent 60%),
    linear-gradient(180deg, transparent, rgba(8, 16, 28, 0.9));
  pointer-events: none;
}
.hero-inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  padding: 3.25rem 1.5rem 2.5rem;
}
.score-inner {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hero-inner h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  margin: 0 0 0.55rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.lede, .subject, .wait-line, .hint, .eyebrow { color: var(--muted); }
.eyebrow { margin: 0 0 0.4rem; font-size: 0.92rem; letter-spacing: 0.04em; text-transform: uppercase; }

.score-badge {
  width: 8.25rem;
  height: 8.25rem;
  border-radius: 28% 72% 35% 65% / 55% 30% 70% 45%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.2), transparent 45%),
    linear-gradient(145deg, #1d3b34, #0f241f 60%, #16352c);
  border: 1px solid rgba(62, 207, 142, 0.55);
  box-shadow: 0 0 0 8px rgba(62, 207, 142, 0.08), 0 18px 40px rgba(0,0,0,0.35);
  display: grid;
  place-content: center;
  text-align: center;
  animation: badge-drift 8s ease-in-out infinite;
}
.score-num { font-family: var(--display); font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--pass); }
.score-max { color: var(--muted); font-weight: 600; }
@keyframes badge-drift {
  0%, 100% { border-radius: 28% 72% 35% 65% / 55% 30% 70% 45%; }
  50% { border-radius: 62% 38% 58% 42% / 42% 58% 42% 58%; }
}

.copy-row {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  max-width: 42rem;
  margin: 1.35rem 0 0.85rem;
}
.copy-row.compact { margin: 0; max-width: 28rem; }
.copy-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0.8rem 0.95rem;
  font: inherit;
  background: rgba(7, 11, 18, 0.7);
  color: var(--ink);
}
.copy-btn {
  width: 3rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(94, 224, 196, 0.08);
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.copy-btn:hover { background: rgba(94, 224, 196, 0.18); transform: translateY(-1px); }
.copy-btn.copied { background: var(--pass); border-color: var(--pass); color: #062116; }

.cta {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.8rem 1.2rem;
  background: linear-gradient(120deg, var(--accent), #3ecf8e);
  color: #062116;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 10px 30px var(--glow);
}

.report-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.4rem 1.5rem 3.5rem;
}
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.accordions { display: grid; gap: 0.7rem; }
.accordion {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.accordion > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), transparent);
  font-weight: 600;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}
.accordion[open] > summary::before { transform: rotate(225deg); }
.acc-title { flex: 1; }
.acc-status {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.35rem;
  flex: 0 0 auto;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.acc-status.status-pass, .acc-status.status-skip { background: var(--pass); }
.acc-status.status-warn { background: var(--warn); }
.acc-status.status-fail { background: var(--fail); }
.acc-status.status-pass::after,
.acc-status.status-skip::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#062116,#062116) 28% 55%/18% 3px no-repeat,
    linear-gradient(#062116,#062116) 48% 45%/3px 45% no-repeat;
  transform: rotate(-40deg);
}
.acc-status.status-warn::after {
  content: "!";
  color: #2a1a00;
  font-weight: 800;
  display: grid;
  place-items: center;
  height: 100%;
}
.acc-status.status-fail::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 55%;
  height: 2.5px;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: none;
}
.acc-status.status-fail::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 55%;
  height: 2.5px;
  background: #fff;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.acc-body { padding: 0.9rem 1.05rem 1.15rem; border-top: 1px solid var(--line); }

.nested { margin: 0.45rem 0; border: 1px solid var(--line); border-radius: 0.55rem; background: rgba(7, 11, 18, 0.45); }
.nested > summary { padding: 0.7rem 0.85rem; cursor: pointer; font-weight: 600; }
.preview-frame {
  width: 100%;
  min-height: 220px;
  border: 0;
  background: #fff;
}
.code-block {
  margin: 0;
  padding: 0.9rem;
  overflow: auto;
  max-height: 320px;
  background: #05080e;
  color: #d7e4f5;
  font-size: 0.82rem;
  white-space: pre-wrap;
}

.rules-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rules-table th, .rules-table td { text-align: left; padding: 0.5rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.rules-table code { color: var(--accent-2); font-size: 0.85rem; }

.link-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.link-list .dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: var(--skip);
  flex: 0 0 auto;
}
.link-list .pass .dot { background: var(--pass); }
.link-list .fail .dot { background: var(--fail); }
.link-list p { margin: 0.2rem 0 0; color: var(--muted); }
.check-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.check-list .dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: var(--skip);
  flex: 0 0 auto;
}
.check-list .pass .dot { background: var(--pass); }
.check-list .warn .dot { background: var(--warn); }
.check-list .fail .dot { background: var(--fail); }
.check-list p { margin: 0.2rem 0 0; color: var(--muted); }
.fix { color: var(--muted); font-size: 0.92rem; }

.bl-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 1rem;
}
.bl-grid .clean { color: var(--pass); font-weight: 600; }
.bl-grid .listed { color: var(--fail); font-weight: 600; }
.bl-grid a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bl-grid a.bl-quiet { opacity: 0.85; font-weight: 500; }
.dns-suggest {
  margin: 0.55rem 0 0;
  padding: 0.75rem 0.85rem;
  overflow: auto;
  background: #05080e;
  color: #d7e4f5;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  font-size: 0.82rem;
  white-space: pre-wrap;
  line-height: 1.45;
}
@media (max-width: 700px) {
  .bl-grid { grid-template-columns: 1fr 1fr; }
}

/* —— Waiting voyage —— */
.voyage {
  margin-top: 2rem;
  padding: 1.25rem 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(22, 40, 58, 0.65), rgba(8, 14, 24, 0.85));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.voyage-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.voyage-meta strong { color: var(--ink); font-family: var(--display); }
.sea {
  position: relative;
  height: 7.5rem;
  overflow: hidden;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 20% 120%, rgba(94, 224, 196, 0.12), transparent 50%),
    linear-gradient(180deg, #0b1524 0%, #0f2740 55%, #0a1a2c 100%);
}
.sea-stars span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.7);
  animation: twinkle 3s ease-in-out infinite;
}
.sea-stars span:nth-child(1) { top: 18%; left: 12%; }
.sea-stars span:nth-child(2) { top: 28%; left: 42%; animation-delay: 0.6s; }
.sea-stars span:nth-child(3) { top: 14%; left: 70%; animation-delay: 1.1s; }
.sea-stars span:nth-child(4) { top: 36%; left: 88%; animation-delay: 1.7s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.4); }
}
.wave {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 2.4rem;
  opacity: 0.55;
  background: radial-gradient(closest-side at 50% 0%, transparent 60%, rgba(94, 224, 196, 0.18) 61%, transparent 70%) 0 0 / 3rem 100% repeat-x;
  animation: wave-drift 7s linear infinite;
}
.wave.w1 { bottom: 1.1rem; opacity: 0.35; animation-duration: 9s; }
.wave.w2 { bottom: 0.35rem; opacity: 0.55; animation-duration: 6s; animation-direction: reverse; }
.wave.w3 { bottom: -0.2rem; opacity: 0.75; height: 1.6rem; animation-duration: 4.5s; }
@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(3rem); }
}
.ship-track {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 1.35rem;
  height: 3.5rem;
}
.ship {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 4.2rem;
  height: 3.2rem;
  transition: left 4.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: ship-bob 2.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
  will-change: left;
}
.ship svg { width: 100%; height: 100%; display: block; }
@keyframes ship-bob {
  0%, 100% { translate: 0 0; rotate: -2deg; }
  50% { translate: 0 -6px; rotate: 2deg; }
}
.lighthouse {
  position: absolute;
  right: 0.75rem;
  bottom: 1.7rem;
  width: 0.55rem;
  height: 2.2rem;
  border-radius: 0.2rem 0.2rem 0 0;
  background: linear-gradient(#f0a46a, #8a4b20);
  box-shadow: 0 0 18px rgba(240, 164, 106, 0.55);
}
.lighthouse::after {
  content: "";
  position: absolute;
  top: -0.2rem;
  left: 50%;
  width: 4.5rem;
  height: 1.2rem;
  transform: translateX(-10%);
  background: linear-gradient(90deg, rgba(240,164,106,0.45), transparent);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 60%);
  animation: beam 3.5s ease-in-out infinite;
  transform-origin: left center;
}
@keyframes beam {
  0%, 100% { opacity: 0.35; transform: translateX(-10%) scaleX(0.85); }
  50% { opacity: 0.9; transform: translateX(-10%) scaleX(1.15); }
}
.voyage-caption {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.voyage-caption em { color: var(--accent); font-style: normal; font-weight: 600; }

/* —— 404 lost at sea —— */
.lost-sea {
  position: relative;
  min-height: calc(100vh - 4rem);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2rem;
  padding: 3rem 1.5rem 5rem;
  overflow: hidden;
}
.lost-sky { position: absolute; inset: 0; pointer-events: none; }
.lost-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.75);
  animation: twinkle 3.2s ease-in-out infinite;
}
.lost-star.s1 { top: 14%; left: 18%; }
.lost-star.s2 { top: 22%; left: 62%; animation-delay: 0.7s; }
.lost-star.s3 { top: 10%; left: 78%; animation-delay: 1.3s; }
.lost-star.s4 { top: 28%; left: 40%; animation-delay: 1.9s; }
.lost-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 36rem;
}
.lost-code {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4.5rem, 14vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--accent), #3ecf8e 45%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 12px 30px var(--glow));
}
.lost-copy h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.03em;
}
.lost-path {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--line);
  color: var(--accent-2);
  font-size: 0.9rem;
  word-break: break-all;
}
.lost-scene {
  position: relative;
  width: min(28rem, 100%);
  height: 11rem;
  z-index: 1;
}
.lost-waves {
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(180deg, transparent, rgba(15, 39, 64, 0.85));
}
.lost-wave {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 2.2rem;
  opacity: 0.5;
  background: radial-gradient(closest-side at 50% 0%, transparent 60%, rgba(94, 224, 196, 0.2) 61%, transparent 70%) 0 0 / 2.8rem 100% repeat-x;
  animation: wave-drift 7s linear infinite;
}
.lost-wave.w1 { bottom: 1.4rem; opacity: 0.3; animation-duration: 9s; }
.lost-wave.w2 { bottom: 0.55rem; animation-duration: 6s; animation-direction: reverse; }
.lost-wave.w3 { bottom: -0.15rem; opacity: 0.7; height: 1.5rem; animation-duration: 4.8s; }
.lost-bottle {
  position: absolute;
  left: 42%;
  bottom: 1.6rem;
  width: 5.5rem;
  animation: bottle-drift 5.5s ease-in-out infinite;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.35));
}
.lost-bottle svg { width: 100%; height: auto; display: block; }
@keyframes bottle-drift {
  0%, 100% { transform: translate(-50%, 0) rotate(-8deg); }
  50% { transform: translate(-30%, -12px) rotate(6deg); }
}
