:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #101624;
  --surface-2: #151d2d;
  --text: #f2f5fb;
  --muted: #a7b0c2;
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.28);
  --blue: #70a7ff;
  --purple: #a886ff;
  --pink: #f17bb6;
  --green: #76e0ad;
  --amber: #ffc86b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 17% 3%, rgba(80, 112, 255, 0.17), transparent 29rem),
    radial-gradient(circle at 86% 17%, rgba(205, 82, 177, 0.13), transparent 25rem),
    var(--bg);
}
/* Fixed backdrop behind every page: the hub's grid, faded out towards the
   edges, over slow-drifting colour glows that stay put while content scrolls. */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}
body::before {
  inset: -20vmax;
  background:
    radial-gradient(38vmax 30vmax at 22% 18%, rgba(80, 112, 255, 0.26), transparent 70%),
    radial-gradient(34vmax 28vmax at 82% 30%, rgba(205, 82, 177, 0.20), transparent 70%),
    radial-gradient(40vmax 30vmax at 60% 82%, rgba(118, 224, 173, 0.11), transparent 70%),
    radial-gradient(30vmax 26vmax at 14% 78%, rgba(168, 134, 255, 0.18), transparent 70%);
  animation: backdrop-drift 60s ease-in-out infinite alternate;
}
body::after {
  inset: 0;
  background-size: 56px 56px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 20%, transparent 100%);
}
.plexus-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
@keyframes backdrop-drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg); }
  to   { transform: translate3d(-4vmax, 3vmax, 0) rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}
a { color: inherit; }

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 750; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--purple) 58%, var(--pink));
  color: #080b12;
  font-size: 0.78rem;
  letter-spacing: -0.04em;
}
nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
nav a:hover { color: var(--text); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 68px;
  align-items: center;
  padding: 88px 0 84px;
}
.hero-copy-col { min-width: 0; }
.eyebrow { margin: 0 0 12px; color: #8eb7ff; font-size: 0.76rem; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
/* The three sentences are written as a triad, so set them as one. The old
   0.96 line-height collided at large sizes and got worse in a fallback face. */
h1 { margin-bottom: 24px; font-size: clamp(2.5rem, 4.1vw, 3.95rem); line-height: 1.02; letter-spacing: -0.042em; }
h1 .l { display: block; }
h1 .l3 { color: var(--muted); }
.hero-copy { max-width: 46ch; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.35rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 19px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  font-weight: 700;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.button.primary { border-color: transparent; background: var(--text); color: #0a0d15; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button:hover { transform: translateY(-1px); background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.42); }
.button.primary:hover { background: #fff; }
/* Third action demoted from a button: three of equal weight is no hierarchy. */
.text-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 4px;
  color: var(--muted); text-decoration: none; font-weight: 650;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.text-link:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 34px; color: #c4cada; font-size: 0.84rem; }
.trust-row span::before { content: "✓"; margin-right: 7px; color: #76e0ad; }

.tools-section { padding: 62px 0 70px; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1fr minmax(260px, 480px); gap: 30px; align-items: end; margin-bottom: 32px; }
h2 { margin-bottom: 0; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.045em; }
.section-heading > p, .workflow p { margin-bottom: 4px; color: var(--muted); line-height: 1.65; }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
}
.tool-card::after { content: ""; position: absolute; inset: auto -70px -90px auto; width: 260px; height: 260px; border-radius: 50%; filter: blur(34px); opacity: .34; }
.prompt-card::after { background: var(--purple); }
.p5-card::after { background: var(--blue); }
.svg-card::after { background: var(--pink); }
.prompt-card .card-kicker { color: var(--purple); }
.p5-card .card-kicker { color: var(--blue); }
.svg-card .card-kicker { color: var(--pink); }
.card-kicker { position: relative; z-index: 1; color: var(--muted); font-size: .79rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: currentColor; }
.tool-card h3 { margin: 28px 0 15px; font-size: 1.75rem; letter-spacing: -.03em; }
.tool-card p { min-height: 112px; color: var(--muted); line-height: 1.62; }
.tool-card ul { padding-left: 18px; color: #cdd3df; line-height: 1.9; font-size: .91rem; }
.card-link { position: absolute; left: 28px; bottom: 28px; z-index: 1; font-weight: 750; text-decoration: none; }
.card-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.workflow { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; padding: 85px 0; border-top: 1px solid var(--line); }
.workflow h2 { margin-bottom: 22px; }
.workflow ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow li { display: grid; grid-template-columns: 40px 1fr; gap: 3px 15px; padding: 19px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); counter-increment: workflow; }
.workflow li::before { content: counter(workflow, decimal-leading-zero); grid-row: 1 / span 2; color: #8eb7ff; font: 700 .8rem ui-monospace, monospace; }
.workflow li span { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.browser-note { margin-bottom: 75px; padding: 20px 22px; border: 1px solid rgba(112,167,255,.3); border-radius: 14px; background: rgba(112,167,255,.07); color: var(--muted); line-height: 1.6; }
.browser-note strong { color: var(--text); }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
.legal-page { max-width: 800px; padding: 70px 0 100px; }
.legal-page h1 { font-size: clamp(2.7rem, 6vw, 4.8rem); }
.legal-page h2 { margin: 42px 0 12px; font-size: 1.5rem; }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.7; }

.settings-page { max-width: 900px; padding: 70px 0 100px; }
.settings-page > h1 { max-width: 760px; font-size: clamp(2.8rem, 7vw, 5.8rem); }
.settings-intro { max-width: 760px; margin-bottom: 38px; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.settings-card { padding: clamp(24px, 5vw, 40px); border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); }
.settings-card + .settings-card { margin-top: 22px; }
.setting-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.setting-heading h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.setting-label { margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.local-badge { flex: none; padding: 7px 10px; border: 1px solid rgba(118,224,173,.28); border-radius: 999px; color: #76e0ad; background: rgba(118,224,173,.07); font-size: .78rem; font-weight: 750; }
.folder-status { display: grid; grid-template-columns: 12px 1fr; gap: 14px; margin: 30px 0 24px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.18); }
.status-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 5px rgba(167,176,194,.08); }
.folder-status[data-status="ready"] .status-dot { background: #76e0ad; box-shadow: 0 0 0 5px rgba(118,224,173,.10); }
.folder-status[data-status="attention"] .status-dot,
.folder-status[data-status="working"] .status-dot { background: #ffc86b; box-shadow: 0 0 0 5px rgba(255,200,107,.10); }
.folder-status[data-status="error"] .status-dot,
.folder-status[data-status="unsupported"] .status-dot { background: #ff7f96; box-shadow: 0 0 0 5px rgba(255,127,150,.10); }
.folder-status p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.folder-button { min-width: 160px; }
.folder-status[data-status="browser"] .status-dot { background: #7cb8ff; box-shadow: 0 0 0 5px rgba(124,184,255,.12); }
.browser-storage { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.browser-storage h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.browser-storage > p:not(.setting-label):not(.setting-help) { margin: 0 0 16px; color: var(--muted); line-height: 1.55; }
.browser-storage[data-offer="true"] { border-top-color: rgba(124,184,255,.45); }
.setting-help { margin: 16px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.folder-explainer { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; margin-top: 42px; padding-top: 42px; border-top: 1px solid var(--line); }
.folder-explainer h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
.folder-explainer > p { color: var(--muted); line-height: 1.7; }
.folder-explainer code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: #d7e4ff; background: rgba(255,255,255,.04); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }

.model-intro { max-width: 700px; margin-top: 20px; }
.model-setup-steps { display: grid; gap: 10px; margin: 24px 0; padding-left: 23px; color: var(--muted); line-height: 1.55; }
.model-setup-steps strong { color: var(--text); }
.model-setup-steps code,
.model-provider-details code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; color: #d7e4ff; background: rgba(255,255,255,.04); }
.model-endpoint-form { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(160px, .8fr) minmax(240px, 1.4fr); gap: 13px; align-items: end; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0,0,0,.18); }
.model-endpoint-form label { display: grid; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.model-endpoint-form input,
.model-endpoint-form select { width: 100%; min-height: 43px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: var(--surface-2); color: var(--text); font: inherit; }
.model-endpoint-form input:focus,
.model-endpoint-form select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(112,167,255,.11); }
.endpoint-key-field { grid-column: span 2; }
.endpoint-key-field[hidden] { display: none; }
.model-connect-status { min-height: 22px; margin-top: 14px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.model-connect-status[data-status="ready"] { color: #76e0ad; }
.model-connect-status[data-status="working"],
.model-connect-status[data-status="attention"] { color: #ffc86b; }
.model-connect-status[data-status="error"] { color: #ff8ca0; }
.model-provider-list { display: grid; gap: 9px; margin-top: 10px; }
.model-provider-empty { margin: 0; padding: 17px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.model-provider-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.model-provider-details { display: grid; min-width: 0; gap: 5px; }
.model-provider-details code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-provider-state { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.model-provider-state[data-status="ready"] { color: #76e0ad; }
.model-provider-state[data-status="working"] { color: #ffc86b; }
.model-provider-state[data-status="error"] { color: #ff8ca0; }
.model-provider-state[data-status="muted"] { opacity: .65; }
.model-provider-actions { display: flex; flex: none; align-items: center; gap: 8px; }
.model-enabled-toggle { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.button.compact { min-height: 36px; padding: 0 12px; font-size: .8rem; }
.button.danger { color: #ff9aac; }

/* ── Portfolio: facts, project groups, engineering, about ───────────────── */
.facts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-bottom: 70px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  background: var(--line);
}
.facts > div { display: grid; gap: 6px; padding: 22px 24px; background: var(--bg); }
.facts strong { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -.04em; line-height: 1; }
.facts span { color: var(--muted); font-size: .86rem; line-height: 1.45; }

.project-group + .project-group { margin-top: 56px; }
.group-heading { display: grid; grid-template-columns: minmax(220px, .7fr) 1.3fr; gap: 10px 30px; align-items: baseline; margin-bottom: 18px; }
.group-heading h3 { margin: 0; font-size: 1.32rem; letter-spacing: -.02em; }
.group-heading p { margin: 0; color: var(--muted); line-height: 1.6; }
.project-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.project-grid.featured { grid-template-columns: repeat(2, 1fr); }
.project-grid.featured > .wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: center; }
.project-card.wide .card-body { display: flex; flex-direction: column; height: 100%; }
.project-card.wide .card-shot { position: relative; z-index: 1; display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 12px; }
.project-grid.four { grid-template-columns: repeat(4, 1fr); }
.project-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding: 26px; border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  --accent: var(--blue);
}
.project-card::after {
  content: ""; position: absolute; inset: auto -80px -100px auto; width: 240px; height: 240px;
  border-radius: 50%; background: var(--accent); filter: blur(38px); opacity: .22; pointer-events: none;
}
.project-card .card-kicker { color: var(--accent); }
.project-card h4 { position: relative; z-index: 1; margin: 18px 0 12px; font-size: 1.45rem; letter-spacing: -.03em; }
.featured .project-card h4 { font-size: 1.8rem; }
.project-card p { position: relative; z-index: 1; margin-bottom: 18px; color: var(--muted); line-height: 1.62; }
.project-card .skills { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 22px; padding: 0; list-style: none; }
.project-card .skills li { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.18); color: #cdd3df; font-size: .78rem; }
.project-card .card-link { position: relative; left: auto; bottom: auto; z-index: 1; margin-top: auto; color: var(--text); }
.project-card .card-links { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; margin-top: auto; }
.project-card .card-links .card-link { margin-top: 0; }
.project-card .card-link.secondary { color: var(--muted); font-weight: 650; }
.project-card .card-link.secondary:hover { color: var(--text); }
.project-card:hover { border-color: var(--line-strong); }
.accent-blue { --accent: var(--blue); }
.accent-purple { --accent: var(--purple); }
.accent-pink { --accent: var(--pink); }
.accent-green { --accent: var(--green); }
.accent-amber { --accent: var(--amber); }

.engineering { padding: 70px 0 80px; border-top: 1px solid var(--line); }
.eng-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.eng-item { padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); }
.eng-item h3 { margin-bottom: 10px; font-size: 1.05rem; }
.eng-item p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.eng-item code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; color: #d7e4ff; background: rgba(255,255,255,.04); font-size: .85em; }

.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; padding: 85px 0; border-top: 1px solid var(--line); }
.about-body p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.contact-links:not(:has(a:not([hidden]))) { display: none; }

@media (max-width: 1040px) {
  .project-grid.four { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 880px) {
  .tool-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .group-heading, .about { grid-template-columns: 1fr; gap: 12px; }
  .about { gap: 24px; }
  .project-grid.featured, .eng-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 360px; }
  .tool-card p { min-height: auto; }
  .section-heading, .workflow, .folder-explainer { grid-template-columns: 1fr; gap: 28px; }
  .model-endpoint-form { grid-template-columns: 1fr 1fr; }
  .endpoint-url-field, .endpoint-key-field { grid-column: span 2; }
}

@media (max-width: 600px) {
  .site-header, main, footer { width: min(100% - 24px, 1180px); }
  /* Drop the nav onto its own row rather than hiding links: on a phone the
     header is the only route to Settings, Examples, and Privacy. */
  .site-header { min-height: 0; padding: 14px 0; }
  nav { flex: 1 0 100%; gap: 0 18px; }
  nav a { font-size: 0.86rem; }
  /* Touch targets: at least 24px tall (WCAG 2.5.8), most a comfortable 32+. */
  nav a, footer a { display: inline-flex; align-items: center; min-height: 32px; }
  .card-link, .text-link, .showcase-more { display: inline-flex; align-items: center; min-height: 32px; }
  .hero { padding: 78px 0 62px; }
  h1 { font-size: clamp(2.8rem, 16vw, 4.4rem); }
  .tools-section { padding-top: 45px; }
  .project-grid, .project-grid.four { grid-template-columns: 1fr; }
  .facts { margin-bottom: 50px; }
  .facts > div { padding: 18px; }
  footer { flex-direction: column; }
  .model-endpoint-form { grid-template-columns: 1fr; }
  .endpoint-url-field, .endpoint-key-field { grid-column: auto; }
  .model-provider-row { align-items: flex-start; flex-direction: column; }
  .model-provider-actions { width: 100%; flex-wrap: wrap; }
}

/* ── Showcase strip (hero right column) ─────────────────────────────────── */
.showcase {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .018));
}
.showcase[hidden] { display: none; }
.showcase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.showcase-label {
  font-family: var(--mono, ui-monospace, monospace); font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #8eb7ff;
}
.showcase-badge { font-family: var(--mono, ui-monospace, monospace); font-size: .68rem; color: var(--muted); }
.showcase-intro {
  margin: 4px 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.5;
  font-family: var(--mono, ui-monospace, monospace);
}
.showcase-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.showcase-tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 13px; overflow: hidden;
  background: var(--surface);
  animation: showcase-rise .5s cubic-bezier(.2, .7, .3, 1) both; animation-delay: var(--d);
  transition: transform .18s ease, border-color .18s ease;
}
.showcase-tile:hover, .showcase-tile:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); }
.showcase-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.showcase-art {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #06080e;
}
.showcase-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.showcase-chip, .showcase-score {
  position: absolute; top: 7px; z-index: 1; padding: 3px 8px; border-radius: 999px;
  font-family: var(--mono, ui-monospace, monospace); font-size: .6rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; backdrop-filter: blur(6px);
}
.showcase-chip { left: 7px; }
.showcase-score {
  right: 7px; text-transform: none;
  background: color-mix(in srgb, #76e0ad 30%, rgba(6, 8, 14, .78)); color: #76e0ad;
}
.pg  .showcase-chip { background: color-mix(in srgb, var(--purple) 34%, rgba(6, 8, 14, .72)); color: var(--purple); }
.p5  .showcase-chip { background: color-mix(in srgb, var(--blue)   34%, rgba(6, 8, 14, .72)); color: var(--blue); }
.svg .showcase-chip { background: color-mix(in srgb, var(--pink)   34%, rgba(6, 8, 14, .72)); color: var(--pink); }
.gf  .showcase-chip { background: color-mix(in srgb, var(--green)  34%, rgba(6, 8, 14, .72)); color: var(--green); }
.vr  .showcase-chip { background: color-mix(in srgb, var(--amber)  34%, rgba(6, 8, 14, .72)); color: var(--amber); }
.showcase-meta {
  display: flex; align-items: baseline; gap: 8px; padding: 9px 11px 2px;
  font-size: .8rem; font-weight: 650;
}
.showcase-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.showcase-go { color: var(--muted); transition: color .18s ease, transform .18s ease; }
.showcase-tile:hover .showcase-go { color: var(--text); transform: translateX(2px); }
.showcase-sub {
  padding: 0 11px 10px; font-family: var(--mono, ui-monospace, monospace); font-size: .66rem;
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@keyframes showcase-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding: 56px 0; }
}
@media (max-width: 430px) {
  .showcase-grid { grid-template-columns: 1fr; }
}

.showcase-more {
  display: inline-flex; gap: 7px; margin-top: 14px;
  color: var(--muted); font-size: .86rem; font-weight: 650; text-decoration: none;
}
.showcase-more:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); }

/* ── Full showcase page ─────────────────────────────────────────────────── */

.showcase-page { padding: 70px 0 30px; }
.showcase-page-head h1 { margin-bottom: 18px; }
.showcase-page-intro { max-width: 68ch; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.showcase-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  margin: 34px 0 10px; padding-top: 26px; border-top: 1px solid var(--line);
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.03); color: var(--muted); font: inherit; font-size: .86rem; font-weight: 650; cursor: pointer;
}
.filter-chip span { margin-left: 4px; opacity: .7; font-variant-numeric: tabular-nums; }
.filter-chip:hover { color: var(--text); border-color: var(--line-strong); }
.filter-chip[aria-pressed="true"] { background: var(--text); border-color: transparent; color: #0a0d15; }
.filter-chip:focus-visible, .sort-select select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sort-select { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .84rem; font-weight: 650; }
.sort-select select {
  min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface-2); color: var(--text); font: inherit;
}
.showcase-count { margin: 0 0 16px; color: var(--muted); font-size: .8rem; }
.showcase-grid-full { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-bottom: 50px; }
.showcase-empty { grid-column: 1 / -1; color: var(--muted); }
.showcase-tile.is-target { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(112,167,255,.25); }
@media (prefers-reduced-motion: reduce) {
  .showcase-tile { animation: none; }
}

/* ── Write-up pages (work-*.html): how a project was built ─────────────── */
.case-page { max-width: 880px; padding: 64px 0 96px; }
.case-page h1 { margin: 0 0 18px; font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.02; letter-spacing: -.03em; }
.case-page h2 { margin: 56px 0 14px; font-size: 1.45rem; }
.case-page h3 { margin: 0 0 6px; font-size: 1rem; }
.case-page p, .case-page li { color: var(--muted); line-height: 1.7; }
.case-page code { font-size: .88em; color: #cdd3df; }
.case-lead { font-size: 1.15rem; color: #cdd3df !important; max-width: 720px; }
.case-page .hero-actions { margin-top: 24px; }
.case-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 36px 0 0; padding: 0; list-style: none; }
.case-facts li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); line-height: 1.35; font-size: .82rem; }
.case-facts strong { display: block; color: var(--text); font-size: 1.35rem; margin-bottom: 2px; }
.case-figure { margin: 40px 0 0; }
.case-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; }
.case-figure figcaption { margin-top: 10px; color: var(--muted); font-size: .84rem; }
.pipeline { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.pipeline li { counter-increment: step; position: relative; padding: 14px 16px 16px; border: 1px solid var(--line); border-top: 3px solid var(--accent, var(--blue)); border-radius: 12px; background: var(--surface); font-size: .86rem; line-height: 1.5; }
.pipeline li::before { content: counter(step, decimal-leading-zero); display: block; margin-bottom: 6px; color: var(--accent, var(--blue)); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.pipeline li strong { display: block; color: var(--text); margin-bottom: 2px; }
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.case-grid > div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.case-grid > div p { margin: 0; font-size: .92rem; }
.case-lessons { padding-left: 1.2em; }
.case-lessons li { margin-bottom: 10px; }
.case-lessons strong { color: var(--text); }
.case-page .showcase { margin-top: 18px; }
.case-next { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@media (max-width: 760px) {
  .case-facts { grid-template-columns: 1fr 1fr; }
  .case-grid { grid-template-columns: 1fr; }
}

/* Last so it wins over the tile rules above. Tile labels were sized for a
   two-column grid; on a phone each tile has the full width. */
@media (max-width: 600px) {
  .showcase-label, .showcase-badge, .showcase-chip, .showcase-score, .showcase-sub { font-size: .75rem; }
}

@media (max-width: 600px) {
  li > strong > a { display: inline-flex; align-items: center; min-height: 32px; }
  .pipeline code { font-size: 1em; }
  .case-page code { font-size: .95em; }
}

/* The wide featured card puts its screenshot beside the text; stack them
   once the featured grid itself drops to one column. */
@media (max-width: 880px) {
  .project-grid.featured > .wide { grid-template-columns: minmax(0, 1fr); }
}
