/* ELCE — Commit-inspired static design (vanilla CSS, no build step) */

@font-face {
  font-family: 'Mona Sans';
  src: url('./fonts/Mona-Sans.var.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --bg: #0a0e17;
  --text: #d1d5db;        /* gray-300 */
  --muted: #6b7280;       /* gray-500 */
  --faint: #9ca3af;       /* gray-400 */
  --white: #ffffff;
  --accent: #7dd3fc;      /* sky-300 */
  --accent-hover: #bae6fd;/* sky-200 */
  --accent-deep: #38bdf8; /* sky-400 */
  --ring: rgba(255, 255, 255, 0.1);
  --card: rgba(255, 255, 255, 0.025);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  --font-display: 'Mona Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
strong { color: var(--white); font-weight: 600; }

/* ---------- Layout: fixed sidebar + content column ---------- */

.layout { display: flex; flex-direction: column; min-height: 100vh; }

.sidebar {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  flex: none;
}

.sidebar-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(48rem 22rem at 0% 110%,
    rgba(56, 189, 248, 0.3),
    rgba(0, 71, 255, 0.09) 54%,
    rgba(10, 14, 23, 0) 100%);
  pointer-events: none;
}

.sidebar-edge {
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--white);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.starfield {
  position: absolute;
  top: 3.5rem;
  right: -11rem;
  width: 55rem;
  transform: rotate(30deg);
  transform-origin: top right;
  opacity: 0.7;
  overflow: visible;
  pointer-events: none;
}
.starfield .star { r: 1px; fill: var(--white); opacity: 0; }
.starfield .star.dim { opacity: 0; }
.starfield .star.blur { filter: url(#star-blur); }
.starfield .constellation path {
  stroke: var(--white);
  stroke-opacity: 0.2;
  stroke-width: 1;
  fill: transparent;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.motion-ok .starfield .star {
  animation: star-in 4s ease forwards, twinkle 3s ease-in-out 4s infinite alternate;
}
.motion-ok .starfield .star.dim {
  animation: star-in-dim 4s ease forwards, twinkle-dim 3.5s ease-in-out 4s infinite alternate;
}
.motion-ok .starfield .constellation path {
  animation: draw 5s ease forwards;
}
@keyframes star-in { to { opacity: 1; } }
@keyframes star-in-dim { to { opacity: 0.2; } }
@keyframes twinkle { from { opacity: 1; } to { opacity: 0.6; } }
@keyframes twinkle-dim { from { opacity: 0.2; } to { opacity: 0.5; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.sidebar-body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: inherit;
  padding: 5rem 1.5rem 1.5rem;
}
.sidebar-intro { width: 100%; max-width: 28rem; margin: 0 auto; flex: 1; }
.sidebar-footer { width: 100%; max-width: 28rem; margin: 0 auto; }
.sidebar-footer p {
  margin: 0;
  padding: 1rem 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.brand { display: inline-block; }
.logo {
  display: inline-block;
  height: 2rem;
  width: 2rem;
  vertical-align: middle;
  border-radius: 0.5rem;
  box-shadow: 0 0 0 1px var(--ring);
}

.sidebar-title {
  margin: 3.5rem 0 0;
  font-family: var(--font-display);
  font-size: 2.25rem;
  line-height: 1.2;
  font-weight: 300;
  color: var(--white);
  letter-spacing: -0.01em;
}
.sidebar-title .accent { color: var(--accent); }

.sidebar-desc {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-arrow { width: 1rem; height: 1rem; }
.btn-arrow.flip { transform: scaleX(-1); }

.icon-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 0.5rem;
  margin-top: 2rem;
}
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--faint);
  transition: color 0.15s ease, background 0.15s ease;
}
.icon-link svg { width: 1rem; height: 1rem; }
.icon-link:hover { color: var(--white); background: rgba(255, 255, 255, 0.05); }

/* ---------- Content column ---------- */

.content { position: relative; flex: 1 1 auto; }
.content-main {
  position: relative;
  max-width: 36rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem 3rem;
}

/* Vertical dashed timeline strip (horizontal tick every 8px) */
.timeline {
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(0.75rem, calc(50% - 18rem + 0.75rem));
  width: 6px;
  background: repeating-linear-gradient(to bottom,
    rgba(125, 211, 252, 0.18) 0,
    rgba(125, 211, 252, 0.18) 1px,
    transparent 1px,
    transparent 8px);
  pointer-events: none;
}

/* ---------- Sections & entries ---------- */

.section { margin-bottom: 5rem; }
.section:last-child { margin-bottom: 0; }

.section-heading {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.01em;
}
.section-sub { margin: 0.375rem 0 0; font-size: 0.875rem; color: var(--muted); }

.entries { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 4rem; }

.entry { position: relative; scroll-margin-top: 4rem; }
.entry-header { position: relative; display: flex; align-items: center; height: 1rem; margin-bottom: 0.75rem; }
.entry-tick {
  position: absolute;
  left: calc(-2.25rem - 8px);
  width: 1.75rem;
  height: 1px;
  background: var(--faint);
}
.entry-date {
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.entry-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.entry-title a { color: var(--white); transition: color 0.15s ease; }
.entry-title a:hover { color: var(--accent); }
.entry-desc { margin: 0.75rem 0 0; font-size: 0.9375rem; color: var(--text); }

.entry-img-wrap {
  display: block;
  margin: 0 0 1.25rem;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--ring);
}
.entry-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 2.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  transition: color 0.15s ease;
}
.text-link:hover { color: var(--accent-hover); }

/* ---------- App cards ---------- */

.app-grid { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 2.5rem; }
.app-card {
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: 0 0 0 1px var(--ring);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.app-card:hover { box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.4); transform: translateY(-2px); }
.app-img-wrap { box-shadow: inset 0 0 0 1px var(--ring); }
.app-img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.app-img-wrap--icon {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(125, 211, 252, 0.08), transparent 70%);
}
.app-img-wrap--icon picture { display: contents; }
.app-icon {
  width: clamp(96px, 32%, 176px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 22.5%;
  box-shadow: 0 0 0 1px var(--ring), 0 12px 32px rgba(0, 0, 0, 0.45);
}
.app-body { padding: 1.25rem 1.25rem 1.5rem; }
.app-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
}
.app-tag { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--accent); }
.app-desc { margin: 0.75rem 0 0; font-size: 0.9375rem; color: var(--text); }

/* ---------- Post page ---------- */

.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.015em;
}
.post-hero-wrap {
  margin: 1.5rem 0 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--ring);
}
.post-hero { width: 100%; object-fit: cover; }
.back-link { margin-top: 3rem; }

.prose { margin-top: 2rem; font-size: 0.9375rem; }
.prose h2 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
}
.prose h3 {
  margin: 2rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--white);
}
.prose p { margin: 1rem 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--accent-hover); }
.prose ul, .prose ol { margin: 1rem 0; padding-left: 1.5rem; }
.prose li { margin: 0.375rem 0; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 2px solid var(--accent-deep);
  background: rgba(56, 189, 248, 0.06);
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--faint);
}
.prose blockquote p { margin: 0.25rem 0; }
.prose code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  font-size: 0.875em;
}
.prose pre {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px var(--ring);
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-size: 0.8125rem;
}
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: 0.75rem; }
.prose hr { border: 0; border-top: 1px solid var(--ring); margin: 2.5rem 0; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 1; }
.motion-ok .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s ease; }
.motion-ok .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Large screens: sidebar becomes a fixed left panel ---------- */

@media (min-width: 1024px) {
  .layout { flex-direction: row; }
  .sidebar {
    flex: 0 0 clamp(30rem, 46%, 44rem);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .sidebar-glow {
    background: radial-gradient(44rem 60rem at 115% -20%,
      rgba(56, 189, 248, 0.3),
      rgba(0, 71, 255, 0.09) 54%,
      rgba(10, 14, 23, 0) 100%);
  }
  .sidebar-edge { inset: 0 0 0 auto; width: 1px; height: auto; }
  .sidebar-body { min-height: 100vh; padding: 5rem 3rem 1.5rem max(4rem, calc(50% - 14rem)); }
  .sidebar-intro, .sidebar-footer { margin: 0; }
  .sidebar-title { font-size: 2.5rem; }
  .content { min-width: 0; }
  .content-main { padding-top: 8rem; padding-bottom: 8rem; }
}

@media (max-width: 640px) {
  .sidebar-title { font-size: 1.875rem; }
  .post-title { font-size: 1.625rem; }
  .starfield { right: -16rem; }
}
