/* ===============================
   Garry Costin-Davis — Site Styles
   Dark, editorial-minimal hybrid
   =============================== */

/* Reset / Base */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid rgba(74,127,167,0.65);
  outline-offset: 3px;
}

/* Theme Tokens */
:root{
  --bg: #161616;
  --panel: #1d1d1d;
  --text: #eaeaea;
  --muted: #b5b5b5;
  --faint: #8f8f8f;

  /* Accent: pick one */
  --accent: #4a7fa7; /* muted blue */
  /* --accent: #5f8f7a; */ /* desaturated green */
  /* --accent: #a46a3f; */ /* muted rust */

  --rule: rgba(234,234,234,0.12);

  --serif: ui-serif, "Georgia", "Times New Roman", Times, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;

  --max: 76ch;
  --pad: clamp(18px, 3vw, 36px);
  --gap: clamp(14px, 2vw, 22px);
  --radius: 14px;

  --h1: clamp(2.0rem, 4vw, 3.0rem);
  --h2: clamp(1.2rem, 2.2vw, 1.6rem);
  --h3: 1.05rem;
  --body: 1rem;
  --small: 0.92rem;
  --lh: 1.65;
}

/* Global */
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: var(--lh);
  letter-spacing: 0.2px;
}

::selection { background: rgba(74,127,167,0.35); }

.container{
  width: min(var(--max), calc(100% - (var(--pad) * 2)));
  margin-inline: auto;
}

/* Skip link */
.skip-link{
  position: absolute;
  left: -999px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}
.skip-link:focus{ left: 12px; z-index: 999; }

/* Header / Nav */
.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22,22,22,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  padding: 14px 0;
}

.brand{
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: 0.2px;
  text-decoration: none;
  font-size: 1.15rem;
  white-space: nowrap;
}

.brand .dot{ color: var(--accent); }

.nav-links{
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
  align-items: baseline;
}

.nav-links a{
  text-decoration: none;
  color: var(--muted);
  font-size: var(--small);
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a:focus-visible{
  color: var(--text);
  border-bottom-color: var(--rule);
  outline: none;
}

.nav-links a[aria-current="page"]{
  color: var(--text);
  border-bottom-color: rgba(234,234,234,0.25);
}

/* Main */
main{ padding: 34px 0 52px; }

.page-title{
  margin: 0 0 10px 0;
  font-family: var(--serif);
  font-size: var(--h1);
  line-height: 1.12;
  letter-spacing: 0.2px;
}

.dek{
  margin: 0 0 26px 0;
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 68ch;
}

.section{
  padding: 22px 0;
  border-top: 1px solid var(--rule);
}

.section h2{
  font-family: var(--serif);
  font-size: var(--h2);
  margin: 0 0 10px 0;
}

.section p{ margin: 0 0 12px 0; }

.meta{
  color: var(--faint);
  font-size: var(--small);
}

.rule{
  height: 1px;
  background: var(--rule);
  margin: 22px 0;
}

/* Cards / Layout */
.grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 860px){
  .grid.cols-2{ grid-template-columns: 1fr 1fr; }
}

.card{
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px 16px;
}

.card h3{
  margin: 0 0 6px 0;
  font-size: var(--h3);
  font-weight: 650;
}

.card p{ color: var(--muted); margin: 0; }
.card p + p{ margin-top: 10px; }

.card a{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(234,234,234,0.18);
}
.card a:hover{ border-bottom-color: var(--accent); }

.badges{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.badge{
  font-size: 0.85rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 10px;
}

/* Links & Buttons */
a.link{
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(234,234,234,0.25);
}
a.link:hover{ border-bottom-color: var(--accent); }

.button-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: var(--small);
}

.btn:hover{ border-color: rgba(234,234,234,0.25); }
.btn.primary{ border-color: rgba(74,127,167,0.55); }
.btn.primary:hover{ border-color: var(--accent); }

/* Footer */
.site-footer{
  border-top: 1px solid var(--rule);
  padding: 26px 0 38px;
  color: var(--muted);
  font-size: var(--small);
}

.footer-links{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.footer-links a{
  text-decoration: none;
  color: var(--muted);
  border-bottom: 1px solid transparent;
}
.footer-links a:hover{
  color: var(--text);
  border-bottom-color: var(--rule);
}

/* Utilities */
.sr-only{
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
