:root {
  --sky-top: #8ec5ee;
  --sky-bottom: #e3f1fb;
  --cloud: #ffffff;
  --cloud-shade: #8fa9c4;
  --cloud-opacity: 1;
  --text: #1c1917;
  --muted: #3f3a36;
  --accent: #1e40af;
  --on-accent: #ffffff;
  --border: rgba(28, 25, 23, 0.15);
  --card: rgba(255, 255, 255, 0.55);
  --text-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sky-top: #0a1830;
    --sky-bottom: #1f3a60;
    --cloud: #a9b8cf;
    --cloud-shade: #26364f;
    --cloud-opacity: 0.45;
    --text: #f5f5f4;
    --muted: #d4dbe6;
    --accent: #93c5fd;
    --on-accent: #0a1830;
    --border: rgba(255, 255, 255, 0.15);
    --card: rgba(10, 24, 48, 0.55);
    --text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 80rem;
  padding: 0 1.5rem;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  background: var(--sky-bottom);
  color: var(--text);
  text-shadow: var(--text-shadow);
}

/* Full-screen cloud canvas added by clouds.js; sits behind all content. */
.sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(var(--sky-top), var(--sky-bottom));
}

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

/* Name top left, nav top right, generous space before the content. */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 0 6rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { display: block; height: 44px; width: auto; filter: drop-shadow(1px 3px 2px rgba(0, 0, 0, 0.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; font-size: 1.35rem; }
.brand-text span { color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 0.25rem 2.5rem; padding-right: 1.5rem; font-size: 1.1rem; }
/* Contact with a small, faded link to the password-protected inbox below it. */
.nav-stack { display: flex; flex-direction: column; align-items: flex-start; }
nav a.nav-sub { font-size: 0.8rem; color: var(--muted); opacity: 0.6; }
nav a.nav-sub:hover, nav a.nav-sub:focus-visible { opacity: 1; }

/* Sidebar (intro + contact links) beside the main column of sections. */
.layout {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 3fr;
  gap: 2rem;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 1.5rem;
  border-top: 1px solid var(--border);
}
.sidebar .intro { margin: 1rem 0; }
.sidebar-links { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.sidebar-links li { padding: 0.4rem 0; border-top: 1px solid var(--border); }
/* Same hover as the other links, but the existing ↗ nudges up-right
   instead of a second arrow appearing. */
.sidebar-links a {
  display: inline-block;
  color: var(--text);
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: color 0.2s ease, transform 0.25s ease, background-size 0.3s ease;
}
.sidebar-links a span { display: inline-block; transition: transform 0.25s ease; }
.sidebar-links a:hover,
.sidebar-links a:focus-visible {
  text-decoration: none;
  color: var(--accent);
  transform: translateX(6px);
  background-size: 100% 2px;
}
.sidebar-links a:hover span,
.sidebar-links a:focus-visible span { transform: translate(2px, -2px); }

.section { border-top: 1px solid var(--border); }
.section-label { margin: 1rem 0 1.5rem; font-size: 1rem; font-weight: 700; }
/* Shared hover effect for section and nav links: slide right, turn accent,
   draw an underline, and show an arrow. The arrow floats beside the link so
   it never pushes neighbouring links around. */
.section-label a,
nav a {
  position: relative;
  display: inline-block;
  color: var(--text);
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: color 0.2s ease, transform 0.25s ease, background-size 0.3s ease;
}
.section-label a::after,
nav a::after {
  content: "→";
  position: absolute;
  left: 100%;
  margin-left: 0.25em;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.section-label a:hover,
.section-label a:focus-visible,
nav a:hover,
nav a:focus-visible {
  text-decoration: none;
  color: var(--accent);
  transform: translateX(6px);
  background-size: 100% 2px;
}
.section-label a:hover::after,
.section-label a:focus-visible::after,
nav a:hover::after,
nav a:focus-visible::after { opacity: 1; }

/* Logo and name: the logo tilts and grows, the name turns accent and
   underlines, and the whole group nudges right. */
.brand { transition: transform 0.25s ease; }
.brand img { transition: transform 0.4s ease; }
.brand-text strong,
.brand-text span {
  width: fit-content;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat;
  transition: color 0.2s ease, background-size 0.3s ease;
}
.brand:hover,
.brand:focus-visible { transform: translateX(6px); }
.brand:hover img,
.brand:focus-visible img { transform: rotate(-12deg) scale(1.12); }
.brand:hover .brand-text strong,
.brand:hover .brand-text span,
.brand:focus-visible .brand-text strong,
.brand:focus-visible .brand-text span {
  color: var(--accent);
  background-size: 100% 2px;
}

@media (prefers-reduced-motion: reduce) {
  .section-label a, .section-label a::after,
  nav a, nav a::after,
  .brand, .brand img, .brand-text strong, .brand-text span,
  .sidebar-links a, .sidebar-links a span { transition: none; }
  .section-label a:hover, .section-label a:focus-visible,
  nav a:hover, nav a:focus-visible,
  .brand:hover, .brand:focus-visible,
  .brand:hover img, .brand:focus-visible img,
  .sidebar-links a:hover, .sidebar-links a:focus-visible,
  .sidebar-links a:hover span, .sidebar-links a:focus-visible span { transform: none; }
}

/* One row per entry: details on the left, bullet points on the right. */
.entry {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2rem;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--border);
}
.section > .entry:first-child { border-top: none; }
.entry h3 { margin: 0 0 0.5rem; font-size: 0.85rem; font-weight: 600; }
/* A section without a label (Skillset) uses its entry title as the heading. */
.section > .entry:first-child h3 { font-size: 1rem; font-weight: 700; }
.entry-details p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.entry-points { margin: 0; padding-left: 1.1rem; }
.entry-points li { margin-bottom: 0.5rem; }

.prose { padding-top: 1rem; border-top: 1px solid var(--border); max-width: 42rem; }
.prose p { margin: 0 0 1rem; color: var(--muted); }
.prose h3 { margin: 1.5rem 0 0.25rem; font-size: 1rem; }

footer {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 48rem) {
  .site-header { padding-bottom: 3rem; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .entry { grid-template-columns: 1fr; gap: 0.75rem; }
}

/* --- SSH detector live demo --- */
.demo-link { font-weight: 600; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

.demo-explainer { max-width: 46rem; }
.demo-explainer h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.demo-explainer p { margin: 0 0 0.75rem; color: var(--muted); }

.demo-start { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1.25rem 0 1rem; }
.demo-hint { margin: 0; color: var(--muted); font-size: 0.9rem; }

.demo button, .contact button {
  padding: 0.55rem 1.2rem;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  cursor: pointer;
}
.demo button.primary, .contact button.primary { color: var(--on-accent); background: var(--accent); font-size: 1.05rem; }
.demo button.secondary { color: var(--text); background: transparent; border-color: var(--border); }
.demo button:hover, .contact button:hover { filter: brightness(1.1); }
.demo button:focus-visible, .contact button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.demo details { margin-bottom: 1rem; }
.demo summary { cursor: pointer; font-weight: 600; padding: 0.25rem 0; }
.demo summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.demo-paste .demo-hint { margin: 0.5rem 0; }

.demo-paste textarea {
  display: block;
  width: 100%;
  min-height: 14rem;
  padding: 0.75rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  backdrop-filter: blur(6px);
  resize: vertical;
}
.demo-paste textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.demo-actions { margin: 0.75rem 0 0.5rem; }

.demo-error { padding: 0.75rem 1rem; border: 1px solid #f87171; border-radius: 0.375rem; background: var(--card); }
.demo-note { color: var(--muted); max-width: 46rem; }

/* Big one-line answer first, so visitors get the point at a glance. */
.verdict {
  margin: 1.5rem 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0.375rem;
  backdrop-filter: blur(6px);
}
.verdict-alert { border-left-color: #f87171; }
.verdict-clear { border-left-color: #4ade80; }
.verdict p { margin: 0; color: var(--muted); }
.verdict .verdict-headline { color: var(--text); font-size: 1.25rem; font-weight: 700; }

.finding { padding: 0.9rem 0; border-top: 1px solid var(--border); max-width: 52rem; }
.finding h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.finding p { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.finding-analogy { color: var(--muted); font-style: italic; }
.finding-meta { color: var(--muted); font-size: 0.85rem; }

.demo-subhead { margin: 1.5rem 0 0.25rem; font-size: 1rem; }
.demo-more { margin-top: 1.25rem; }

.table-wrap { overflow-x: auto; margin-top: 0.5rem; }
.demo-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.demo-table th, .demo-table td { padding: 0.4rem 0.75rem 0.4rem 0; text-align: left; border-top: 1px solid var(--border); }
.demo-table th { font-weight: 600; }
.demo-table td:nth-child(2) { font-variant-numeric: tabular-nums; }

.glossary { margin-top: 2rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.glossary dl { margin: 0.5rem 0; max-width: 46rem; }
.glossary dt { font-weight: 600; margin-top: 0.6rem; }
.glossary dd { margin: 0; color: var(--muted); }

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

/* ---- Penetration-test report page ---- */
.report { border-top: none; }
.report-back { margin: 0 0 1rem; }
.report-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.report-note a { white-space: nowrap; }
.report-body { max-width: 52rem; line-height: 1.65; }
.report-body h1 { font-size: 1.9rem; margin: 0 0 0.5rem; }
.report-body h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.report-body h3 { font-size: 1.1rem; margin: 2rem 0 0.75rem; }
.report-body h4 { margin: 1.5rem 0 0.5rem; }
.report-body p { margin: 0.75rem 0; }
.report-body ul { margin: 0.75rem 0; padding-left: 1.25rem; }
.report-body li { margin: 0.35rem 0; }
.report-body hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.report-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.report-body th, .report-body td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
}
.report-body th { background: var(--card); }
.report-body code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
}
.report-body pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
}
.report-body pre code { background: none; border: none; padding: 0; }

/* ---- Contact form ---- */
.contact-intro { max-width: 42rem; color: var(--muted); }
.contact-form { display: flex; flex-direction: column; gap: 0.35rem; max-width: 36rem; margin-top: 1rem; }
.contact-form label { font-weight: 600; margin-top: 0.6rem; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  backdrop-filter: blur(6px);
}
.contact-form textarea { min-height: 10rem; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-form button { align-self: flex-start; margin-top: 1rem; }
.message-body { white-space: pre-wrap; }

/* Landing page: just the logo, centered over the cloud background. */
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1.5rem;
  display: grid;
  place-items: center;
}
.landing-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  transition: transform 0.25s ease;
}
.landing-logo:hover { text-decoration: none; transform: scale(1.04); }
/* Sized by the smaller of width and height so it always fits on screen. */
.landing-logo img {
  width: min(18rem, 60vw, 55vh);
  height: auto;
  filter: drop-shadow(0.4rem 0.9rem 0.8rem rgba(0, 0, 0, 0.45));
}
.landing-hint { font-size: 0.95rem; letter-spacing: 0.05em; transition: opacity 0.3s ease; }
/* Set on click while the home page loads, so the click visibly registers. */
.landing.entering .landing-hint { opacity: 0; }
/* Only mention the keyboard on devices likely to have one. */
@media not (hover: hover) { .key-hint { display: none; } }

/* Email link copies the address; the label swaps to "✓ Copied" briefly. */
.sidebar-links a .email-label { transition: none; }
.sidebar-links a:hover .email-label,
.sidebar-links a:focus-visible .email-label { transform: none; }
.sidebar-links a.copied { color: var(--accent); }
.sidebar-links a.copied span[aria-hidden] { visibility: hidden; }
.email-fallback { display: block; margin-top: 0.25rem; color: var(--muted); user-select: all; }
