/* johncrox.com — shared styles
   Design: one accent (amber/ember), system fonts, dark-mode aware, no JS. */

:root {
  color-scheme: light dark;

  --bg: #fbfaf8;
  --bg-raised: #ffffff;
  --border: #e6e1d9;
  --border-strong: #d5cec2;
  --text: #1c1b19;
  --muted: #6b665e;
  --accent: #b4530c;
  --accent-soft: #fdf1e5;
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.05), 0 8px 24px -16px rgba(28, 27, 25, 0.25);

  --measure: 40rem;
  --page: 46rem;

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14140f;
    --bg-raised: #1c1c17;
    --border: #2e2d26;
    --border-strong: #423f35;
    --text: #ece8e0;
    --muted: #9d978b;
    --accent: #f0a35e;
    --accent-soft: #2a1f13;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -16px rgba(0, 0, 0, 0.8);
  }
}

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

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

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

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

/* ---------- links ---------- */

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- header / nav ---------- */

.site-header {
  padding: 2.25rem 0 0.5rem;
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
}

.brand {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover { color: var(--accent); text-decoration: none; }

.nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav a { color: var(--muted); }
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* ---------- page shell ---------- */

main { padding: 1.5rem 0 4rem; }

.page-title {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 1.5rem 0 0.5rem;
}

.lede {
  color: var(--muted);
  max-width: var(--measure);
  margin: 0 0 2.5rem;
}

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

.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 650;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---------- home ---------- */

.hero { padding: 2rem 0 0; }

.hero h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.hero .role {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
}

.bio {
  max-width: var(--measure);
  font-size: 1.075rem;
}
.bio p { margin: 0 0 1rem; }

/* ---------- contact row ---------- */

.contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 2rem 0 0;
}

.contacts a,
.contacts .chip-static {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-raised);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.contacts a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.contacts .chip-static { color: var(--muted); }

.contacts svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
}

/* ---------- cards / lists ---------- */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

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

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card .card-actions {
  margin-top: auto;
  padding-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  font-size: 0.92rem;
}

.tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg-raised);
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }

@media (prefers-color-scheme: dark) {
  .btn { color: #1a1409; }
}

/* project + writing lists */

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.75rem;
}

.entry h3 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.entry h3 a { color: var(--text); }
.entry h3 a:hover { color: var(--accent); text-decoration: none; }

.entry p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  max-width: var(--measure);
}

.entry .meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  align-items: center;
}

.entry.featured {
  padding: 1.35rem 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.92rem;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

@media (max-width: 34rem) {
  body { font-size: 16px; }
  .site-header { padding-top: 1.5rem; }
  .nav { gap: 1rem; }
}
