:root {
  color-scheme: dark;
  --bg: #050506;
  --fg: #f5f5f4;
  --muted: rgba(245, 245, 244, 0.45);
  --line: rgba(255, 255, 255, 0.08);
  --accent: #a3e635;
  --font-display: "Syne", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --content-max: 42rem;
  --page-pad: clamp(1rem, 4vw, 2.5rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
}

/* Footer stays at viewport bottom when content is short */
body.layout-sticky-footer {
  display: flex;
  flex-direction: column;
}

body.layout-sticky-footer .content-wrap {
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: max(1.25rem, env(safe-area-inset-top)) var(--page-pad) 1rem;
  border-bottom: 1px solid var(--line);
}

.site-header-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.project-search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.project-search-field input {
  width: min(14rem, 42vw);
  padding: 0.5rem 0.65rem 0.5rem 1.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.2s;
}

.project-search-field input::placeholder {
  color: var(--muted);
}

.project-search-field input:focus {
  border-color: rgba(163, 230, 53, 0.45);
}

.project-search-field .search-icon {
  position: absolute;
  left: 0.55rem;
  width: 0.75rem;
  height: 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}

.project-search-field .search-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 0.35rem;
  height: 1px;
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: right bottom;
}

.site-brand {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-brand strong {
  display: block;
  color: var(--fg);
  font-weight: 500;
}

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

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
}

.content-wrap {
  padding: clamp(2rem, 6vw, 4rem) var(--page-pad) clamp(4rem, 10vw, 6rem);
}

.content-narrow {
  max-width: var(--content-max);
  margin-left: auto;
  margin-right: auto;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.lead {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  line-height: 1.65;
  color: rgba(245, 245, 244, 0.82);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-row .tag {
  color: var(--accent);
}

.project-hero {
  margin: 2rem 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.project-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-hero.placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-home__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 1.25rem;
}

.app-home__logo {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1.1rem;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.app-home__titles .page-title {
  margin: 0;
}

.app-home__tagline {
  margin: 0.35rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-home__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0 0 2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.app-home__legal a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.app-home__section {
  margin-bottom: 2rem;
}

.app-home__section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-home__section p,
.app-home__section li {
  color: var(--muted);
  line-height: 1.65;
}

.app-home__section ul {
  margin: 0;
  padding-left: 1.2rem;
}

.site-brand__by {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

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

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

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
}

.link-row a {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(163, 230, 53, 0.35);
  padding-bottom: 0.15rem;
}

.section-title {
  margin: clamp(2.5rem, 6vw, 3.5rem) 0 1rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.post-list,
.project-index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.post-list li,
.project-index-list li {
  border-bottom: 1px solid var(--line);
}

.post-list a,
.project-index-list a {
  display: block;
  padding: 1rem 0;
  color: var(--fg);
}

.post-list a:hover,
.project-index-list a:hover {
  color: var(--accent);
}

.post-list .post-title,
.project-index-list .project-name {
  display: block;
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.post-list .post-summary,
.project-index-list .project-tagline {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.post-list .post-date,
.post-list .post-meta {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.writing-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.75rem;
}

.filter-chip {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.filter-chip:hover {
  color: var(--fg);
  border-color: rgba(163, 230, 53, 0.35);
}

.filter-chip.is-active {
  color: var(--accent);
  border-color: rgba(163, 230, 53, 0.45);
  background: rgba(163, 230, 53, 0.08);
}

.blog-cta {
  margin: 0 0 1.25rem;
}

.blog-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(163, 230, 53, 0.35);
  padding-bottom: 0.15rem;
}

.blog-cta .ext-icon {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border: 1px solid currentColor;
  border-radius: 1px;
  position: relative;
}

.blog-cta .ext-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 0.35rem;
  height: 0.35rem;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
}

.empty-note {
  margin: 0;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.breadcrumbs {
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

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

.breadcrumbs span[aria-hidden="true"] {
  margin: 0 0.4rem;
}

.article-body {
  max-width: var(--content-max);
  font-size: 1.05rem;
  line-height: 1.75;
  color: rgba(245, 245, 244, 0.88);
}

.article-body h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.article-body h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.article-body p,
.article-body ul,
.article-body ol {
  margin: 0 0 1rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.25rem;
}

.article-body li {
  margin-bottom: 0.35rem;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12em 0.35em;
  border-radius: 3px;
}

.article-body pre {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.article-body strong {
  color: var(--fg);
  font-weight: 600;
}

.article-body .callout {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(163, 230, 53, 0.06);
  border-radius: 0 6px 6px 0;
  font-size: 0.98rem;
  color: rgba(245, 245, 244, 0.82);
}

.article-body table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.article-body th,
.article-body td {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body .tab-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin: 0 0.1em;
  vertical-align: -0.2em;
  object-fit: contain;
}

.article-body .tab-icon--table {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  vertical-align: middle;
}

.article-body th {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.figure-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.figure-row .figure {
  margin: 0;
}

.article-body .figure--phone img {
  max-width: 220px;
  margin: 0 auto;
}

.figure {
  margin: 1.75rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure figcaption {
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer {
  padding: 2rem var(--page-pad) max(2rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
