/* JL-SEC – site styles.
   No external fonts, images or scripts: everything is served from our own
   origin so the Content-Security-Policy in .htaccess can stay strict. */

:root {
  /* Brand: deep navy background, bright blue accent. */
  --bg: #070e1a;
  --bg-alt: #0a1424;
  --surface: #0d1a2e;
  --surface-2: #122340;
  --line: #1a2a44;
  --line-strong: #253a5c;
  --text: #e8f0fa;
  --text-muted: #a5b4c8;
  --text-faint: #7f91aa;
  --accent: #4aa3ff;
  --accent-strong: #7dbdff;
  --accent-ink: #031426;
  --accent-soft: rgba(74, 163, 255, 0.13);
  /* Status colours (article callouts). */
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.1);
  --red: #ff7a7a;
  --amber: #f5b642;
  --violet: #a78bfa;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: var(--accent-ink); }

.lead {
  max-width: 62ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--text-muted);
}

.mono-label {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { padding: 0.6rem 0.95rem; font-size: 0.9rem; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 14, 26, 0.85);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: auto;
  color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-mark { width: 43px; height: 40px; flex: none; }
/* Wordmark + tagline in one SVG: the tagline spans exactly the width of "JL-SEC", as in the logo. */
.brand-word { width: 148px; height: 33px; flex: none; fill: currentColor; }
.brand-word .brand-tag { fill: var(--text-muted); font-family: var(--font-sans); font-weight: 600; }
.brand-word .brand-cursor { fill: #0ea5e9; animation: blink 1.1s steps(1) infinite; }
@media (max-width: 360px) {
  .header-inner { column-gap: 0.75rem; }
  .brand { gap: 0.6rem; }
  .brand-mark { width: 34px; height: 32px; }
  .brand-word { width: 112px; height: 25px; }
}

@keyframes blink { 50% { opacity: 0; } }

/* Minimal top menu on the right, next to the flags. Each item is its own page. */
.tabs { display: flex; gap: 0.15rem; }
.tabs a {
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: underline 2px transparent;
  text-underline-offset: 7px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { color: var(--text); text-decoration-color: var(--accent); }

/* Language switch: three small flags, the current one fully visible and outlined. */
.lang-switch { display: flex; align-items: center; gap: 0.4rem; }
.lang-switch a {
  display: block;
  padding: 2px;
  border-radius: 4px;
  line-height: 0;
  opacity: 0.45;
  transition: opacity 0.15s;
}
.lang-switch a:hover { opacity: 0.9; }
.lang-switch a[aria-current="page"] { opacity: 1; box-shadow: 0 0 0 1.5px var(--accent); }
.flag { display: block; width: 24px; height: 16px; border-radius: 2px; }

/* ---------- Pages ---------- */

.section { padding-block: clamp(48px, 8vw, 96px); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head .lead { margin-bottom: 0; }
.page-top { padding-top: clamp(40px, 6vw, 72px); }
.page-h1 { margin-bottom: 1.25rem; font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
.narrow { max-width: 760px; }
.narrow .lead + .lead { margin-top: -0.25rem; }

/* Home: just text, vertically centred in the window. */
.hero {
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h) - 90px);
  padding-block: clamp(48px, 8vw, 96px);
}
.hero-copy { max-width: 820px; }
.hero h1 { margin-bottom: 1.4rem; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { margin-bottom: 1.5rem; }
.hero .hero-incident { margin-bottom: 0; color: var(--text); font-size: clamp(1.15rem, 2vw, 1.4rem); }
.hero-incident a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

/* About */

.tags-label { margin-top: 2.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  padding: 0.42rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Contact */

.contact-list { margin: 2rem 0 2.5rem; }
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.contact-list li:first-child { padding-top: 0; }
.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.contact-list a { color: var(--text); font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); }

.company p { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }
.company .register { margin: 0; color: var(--text-faint); font-size: 0.85rem; }

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 28px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.88rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-copy { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Blog: lists ---------- */


.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s, background-color 0.2s, transform 0.2s;
}
.post-card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0 0 0.9rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}
.post-lang {
  margin-left: 0.25rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-muted);
}
.post-title { margin: 0 0 0.75rem; font-size: 1.3rem; line-height: 1.25; }
.post-link { color: var(--text); }
.post-link:hover { color: var(--text); }
.post-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-link:focus-visible { outline: none; }
.post-card:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.post-desc { margin-bottom: 1.25rem; color: var(--text-muted); font-size: 0.97rem; }
.post-more { margin-top: auto; color: var(--accent); font-size: 0.92rem; font-weight: 600; }
.posts-empty { color: var(--text-muted); }

/* ---------- Blog: article ----------
   Written for readers of all ages: large type, generous spacing, high contrast. */

.article { padding-block: clamp(32px, 6vw, 64px) clamp(64px, 9vw, 112px); }
.article-container { max-width: calc(760px + 2 * var(--gutter)); }

.article-back { margin: 0 0 2rem; font-size: 1rem; }
.article-back a { color: var(--text-muted); }
.article-back a:hover { color: var(--accent); }

.article-head { margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.article-head h1 { margin-bottom: 1.25rem; font-size: clamp(2rem, 4.8vw, 3rem); line-height: 1.15; }
.article-lead { margin-bottom: 1.5rem; color: var(--text-muted); font-size: clamp(1.2rem, 2vw, 1.35rem); line-height: 1.6; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-faint);
  font-size: 1rem;
}

.prose { font-size: clamp(1.15rem, 1.6vw, 1.25rem); line-height: 1.75; }
.prose > * + * { margin-top: 1.25em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose figure, .prose table { margin-bottom: 0; }
.prose h2 { margin-top: 2.4em; margin-bottom: 0; font-size: clamp(1.55rem, 3vw, 1.9rem); line-height: 1.25; }
.prose h3 { margin-top: 2em; margin-bottom: 0; font-size: 1.3rem; }
.prose h2 + *, .prose h3 + * { margin-top: 0.75em; }
.prose strong { color: #fff; font-weight: 700; }
.prose em { color: var(--text-muted); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.6em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose hr { margin-block: 2.5em; border: 0; border-top: 1px solid var(--line-strong); }

.prose blockquote {
  margin-inline: 0;
  padding: 1.1em 1.4em;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(74, 163, 255, 0.08);
}
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > * + * { margin-top: 0.8em; }

.prose kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.05em 0.5em;
  border: 1px solid #4f6a90;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #16294a;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.prose th, .prose td { padding: 0.6em 0.8em; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }

/* Callout boxes (use <div class="callout callout-key|callout-ok|callout-danger"> in an article) */
.callout {
  padding: 1.3em 1.5em;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.callout > :first-child { margin-top: 0; }
.callout > * + * { margin-top: 0.8em; }
.callout-key { border-color: var(--amber); background: rgba(245, 182, 66, 0.07); }
.callout-ok { border-color: var(--green); background: var(--green-soft); }
.callout-danger { border-color: var(--red); background: rgba(255, 122, 122, 0.08); }
.callout-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.callout-key .callout-title { color: var(--amber); }
.callout-ok .callout-title { color: var(--green); }
.callout-key li::marker { color: var(--amber); }
.callout-ok li::marker { color: var(--green); }
.callout-danger li::marker { color: var(--red); }
.callout-danger .callout-title { color: var(--red); }

/* Illustration of a fake "I'm not a robot" check */
.mock-figure { margin-inline: 0; }
.mock-window {
  position: relative;
  max-width: 460px;
  margin-inline: auto;
  padding: 22px;
  border: 1px solid #d6dbe1;
  border-radius: 10px;
  background: #f7f8fa;
  color: #1d2733;
  font-family: Arial, var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}
.mock-captcha {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  background: #fff;
  font-size: 1.05rem;
}
.mock-check {
  flex: none;
  width: 26px;
  height: 26px;
  border: 2px solid #c1c1c1;
  border-radius: 3px;
  background: #fff;
}
.mock-steps { margin-top: 16px; padding: 14px 16px; border-radius: 6px; background: #fff; border: 1px solid #e3e6ea; }
.mock-heading { margin: 0 0 8px; font-weight: 700; }
.prose .mock-steps ol { margin: 0; padding-left: 1.3em; }
.prose .mock-steps li + li { margin-top: 0.35em; }
.prose .mock-steps li::marker { color: #1d2733; }
.prose .mock-window kbd { border-color: #9aa5b1; background: #eef1f4; color: #1d2733; }
.mock-stamp {
  position: absolute;
  top: 14px;
  right: -10px;
  padding: 4px 12px;
  border: 3px solid var(--red);
  border-radius: 6px;
  background: rgba(7, 14, 26, 0.92);
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  transform: rotate(8deg);
}
.mock-figure figcaption {
  max-width: 560px;
  margin: 1rem auto 0;
  color: var(--text-muted);
  font-size: 0.95em;
  text-align: center;
}

.article-share {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 1.05rem;
}
.article-share p { margin: 0; }
.article-share p + p { margin-top: 0.75rem; }
.article-share { margin-bottom: 2rem; }

/* ---------- Error page ---------- */

.error-page { display: grid; place-items: center; min-height: 100vh; padding: 48px var(--gutter); text-align: center; }
.error-page .code { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); letter-spacing: 0.08em; }
.error-page h1 { margin: 0.6rem 0 1rem; font-size: clamp(2rem, 5vw, 3rem); }
.error-page p { color: var(--text-muted); }
.error-page .btn { margin-top: 1rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Narrow screens: logo + flags on the first row, the menu right-aligned on a second row. */
@media (max-width: 680px) {
  .header-inner { padding-block: 0.6rem 0.35rem; }
  .tabs { order: 3; width: 100%; justify-content: flex-end; margin-top: 0.3rem; }
  .tabs a { padding: 0.55rem 0.5rem; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .posts { grid-template-columns: minmax(0, 1fr); }
  .post-card { padding: 22px 20px; }
  .mock-window { padding: 16px; }
  .mock-stamp { right: 6px; top: -14px; }
}

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

/* ---------- Print (articles are meant to be printed for parents and grandparents) ---------- */

@media print {
  :root {
    --bg: #fff;
    --bg-alt: #fff;
    --surface: #fff;
    --surface-2: #f2f2f2;
    --line: #bbb;
    --line-strong: #888;
    --text: #000;
    --text-muted: #222;
    --text-faint: #444;
    --accent: #000;
    --accent-soft: transparent;
    --green: #000;
    --green-soft: transparent;
  }
  body { background: #fff; color: #000; font-size: 12pt; }
  .skip-link, .site-header, .site-footer, .print-btn, .article-back, .article-share { display: none !important; }
  .article { padding: 0; }
  .prose { font-size: 13pt; line-height: 1.6; }
  .prose strong { color: #000; }
  .prose a { color: #000; }
  .prose kbd { border-color: #000; background: #fff; color: #000; }
  .callout, .prose blockquote { break-inside: avoid; border-color: #000; background: none; }
  .mock-figure { break-inside: avoid; }
  .mock-window { box-shadow: none; }
  .mock-stamp { background: #fff; color: #c00; border-color: #c00; }
  h2, h3 { break-after: avoid; }
}
