﻿/*
  John Gallagher Portfolio Remake
  - Single stylesheet shared by all pages.
  - No build step; modern CSS with graceful fallbacks.
*/

:root{
  --bg0:#03050B;
  --bg1:#070A12;
  --panel:rgba(255,255,255,.04);
  --panel2:rgba(255,255,255,.07);
  --stroke:rgba(255,255,255,.12);
  --stroke2:rgba(255,255,255,.20);
  --text:#F4F6FF;
  --muted:rgba(244,246,255,.72);
  --muted2:rgba(244,246,255,.56);
  --brand:#6AE4FF;
  --brand2:#9C7CFF;
  --accent:#FFCF6A;
  --good:#7DF0B1;
  --danger:#FF93A7;
  --shadow:0 18px 70px rgba(0,0,0,.45);
  --shadow2:0 10px 30px rgba(0,0,0,.25);
  --radius:18px;
  --radius2:26px;
  --max:1140px;
  --pad:20px;
  --h1:clamp(2.1rem, 4.3vw, 3.5rem);
  --h2:clamp(1.5rem, 2.3vw, 2.0rem);
  --h3:1.05rem;
  --glow1:rgba(106,228,255,.16);
  --glow2:rgba(156,124,255,.13);
  --glow3:rgba(255,207,106,.09);
}

html[data-theme="light"]{
  --bg0:#FBFCFF;
  --bg1:#FFFFFF;
  --panel:#FFFFFF;
  --panel2:#FFFFFF;
  --stroke:rgba(12,16,34,.12);
  --stroke2:rgba(12,16,34,.20);
  --text:#0C1022;
  --muted:rgba(12,16,34,.68);
  --muted2:rgba(12,16,34,.50);
  --shadow:0 16px 40px rgba(12,16,34,.08);
  --shadow2:0 8px 20px rgba(12,16,34,.06);
  --glow1:rgba(12,133,255,.04);
  --glow2:rgba(156,124,255,.025);
  --glow3:rgba(255,207,106,.015);
}

*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family: Manrope, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1000px 520px at 16% 6%, var(--glow1), transparent 60%),
    radial-gradient(900px 520px at 86% 10%, var(--glow2), transparent 55%),
    radial-gradient(900px 520px at 70% 100%, var(--glow3), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  color:var(--text);
  line-height:1.55;
}

h1,h2,h3,.brand-title{font-family:"Space Grotesk", Manrope, ui-sans-serif, system-ui}
img{max-width:100%;display:block}
a{color:inherit;text-decoration:none}

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

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0;
}

.skip-link{
  position:absolute;left:14px;top:10px;z-index:9999;
  padding:10px 12px;border-radius:999px;
  background:var(--panel2);border:1px solid var(--stroke);
  transform:translateY(-160%);
  transition:transform .18s ease;
}
.skip-link:focus{transform:translateY(0)}

/* Header */
.site-header{
  position:sticky;top:0;z-index:1000;
  background:rgba(3,5,11,.82);
  border-bottom:1px solid rgba(255,255,255,.10);
  backdrop-filter: blur(12px);
}
html[data-theme="light"] .site-header{
  background:rgba(255,255,255,.95);
  border-bottom:1px solid rgba(12,16,34,.10);
}

.header-inner{
  display:grid;
  grid-template-columns: 1fr auto auto;
  align-items:center;
  gap:14px;
  padding:14px 0;
}

.brand{display:flex;align-items:center;gap:12px;min-width: 220px}
.brand-mark{
  width:44px;height:44px;border-radius:14px;
  background: linear-gradient(135deg, rgba(106,228,255,.95), rgba(156,124,255,.85));
  display:grid;place-items:center;
  box-shadow: var(--shadow2);
}
.brand-mark span{font-weight:900;color:#071026;letter-spacing:-0.03em}
.brand-title{font-weight:800;letter-spacing:-0.02em;line-height:1.1}
.brand-sub{display:block;font-size:12px;color:var(--muted2);margin-top:2px}

.topnav{
  display:inline-flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}
.topnav a{
  display:inline-flex;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.04);
  color:var(--muted);
  font-weight:900;
  font-size:14px;
}
html[data-theme="light"] .topnav a{background:rgba(12,16,34,.03)}
.topnav a:hover{border-color:var(--stroke2);color:var(--text)}
.topnav a[aria-current="page"]{border-color:rgba(106,228,255,.55);color:var(--text)}

.topbar{display:flex;align-items:center;gap:10px;justify-content:flex-end}

.pill{
  display:inline-flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:999px;
  background:var(--panel2);border:1px solid var(--stroke);
  color:var(--text);
  cursor:pointer;
}
.pill:hover{border-color:var(--stroke2)}
.pill:focus-visible{outline:2px solid rgba(106,228,255,.55);outline-offset:2px}
.pill .pill-text{font-size:14px;color:var(--muted)}

.nav-btn{
  width:46px;height:46px;border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--panel2);
  cursor:pointer;
  display:grid;place-items:center;
}
.nav-btn:hover{border-color:var(--stroke2)}
.nav-btn:focus-visible{outline:2px solid rgba(106,228,255,.55);outline-offset:2px}

.bars{width:18px;height:2px;background:var(--text);border-radius:999px;position:relative}
.bars:before,.bars:after{
  content:"";position:absolute;left:0;width:18px;height:2px;background:var(--text);border-radius:999px
}
.bars:before{top:-6px}
.bars:after{top:6px}

/* Drawer */
.drawer{position:fixed;inset:0;z-index:2000;display:grid}
.drawer[hidden]{display:none}
.drawer-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.drawer-panel{
  position:relative;
  width:min(420px, 92vw);
  margin-left:auto;
  height:100%;
  background:rgba(6,9,17,.96);
  border-left:1px solid rgba(255,255,255,.12);
  padding:16px;
  box-shadow: var(--shadow);
}
html[data-theme="light"] .drawer-panel{
  background:rgba(255,255,255,.98);
  border-left:1px solid rgba(12,16,34,.12);
}

.drawer-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
.drawer-title{font-weight:900;letter-spacing:-0.02em}
.drawer-close{
  width:44px;height:44px;border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--panel2);
  color:var(--text);
  cursor:pointer;
}
.drawer-close:hover{border-color:var(--stroke2)}

.drawer-nav{display:grid;gap:8px;margin-top:10px}
.drawer-nav a{
  padding:12px 12px;border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color:var(--muted);
  font-weight:900;
}
html[data-theme="light"] .drawer-nav a{
  border:1px solid rgba(12,16,34,.12);
  background: rgba(12,16,34,.04);
}
.drawer-nav a:hover{border-color:rgba(106,228,255,.40)}
.drawer-nav a[aria-current="page"]{color:var(--text);border-color:rgba(106,228,255,.55)}

/* Hero */
.hero{padding:58px 0 26px}
.hero-grid{display:grid;grid-template-columns: 1.08fr .92fr;gap:18px;align-items:start}

.kicker{
  display:inline-flex;align-items:center;gap:10px;
  padding:8px 12px;border-radius:999px;
  background: var(--panel2);
  border:1px solid var(--stroke);
  color:var(--muted);
  font-weight:900;
  font-size:13px;
}

h1{font-size:var(--h1);line-height:1.02;letter-spacing:-0.04em;margin:14px 0 10px}
.lead{font-size:18px;color:var(--muted);margin:0 0 18px;max-width: 60ch}

.cta{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0 18px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  padding:12px 14px;border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--panel2);
  color:var(--text);
  font-weight:900;
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover{transform:translateY(-1px);border-color:rgba(106,228,255,.45)}
.btn.primary{
  background: linear-gradient(135deg, rgba(106,228,255,.65), rgba(156,124,255,.45));
  border-color:rgba(106,228,255,.55);
}
.btn.ghost{background: transparent}
.btn:focus-visible{outline:2px solid rgba(106,228,255,.55);outline-offset:2px}

.hero-card{
  border:1px solid rgba(255,255,255,.12);
  border-radius: var(--radius2);
  overflow:hidden;
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
}
html[data-theme="light"] .hero-card{
  border:1px solid rgba(12,16,34,.12);
  background: rgba(12,16,34,.04);
}
.hero-portrait{
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.24);
  display:flex;
  justify-content:center;
  align-items:center;
  padding:12px;
}
html[data-theme="light"] .hero-portrait{
  border-bottom:1px solid rgba(12,16,34,.12);
  background:rgba(12,16,34,.03);
}
.hero-portrait img{
  width:100%;
  height:auto;
  max-height:420px;
  object-fit:contain;
  object-position:center top;
}

.hero-card-top{padding:16px 16px 0}
.hero-card-title{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.hero-card-title h2{margin:0;font-size:18px;letter-spacing:-0.02em}

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  color:var(--muted);
  background: var(--panel2);
}

.hero-metric{display:grid;grid-template-columns: 1fr 1fr;gap:10px;padding:14px 16px 16px}
.metric{
  border:1px solid rgba(255,255,255,.10);
  border-radius: var(--radius);
  background: rgba(0,0,0,.14);
  padding: 12px;
}
html[data-theme="light"] .metric{border:1px solid rgba(12,16,34,.10);background: rgba(12,16,34,.03)}
.metric b{display:block;font-size:14px;letter-spacing:-0.01em}
.metric span{color:var(--muted2);font-size:12px}

/* Sections */
.section{padding:46px 0}
.section.alt{
  background:
    radial-gradient(900px 520px at 10% 10%, rgba(106,228,255,.08), transparent 62%),
    rgba(255,255,255,.03);
  border-top:1px solid rgba(255,255,255,.10);
  border-bottom:1px solid rgba(255,255,255,.10);
}
html[data-theme="light"] .section.alt{
  background:
    radial-gradient(900px 520px at 10% 10%, rgba(12,133,255,.03), transparent 62%),
    rgba(12,16,34,.015);
  border-top:1px solid rgba(12,16,34,.10);
  border-bottom:1px solid rgba(12,16,34,.10);
}

.section-head{display:flex;justify-content:space-between;align-items:end;gap:16px;margin-bottom:14px}
.section-head h2{font-size:var(--h2);letter-spacing:-0.03em;margin:0}
.section-head p{margin:0;color:var(--muted)}

.grid{display:grid;gap:12px}
.grid.cols-3{grid-template-columns: repeat(3, minmax(0, 1fr))}
.grid.cols-2{grid-template-columns: repeat(2, minmax(0, 1fr))}

.card{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  border-radius: var(--radius2);
  padding: 16px;
  box-shadow: var(--shadow2);
}
html[data-theme="light"] .card{border:1px solid rgba(12,16,34,.12);background: rgba(12,16,34,.04)}

.card h3{margin:0 0 8px;font-size:var(--h3);letter-spacing:-0.02em}
.card p{margin:0;color:var(--muted)}
.cert-action{margin-top:12px}

.card-link{display:block}
.card-link:hover .card{border-color:rgba(106,228,255,.45)}

.card-media{
  padding:0;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  height:100%;
}
.thumb{
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.16);
  aspect-ratio:16/9;
  overflow:hidden;
}
html[data-theme="light"] .thumb{
  border-bottom:1px solid rgba(12,16,34,.12);
  background:rgba(12,16,34,.03);
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.card-body{padding:16px}
.card-link .thumb img{transition:transform .25s ease}
.card-link:hover .thumb img{transform:scale(1.03)}

.cert-media .thumb{
  aspect-ratio:4/3;
  background:rgba(255,255,255,.02);
}
.cert-media .thumb img{
  object-fit:contain;
  padding:10px;
}
html[data-theme="light"] .cert-media .thumb{
  background:#fff;
}
.cert-thumb-btn{
  width:100%;
  padding:0;
  border:0;
  margin:0;
  cursor:zoom-in;
  background:transparent;
}

.media-frame{
  margin-top:14px;
  max-width:960px;
  margin-left:auto;
  margin-right:auto;
  border:1px solid rgba(255,255,255,.14);
  border-radius:var(--radius2);
  overflow:hidden;
  background:rgba(0,0,0,.2);
}
html[data-theme="light"] .media-frame{
  border:1px solid rgba(12,16,34,.12);
  background:#fff;
}
.media-frame iframe{
  width:100%;
  min-height:480px;
  border:0;
  display:block;
}
.media-frame img{
  width:100%;
  max-height:460px;
  height:auto;
  object-fit:contain;
  background:rgba(0,0,0,.16);
  display:block;
}
html[data-theme="light"] .media-frame img{background:#fff}

.video-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  color:var(--text);
}
.video-link:hover{text-decoration:underline}

.cert-modal{
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  place-items:center;
  padding:18px;
}
.cert-modal[hidden]{display:none}
.cert-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.72);
}
.cert-modal-dialog{
  position:relative;
  z-index:1;
  width:min(1000px,96vw);
  max-height:92vh;
  border-radius:var(--radius2);
  border:1px solid rgba(255,255,255,.16);
  background:rgba(10,14,24,.96);
  box-shadow:var(--shadow);
  padding:12px;
  display:grid;
  gap:10px;
}
html[data-theme="light"] .cert-modal-dialog{
  border:1px solid rgba(12,16,34,.14);
  background:#fff;
}
.cert-modal-close{
  justify-self:end;
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:var(--panel2);
  color:var(--text);
  cursor:pointer;
}
.cert-modal-close:hover{border-color:var(--stroke2)}
.cert-modal-scroller{
  max-height:78vh;
  overflow:auto;
  display:block;
  padding:0;
}
.cert-modal-img{
  width:auto;
  height:auto;
  max-width:none;
  max-height:none;
  display:block;
  margin:0;
  border-radius:14px;
  background:rgba(0,0,0,.22);
}
html[data-theme="light"] .cert-modal-img{background:#fff}
.cert-modal-caption{
  margin:0;
  color:var(--muted);
  font-weight:700;
  font-size:14px;
}

.tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.tag{
  padding:6px 10px;border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.12);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
html[data-theme="light"] .tag{border:1px solid rgba(12,16,34,.12);background: rgba(12,16,34,.03)}
.tag.hot{border-color:rgba(255,207,106,.55);color:rgba(255,207,106,.92)}

.kpi{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}

.two-col{display:grid;grid-template-columns: 1fr 1fr;gap:12px;align-items:start}

hr.sep{border:none;border-top:1px solid rgba(255,255,255,.10);margin:18px 0}
html[data-theme="light"] hr.sep{border-top:1px solid rgba(12,16,34,.10)}

/* Article */
.article{padding:18px 0 30px}
.breadcrumbs{display:flex;gap:8px;flex-wrap:wrap;color:var(--muted2);font-size:13px;margin:8px 0 12px}
.breadcrumbs a{color:var(--muted)}
.article h1{margin-top:10px}
.article .meta{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 0}

.list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
  display:grid;
  gap:8px;
}

.callout{
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--radius2);
  border: 1px solid rgba(106,228,255,.35);
  background: rgba(106,228,255,.08);
  color: var(--muted);
}

/* Footer */
.site-footer{padding:30px 0 44px;border-top:1px solid rgba(255,255,255,.10)}
html[data-theme="light"] .site-footer{border-top:1px solid rgba(12,16,34,.10)}

.footer-grid{display:grid;grid-template-columns: 1fr auto;gap:12px;align-items:center}
.footer-links{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}

.small{font-size:13px;color:var(--muted2)}

/* Reveal */
.reveal{opacity:0;transform:translateY(12px);transition: opacity .6s ease, transform .6s ease}
.reveal.show{opacity:1;transform:none}

@media (max-width: 960px){
  .hero-grid{grid-template-columns: 1fr}
  .grid.cols-3{grid-template-columns: 1fr}
  .grid.cols-2{grid-template-columns: 1fr}
  .two-col{grid-template-columns: 1fr}
  .footer-grid{grid-template-columns: 1fr}
  .footer-links{justify-content:flex-start}
  .media-frame iframe{min-height:360px}
  .media-frame img{max-height:320px}
}

@media (max-width: 860px){
  .header-inner{grid-template-columns: 1fr auto}
  .topnav{display:none}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  .reveal{transition:none}
  .btn{transition:none}
}

