/* Home page (_layouts/landing.html). Posts keep the TeXt theme's dark skin. */

:root {
  color-scheme: light dark;

  --bg: #f1f3f7;
  --side: #fafbfc;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --ink: #0c0f14;
  --ink-2: #353d48;
  --muted: #6a7380;
  --line: #e0e4ea;
  --nav-active: #e6ebf1;
  --accent: #74bdf0;
  --accent-strong: #4ea7e6;
  --accent-ink: #082538;
  --live: #22c55e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, .06), 0 16px 36px rgba(15, 23, 42, .12);
  --trace: rgba(100, 140, 185, .22);
  --trace-pad: rgba(100, 140, 185, .34);
  --hero-glow: rgba(116, 189, 240, .20);

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --side-width: 300px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0f13;
    --side: #10141a;
    --surface: #151a21;
    --surface-2: #1b2129;
    --ink: #eef2f6;
    --ink-2: #c3cad4;
    --muted: #8b95a3;
    --line: #252c36;
    --nav-active: #1d242e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 40px rgba(0, 0, 0, .45);
    --trace: rgba(116, 170, 220, .14);
    --trace-pad: rgba(116, 170, 220, .24);
    --hero-glow: rgba(116, 189, 240, .10);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.landing {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.landing a { color: inherit; text-decoration: none; }
.landing img { display: block; max-width: 100%; }
.landing p { margin: 0; }
.landing :focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 6px; }

.icon { width: 22px; height: 22px; flex: none; }

/* Small tracked caps used for every label on the page */
.label {
  font: 700 .72rem/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot--live { background: var(--live); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot--fresh { background: var(--accent); box-shadow: 0 0 0 3px rgba(116, 189, 240, .22); }

/* ---------- shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 36px 18px 18px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.profile__text { display: flex; flex-direction: column; gap: 3px; }

.profile__avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line);
}
.profile__avatar--initials {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 25%, #2b3644, #0d1218 75%);
  color: #fff;
  font: 900 1.9rem/1 var(--font-display);
  font-stretch: 125%;
  letter-spacing: .02em;
}

.profile__name {
  font: 800 1.2rem/1.2 var(--font-display);
  font-stretch: 104%;
}
.profile__tagline { color: var(--muted); font-size: .92rem; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }

.side-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 1.04rem;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.side-nav__link .icon { color: var(--muted); }
.side-nav__link:hover { background: var(--surface-2); color: var(--ink); }
.side-nav__link.is-active { background: var(--nav-active); color: var(--ink); font-weight: 600; }
.side-nav__link.is-active .icon { color: var(--accent-strong); }
.side-nav__link.is-active::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.side__follow { padding-top: 24px; border-top: 1px solid var(--line); margin: 0 10px; }
.side__label { margin: 0 4px 12px; }

.socials { list-style: none; margin: 0 -10px; padding: 0; display: flex; flex-direction: column; gap: 2px; }

.socials__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-radius: 12px;
  color: var(--ink-2);
  font-weight: 500;
  transition: background .15s ease;
}
.socials__link:hover { background: var(--surface-2); color: var(--ink); }
.socials__name { flex: 1; }
.socials__link .icon:last-child { width: 14px; height: 14px; color: var(--muted); opacity: .7; }

.side__foot {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.side-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.side-card__thumb { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; flex: none; }
.side-card .label { display: block; margin-bottom: 6px; }
.side-card__title { font-weight: 600; }
.side-card:hover .side-card__title { color: var(--accent-strong); }

.side-mail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-2);
}
.side-mail .icon { width: 18px; height: 18px; color: var(--muted); }
.side-mail:hover { color: var(--accent-strong); }

/* ---------- main ---------- */

.main {
  position: relative;
  overflow: hidden;
  background: radial-gradient(55% 420px at 88% 0%, var(--hero-glow), transparent 70%), var(--bg);
  container-type: inline-size;
}

.main__inner {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  padding: 56px 56px 40px;
}

/* PCB decoration behind the heading */
.hero-art {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 64%);
  height: auto;
  pointer-events: none;
}
.hero-art .pcb-edge { stroke: var(--trace); stroke-width: 1.5; }
.hero-art .pcb-trace { stroke: var(--trace); stroke-width: 1.6; stroke-linejoin: round; }
.hero-art .pcb-pad { stroke: var(--trace-pad); stroke-width: 1.4; }
.hero-art .pcb-silk { fill: var(--trace-pad); font: 600 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; }
.hero-art .pcb-led { fill: var(--accent); }
.hero-art .pcb-led-glow { fill: var(--accent); opacity: .18; }

.crumbs { display: flex; align-items: center; gap: 14px; }
.crumbs span + span { padding-left: 14px; border-left: 1px solid var(--line); color: var(--ink); }

.hero__title {
  margin: 18px 0 0;
  font: 900 clamp(2.6rem, 7.4cqi, 5.4rem)/.95 var(--font-display);
  font-stretch: 125%;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.hero__lede {
  margin-top: 22px;
  max-width: 34em;
  color: var(--ink-2);
  font-size: clamp(1.05rem, 1.8cqi, 1.3rem);
}

.section { margin-top: 72px; }

.section__title {
  margin: 0 0 30px;
  font: 900 clamp(1.9rem, 4.4cqi, 3.1rem)/1 var(--font-display);
  font-stretch: 125%;
  text-transform: uppercase;
}

/* ---------- framed images ---------- */

.frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-2);
}
.frame img { width: 100%; height: 100%; object-fit: cover; }

/* Viewfinder corner marks */
.frame::after {
  --mark: rgba(255, 255, 255, .9);
  --len: 18px;
  --w: 1.5px;
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  background:
    linear-gradient(var(--mark) 0 0) top left / var(--len) var(--w),
    linear-gradient(var(--mark) 0 0) top left / var(--w) var(--len),
    linear-gradient(var(--mark) 0 0) top right / var(--len) var(--w),
    linear-gradient(var(--mark) 0 0) top right / var(--w) var(--len),
    linear-gradient(var(--mark) 0 0) bottom left / var(--len) var(--w),
    linear-gradient(var(--mark) 0 0) bottom left / var(--w) var(--len),
    linear-gradient(var(--mark) 0 0) bottom right / var(--len) var(--w),
    linear-gradient(var(--mark) 0 0) bottom right / var(--w) var(--len);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, .5));
}

.pill {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border-radius: 7px;
  font: 700 .7rem/1 var(--font-display);
  font-stretch: 112%;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.pill--top { top: 18px; left: 18px; }
.pill--bottom { bottom: 18px; left: 18px; }
.pill--dark { background: rgba(10, 12, 16, .84); color: #fff; backdrop-filter: blur(6px); }
.pill--light { background: rgba(255, 255, 255, .92); color: #161a20; }

/* ---------- now building ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.feature__media { aspect-ratio: 3 / 2; }

.feature__title {
  margin: 0;
  font: 900 clamp(2.4rem, 5.6cqi, 3.9rem)/.95 var(--font-display);
  font-stretch: 125%;
  text-transform: uppercase;
}
.feature__title a:hover { color: var(--accent-strong); }

.feature__text { margin-top: 18px; color: var(--ink-2); font-size: 1.12rem; line-height: 1.65; }
.feature__meta { margin-top: 16px; color: var(--muted); font-size: .95rem; }

.entry {
  margin-top: 24px;
  padding: 20px 22px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.entry .label { display: flex; align-items: center; gap: 10px; }
.entry__head { display: flex; align-items: baseline; gap: 14px; margin-top: 14px; }
.entry__when { color: var(--ink); flex: none; }
.entry__title { font-weight: 700; font-size: 1.15rem; }
.entry__text { margin-top: 8px; color: var(--ink-2); line-height: 1.6; }

.button {
  display: inline-block;
  margin-top: 26px;
  padding: 13px 26px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink) !important;
  font-weight: 700;
  font-size: 1.02rem;
  box-shadow: 0 8px 20px rgba(78, 167, 230, .3);
  transition: background .15s ease, transform .15s ease;
}
.button:hover { background: var(--accent-strong); transform: translateY(-1px); }

.feature__note { margin-top: 14px; max-width: 30em; color: var(--muted); font-size: .9rem; }

/* ---------- filters + grid ---------- */

.filters {
  display: flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: 500 1rem/1 var(--font-body);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.chip .icon { width: 19px; height: 19px; color: var(--muted); }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip__count {
  min-width: 24px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  text-align: center;
}
.chip.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip.is-active .icon { color: var(--accent-ink); }
.chip.is-active .chip__count { background: rgba(255, 255, 255, .5); color: var(--accent-ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 24px;
  margin-top: 32px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.card__media { aspect-ratio: 16 / 10; }
.card__media img { transition: transform .4s ease; }
.card:hover .card__media img { transform: scale(1.03); }

.card__body { display: flex; flex-direction: column; flex: 1; padding: 18px 10px 8px; }

.card__title {
  margin: 0;
  font: 800 1.2rem/1.3 var(--font-display);
  font-stretch: 104%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* The title link covers the whole card */
.card__title a::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.card:hover .card__title { color: var(--accent-strong); }

.card__text {
  margin-top: 10px !important;
  color: var(--ink-2);
  font-size: .96rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta { margin-top: auto !important; padding-top: 16px; color: var(--muted); font-size: .86rem; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
}
.foot a { display: inline-flex; align-items: center; gap: 6px; }
.foot a:hover { color: var(--ink); }
.foot .icon { width: 16px; height: 16px; }

/* ---------- narrower main column ---------- */

@container (max-width: 880px) {
  .feature { grid-template-columns: 1fr; gap: 28px; padding: 16px; }
  .feature__body { padding: 0 8px 10px; }
}

/* ---------- tablet and phone: sidebar becomes a header ---------- */

@media (max-width: 960px) {
  .shell { display: block; }

  .side {
    position: static;
    height: auto;
    gap: 18px;
    padding: 20px 16px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile { flex-direction: row; text-align: left; gap: 14px; }
  .profile__avatar { width: 56px; height: 56px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); }
  .profile__avatar--initials { font-size: 1.15rem; }

  .side-nav { flex-direction: row; gap: 4px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav__link { flex: none; gap: 8px; padding: 9px 13px; font-size: .95rem; }
  .side-nav__link .icon { width: 18px; height: 18px; }
  .side-nav__link.is-active::before { display: none; }

  .side__follow { padding-top: 0; border-top: 0; margin: 0; }
  .side__label { display: none; }
  .socials { flex-direction: row; gap: 6px; margin: 0; }
  .socials__link { width: 44px; height: 44px; padding: 0; justify-content: center; background: var(--surface); border: 1px solid var(--line); }
  .socials__name, .socials__link .icon:last-child { display: none; }

  .side__foot { display: none; }

  .main__inner { padding: 32px 16px 32px; }
  .hero-art { width: 92%; opacity: .7; }
  .section { margin-top: 52px; }
  .grid { gap: 18px; }
}

/* All four nav links fit on a phone once the icons go */
@media (max-width: 480px) {
  .side-nav__link .icon { display: none; }
  .side-nav__link { padding: 9px 12px; }
}
