/* ============================================================
   EASY CODING TRICKS — Design System
   Theme: "The site is the editor."
   Ink-navy editor palette · amber accent · JetBrains Mono voice
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg:          #0B101E;
  --bg-deep:     #070B15;
  --surface:     #111828;
  --surface-2:   #182136;
  --surface-3:   #1F2A44;
  --border:      #24304C;
  --border-soft: #1B2540;

  --text:   #E9EEF9;
  --muted:  #93A1C0;
  --faint:  #5E6C8E;

  --accent:        #FFB454;
  --accent-bright: #FFC876;
  --accent-ink:    #221604;
  --accent-dim:    rgba(255, 180, 84, 0.12);

  --tok-cyan:   #45C6E8;
  --tok-violet: #C193F5;
  --tok-green:  #9CD672;
  --tok-red:    #FF7A7A;
  --yt-red:     #FF4E45;

  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;

  --shadow-1: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 18px 48px -12px rgba(0, 0, 0, 0.55);

  --container: 1160px;
  --header-h: 68px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle editor-grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(147, 161, 192, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 161, 192, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% -5%, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% -5%, #000 0%, transparent 68%);
  z-index: 0;
}

img, svg, video, iframe { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

h1, h2, h3 {
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.05rem); }
h3 { font-size: 1.12rem; font-weight: 700; }
h4 { font-family: var(--font-body); font-weight: 800; font-size: 1.02rem; margin: 0 0 0.4em; }

p { margin: 0 0 1em; }
.lead { font-size: 1.13rem; color: var(--muted); max-width: 60ch; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: min(var(--container), 100% - 2.5rem);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

main { min-height: 60vh; }

.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }

/* Code-comment eyebrow — structural signature */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.01em;
  margin: 0 0 0.65rem;
}
.eyebrow::before { content: "// "; color: var(--tok-green); opacity: 0.85; }

.section-head { margin-bottom: 2.2rem; }
.section-head .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head p { color: var(--muted); max-width: 58ch; margin: 0.35rem 0 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(11, 16, 30, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 0 0 1px rgba(255, 180, 84, 0.25), 0 4px 14px -4px rgba(255, 180, 84, 0.5);
}
.brand .brand-tld { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-s);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-dim); }
.nav-cta { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 42px; height: 42px;
  border-radius: var(--radius-s);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.72rem 1.3rem;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.96rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 20px -6px rgba(255, 180, 84, 0.55);
}
.btn-primary:hover { background: var(--accent-bright); color: var(--accent-ink); }

.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--faint); color: var(--text); background: var(--surface-3); }

.btn-yt { background: var(--yt-red); color: #fff; box-shadow: 0 6px 20px -6px rgba(255, 78, 69, 0.5); }
.btn-yt:hover { background: #ff6159; color: #fff; }

.btn-danger { background: rgba(255, 122, 122, 0.12); border-color: rgba(255, 122, 122, 0.4); color: var(--tok-red); }
.btn-danger:hover { background: rgba(255, 122, 122, 0.2); color: var(--tok-red); }

.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.88rem; }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.05rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 4.8rem 0 4.2rem; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.2rem;
  align-items: center;
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 .h-accent { color: var(--accent); }
.hero h1 .h-cursor {
  display: inline-block;
  width: 0.55em; height: 0.08em;
  margin-left: 0.12em;
  background: var(--accent);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
.hero .lead { margin-bottom: 1.8rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.hero-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero-note .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tok-green); box-shadow: 0 0 10px var(--tok-green); }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- Editor window (signature) ---------- */
.editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.editor-chrome {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.editor-dots { display: flex; gap: 6px; }
.editor-dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.editor-dots i:nth-child(1) { background: #FF5F57; }
.editor-dots i:nth-child(2) { background: #FEBC2E; }
.editor-dots i:nth-child(3) { background: #28C840; }
.editor-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-bottom-color: var(--surface);
  padding: 0.35rem 0.8rem;
  border-radius: 7px 7px 0 0;
  transform: translateY(0.66rem);
}
.editor-tab .tab-dot { color: var(--accent); margin-right: 0.4rem; }

.editor-body {
  padding: 1.15rem 0;
  font-family: var(--font-mono);
  font-size: clamp(0.78rem, 1.35vw, 0.9rem);
  line-height: 1.75;
  counter-reset: line;
  min-height: 15.8em;
}
.editor-body { overflow-x: auto; }
.editor-body .ln {
  display: block;
  padding: 0 1.1rem 0 0;
  white-space: pre;
}
.editor-body .ln::before {
  counter-increment: line;
  content: counter(line);
  display: inline-block;
  width: 2.6em;
  margin-right: 1.1em;
  text-align: right;
  color: var(--faint);
  opacity: 0.65;
  user-select: none;
}
.editor-body .caret {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

.t-kw  { color: var(--tok-violet); }
.t-fn  { color: var(--accent); }
.t-str { color: var(--tok-green); }
.t-num { color: var(--tok-cyan); }
.t-com { color: var(--faint); font-style: italic; }
.t-pun { color: var(--muted); }
.t-var { color: var(--tok-cyan); }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.4rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 1.1rem 1.25rem;
}
.stat b { font-family: var(--font-mono); font-size: 1.35rem; color: var(--accent); display: block; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

/* ---------- Post cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: transform 0.16s ease, border-color 0.16s, box-shadow 0.16s;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-2);
}
.post-card:hover .thumb img { transform: scale(1.04); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.thumb .thumb-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 15% 0%, rgba(255, 180, 84, 0.16), transparent 55%),
    radial-gradient(120% 120% at 100% 100%, rgba(69, 198, 232, 0.14), transparent 55%),
    var(--surface-2);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 2rem;
  color: var(--accent);
  letter-spacing: -0.04em;
}
.thumb .play {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(7, 11, 21, 0.75);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.thumb .play svg { width: 15px; height: 15px; }

.post-card .card-file {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--faint);
  padding: 0.6rem 1.1rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.post-card .card-file::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); opacity: 0.8; }

.post-card .card-body { padding: 0.5rem 1.1rem 1.15rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.post-card h3 { margin: 0; font-size: 1.04rem; line-height: 1.4; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--accent); }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card .card-desc {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding-top: 0.35rem;
}
.card-date { font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); white-space: nowrap; flex: none; }

/* Chips / tags */
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tok-cyan);
  background: rgba(69, 198, 232, 0.09);
  border: 1px solid rgba(69, 198, 232, 0.22);
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  position: relative;
  z-index: 2;
}
.chip-lang { color: var(--accent); background: var(--accent-dim); border-color: rgba(255, 180, 84, 0.3); }

/* ---------- Toolbar (search + filters) ---------- */
.toolbar { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.8rem; }
.search-box { position: relative; flex: 1 1 280px; max-width: 460px; }
.search-box svg {
  position: absolute; left: 0.95rem; top: 50%; translate: 0 -50%;
  width: 17px; height: 17px; color: var(--faint);
  pointer-events: none;
}
.search-box input[type="text"] { padding-left: 2.85rem; }

.filter-row { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.14s;
}
.filter-btn:hover { color: var(--text); border-color: var(--border); }
.filter-btn.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 700; }

.result-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); margin: -0.8rem 0 1.4rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.15rem; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.field .hint { font-size: 0.8rem; color: var(--faint); font-weight: 500; margin-left: 0.35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
  width: 100%;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.96rem;
  padding: 0.72rem 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
textarea.code-input { font-family: var(--font-mono); font-size: 0.86rem; min-height: 200px; white-space: pre; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 180, 84, 0.16);
}
input::placeholder, textarea::placeholder { color: var(--faint); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E6C8E' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.1rem; }

/* ---------- Panels / cards ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: 1.8rem;
}
.panel-tight { padding: 1.25rem; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative;
  background:
    radial-gradient(90% 140% at 8% 0%, rgba(255, 180, 84, 0.13), transparent 55%),
    radial-gradient(80% 140% at 95% 100%, rgba(193, 147, 245, 0.1), transparent 55%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 3rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  overflow: hidden;
}
.cta-band h2 { margin-bottom: 0.4rem; }
.cta-band p { color: var(--muted); margin: 0; max-width: 52ch; }
.cta-band .cta-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.cta-band::after {
  content: "</>";
  position: absolute;
  right: -0.4rem; bottom: -2.6rem;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 9rem;
  color: var(--surface-3);
  opacity: 0.5;
  pointer-events: none;
  line-height: 1;
}

/* ---------- Post page ---------- */
.post-header { padding: 3rem 0 1.6rem; }
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--faint);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.breadcrumbs a { color: var(--faint); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.6; }

.post-meta-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 0.9rem; }
.post-date { font-family: var(--font-mono); font-size: 0.82rem; color: var(--faint); }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.2rem;
  align-items: start;
  padding-bottom: 4rem;
}

/* Video facade — loads iframe only on click (fast + good for SEO) */
.video-facade {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  margin-bottom: 1.8rem;
}
.video-facade img { width: 100%; height: 100%; object-fit: cover; }
.video-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade .vf-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(7, 11, 21, 0.1), rgba(7, 11, 21, 0.55));
  transition: background 0.2s;
}
.video-facade:hover .vf-play { background: linear-gradient(180deg, rgba(7, 11, 21, 0.02), rgba(7, 11, 21, 0.4)); }
.vf-play .vf-btn {
  width: 74px; height: 52px;
  background: var(--yt-red);
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 12px 32px -8px rgba(255, 78, 69, 0.65);
  transition: transform 0.15s;
}
.video-facade:hover .vf-btn { transform: scale(1.07); }
.vf-play svg { width: 22px; height: 22px; margin-left: 2px; }

.post-body { color: var(--muted); font-size: 1.03rem; }
.post-body strong { color: var(--text); }

/* Code block w/ toolbar */
.codeblock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  margin: 1.6rem 0;
  box-shadow: var(--shadow-1);
}
.codeblock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.7rem 0.6rem 1rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.codeblock-name {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.codeblock-name .fdot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.codeblock-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codeblock-actions { display: flex; gap: 0.45rem; flex: none; }
.codeblock pre { margin: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: all 0.14s;
}
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.icon-btn.ok { color: var(--tok-green); border-color: rgba(156, 214, 114, 0.5); }
.icon-btn svg { width: 14px; height: 14px; }

/* Sidebar */
.sidebar { position: sticky; top: calc(var(--header-h) + 1.4rem); display: flex; flex-direction: column; gap: 1.2rem; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 1.3rem;
}
.side-card h3 { font-size: 0.95rem; margin-bottom: 0.8rem; }
.side-card .btn { width: 100%; margin-bottom: 0.6rem; }
.side-card .btn:last-child { margin-bottom: 0; }
.side-note { font-size: 0.85rem; color: var(--faint); margin: 0.7rem 0 0; }

/* ---------- Hire page ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.3rem; }
.service {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 1.5rem;
  transition: transform 0.16s, border-color 0.16s;
}
.service:hover { transform: translateY(-3px); border-color: var(--border); }
.service .s-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(255, 180, 84, 0.28);
  color: var(--accent);
  display: grid; place-items: center;
  margin-bottom: 1rem;
}
.service .s-icon svg { width: 22px; height: 22px; }
.service p { color: var(--muted); font-size: 0.93rem; margin: 0; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 2rem;
  align-items: start;
}
.contact-ways { display: flex; flex-direction: column; gap: 0.8rem; }
.way {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 1rem 1.15rem;
  color: var(--text);
  font-weight: 700;
  transition: border-color 0.15s, transform 0.15s;
}
.way:hover { border-color: var(--border); transform: translateX(3px); color: var(--text); }
.way .w-icon {
  width: 42px; height: 42px;
  flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--accent);
}
.way .w-icon svg { width: 20px; height: 20px; }
.way small { display: block; color: var(--faint); font-weight: 500; font-size: 0.8rem; }
.way .arrow { margin-left: auto; color: var(--faint); }

/* ---------- About / links ---------- */
.about-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 2.6rem; align-items: start; }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-l);
  padding: 1.9rem;
  text-align: center;
  position: sticky;
  top: calc(var(--header-h) + 1.4rem);
}
.avatar {
  width: 108px; height: 108px;
  margin: 0 auto 1rem;
  border-radius: 28px;
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255, 200, 118, 0.9), rgba(255, 180, 84, 0.7) 45%, rgba(255, 154, 46, 0.85)),
    var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  box-shadow: 0 14px 34px -10px rgba(255, 180, 84, 0.5);
}
.profile-card h1 { font-size: 1.5rem; margin-bottom: 0.2rem; }
.profile-card .role { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; }

.skills { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; margin-bottom: 1.4rem; }

.link-list { display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------- Status bar footer (signature) ---------- */
.statusbar {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--faint);
}
.statusbar .container {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}
.statusbar .container::-webkit-scrollbar { display: none; }
.statusbar .sb-item { display: inline-flex; align-items: center; gap: 0.42rem; white-space: nowrap; }
.statusbar .sb-item svg { width: 13px; height: 13px; }
.statusbar a.sb-item { color: var(--faint); }
.statusbar a.sb-item:hover { color: var(--accent); }
.statusbar .sb-live { color: var(--tok-green); }
.statusbar .sb-live .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--tok-green);
  box-shadow: 0 0 8px var(--tok-green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.statusbar .sb-right { margin-left: auto; display: inline-flex; gap: 1.3rem; }

.site-footer { background: var(--bg-deep); padding: 2.6rem 0 2.2rem; }
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-grid .f-brand p { color: var(--faint); font-size: 0.9rem; max-width: 34ch; margin: 0.6rem 0 0; }
.footer-cols { display: flex; gap: 3.5rem; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); text-transform: lowercase; margin-bottom: 0.7rem; }
.footer-col h4::before { content: "# "; color: var(--tok-violet); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.footer-col a { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.84rem;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  z-index: 100;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.8rem 1.25rem;
  border-radius: 10px;
  box-shadow: var(--shadow-2);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.2s;
  max-width: min(92vw, 480px);
}
.toast.show { opacity: 1; translate: -50% -6px; }
.toast.ok { border-color: rgba(156, 214, 114, 0.5); }
.toast.err { border-color: rgba(255, 122, 122, 0.55); }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: var(--tok-green); }
.toast.err svg { color: var(--tok-red); }

/* ---------- Skeletons / empty ---------- */
.skeleton {
  border-radius: var(--radius-m);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--border-soft);
}
.skeleton.card { aspect-ratio: 16 / 12; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-l);
  color: var(--muted);
}
.empty .e-glyph { font-family: var(--font-mono); font-size: 2rem; color: var(--faint); margin-bottom: 0.6rem; }
.empty h3 { color: var(--text); }
.empty p { max-width: 46ch; margin-inline: auto; }

/* ---------- Demo banner ---------- */
.demo-banner {
  background: linear-gradient(90deg, rgba(255, 180, 84, 0.14), rgba(193, 147, 245, 0.1));
  border-bottom: 1px solid rgba(255, 180, 84, 0.25);
  color: var(--text);
  font-size: 0.88rem;
  padding: 0.55rem 0;
  text-align: center;
}
.demo-banner b { color: var(--accent); font-family: var(--font-mono); font-size: 0.82rem; }
.demo-banner a { font-weight: 800; }

/* ---------- Admin ---------- */
.admin-wrap { padding: 3rem 0 4rem; }
.login-card { max-width: 420px; margin: 4rem auto; }
.login-card .logo-big {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.3rem;
  margin: 0 auto 1.1rem;
}

.admin-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.8rem; border-bottom: 1px solid var(--border-soft); padding-bottom: 0.9rem; }
.admin-tab {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.admin-tab:hover { color: var(--text); background: var(--surface-2); }
.admin-tab.active { color: var(--accent); background: var(--accent-dim); border-color: rgba(255, 180, 84, 0.3); }
.admin-tab .count {
  background: var(--surface-3);
  color: var(--muted);
  border-radius: 999px;
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
}

.file-row {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1rem;
  margin-bottom: 1rem;
}
.file-row .file-head { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.7rem; }
.file-row .file-head input { flex: 1; }

.admin-list { display: flex; flex-direction: column; gap: 0.8rem; }
.admin-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-m);
  padding: 0.95rem 1.15rem;
}
.admin-item .ai-main { min-width: 0; flex: 1; }
.admin-item .ai-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .ai-sub { font-family: var(--font-mono); font-size: 0.76rem; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item .ai-actions { display: flex; gap: 0.45rem; flex: none; }
.admin-item.unread { border-left: 3px solid var(--accent); }

.msg-body { color: var(--muted); font-size: 0.94rem; white-space: pre-wrap; margin-top: 0.5rem; }

.copy-field {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}
.copy-field input { font-family: var(--font-mono); font-size: 0.84rem; }

.uid-banner {
  background: rgba(69, 198, 232, 0.08);
  border: 1px solid rgba(69, 198, 232, 0.3);
  border-radius: var(--radius-m);
  padding: 1rem 1.2rem;
  margin-bottom: 1.6rem;
  font-size: 0.92rem;
}
.uid-banner code {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  color: var(--tok-cyan);
  font-size: 0.82rem;
  word-break: break-all;
}

.divider { border: 0; border-top: 1px solid var(--border-soft); margin: 2rem 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
}
.badge.live { color: var(--tok-green); background: rgba(156, 214, 114, 0.1); }
.badge.demo { color: var(--accent); background: var(--accent-dim); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 3.6rem 0 2.4rem; }
.page-hero .lead { margin-top: 0.4rem; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 0.75rem; } .mt-2 { margin-top: 1.5rem; } .mt-3 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.4rem; }
  .post-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; max-width: 440px; margin-inline: auto; }
}

@media (max-width: 780px) {
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: rgba(11, 16, 30, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.25rem 1.2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.8rem 0.9rem; font-size: 1.02rem; }
  .nav-toggle { display: inline-flex; }
  .nav-cta .btn-subscribe-text { display: none; }

  .section { padding: 3.2rem 0; }
  .hero { padding: 3rem 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .cta-band { padding: 2.2rem 1.6rem; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-cols { gap: 2rem; }
}

@media (max-width: 460px) {
  body { font-size: 15.5px; }
  .stats { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 auto; }
}

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

/* ---------- Print ---------- */
@media print {
  .site-header, .statusbar, .site-footer, .sidebar, .video-facade { display: none; }
  body { background: #fff; color: #000; }
}
