/* colin.sh: hand-written CSS, no build step.
   Theming: every color is declared once with light-dark(); the toggle just
   flips color-scheme via [data-theme] on <html>. */

:root {
  color-scheme: light dark;

  --bg:          light-dark(#faf9f7, #101216);
  --bg-elevated: light-dark(#ffffff, #171a20);
  --bg-header:   light-dark(rgba(250, 249, 247, 0.85), rgba(16, 18, 22, 0.85));
  --text:        light-dark(#1f2328, #e8eaed);
  --muted:       light-dark(#5f6368, #9aa0a6);
  --border:      light-dark(#e4e2dd, #2a2f38);
  --accent:      light-dark(#1a73e8, #8ab4f8);
  --accent-ink:  light-dark(#ffffff, #101216);
  --accent-wash: light-dark(rgba(26, 115, 232, 0.055), rgba(138, 180, 248, 0.07));
  --shadow:      light-dark(0 1px 2px rgba(31, 35, 40, 0.05), none);
}

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

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 100;
  padding: 0.5rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin-left: auto;
  font-size: 0.92rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent); }

.theme-toggle {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Show the icon for the mode you'd switch to. */
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Hero ---------- */

.hero {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 3.25rem 0 1rem;
}

.avatar {
  position: relative;
  flex-shrink: 0;
  width: 8rem;
  height: 8rem;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, var(--bg)));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), var(--shadow);
}
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-initials {
  font-size: 2.6rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--accent-ink);
  user-select: none;
}

.hero-text h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.9rem, 5vw, 2.35rem);
}
.tagline {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 500;
}
.hero-sub {
  margin: 0;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { color: var(--accent-ink); filter: brightness(1.06); }

.soon-pill {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Sections ---------- */

.section {
  padding: 2.4rem 0;
  scroll-margin-top: 4.25rem;
}

.section h2 {
  margin: 0 0 1.1rem;
  font-size: 1.45rem;
}

.section-intro {
  margin: -0.5rem 0 1.25rem;
  color: var(--muted);
}

.empty-state {
  padding: 1.1rem 1.25rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
}
.empty-state p { margin: 0; }

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

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.2rem;
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.card-title {
  color: var(--text);
  text-decoration: none;
}
.card-title::after {
  /* Stretch the title's hit area over the whole card. */
  content: "";
  position: absolute;
  inset: 0;
}
.card:hover .card-title { color: var(--accent); }

.card p {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.card-domain {
  margin-top: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--accent);
}

/* ---------- Featured: Crowable ---------- */

.featured {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.75rem 1.9rem;
  background: linear-gradient(160deg, var(--accent-wash), transparent 70%) var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.featured-text {
  flex: 1;
  min-width: 0;
}

.featured-media {
  width: 230px;
  height: auto;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.featured-media.featured-logo {
  border: none;
  border-radius: 0;
}

@media (max-width: 620px) {
  .featured { flex-direction: column; align-items: stretch; }
  .featured-media { width: 100%; max-width: 320px; align-self: center; }
}

.kicker {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
}

.featured h2 { margin: 0 0 0.2rem; }

.featured-tagline {
  margin: 0 0 0.75rem;
  font-weight: 550;
}

.featured p { margin-top: 0; }

.featured-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 0.2rem;
}

.featured-status {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Notes (microblog) ---------- */

.notes-list {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.note + .note { border-top: 1px solid var(--border); }

.note h3 { margin: 0; font-size: 1rem; }

.note-toggle {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  width: 100%;
  padding: 0.85rem 1.15rem;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}
.note-toggle:hover { color: var(--accent); }

.note-date {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.note-chevron {
  margin-left: auto;
  flex-shrink: 0;
  align-self: center;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.note[data-open] .note-chevron { transform: rotate(90deg); }

.note-body {
  padding: 0 1.15rem 1rem;
  color: var(--text);
}
.note-body > p:first-child { margin-top: 0; }
.note-body p:last-of-type { margin-bottom: 0.5rem; }

.note-permalink {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}
.note-permalink:hover { color: var(--accent); }

/* ---------- Elsewhere ---------- */

.gh-chart {
  display: block;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  line-height: 0;
}
.gh-chart img {
  width: 100%;
  height: auto;
}
/* Approximate a dark rendering of the (light-only) chart SVG. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .gh-chart img {
    filter: invert(1) hue-rotate(180deg) saturate(1.3);
  }
}
:root[data-theme="dark"] .gh-chart img {
  filter: invert(1) hue-rotate(180deg) saturate(1.3);
}

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

.site-footer {
  max-width: 44rem;
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.site-footer p { margin: 0; }

/* ---------- Small screens ---------- */

@media (max-width: 540px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    padding-top: 2.25rem;
  }
  .avatar { width: 6.5rem; height: 6.5rem; }
  .avatar-initials { font-size: 2.1rem; }
  .site-nav { font-size: 0.85rem; gap: 0.1rem 0.8rem; }
}

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