/* =========================================================================
   Dacite.dev — shared stylesheet
   Cool basalt-grey surfaces, a single blue-grey accent, text-only cards.
   Hand-written, zero build step.
   ========================================================================= */

/* ---- Design tokens ----------------------------------------------------- */
:root {
  /* Surfaces (cool near-black basalt) */
  --bg:            #0d0e12;
  --bg-2:          #101218;
  --surface:       #15171d;
  --surface-2:     #191c23;

  /* Lines */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.17);

  /* Type */
  --text:       #e9eaee;
  --text-muted: #9aa1ad;
  --text-dim:   #656c7a;

  /* The one accent: steel blue-grey. No gradients. */
  --accent:        #8ca6c9;
  --accent-strong: #a8bedb;
  --on-accent:     #0b0f16;

  /* Status */
  --ok:     #6fcf97;
  --paused: #d8b56a;

  --radius:    14px;
  --ease:      cubic-bezier(0.2, 0.7, 0.3, 1);

  --maxw: 1140px;

  --font-display: "Bricolage Grotesque", Georgia, system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---- Backdrop: clean cool gradient, no grain, no glow ------------------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #101218 0%, #0c0d11 58%, #090a0d 100%);
}

/* ---- A11y helpers ------------------------------------------------------ */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  border: 1px solid var(--border-strong);
  z-index: 100;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Layout ------------------------------------------------------------ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; height: 66px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.15rem;
}
.brand .mark { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.brand .dot { color: var(--accent); }

/* ---- Hero (left-aligned, asymmetric) ---------------------------------- */
.hero { padding: clamp(56px, 11vw, 116px) 0 clamp(34px, 6vw, 56px); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.7rem, 8vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  max-width: 14ch;
}
.hero h1 .heat { color: var(--accent); }
.hero p {
  margin-top: 20px;
  max-width: 34rem;
  color: var(--text-muted);
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
}

/* ---- Filters ----------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 28px; }
.chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}

/* ---- Project cards (text only) ---------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  padding-bottom: 20px;
}
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 184px;
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.85);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; }
.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.018em;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  transition: color 0.2s var(--ease);
}
.card:hover h3 { color: var(--accent); }
.card h3 .ext { font-size: 0.7em; color: var(--text-dim); }
.card-desc { color: var(--text-muted); font-size: 0.94rem; margin-top: 11px; flex: 1; position: relative; }
.card-tags { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.02em; margin-top: 18px; position: relative; }
.card.hidden { display: none; }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; padding-top: 3px; }
.status .led { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.status.is-paused { color: var(--paused); }
.status.is-paused .led { background: var(--paused); }

/* ---- Scroll reveal ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: clamp(44px, 8vw, 84px);
  padding: 40px 0 52px;
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.footer-inner p { color: var(--text-dim); font-size: 0.88rem; }
.footer-links { display: flex; gap: 20px; align-items: center; }
.footer-links a { color: var(--text-muted); font-size: 0.88rem; transition: color 0.18s var(--ease); }
.footer-links a:hover { color: var(--accent); }

/* ---- Sub-page header --------------------------------------------------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 0.9rem; font-weight: 500;
  margin-bottom: 20px; transition: color 0.18s var(--ease), gap 0.18s var(--ease);
}
.back-link:hover { color: var(--accent); gap: 12px; }
.section-head { padding: clamp(40px, 8vw, 70px) 0 28px; }
.section-head h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.section-head h1 .heat { color: var(--accent); }
.section-head p { color: var(--text-muted); font-size: 1.04rem; }

/* ---- 404 --------------------------------------------------------------- */
.center-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
}
.err-code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(5rem, 22vw, 11rem);
  line-height: 1; letter-spacing: -0.04em;
  color: var(--accent);
}
.err-msg { font-size: 1.16rem; color: var(--text); margin-top: 6px; }
.err-sub { font-size: 0.94rem; color: var(--text-dim); margin-top: 6px; margin-bottom: 28px; }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 24px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { transform: translateY(-2px); background: var(--accent-strong); }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 540px) {
  .grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; justify-content: center; }
}

/* ---- Reduced motion ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
