/* The Lab Idiot - deliberately crude stylesheet */

:root,
html[data-theme="light"] {
  --bg: #f4f4f4;        /* very light gray */
  --text: #111111;      /* near black */
  --muted: #666666;     /* gray text */
  --line: #999999;      /* borders */
  --link: #0000ee;      /* classic electric blue link */
  --accent: #0000ff;    /* electric blue accent */
  --card: #ffffff;      /* cards / inputs / buttons */

  --maxw: 1200px;
}

/* ---------- Dark mode ---------- */
html[data-theme="dark"] {
  --bg: #14171c;        /* near black */
  --text: #e7e7e7;      /* off white */
  --muted: #9aa0a6;     /* gray text */
  --line: #3a3f45;      /* borders */
  --link: #6fb3ff;      /* lighter blue link */
  --accent: #6fb3ff;    /* lighter blue accent */
  --card: #1c2026;      /* cards / inputs / buttons */

  color-scheme: dark;   /* native form controls follow dark */
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", "Courier New", monospace;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Links */
a {
  color: var(--link);
  text-decoration: underline;
}
a:visited {
  color: var(--link);
}
a:hover {
  text-decoration: none;
  background: var(--link);
  color: var(--bg);
}

img {
  max-width: 100%;
}

/* Layout container */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

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

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.brand {
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
}
.nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.navlink {
  font: inherit;
  color: var(--link);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-decoration: underline;
}
.navlink:hover {
  background: var(--link);
  color: var(--bg);
  text-decoration: none;
}
/* Compact, boxed toggles for language + theme. */
.nav .navlink {
  border: 1px solid var(--line);
  padding: 2px 8px;
  text-decoration: none;
  color: var(--text);
  min-width: 34px;
  text-align: center;
}
.nav .navlink:hover {
  background: var(--text);
  color: var(--bg);
}
.icon-btn {
  font-size: 15px;
  line-height: 1.2;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  padding: 8px 14px;
  border: 1px solid var(--text);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  line-height: 1.2;
}
.btn:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled,
.btn[disabled] {
  color: var(--muted);
  border-color: var(--line);
  background: var(--bg);
  cursor: not-allowed;
}
.btn--primary {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Sections ---------- */
main {
  padding-top: 24px;
  padding-bottom: 48px;
}
.section {
  margin-top: 36px;
}
.section > h2 {
  font-size: 18px;
  margin: 0 0 12px 0;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 28px 0 8px 0;
}
.hero h1 {
  font-size: 42px;
  margin: 0 0 6px 0;
  line-height: 1.1;
}
.hero .subtitle {
  margin: 0 0 18px 0;
  color: var(--muted);
}

/* ---------- Cards grid ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
}
.card h3 a {
  color: var(--text);
}
.card h3 a:hover {
  color: var(--bg);
}
.card .desc {
  margin: 0 0 10px 0;
  flex: 1;
}
.card .card-foot {
  margin-top: auto;
}

/* ---------- Rows (latest experiments / list) ---------- */
.rows {
  border-top: 1px solid var(--line);
}
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.row:hover {
  background: var(--text);
  color: var(--bg);
}
.row:hover .row-meta {
  color: var(--bg);
}
.row-title {
  font-weight: bold;
}
.row-meta {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

/* ---------- Search ---------- */
.search {
  margin-bottom: 14px;
}
.search input {
  font: inherit;
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 0;
}
.search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ---------- Project detail ---------- */
.back {
  display: inline-block;
  margin-bottom: 16px;
}
.detail h1 {
  font-size: 32px;
  margin: 0 0 6px 0;
}
.detail .summary {
  margin: 0 0 12px 0;
}
.detail .meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.status {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 1px 8px;
  font-size: 13px;
  text-transform: lowercase;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 4px 0;
}
.section p {
  margin: 0;
}

/* Embed / launch placeholder area */
.embed {
  border: 1px dashed var(--line);
  background: var(--card);
  padding: 16px;
}
.embed p {
  margin: 0 0 12px 0;
}
.embed-frame {
  width: 100%;
  height: 480px;
  border: 1px solid var(--line);
}

/* ---------- Simulator placeholder / 404 ---------- */
.notice {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 24px;
  margin-top: 16px;
}
.notice h1 {
  margin-top: 0;
}
.notice .actions {
  margin-top: 18px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
}
.site-footer .wrap {
  padding-top: 16px;
  padding-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}
.site-footer a {
  color: var(--link);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero h1 {
    font-size: 34px;
  }
}

@media (max-width: 600px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 28px;
  }
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn {
    padding: 10px 14px; /* easier to tap */
  }
}
