@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #101010;
  --surface: #171717;
  --surface-hover: #1d1d1d;
  --ink: #f4f1e9;
  --muted: #9e9b93;
  --dim: #6f6c65;
  --line: #2d2c29;
  --soft-line: #232220;
  --accent: #ff6b35;
  --selection: rgba(255, 107, 53, 0.28);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f1efe9;
  --surface: #f8f6f0;
  --surface-hover: #fffdf8;
  --ink: #171716;
  --muted: #68655f;
  --dim: #928e86;
  --line: #d5d1c8;
  --soft-line: #e3dfd6;
  --selection: rgba(255, 107, 53, 0.2);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(var(--soft-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--soft-line) 1px, transparent 1px),
    var(--bg);
  background-size: 64px 64px;
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: background-color 180ms ease, color 180ms ease;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--selection); }

.page-shell { width: min(1440px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }

.site-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small, .eyebrow, .kicker, footer, .availability, .shortcut, .section-meta { font-family: 'Space Mono', monospace; }
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; transform: rotate(45deg); }
.brand-mark span { background: var(--ink); }
.brand-mark span:nth-child(2) { background: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 20px; }
.availability { color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.availability span, .status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #40c98d; box-shadow: 0 0 0 4px rgba(64, 201, 141, .1); }

.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.icon-button:hover { border-color: var(--accent); }
.sun { display: none; }
[data-theme='light'] .sun { display: inline; }
[data-theme='light'] .moon { display: none; }

main { padding: clamp(52px, 8vw, 112px) 0 72px; }
.intro { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .45fr); align-items: end; gap: 48px; margin-bottom: clamp(64px, 9vw, 120px); }
.kicker { margin: 0 0 20px; color: var(--accent); font-size: 11px; letter-spacing: .12em; }
h1 { max-width: 900px; margin: 0; font-size: clamp(54px, 8vw, 122px); font-weight: 600; line-height: .9; letter-spacing: -.075em; }
h1 em { color: var(--muted); font-style: normal; font-weight: 400; }
.intro-copy { max-width: 340px; margin: 0 0 8px; padding-left: 20px; border-left: 2px solid var(--accent); color: var(--muted); font-size: 16px; line-height: 1.75; }

.workspace { border-top: 1px solid var(--line); padding-top: 24px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.search-box { flex: 0 1 390px; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--selection); }
.search-box svg { width: 18px; stroke: var(--muted); stroke-width: 1.6; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: var(--dim); }
kbd { padding: 2px 6px; border: 1px solid var(--line); background: var(--bg); color: var(--dim); font: 10px 'Space Mono', monospace; }

.filters { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.filter { padding: 9px 14px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.filter:hover { color: var(--ink); }
.filter.is-active { border-color: var(--line); background: var(--surface); color: var(--ink); }

.section-meta { display: flex; justify-content: space-between; gap: 20px; margin: 32px 0 14px; color: var(--dim); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.section-meta kbd { vertical-align: 1px; }

.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.project-card { position: relative; min-height: 310px; display: flex; flex-direction: column; padding: 26px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); color: inherit; text-decoration: none; isolation: isolate; transition: background 180ms ease, transform 180ms ease; }
.project-card::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; background: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--project-accent) 18%, transparent), transparent 55%); transition: opacity 180ms ease; }
.project-card:hover, .project-card:focus-visible { z-index: 2; outline: 1px solid var(--project-accent); outline-offset: -1px; background: var(--surface-hover); }
.project-card:hover::after, .project-card:focus-visible::after { opacity: 1; }
.project-card:hover .external-icon { transform: translate(2px, -2px); color: var(--project-accent); }
.card-accent { position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--project-accent); transform: scaleX(.18); transform-origin: left; transition: transform 200ms ease; }
.project-card:hover .card-accent { transform: scaleX(1); }

.card-topline { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 38px; }
.project-logo { position: relative; width: 52px; height: 52px; display: grid; place-items: center; overflow: hidden; border: 1px solid color-mix(in srgb, var(--project-accent) 55%, var(--line)); background: color-mix(in srgb, var(--project-accent) 10%, var(--surface)); color: var(--project-accent); }
.logo-fallback { font: 700 12px 'Space Mono', monospace; letter-spacing: -.04em; }
.project-logo img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 6px; object-fit: contain; background: color-mix(in srgb, var(--surface) 92%, var(--project-accent)); }
.shortcut { color: var(--dim); font-size: 9px; }
.eyebrow { color: var(--project-accent); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 8px; }
.card-title-row strong { font-size: 23px; letter-spacing: -.035em; }
.external-icon { width: 20px; color: var(--muted); transition: transform 180ms ease, color 180ms ease; }
.external-icon svg { width: 100%; stroke: currentColor; stroke-width: 1.5; }
.description { display: block; max-width: 34ch; margin-top: 14px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 22px; }
.tags span { padding: 4px 7px; border: 1px solid var(--line); color: var(--dim); font-size: 10px; }
.host { display: flex; align-items: center; margin-top: auto; padding-top: 24px; color: var(--dim); font: 10px 'Space Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.host .status-dot { width: 5px; height: 5px; margin-right: 9px; box-shadow: none; }

.empty-state { padding: 72px 20px; border: 1px solid var(--line); text-align: center; }
.empty-state strong, .empty-state span { display: block; }
.empty-state span { margin-top: 8px; color: var(--muted); }

footer { min-height: 80px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--dim); font-size: 9px; letter-spacing: .08em; }

@media (max-width: 960px) {
  .intro { grid-template-columns: 1fr; align-items: start; }
  .intro-copy { max-width: 520px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { flex-basis: auto; max-width: none; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .page-shell { padding: 0 16px; }
  .site-header { height: 72px; }
  .availability { display: none; }
  main { padding-top: 48px; }
  .intro { gap: 28px; margin-bottom: 64px; }
  h1 { font-size: clamp(48px, 15vw, 72px); }
  .intro-copy { font-size: 14px; }
  .filters { margin: 0 -16px; padding: 0 16px; }
  .section-meta span:last-child { display: none; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { min-height: 290px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
