/* ===========================================================================
   Theme tokens
   Tweak these to re-skin the whole site in one place.
   =========================================================================== */
:root {
  --bg:          #07080c;   /* deep near-black */
  --bg-soft:     #0d0f16;   /* raised surfaces (cards) */
  --bg-hover:    #12151f;
  --border:      #1c2030;
  --text:        #e7e9f0;   /* primary text */
  --text-dim:    #9aa0b4;   /* secondary text */
  --text-faint:  #5b6076;   /* labels, indices */
  --accent:      #0bb660;   /* emerald green - the only colour pop */
  --accent-soft: rgba(11, 182, 96, 0.12);
  --max-width:   1040px;
  --radius:      14px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===========================================================================
   Reset & base
   =========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

code {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.85em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.12em 0.4em;
  border-radius: 5px;
}

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

/* ===========================================================================
   Background canvas
   =========================================================================== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
}

/* Soft radial vignette over the canvas to keep things calm */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(11, 182, 96, 0.06), transparent 60%),
    radial-gradient(100% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ===========================================================================
   Layout helpers
   =========================================================================== */
.nav, main, .footer { max-width: var(--max-width); margin-inline: auto; }
.nav, main { padding-inline: clamp(1.25rem, 5vw, 2.5rem); }

/* ===========================================================================
   Navigation
   =========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.25rem;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(7, 8, 12, 0.7), transparent);
}

.nav__brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__links { display: flex; gap: 1.75rem; }

.nav__links a {
  color: var(--text-dim);
  font-size: 0.92rem;
  transition: color 0.2s var(--ease);
}
.nav__links a:hover { color: var(--text); }

/* ===========================================================================
   Hero
   =========================================================================== */
.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 4rem;
  position: relative;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin: 0 0 1.25rem;
}

.hero__title {
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  margin-bottom: 1.5rem;
}

.hero__subtitle {
  max-width: 32rem;
  color: var(--text-dim);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 300;
  margin: 0 0 2.5rem;
}

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
}
.hero__scroll span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  background: var(--text-faint);
  border-radius: 2px;
  animation: scroll-hint 1.8s var(--ease) infinite;
}
@keyframes scroll-hint {
  0%   { opacity: 0; transform: translateY(0); }
  40%  { opacity: 1; }
  80%  { opacity: 0; transform: translateY(12px); }
  100% { opacity: 0; }
}

/* ===========================================================================
   Buttons
   =========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease);
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary { background: var(--accent); color: #0a0c12; }
.btn--primary:hover { background: #93adff; }

.btn--ghost { border-color: var(--border); color: var(--text-dim); }
.btn--ghost:hover { border-color: var(--accent); color: var(--text); }

/* ===========================================================================
   Sections
   =========================================================================== */
.section { padding-block: clamp(4rem, 10vw, 7rem); }

.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}
.section__index {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--accent);
}
.section__title { font-size: clamp(1.6rem, 4vw, 2.2rem); }

.about p, .contact p {
  max-width: 38rem;
  color: var(--text-dim);
  font-weight: 300;
  font-size: 1.08rem;
}
.about p + p { margin-top: 1.25rem; }
.contact p { margin-bottom: 1.75rem; }

/* ===========================================================================
   Cards
   =========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
a.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.card__tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}
.card__title { font-size: 1.2rem; margin-bottom: 0.6rem; }
.card__desc {
  color: var(--text-dim);
  font-size: 0.95rem;
  font-weight: 300;
  margin: 0 0 1.25rem;
  flex-grow: 1;
}
.card__cta { color: var(--accent); font-size: 0.9rem; font-weight: 500; }

.card--placeholder { opacity: 0.55; }

/* ===========================================================================
   Footer
   =========================================================================== */
.footer {
  padding: 2.5rem clamp(1.25rem, 5vw, 2.5rem);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer p { color: var(--text-faint); font-size: 0.85rem; margin: 0; }

/* ===========================================================================
   Scroll-reveal (progressive enhancement via main.js)
   =========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ===========================================================================
   Dashboard
   =========================================================================== */
.clock {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.82rem;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}
.clock__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-soft);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(11, 182, 96, 0.4); }
  70%  { box-shadow: 0 0 0 7px rgba(11, 182, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 182, 96, 0); }
}

.dash { padding-block: 1rem clamp(4rem, 8vw, 6rem); }

.dash__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 1.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 188px;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
    background 0.25s var(--ease);
}
a.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--bg-hover);
}

.tile__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.tile__icon svg { width: 22px; height: 22px; }

.tile__title { font-size: 1.18rem; margin-bottom: 0.4rem; }
.tile__desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 300;
  margin: 0 0 1.2rem;
  flex-grow: 1;
}
.tile__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tile__cta { color: var(--accent); font-size: 0.88rem; font-weight: 500; }
.tile__pill {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}
.tile--soon { opacity: 0.6; }

/* ===========================================================================
   Article / tutorial prose
   =========================================================================== */
.article { padding-block: 3rem 5rem; }

.article__back {
  display: inline-block;
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.2s var(--ease);
}
.article__back:hover { color: var(--accent); }

.article__meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}
.article h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1.5rem;
}

.prose { max-width: 44rem; }
.prose p, .prose li {
  color: var(--text-dim);
  font-weight: 300;
  font-size: 1.05rem;
}
.prose h2 {
  font-size: 1.5rem;
  margin: 2.75rem 0 1rem;
  color: var(--text);
}
.prose h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.prose img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.75rem 0;
}
.callout p { margin: 0; color: var(--text); }

.step {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin: 2rem 0;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--accent);
}
.steps { counter-reset: step; }

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