/* ==========================================================================
   Lesley Boyd - personal site
   Plain modern CSS. No framework, no jQuery.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------
   Dark is the default, deliberately, regardless of the visitor's OS setting.
   Light is opt-in through the toggle, which stores data-theme="light".
   ------------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --bg:           #10181a;
  --bg-raised:    #172225;
  --bg-sunken:    #0b1214;
  --text:         #e6edee;
  --text-muted:   #a3b3b7;
  --text-subtle:  #7e9096;
  --accent:       #5eead4;
  --accent-hover: #99f6e4;
  --accent-soft:  #16332f;
  --border:       #27373b;
  --shadow:       0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-lift:  0 2px 4px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .40);

  --radius:       12px;
  --radius-sm:    8px;
  --measure:      68ch;
  --font-sans:    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif:   ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:           #f7f8f8;
  --bg-raised:    #ffffff;
  --bg-sunken:    #eceeef;
  --text:         #1b2426;
  --text-muted:   #56656a;
  --text-subtle:  #7b8a90;
  --accent:       #0f766e;
  --accent-hover: #115e56;
  --accent-soft:  #d6ebe8;
  --border:       #dde2e3;
  --shadow:       0 1px 2px rgba(16, 32, 36, .06), 0 4px 12px rgba(16, 32, 36, .06);
  --shadow-lift:  0 2px 4px rgba(16, 32, 36, .08), 0 12px 28px rgba(16, 32, 36, .10);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h3 { font-size: 1.2rem; font-family: var(--font-sans); font-weight: 650; }
h4 { font-size: 1rem;   font-family: var(--font-sans); font-weight: 650; }

p { margin: 0 0 1rem; max-width: var(--measure); }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--bg);
  padding: .7rem 1.1rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Layout ------------------------------------------------------------- */
.wrap {
  width: min(100% - 2rem, 1080px);
  margin-inline: auto;
}

.section {
  padding-block: clamp(3rem, 8vw, 5.5rem);
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
}

/* --- Header / nav ------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header > .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.nav ul {
  display: flex;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: block;
  padding: .45rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 1.1rem; height: 1.1rem; }

/* Theme toggle shows the icon for the mode the click switches to.
   Dark is the default, so the sun shows until the visitor picks light. */
.icon-btn .icon-sun  { display: block; }
.icon-btn .icon-moon { display: none; }
:root[data-theme="light"] .icon-btn .icon-sun  { display: none; }
:root[data-theme="light"] .icon-btn .icon-moon { display: block; }

.nav-toggle { display: none; }

@media (max-width: 800px) {
  .nav-toggle { display: grid; order: 3; }
  .nav {
    order: 4;
    flex-basis: 100%;
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav ul {
    flex-direction: column;
    gap: 0;
    padding-bottom: .75rem;
  }
  .nav a {
    padding: .7rem .75rem;
    border-radius: 0;
    border-top: 1px solid var(--border);
  }
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 9vw, 6rem);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

/* Soft tinted wash. The old slider photos have text burned into them, so
   they are not usable as a background. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 0%,
      color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 70% 70% at 95% 100%,
      color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
}

.hero > .wrap { position: relative; }

.hero-grid {
  display: grid;
  gap: clamp(1.5rem, 5vw, 3rem);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 760px) {
  .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

.hero h1 { margin-bottom: .25rem; }

.hero-roles {
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.hero-lede {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 52ch;
}

.portrait {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  width: 100%;
  max-width: 320px;
  justify-self: center;
}

/* --- Buttons ------------------------------------------------------------ */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent);
}

.btn svg { width: 1rem; height: 1rem; }

/* --- Prose / about ------------------------------------------------------ */
.prose p { color: var(--text-muted); }
.prose p:first-of-type {
  font-size: 1.15rem;
  color: var(--text);
}

/* --- Experience --------------------------------------------------------- */
.timeline {
  display: grid;
  gap: .75rem;
  margin-top: 2rem;
}

.job {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.job > summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
}
.job > summary::-webkit-details-marker { display: none; }
.job > summary:hover { background: var(--accent-soft); }

.job-logo {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 3px;
}

.job-head { margin-right: auto; min-width: 0; }
.job-org  { display: block; font-size: 1.05rem; }
.job-role { display: block; font-weight: 500; color: var(--text-muted); font-size: .92rem; }

.job-dates {
  font-size: .85rem;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}

.job-chevron {
  width: 1rem; height: 1rem;
  flex: none;
  color: var(--text-subtle);
  transition: transform .2s;
}
.job[open] .job-chevron { transform: rotate(180deg); }

.job-body {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.job-body h4 { margin-top: 1.1rem; color: var(--text); }
.job-body ul { margin: 0 0 .5rem; padding-left: 1.15rem; }
.job-body li { margin-bottom: .45rem; color: var(--text-muted); max-width: var(--measure); }

@media (max-width: 600px) {
  .job > summary { flex-wrap: wrap; gap: .75rem; padding: 1rem; }
  .job-dates { order: 3; width: 100%; }
  .job-body { padding: 0 1rem 1rem; }
}

/* --- Cards (projects / certs) ------------------------------------------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin-top: 2rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.card-media {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 1.1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-body h3 { margin-bottom: .35rem; }
.card-body p  { color: var(--text-muted); font-size: .95rem; flex: 1; }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .75rem;
}
.card-links a {
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.card-links a:hover { text-decoration: underline; }
.card-links svg { width: .85rem; height: .85rem; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .75rem;
}
.tag {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* On light the plain accent is too pale against the soft chip background. */
:root[data-theme="light"] .tag { color: var(--accent-hover); }

/* Credential cards carry no image, so they need their own minimum height. */
.credential .card-body { justify-content: center; min-height: 6.5rem; }
.credential h3 { margin-bottom: .2rem; }
.credential p  { flex: none; color: var(--text-subtle); font-size: .9rem; margin: 0; }

.education {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: .6rem;
}
.education li {
  padding-left: 1rem;
  border-left: 2px solid var(--accent-soft);
  color: var(--text-muted);
}
.education strong { color: var(--text); font-weight: 650; }
.edu-note { color: var(--text-subtle); font-size: .88rem; }
.edu-note::before { content: " \00b7 "; }

/* --- Tech --------------------------------------------------------------- */
.skill-heading {
  margin: 2rem 0 0;
  color: var(--text);
}
.skill-heading:first-of-type { margin-top: 1.5rem; }

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}

.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 550;
  box-shadow: var(--shadow);
}

/* --- Contact ------------------------------------------------------------ */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: .9rem;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.contact-list svg {
  width: 1.1rem; height: 1.1rem;
  flex: none;
  color: var(--accent);
}
.contact-list a { text-decoration: none; font-weight: 550; }
.contact-list a:hover { text-decoration: underline; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  padding-block: 2rem;
}
.site-footer > .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.site-footer p {
  margin: 0;
  color: var(--text-subtle);
  font-size: .88rem;
}

.social {
  display: flex;
  gap: .4rem;
}
.social a {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.social a:hover { background: var(--accent-soft); color: var(--accent-hover); }
.social svg { width: 1.2rem; height: 1.2rem; }
