/* Look and feel inspired by uptimekuma.co: Inter, navy text, mint-green accent, pill shapes, soft shadows. */

:root {
  --bg: #ffffff;
  --band: #f1f3f4;
  --surface: #ffffff;
  --text: #1c2440;
  --heading: #0b1341;
  --muted: #5b6478;
  --line: #e4e7ec;
  --link: #0063dc;
  --accent: #5cdd8b;
  --accent-strong: #3cc46f;
  --accent-ink: #0b1341;
  --chip: #f1f3f4;
  --shadow: 0 6px 24px rgba(28, 36, 64, 0.08);

  --ok: #5cdd8b;
  --ok-ink: #0b3d1f;
  --bad: #dc3545;
  --bad-ink: #ffffff;
  --warn: #f8a306;
  --warn-ink: #3a2600;
  --unknown: #9ca3af;
  --unknown-ink: #ffffff;

  --radius: 8px;
  --pill: 9999px;
  --wrap: 1100px;
  --narrow: 760px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --band: #111827;
    --surface: #161e33;
    --text: #d6dbe7;
    --heading: #ffffff;
    --muted: #9099b0;
    --line: #26304a;
    --link: #6aa8ff;
    --chip: #1f2942;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --unknown: #4b5563;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --band: #111827;
  --surface: #161e33;
  --text: #d6dbe7;
  --heading: #ffffff;
  --muted: #9099b0;
  --line: #26304a;
  --link: #6aa8ff;
  --chip: #1f2942;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --unknown: #4b5563;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--chip);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}
.narrow {
  max-width: var(--narrow);
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- nav ---------- */

.nav {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-weight: 800;
  font-size: 1.1rem;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang {
  display: inline-flex;
  background: var(--chip);
  border-radius: var(--pill);
  padding: 3px;
}
.lang button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--pill);
  cursor: pointer;
}
.lang button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--heading);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--chip);
  color: var(--heading);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

/* ---------- hero ---------- */

.hero {
  padding: 72px 0 64px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 14px;
  border-radius: var(--pill);
  background: var(--chip);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.lead {
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 auto 32px;
  max-width: 640px;
}

.check {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--pill);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.check input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--heading);
  font: inherit;
  font-size: 1.05rem;
  padding: 10px 18px;
  outline: none;
}
.check:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 3px rgba(92, 221, 139, 0.3);
}
.note {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--pill);
  padding: 12px 28px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-strong);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-primary:disabled {
  opacity: 0.75;
  cursor: progress;
}
.btn.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.btn-secondary {
  background: var(--heading);
  color: var(--bg);
  padding: 10px 22px;
}
.btn-secondary:hover {
  opacity: 0.9;
}
.btn-ghost {
  background: transparent;
  color: var(--heading);
  border: 1px solid var(--line);
  padding: 8px 16px;
  font-size: 0.85rem;
}
.btn-ghost:hover {
  background: var(--chip);
}

/* ---------- pills ---------- */

.pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--pill);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.pill-sm {
  padding: 2px 10px;
  font-size: 0.78rem;
}
.pill-patched { background: var(--ok); color: var(--ok-ink); }
.pill-vulnerable { background: var(--bad); color: var(--bad-ink); }
.pill-eol { background: var(--bad); color: var(--bad-ink); }
.pill-check-host { background: var(--warn); color: var(--warn-ink); }
.pill-unknown { background: var(--warn); color: var(--warn-ink); }
.pill-no-php { background: var(--unknown); color: var(--unknown-ink); }

/* ---------- result ---------- */

.result-region {
  margin-top: 32px;
  text-align: left;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.result {
  border-left: 5px solid var(--unknown);
  animation: rise 0.25s ease-out;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
}
.result.is-patched { border-left-color: var(--ok); }
.result.is-vulnerable,
.result.is-eol { border-left-color: var(--bad); }
.result.is-check-host,
.result.is-unknown { border-left-color: var(--warn); }

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
}
.result-host {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 0;
  line-height: 1.3;
}
.result-host .host {
  color: var(--heading);
  overflow-wrap: anywhere;
}
.result-host .redirect {
  font-size: 0.8rem;
}
.result-head .recheck {
  margin-left: auto;
  flex-shrink: 0;
}
.result-head .share {
  flex-shrink: 0;
}
.share.copied {
  color: var(--accent-strong);
}
.result-title {
  font-size: 1.35rem;
}
.result-body {
  margin: 0 0 20px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
}
.facts div {
  background: var(--chip);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 0;
}
.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 700;
  color: var(--heading);
  overflow-wrap: anywhere;
}

.result h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 8px;
}
.signals {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  background: var(--chip);
  border-radius: var(--pill);
  padding: 4px 12px;
  font-size: 0.85rem;
}
.chip code {
  background: transparent;
  padding: 0;
  color: var(--muted);
}
.steps {
  margin: 0 0 4px;
  padding-left: 20px;
}
.steps li {
  margin-bottom: 6px;
}

.hostmsg {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hostmsg-intro {
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.hostmsg-text {
  display: block;
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.hostmsg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cta {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--band);
  display: flex;
  align-items: center;
  gap: 16px;
}
.cta-text {
  margin: 0;
  font-size: 0.92rem;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.35);
  color: var(--heading);
}

/* ---------- info band ---------- */

.band {
  background: var(--band);
  padding: 72px 0;
}
.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 32px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid .card h3 {
  font-size: 1.15rem;
}
.grid .card p {
  margin: 0;
}
.versions {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.versions li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.versions li:last-child {
  border-bottom: 0;
}
.branch {
  font-weight: 600;
  color: var(--heading);
}

/* ---------- faq ---------- */

.faq {
  padding: 72px 0;
}
details {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  padding: 0 20px;
}
summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: var(--heading);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
summary::-webkit-details-marker {
  display: none;
}
summary::after {
  content: "+";
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
}
details[open] summary::after {
  content: "–";
}
details p {
  margin: 0;
  padding: 0 0 16px;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-size: 0.9rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: start;
}
.footer-text p {
  margin: 0 0 4px;
}
.logo {
  display: block;
  height: 34px;
  width: auto;
}
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.footer-links li {
  margin-bottom: 2px;
}

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

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding: 48px 0 40px;
  }
  .eyebrow {
    font-size: 0.72rem;
    padding: 6px 12px;
    text-align: left;
  }
  .dot {
    flex-shrink: 0;
  }
  .check {
    flex-direction: column;
    border-radius: 16px;
  }
  .check input {
    padding: 12px 14px;
  }
  .check .btn {
    width: 100%;
  }
  .facts {
    grid-template-columns: 1fr;
  }
  .cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .card {
    padding: 20px 16px;
  }
}
