:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #eef3f1;
  --text: #17201c;
  --muted: #62706b;
  --border: #d9e1de;
  --accent: #0f7b72;
  --accent-2: #c44f2d;
  --shadow: 0 14px 32px rgba(20, 34, 30, .08);
  --radius: 8px;
  --max-width: 1040px;
}

body[data-theme="dark"] {
  --bg: #111715;
  --surface: #18231f;
  --surface-2: #202d28;
  --text: #edf5f2;
  --muted: #adc0b9;
  --border: #30423c;
  --accent: #62d4c7;
  --accent-2: #ff9a76;
  --shadow: 0 16px 36px rgba(0, 0, 0, .26);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.header-inner,
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

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

.btn-icon {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: .45rem .7rem;
}

.btn-icon:hover {
  border-color: var(--accent);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2rem 0;
  padding: clamp(1rem, 3vw, 2rem);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: .4rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
}

h2 {
  margin-top: 2rem;
  margin-bottom: .6rem;
  color: var(--accent);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

h3 {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .8rem 0 1.2rem;
}

.tag-list span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: .28rem .55rem;
  font-size: .78rem;
  font-weight: 800;
}

.project-summary {
  color: var(--muted);
  font-size: 1.05rem;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 1rem 0 1.2rem;
}

.project-links a {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 800;
  padding: .55rem .75rem;
  text-decoration: none;
}

.project-links a:hover {
  border-color: var(--accent);
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
  margin: 1.2rem 0;
}

.project-facts div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: .85rem;
}

.project-facts dt {
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.project-facts dd {
  margin: .25rem 0 0;
  color: var(--muted);
}

.card img,
.card video,
.card iframe {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}

.card iframe {
  min-height: 460px;
}

.project-preview-frame {
  height: 535px;
  border: none;
  pointer-events: none;
}

.step {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.code-block {
  max-height: 420px;
  overflow: auto;
  background: #17201c;
  color: #eef8f5;
  padding: 1rem;
  border-radius: var(--radius);
  font-family: "Fira Code", Consolas, monospace;
  font-size: .85rem;
  white-space: pre;
}

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

ul {
  padding-left: 1.3rem;
}

li {
  margin: .28rem 0;
}

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

@media (max-width: 700px) {
  .project-facts {
    grid-template-columns: 1fr;
  }

  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: .8rem 0;
  }
}
