/* Digital Security Explained — v1.0
   Calm, technical, readable. Navy + teal + subtle gold rule.
   Designed for the current static HTML templates on this site.
*/

:root{
  /* Layout */
  --max: 1500px;
  --padY: 18px;
  --padX: clamp(12px, 1.8vw, 22px);

  /* Core colors */
  --bg:#ffffff;
  --fg:#0f172a;
  --muted:#475569;
  --line:#e2e8f0;
  --soft:#f8fafc;

  /* Brand */
  --header:#0b1f3a;
  --header2:#0f2f4f;

  --accent:#2aa6a4;
  --accent2:#1e8f8d;

  /* Subtle accent rule */
  --gold:#c8a24a;

  /* UI */
  --radius:14px;
  --shadow:0 10px 24px rgba(15, 23, 42, 0.06);
  --shadow2:0 6px 14px rgba(15, 23, 42, 0.06);
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }

body{
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.wrap{
  width: min(var(--max), 96vw);
  max-width: none;
  margin: 0 auto;
  padding: var(--padY) var(--padX);
}

/* Prevent accidental nested wrap from narrowing */
.wrap .wrap{
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Typography */
h1,h2,h3{ line-height: 1.2; }
h1{ margin:0 0 10px; font-size: clamp(26px, 3vw, 34px); letter-spacing:-0.02em; }
h2{ margin:26px 0 10px; font-size: clamp(18px, 2.2vw, 22px); }
h3{ margin:18px 0 8px; font-size: 16px; }
p{ margin:10px 0; }
small,.muted{ color: var(--muted); }
ul{ padding-left: 18px; }
li{ margin: 6px 0; }

code{
  background:#eef2f7;
  padding:2px 6px;
  border-radius:8px;
  border:1px solid #e6edf6;
}

/* Links + focus */
a{ color: var(--accent); text-decoration:none; }
a:hover{ color: var(--accent2); text-decoration:underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible{
  outline:3px solid rgba(42,166,164,0.35);
  outline-offset:3px;
  border-radius:10px;
}

/* Header */
header{
  /* Fallback prevents white-on-white if gradient fails */
  background-color: var(--header);
  background: linear-gradient(180deg, var(--header) 0%, var(--header2) 100%);
  border-bottom: 2px solid var(--gold);
  color:#fff;
}

header .wrap{
  padding-top: 22px;
  padding-bottom: 18px;
}

/* Brand block */
header .brand{
  display:flex;
  flex-direction:column;
  gap: 6px;
  margin-bottom: 14px;
}

.brand-link{
  display:inline-flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;
}

.brand-mark{
  width: 38px;
  height: 38px;
  display:block;
  flex:0 0 auto;
}

.brand-title{
  color:#fff;
  font-weight:700;
  letter-spacing:-0.02em;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height:1.1;
}

header .tag{
  color: rgba(255,255,255,0.78);
  font-size: 14px;
  line-height: 1.35;
}

/* Nav */
nav{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  align-items:center;
  margin-top: 10px;
}

nav a{
  color: rgba(255,255,255,0.90);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  text-decoration:none;
}

nav a:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  text-decoration:none;
}

nav a.active{
  background: rgba(42,166,164,0.18);
  border-color: rgba(42,166,164,0.40);
  color:#fff;
}

/* Main (your pages use <main class="wrap">) */
main.wrap{
  padding-top: 22px;
  padding-bottom: 26px;
}

/* Cards */
.card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
  background: #fff;
  box-shadow: var(--shadow2);
}
.card h2, .card h3{ margin-top:0; }

/* Optional panel */
.panel{
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* Tables */
table{
  width:100%;
  border-collapse:collapse;
  margin:14px 0;
  font-size:14px;
}
th,td{
  border:1px solid var(--line);
  padding:10px;
  vertical-align:top;
}
th{
  background: var(--soft);
  text-align:left;
}

/* Footer */
footer{
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.10);
  /* fallback first */
  background-color: var(--header2);
  background: linear-gradient(180deg, var(--header2) 0%, var(--header) 100%);
  color: rgba(255,255,255,0.86);
}
footer a{ color: rgba(255,255,255,0.92); }
footer a:hover{ color:#fff; text-decoration:underline; }
footer .muted{ color: rgba(255,255,255,0.68); }

/* Mobile */
@media (max-width: 640px){
  :root{ --padY: 14px; }
  nav{ gap: 8px; }
  nav a{ padding: 8px 10px; }
  .card{ padding: 14px; }
}

/* Mid-size tuning */
@media (max-width: 1400px){
  header .wrap{ padding-top: 18px; padding-bottom: 16px; }
  nav{ gap: 8px; }
  nav a{ padding: 7px 10px; }
  main.wrap{ padding-top: 24px; padding-bottom: 30px; }
}