/* =========================================================
   Shane Draper — portfolio
   Design system: clean, confident, "analyst-built".
   Single stylesheet, no framework.
   ========================================================= */

/* ---- Design tokens ---- */
:root {
  --ink:        #16181d;
  --ink-soft:   #565b66;
  --ink-faint:  #868b95;
  --bg:         #ffffff;
  --bg-alt:     #f5f6f8;
  --bg-tint:    #eef1fe;
  --line:       #e6e8ec;
  --line-strong:#d3d7de;
  --accent:     #2f56e6;
  --accent-dark:#1e3fc0;
  --accent-ink: #17246b;

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 22, 29, .05), 0 1px 3px rgba(20, 22, 29, .06);
  --shadow-md: 0 10px 30px -12px rgba(20, 22, 29, .18);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);

  --step-eyebrow: .78rem;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
p  { margin: 0 0 1rem; }

::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.1rem;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--step-eyebrow);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.section-head { max-width: 60ch; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { color: var(--ink-soft); font-size: 1.15rem; }

.lead { font-size: 1.25rem; color: var(--ink-soft); max-width: 62ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: .55rem;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  font-size: .9rem;
  letter-spacing: 0;
}
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0; padding: 0;
}
.nav-links a {
  display: inline-block;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .97rem;
  padding: .5rem .8rem;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-alt); }
.nav-links a[aria-current="page"] { color: var(--accent); }
.nav-links .nav-cta {
  margin-left: .4rem;
  background: var(--ink);
  color: #fff;
}
.nav-links .nav-cta:hover { background: var(--accent); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 42px; height: 42px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: .5rem var(--gutter) 1rem;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: .8rem .4rem; font-size: 1.05rem; border-radius: 0; }
  .nav-links .nav-cta { margin: .6rem 0 0; text-align: center; }
}

/* ---- Hero ---- */
.hero { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(2.5rem, 5vw, 4rem); }
.hero .eyebrow { color: var(--accent); }
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 1.2rem; }

/* Stat strip */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: block;
  line-height: 1;
}
.stat .label { color: var(--ink-soft); font-size: .98rem; margin-top: .55rem; }
@media (max-width: 620px) {
  .stats { grid-template-columns: 1fr; gap: 1.5rem; text-align: left; }
}

/* ---- Value props (3-up) ---- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
}
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

.value h3 { margin-bottom: .4rem; }
.value p { color: var(--ink-soft); margin: 0; }
.value .vnum {
  font-family: var(--font-display);
  color: var(--accent);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .1em;
  display: block;
  margin-bottom: .8rem;
}

/* ---- Cards ---- */
.card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.card, .card--link { cursor: pointer; }
a.card:hover, .card--link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--ink);
}
.card .kicker {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--ink-soft); margin: 0 0 1rem; }
.card .card-foot {
  margin-top: auto;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
a.card:hover .card-foot .arrow { transform: translateX(3px); }
.card-media {
  margin: -1.6rem -1.6rem 1.4rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--bg-alt);
  aspect-ratio: 16 / 10;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-media--cover img { object-fit: cover; }

/* ---- Project blocks (Work page) ---- */
.project {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
}
.project:first-of-type { border-top: 0; padding-top: 0; }
.project-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 820px) { .project-grid { grid-template-columns: 1fr; gap: 1.5rem; } }

.project-meta .role {
  color: var(--ink-soft);
  font-size: .95rem;
  margin: 0 0 .3rem;
}
.project-meta h3 { font-size: 1.55rem; margin-bottom: 1rem; }
.project-meta .summary { color: var(--ink-soft); margin: 0 0 1.2rem; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.tags li {
  font-size: .82rem;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--bg-tint);
  padding: .35rem .7rem;
  border-radius: 999px;
}

.pao { display: grid; gap: 1.25rem; }
.pao .block > .plabel {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .35rem;
}
.pao .block p { margin: 0; color: var(--ink); }
.pao ul.outcome {
  margin: 0; padding: 0; list-style: none;
  display: grid; gap: .55rem;
}
.pao ul.outcome li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--ink);
}
.pao ul.outcome li::before {
  content: "";
  position: absolute;
  left: 0; top: .55em;
  width: .5rem; height: .5rem;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
}
.project .project-links { margin-top: 1.4rem; }

/* ---- Code / detail pages ---- */
.detail-hero { padding-block: clamp(2.5rem, 6vw, 4rem) 1rem; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 1.5rem;
}
.detail-step {
  border-top: 1px solid var(--line);
  padding-block: clamp(2rem, 4vw, 3rem);
}
.detail-step:first-of-type { border-top: 0; }
.detail-step h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.detail-step > p { color: var(--ink-soft); max-width: 70ch; }

.step-nav {
  position: sticky; top: 68px;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.step-nav ul {
  list-style: none; margin: 0; padding: .7rem 0;
  display: flex; gap: .3rem; overflow-x: auto;
  scrollbar-width: thin;
}
.step-nav a {
  white-space: nowrap;
  font-size: .88rem; font-weight: 500;
  color: var(--ink-soft);
  padding: .4rem .75rem; border-radius: 999px;
}
.step-nav a:hover { background: var(--bg-alt); color: var(--ink); }

pre {
  background: #0f1117;
  color: #e6e8ef;
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
  font-size: .88rem;
  line-height: 1.6;
  margin: 1.25rem 0 0;
  border: 1px solid #1f2330;
}
pre code {
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}
code { font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:not(pre) > code {
  background: var(--bg-alt);
  padding: .12em .4em;
  border-radius: 5px;
  font-size: .9em;
}

details.code-drop {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 1.25rem;
  overflow: hidden;
}
details.code-drop summary {
  cursor: pointer;
  padding: .9rem 1.2rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-alt);
  list-style: none;
}
details.code-drop summary::-webkit-details-marker { display: none; }
details.code-drop summary::before { content: "▸ "; color: var(--accent); }
details.code-drop[open] summary::before { content: "▾ "; }
details.code-drop pre { margin: 0; border-radius: 0; border: 0; }

/* ---- Games page ---- */
.showcase-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}
.callout-grid { margin-top: 1rem; }
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.3rem;
  background: var(--bg);
}
.callout h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.callout p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

.title-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.title-list li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.title-list .tname { font-family: var(--font-display); font-weight: 600; min-width: 9rem; }
.title-list .tdesc { color: var(--ink-soft); font-size: .97rem; }

/* ---- Music page ---- */
.music { --accent: #3a7d5c; --accent-dark: #2c624766; --bg-tint: #e9f3ee; --accent-ink: #1d4733; }
.music .eyebrow, .music a { color: #2f6f52; }
.track-group { margin-top: 2.5rem; }
.track-group h3 { margin-bottom: .3rem; }
.track-group .group-note { color: var(--ink-soft); margin: 0 0 1.3rem; font-size: .98rem; }
.track {
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.track:first-of-type { border-top: 0; }
.track .tlabel { font-weight: 500; margin: 0 0 .6rem; }
.track audio { width: 100%; height: 40px; }
.embed-wrap { border-radius: 12px; overflow: hidden; margin-top: 1rem; }
.embed-wrap iframe { display: block; width: 100%; border: 0; }

/* ---- Contact ---- */
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}
.contact-email {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-top: 1.5rem; color: var(--ink-soft); }
.meta-row .mlabel { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: .2rem; }
.meta-row .mval { color: var(--ink); font-weight: 500; }

/* ---- CTA band ---- */
.cta-band {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); max-width: 50ch; margin-inline: auto; }
.cta-band .btn--ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }
.cta-band .btn-row { justify-content: center; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem;
  color: var(--ink-soft);
  font-size: .95rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-nav a { color: var(--ink-soft); }
.footer-nav a:hover { color: var(--ink); }

/* ---- Scroll reveal ---- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, a.card:hover, .card--link:hover { transform: none; }
}

/* ---- Utilities ---- */
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
