/* Minimal, content-first styling (mobile-first) */
:root{
  --bg:#ffffff;
  --surface:#ffffff;
  --fg:#0f172a;
  --muted:#475569;
  --accent:#7c3aed;
  --accent-hover:#6d28d9;
  --accent-soft:#ede9fe;
  --border:#e5e7eb;
  --live:#16a34a;     --live-soft:#dcfce7;
  --building:#d97706; --building-soft:#fef3c7;
  --dead:#dc2626;     --dead-soft:#fee2e2;
  --max: 760px;
  --pad: 18px;
  --radius: 10px;
  --header-h: 72px;
}

:root[data-theme="dark"]{
  --bg:#0f1214;
  --surface:#11161b;
  --fg:#cfd6dd;
  --muted:#9ca3af;
  --accent:#f4c95d;
  --accent-hover:#e3b545;
  --accent-soft:#2a2415;
  --border:#1f242b;
  --live:#34d399;     --live-soft:#10241a;
  --building:#fbbf24; --building-soft:#2a2310;
  --dead:#f87171;     --dead-soft:#2a1416;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font: 16px/1.7 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--fg);
  background:var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.wrap{
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  padding: 24px var(--pad) 64px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
body > .wrap{
  min-height: calc(100vh - var(--header-h));
}

header{
  position: sticky;
  top: 0;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
header .wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 16px;
  padding-top: 18px;
  padding-bottom: 18px;
}

nav{
  display:flex;
  align-items:center;
  gap: 22px;
  justify-content:center;
}
nav a{
  text-decoration:none;
  color:var(--muted);
  font-weight: 520;
}
nav a[aria-current="page"]{ color: var(--fg); }

.floating-back{
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  margin-bottom: 16px;
  align-self: flex-end;
  position: relative;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  font-size: 15px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  z-index: 30;
}
.floating-back:hover{
  border-color: var(--accent);
  color: var(--fg);
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft) 12%);
}

.menu-btn{
  display:none;
  border: 1px solid var(--border);
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius);
  font: inherit;
  color: var(--fg);
}

.theme-switch{
  display:flex;
  align-items:center;
  gap: 10px;
  justify-content: flex-end;
  position: relative;
}
.theme-main{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 14px;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.theme-options{
  display: inline-flex;
  gap: 8px;
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: right center;
  opacity: 0;
  transition: transform 160ms ease, opacity 160ms ease;
}
.theme-options[hidden]{
  display: inline-flex;
}
.theme-options.is-open{
  transform: translateY(-50%) scaleX(1);
  opacity: 1;
}
.theme-options button{
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  padding: 9px 12px;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}

@media (max-width: 720px){
  .floating-back{
    display: inline-flex;
  }
  nav{ display:none; }
  nav.open{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap: 10px;
    padding-top: 10px;
  }
  header .wrap{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .menu-btn{ display:inline-flex; align-self:flex-end; }
}

main{
  padding-top: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

h1{
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
h2{
  font-size: 22px;
  margin: 32px 0 12px;
}
h3{
  font-size: 17px;
  margin: 24px 0 8px;
}
p{ margin: 0 0 14px; }

hr{
  border:0;
  border-top: 1px solid var(--border);
  margin: 26px 0;
}
.section-divider{
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0 20px;
}

.small{ font-size: 13px; color: var(--muted); }
.kicker{ color: var(--muted); margin-top: 6px; }
.compact-kicker{ margin-top: 1px; }

.list{
  list-style:none;
  padding:0;
  margin: 10px 0 0;
}
.list li{ margin: 10px 0 0; }
.list a{ text-decoration:none; }
.list a:hover{ text-decoration: underline; }

.contact-links{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 6px 0 18px;
}
.contact-links a{
  text-decoration: none;
}
.contact-links a:hover{
  text-decoration: underline;
}

.bullets{
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 6px;
}
.bullets li{
  padding: 6px 0 6px 16px;
  margin: 0;
  line-height: 1.6;
  border-left: 2px solid var(--accent);
}

/* Projects list — status pills + lessons */
.proj-group{
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 44px 0 14px;
}
.proj-group:first-of-type{ margin-top: 28px; }

.projects{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}
.projects:last-of-type{ margin-bottom: 28px; }
.projects li{
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.project-body{ flex: 1; min-width: 0; max-width: 56ch; }
.project-meta{
  flex: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.project-id{
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.project-name{
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
}
a.project-name:hover{ text-decoration: underline; }
.project-url{
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.project-url::after{ content: "\2197"; margin-left: 2px; }
.project-url:hover{ color: var(--accent); text-decoration: underline; }

.status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.status .dot{
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.status--live{ color: var(--live); background: var(--live-soft); }
.status--live .dot{ background: var(--live); }
.status--building{ color: var(--building); background: var(--building-soft); }
.status--building .dot{ background: var(--building); }
.status--dead{ color: var(--dead); background: var(--dead-soft); }
.status--dead .dot{ background: var(--dead); }

.project-desc{
  color: var(--muted);
  margin: 3px 0 0;
}
.metric{
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 1px 7px;
  border-radius: 6px;
}
.lesson{
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  margin: 4px 0 0;
}

@media (max-width: 720px){
  .projects li{
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 0;
  }
  .project-body{ display: contents; }
  .project-id{
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .project-meta{
    grid-column: 2;
    grid-row: 1;
    margin-top: 2px;
  }
  .project-desc,
  .lesson{ grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: no-preference){
  .status--live .dot{ animation: status-pulse 2.4s ease-in-out infinite; }
  @keyframes status-pulse{
    0%, 100%{ box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
    50%{ box-shadow: 0 0 0 4px color-mix(in srgb, var(--live) 0%, transparent); }
  }
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.grid-collections{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 160ms ease, transform 120ms ease, background 140ms ease;
}
.card a{ text-decoration:none; }
.card a:hover{ text-decoration: underline; }
.card:hover,
.card:focus-visible{
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft) 8%);
  outline: none;
}
.card:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-color: var(--accent-hover);
}

.footer{
  margin-top: auto;
  padding-top: 18px;
  padding-left: var(--pad);
  padding-right: var(--pad);
  border-top: 1px solid var(--border);
  display:flex;
  justify-content:space-between;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  max-width: var(--max);
  width: 100%;
  min-width: 100%;
  margin-left: auto;
  margin-right: auto;
  align-self: stretch;
}
.footer-spacer{
  margin-top: 28px;
}
.footer a{ color: var(--muted); text-decoration:none; }
.footer a:hover{ text-decoration: underline; }
.footer .theme-switch{
  margin-left: auto;
}
