/**
 * Canonical stylesheet for both sites (personal/ and openclaw/).
 *
 * Edit THIS file, then run `make sync` (or `make dist`) from the repo
 * root to copy it into personal/assets/style.css and
 * openclaw/assets/style.css — each site is deployed independently, so
 * each needs its own physical copy; this is just what keeps them from
 * drifting apart by hand.
 */

:root {
  --bg: #faf8f3;
  --fg: #191a16;
  --muted: #6b6f68;
  --border: rgba(25, 26, 22, 0.12);
  --accent: #1b7a4d;
  --accent-soft: rgba(27, 122, 77, 0.09);
  --max-width: 640px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1210;
    --fg: #eef1ec;
    --muted: #8b948d;
    --border: rgba(238, 241, 236, 0.13);
    --accent: #4ade80;
    --accent-soft: rgba(74, 222, 128, 0.1);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

strong {
  font-weight: 650;
}

[id] {
  scroll-margin-top: 2.5rem;
}

/* Page shell -------------------------------------------------------------- */

.page {
  padding: clamp(2.5rem, 6vw, 5rem) 1.5rem 6rem;
}

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  counter-reset: section;
}

/* Header + nav -------------------------------------------------------------- */

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--muted);
}

.brand strong {
  color: var(--fg);
}

nav.site {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

nav.site a {
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

nav.site a:hover {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* Headings + intro ------------------------------------------------------ */

.kicker {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.kicker.blink::after {
  content: "_";
  margin-left: 2px;
  animation: blink 1.1s steps(2, jump-none) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .kicker.blink::after {
    animation: none;
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

h1 {
  font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem);
  font-weight: 700;
  margin: 0 0 0.7rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.updated {
  display: block;
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 1.75rem;
}

.lede {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 52ch;
  margin: 0 0 0.5rem;
}

/* Body content ----------------------------------------------------------- */

.muted-note {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Expandable project list -------------------------------------------------- */

.project-list {
  border-top: 1px solid var(--border);
}

.project {
  border-bottom: 1px solid var(--border);
}

.project:last-child {
  border-bottom: none;
}

.project > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.project > summary::-webkit-details-marker {
  display: none;
}

.project > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.project-heading {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.project-thumb {
  width: 34px;
  height: 34px;
  flex: none;
  object-fit: contain;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(127, 127, 127, 0.08);
}

.project-title {
  color: var(--muted);
}

.project-title strong {
  color: var(--fg);
  transition: color 0.15s ease;
}

.project > summary:hover .project-title strong {
  color: var(--accent);
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.chev {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.project[open] > summary .chev {
  transform: rotate(90deg);
}

.project-body {
  padding: 0 0 1.5rem;
}

.project-body p {
  margin: 0 0 0.75rem;
}

.project-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}

.project-gallery a {
  display: block;
  flex: none;
  line-height: 0;
}

.project-gallery img {
  width: 210px;
  height: 135px;
  object-fit: contain;
  background: rgba(127, 127, 127, 0.08);
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: opacity 0.15s ease;
}

.project-gallery a:hover img {
  opacity: 0.8;
}

.project-body .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

.project-body a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.wrap > h2 {
  counter-increment: section;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 650;
  margin: 2.75rem 0 0.9rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.wrap > h2::before {
  content: counter(section, decimal-leading-zero);
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  flex: none;
}

p,
li {
  color: var(--fg);
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.2rem;
  margin: 0 0 1rem;
}

li {
  margin-bottom: 0.45rem;
  padding-left: 0.2rem;
}

li::marker {
  color: var(--accent);
  font-family: var(--font-mono);
}

.note {
  border-left: 2px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

.note a {
  color: var(--accent);
}

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

footer.site {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

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

footer.site nav {
  display: flex;
  gap: 1rem;
}
