/* ---------------------------------------------------------------------------
   scroggin.com — single stylesheet. Tweak the tokens in :root to restyle.
   --------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0f1116;
  --surface: #161920;
  --surface-hover: #1b1f28;
  --border: #262b35;
  --border-strong: #343a46;

  /* Text */
  --fg: #c6ccd6;
  --fg-strong: #f1f3f7;
  --fg-muted: #8b94a3;
  --fg-faint: #5f6878;

  /* Accent */
  --accent: #b388f0;
  --accent-hover: #cfb0ff;
  --accent-soft: rgba(179, 136, 240, 0.14);
  --info: #5cc2ff;

  /* Type */
  --font-serif: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale */
  --measure: 44rem;
  --radius: 0.75rem;
  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.75rem, 1.4rem + 1.2vw, 2.125rem);
  --step-3: clamp(2.25rem, 1.7rem + 2vw, 3rem);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(60rem 30rem at 50% -10rem, rgba(179, 136, 240, 0.07), transparent 70%);
  background-repeat: no-repeat;
  color: var(--fg);
  font-family: var(--font-serif);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-color: currentColor;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 0.35rem;
  color: var(--fg-strong);
}

::selection {
  background: var(--accent-soft);
  color: var(--fg-strong);
}

/* Layout ------------------------------------------------------------------ */

.container {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }
}

main {
  padding: 2.5rem 0 4rem;
}

@media (min-width: 768px) {
  main {
    padding: 4rem 0 5rem;
  }
}

section + section {
  margin-top: 4.5rem;
}

/* Typography -------------------------------------------------------------- */

h1,
h2,
h3 {
  color: var(--fg-strong);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-3);
  margin-bottom: 2rem;
}

h2 {
  font-size: var(--step-2);
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

p {
  margin: 0 0 1.5rem;
}

ul,
ol {
  padding-left: 1.4rem;
  margin: 0 0 1rem;
}

li {
  margin: 0.4rem 0;
}

li::marker {
  color: var(--fg-faint);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--fg);
  max-width: 36rem;
}

.prose h3 {
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
}

.prose h1 + h3,
.prose h2 + h3 {
  margin-top: 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 0.75rem;
}

/* Header ------------------------------------------------------------------ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 0.75rem 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-strong);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--fg-strong);
  text-decoration: none;
}

/* The home hero already shows the name and avatar, so skip the brand there. */
[data-page="home"] .brand {
  visibility: hidden;
}

.brand img {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 9999px;
  object-fit: cover;
}

.brand span {
  display: none;
}

@media (min-width: 520px) {
  .brand span {
    display: inline;
  }
}

.nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav li {
  margin: 0;
}

.nav a {
  position: relative;
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  color: var(--fg-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--fg-strong);
  background: rgba(255, 255, 255, 0.05);
}

.nav a.active {
  color: var(--fg-strong);
}

.nav a.active::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Footer ------------------------------------------------------------------ */

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 400;
}

footer .social {
  display: flex;
  gap: 1rem;
}

footer .social a {
  color: var(--fg-muted);
  display: inline-flex;
  padding: 0.4rem;
  border-radius: 9999px;
  transition: color 120ms ease, background 120ms ease;
}

footer .social a:hover {
  color: var(--fg-strong);
  background: rgba(255, 255, 255, 0.06);
}

footer .social svg {
  width: 1.35rem;
  height: 1.35rem;
}

footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--fg-faint);
}

/* Home -------------------------------------------------------------------- */

.hero {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .hero {
    grid-template-columns: auto 1fr;
    gap: 2.5rem;
  }
}

.hero img {
  width: 8.5rem;
  height: 8.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.hero h1 {
  margin: 0 0 0.5rem;
}

.hero .tagline {
  margin: 0;
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--fg-muted);
  text-wrap: balance;
}

.hero + section {
  margin-top: 2.5rem;
}

/* Project cards ----------------------------------------------------------- */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.15rem;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0;
}

.card h3 a {
  color: var(--fg-strong);
  text-decoration: none;
}

.card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card h3 .owner {
  color: var(--fg-muted);
  font-weight: 400;
}

.card p {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--fg);
  margin: 0;
  flex: 1;
}

.card .github {
  color: var(--fg-faint);
  flex-shrink: 0;
  display: inline-flex;
  margin-top: 0.1rem;
}

.card:hover .github {
  color: var(--fg-muted);
}

.card .github svg {
  width: 1.15rem;
  height: 1.15rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-family: var(--font-sans);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 1.4rem;
  padding: 0 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  color: var(--fg-muted);
}

.badge-info {
  background: transparent;
  border-color: rgba(92, 194, 255, 0.45);
  color: var(--info);
}

/* Dated entries (talks, resume) ------------------------------------------- */

.entry {
  display: grid;
  gap: 0.25rem 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.entries .entry:first-child {
  border-top: 0;
  padding-top: 0.5rem;
}

.entries .entry:last-child {
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .entry {
    grid-template-columns: 9.5rem minmax(0, 1fr);
  }
}

.entry .when {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--fg-muted);
  padding-top: 0.35rem;
}

.entry .when span {
  display: block;
}

.entry h3 {
  margin: 0 0 0.35rem;
}

.entry p {
  margin: 0;
  color: var(--fg);
}

.entry ul {
  margin: 0.25rem 0 0.75rem;
}

.entry li {
  font-size: 1rem;
  margin: 0.3rem 0;
}

.entry .org {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  margin: 0 0 0.6rem;
}

.entry .tech {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--fg-faint);
  margin: 0.25rem 0 0;
}

.entry .tech strong {
  font-weight: 600;
  color: var(--fg-muted);
}

.entry .earlier {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry .earlier li {
  font-size: 1rem;
  margin: 0 0 0.9rem;
}

.entry .earlier .role {
  color: var(--fg-strong);
  font-weight: 600;
}

.entry .earlier .org {
  display: inline;
  margin: 0 0 0 0.4rem;
}

/* Resume header / skills -------------------------------------------------- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.page-header h1 {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-strong);
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 120ms ease, background 120ms ease;
}

.button:hover {
  color: var(--fg-strong);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--fg-muted);
  text-decoration: none;
}

.button svg {
  width: 0.9rem;
  height: 0.9rem;
}

.skills {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem 3rem;
}

@media (min-width: 640px) {
  .skills {
    grid-template-columns: 1fr 1fr;
  }
}

.skills h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.skills ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skills li {
  margin: 0;
}

.skills .badge {
  height: 1.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg);
}
