/* =========================================================================
   Llewellyn Booth — résumé site
   One stylesheet. Light + dark, fluid type, no framework.
   ========================================================================= */

:root {
  color-scheme: light dark;

  --bg:            #ffffff;
  --surface:       #f7f8fa;
  --surface-2:     #eef1f4;
  --text:          #1b1f24;
  --text-muted:    #5b6472;
  --border:        #e3e6ea;
  --accent:        #0067c0;
  --accent-strong: #0b5fb3;
  --accent-ink:    #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --container: 68rem;
  --prose: 44rem;
  --radius: 12px;
  --radius-pill: 999px;
  --header-h: 4rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0d1117;
    --surface:       #161b22;
    --surface-2:     #1c232d;
    --text:          #e6edf3;
    --text-muted:    #9aa7b4;
    --border:        #283039;
    --accent:        #4cc2ff;
    --accent-strong: #6fd0ff;
    --accent-ink:    #08243a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --bg:            #0d1117;
  --surface:       #161b22;
  --surface-2:     #1c232d;
  --text:          #e6edf3;
  --text-muted:    #9aa7b4;
  --border:        #283039;
  --accent:        #4cc2ff;
  --accent-strong: #6fd0ff;
  --accent-ink:    #08243a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* ---- reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); margin: 0 0 1.5rem; }
h3 { font-size: 1.15rem; margin: 0; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin: .3rem 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

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

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 5vw, 2rem); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem .9rem; border-radius: 8px; transition: top .15s;
}
.skip-link:focus { top: .5rem; color: var(--accent-ink); }

/* ---- header ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.brand {
  font-weight: 700; letter-spacing: -0.02em; color: var(--text); text-decoration: none;
  font-size: 1.05rem;
}
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: clamp(.75rem, 2.2vw, 1.6rem); }
.nav a { color: var(--text-muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--text); }
.nav a[aria-current="true"] { position: relative; }
.nav a[aria-current="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -.35rem; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: .4rem; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem; border-radius: var(--radius-pill);
  font-size: .92rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 1em; height: 1em; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: .5rem 0; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .8rem clamp(1.1rem, 5vw, 2rem); font-size: 1rem; }
  .nav a[aria-current="true"]::after { display: none; }
  .nav .btn { margin: .5rem clamp(1.1rem, 5vw, 2rem); justify-content: center; }
}

/* ---- sections -------------------------------------------------------- */
section { padding-block: clamp(3.5rem, 9vw, 6.5rem); }
.section--tint { background: var(--surface); }
.section--tint + .section--tint { border-top: 1px solid var(--border); }
.section-eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700;
  color: var(--accent); margin: 0 0 .6rem;
}

/* ---- hero (always dark, matches the LinkedIn banner) --------------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(4rem, 12vw, 8rem);
  background: linear-gradient(135deg, #0d1117 0%, #0f2036 58%, #10243c 100%);
  border-bottom: 1px solid #1e2b3a;
}
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; user-select: none;
}
.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  margin: 0 0 1rem; letter-spacing: -0.03em; color: #f5f8fc;
}
.hero .lede { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: #9aa7b4; max-width: 42rem; margin: 0 0 .7rem; }
.hero .lede strong { color: #f5f8fc; font-weight: 600; }
.hero-meta { color: #9aa7b4; font-size: .95rem; margin: 0 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.75rem; }
.hero .btn--ghost { color: #e6edf3; border-color: rgba(255,255,255,.22); }
.hero .btn--ghost:hover { color: #4cc2ff; border-color: #4cc2ff; }
.social { display: flex; gap: .4rem; }
.social a {
  display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius-pill); color: #9aa7b4;
}
.social a:hover { color: #4cc2ff; border-color: #4cc2ff; }
.social svg { width: 1.15rem; height: 1.15rem; }
.viewcount { color: #9aa7b4; font-size: .95rem; margin: 1.25rem 0 0; }
.viewcount strong { color: #e6edf3; font-variant-numeric: tabular-nums; }

/* ---- about --------------------------------------------------------- */
.about-grid { display: grid; grid-template-columns: 220px 1fr; gap: clamp(1.5rem, 5vw, 3rem); align-items: start; }
.about-grid img {
  width: 220px; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg);
  box-shadow: var(--shadow);
}
.about-grid .prose { max-width: var(--prose); }
.about-grid .prose p:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-grid img { max-width: 200px; }
}

/* ---- skills ----------------------------------------------------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; }
.skill-group {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow); padding: 1.1rem 1.25rem;
}
.skill-group h3 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--accent); margin-bottom: .6rem;
}
.skill-group ul { list-style: none; margin: 0; padding: 0; }
.skill-group li { color: var(--text-muted); font-size: .92rem; padding: .16rem 0; }

/* ---- experience timeline ----------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  position: relative; padding-left: 1.75rem; padding-bottom: 2.5rem;
  border-left: 1px solid var(--border);
}
.timeline > li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline > li::before {
  content: ""; position: absolute; left: -5px; top: .35rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--bg);
}
.job-head { display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: baseline; margin-bottom: .1rem; }
.job-head h3 { font-size: 1.1rem; }
.job-role { color: var(--accent); font-weight: 600; font-size: .95rem; }
.job-date {
  margin-left: auto; color: var(--text-muted); font-size: .85rem; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* two positions under one company */
.job-stint { margin-top: 1.4rem; }
.job-stint:first-of-type { margin-top: .5rem; }
.stint-head { display: flex; flex-wrap: wrap; gap: .2rem 1rem; align-items: baseline; margin-bottom: .1rem; }
.timeline p { color: var(--text-muted); font-size: .96rem; max-width: var(--prose); }
.timeline ul { color: var(--text-muted); font-size: .93rem; max-width: var(--prose); }
.timeline details > summary {
  cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 600;
  list-style: none; margin-top: .25rem;
}
.timeline details > summary::-webkit-details-marker { display: none; }
.timeline details[open] > summary { margin-bottom: .5rem; }

/* ---- education ---------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; background: var(--bg); box-shadow: var(--shadow);
}
.card h3 { font-size: 1rem; margin-bottom: .15rem; }
.card .muted { color: var(--text-muted); font-size: .9rem; margin: 0; }

/* ---- certifications -------------------------------------------- */
.cert-grid {
  list-style: none; margin: 0 0 1.5rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem;
}
.cert {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem;
}
.cert h3 { font-size: .98rem; line-height: 1.3; }
.cert-issuer { color: var(--text-muted); font-size: .85rem; margin: 0; }
.cert-level {
  align-self: flex-start;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: .15rem .5rem; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--text-muted) 15%, transparent); color: var(--text-muted);
}
.cert-level--expert { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-strong); }
.cert-level--cisco  { background: color-mix(in srgb, #16a34a 16%, transparent); color: #15803d; }
.cert-level--fund   { opacity: .8; }
:root[data-theme="dark"] .cert-level--cisco,
:root:not([data-theme="light"]) .cert-level--cisco { color: #4ade80; }

/* ---- contact ---------------------------------------------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 3rem); align-items: start; }
@media (max-width: 720px) { .contact-grid { grid-template-columns: 1fr; } }
.form-row { display: grid; gap: .35rem; margin-bottom: 1rem; }
.form-row label { font-size: .88rem; font-weight: 600; }
.form-row input, .form-row textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: .6rem .75rem; width: 100%;
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.form-row textarea { min-height: 7rem; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: .25rem 0 1rem; }
.form-status { font-size: .92rem; margin: .5rem 0 0; min-height: 1.4em; }
.form-status.ok { color: #1a7f37; }
.form-status.err { color: #cf222e; }
:root[data-theme="dark"] .form-status.ok, :root:not([data-theme="light"]) .form-status.ok { color: #3fb950; }
:root[data-theme="dark"] .form-status.err, :root:not([data-theme="light"]) .form-status.err { color: #ff7b72; }
.contact-links { list-style: none; margin: 0; padding: 0; }
.contact-links li { margin: .6rem 0; }
.contact-links a { display: inline-flex; gap: .55rem; align-items: center; color: var(--text); text-decoration: none; }
.contact-links a:hover { color: var(--accent); }
.contact-links svg { width: 1.1rem; height: 1.1rem; color: var(--text-muted); }

/* ---- footer --------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border); padding-block: 2.5rem;
  color: var(--text-muted); font-size: .9rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ---- theme toggle ------------------------------------------------ */
.theme-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 1.2rem; height: 1.2rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }

/* ---- scroll reveal (progressive) ------------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---- print: a clean one-document résumé ----------------------- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --text-muted: #333;
    --border: #bbb; --accent: #000; --shadow: none;
  }
  .site-header, .theme-toggle, .nav-toggle, .skip-link,
  .hero-actions, .social, .viewcount, .site-footer,
  #contact form, #certifications .btn { display: none !important; }

  html { scroll-padding-top: 0; }
  body { font-size: 10.5pt; line-height: 1.4; }
  .container { max-width: none; padding: 0; }
  section { padding-block: .5rem !important; border: 0 !important; background: #fff !important; }
  .hero { padding-block: 0 .5rem !important; }
  .reveal { opacity: 1 !important; transform: none !important; }

  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; margin: .9rem 0 .35rem; }
  .section-eyebrow { color: #000; }
  a { color: #000; text-decoration: none; }

  .about-grid { grid-template-columns: 120px 1fr; }
  .skills-grid, .cards, .cert-grid { gap: .5rem; }
  .skill-group, .card, .cert { break-inside: avoid; }

  /* force-open the "Key responsibilities" details */
  .timeline details > summary { display: none; }
  .timeline details > *:not(summary) { display: block !important; }
  .timeline > li { break-inside: avoid; border-left: 0; padding-left: 0; padding-bottom: .6rem; }
  .timeline > li::before { display: none; }
}
