:root {
  color-scheme: light;
}

.dark {
  color-scheme: dark;
}

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hero-grid {
  background-image:
    linear-gradient(to right, rgb(14 116 144 / 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(14 116 144 / 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent);
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(71 85 105);
}

.dark .nav-link {
  color: rgb(203 213 225);
}

.cookie-consent-banner {
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: 56rem;
  margin-inline: auto;
}

.cookie-consent-banner[hidden] {
  display: none;
}

.cookie-consent-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid rgb(203 213 225);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.98);
  padding: 1.25rem;
  box-shadow: 0 20px 50px -24px rgb(15 23 42 / 0.45);
}

.dark .cookie-consent-panel {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42 / 0.98);
}

.cookie-consent-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .cookie-consent-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .cookie-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.article-card {
  position: relative;
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.72);
  padding: 1.75rem;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgb(6 182 212 / 0.7);
  box-shadow: 0 18px 50px -28px rgb(8 47 73 / 0.45);
}

.dark .article-card {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42 / 0.7);
}

.filter-pill {
  border: 1px solid rgb(203 213 225);
  border-radius: 9999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.875rem;
}

.filter-pill.active {
  border-color: rgb(8 145 178);
  background: rgb(8 145 178);
  color: white;
}

.prose-content {
  font-size: 1.075rem;
  line-height: 1.85;
  color: rgb(51 65 85);
}

.dark .prose-content {
  color: rgb(203 213 225);
}

.prose-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: rgb(15 23 42);
}

.dark .prose-content h2 {
  color: white;
}

.prose-content p,
.prose-content ul {
  margin-top: 1rem;
}

.prose-content ul {
  list-style: disc;
  padding-left: 1.4rem;
}

.prose-content a {
  color: rgb(8 145 178);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose-content :not(pre) > code {
  border-radius: 0.3rem;
  background: rgb(226 232 240);
  padding: 0.12rem 0.35rem;
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.dark .prose-content :not(pre) > code {
  background: rgb(30 41 59);
}

.prose-content pre {
  position: relative;
  margin: 2rem 0;
  overflow-x: auto;
  border: 1px solid rgb(51 65 85);
  border-radius: 0.9rem;
  background: #071019;
  padding: 3rem 1.25rem 1.25rem;
  color: #d8f3f8;
  box-shadow: 0 20px 45px -30px rgb(0 0 0 / 0.8);
}

.prose-content pre::before {
  content: "●  ●  ●";
  position: absolute;
  left: 1.25rem;
  top: 0.85rem;
  color: #38bdf8;
  font-size: 0.7rem;
  letter-spacing: 0.25rem;
}

.prose-content pre code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
}

.prose-content .editor-colors {
  color: #d4d4d4;
}

.prose-content .editor-colors .keyword,
.prose-content .editor-colors .controlKeyword,
.prose-content .editor-colors .preprocessorKeyword {
  color: #569cd6;
}

.prose-content .editor-colors .className,
.prose-content .editor-colors .type,
.prose-content .editor-colors .typeVariable {
  color: #4ec9b0;
}

.prose-content .editor-colors .string,
.prose-content .editor-colors .stringCSharpVerbatim,
.prose-content .editor-colors .markdownCode {
  color: #ce9178;
}

.prose-content .editor-colors .comment,
.prose-content .editor-colors .xmlComment,
.prose-content .editor-colors .xmlDocComment {
  color: #6a9955;
}

.prose-content .editor-colors .number {
  color: #b5cea8;
}

.prose-content .editor-colors .powershellCommand,
.prose-content .editor-colors .builtinFunction,
.prose-content .editor-colors .attribute {
  color: #dcdcaa;
}

.prose-content .editor-colors .powershellVariable {
  color: #9cdcfe;
}

.prose-content .editor-colors .powershellParameter,
.prose-content .editor-colors .powershellOperator,
.prose-content .editor-colors .operator,
.prose-content .editor-colors .delimiter {
  color: #d4d4d4;
}

.prose-content .editor-colors .namespace {
  color: #c586c0;
}

@media (max-width: 767px) {
  #nav-menu.open {
    position: absolute;
    top: 4rem;
    right: 1.25rem;
    display: flex;
    min-width: 12rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.8rem;
    background: white;
    padding: 1rem;
    box-shadow: 0 16px 40px rgb(15 23 42 / 0.12);
  }

  .dark #nav-menu.open {
    border-color: rgb(51 65 85);
    background: rgb(15 23 42);
  }
}

.article-hero img,
.prose-content img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgb(30 58 86);
  border-radius: 0.9rem;
  background: #0b1220;
}

.prose-content img {
  margin: 2rem auto 0.4rem;
}

.prose-content p > em:only-child {
  display: block;
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgb(100 116 139);
}

.prose-content h3 {
  margin-top: 2rem;
  font-size: 1.25rem;
  font-weight: 650;
}

.prose-content ol {
  margin-top: 1rem;
  list-style: decimal;
  padding-left: 1.4rem;
}

.prose-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.prose-content th,
.prose-content td {
  border: 1px solid rgb(203 213 225);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.dark .prose-content th,
.dark .prose-content td {
  border-color: rgb(51 65 85);
}

.prose-content blockquote {
  margin: 1.5rem 0;
  border-left: 3px solid rgb(6 182 212);
  padding-left: 1rem;
  color: rgb(71 85 105);
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.share-btn {
  border: 1px solid rgb(203 213 225);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.share-btn:hover,
.share-btn:focus-visible {
  border-color: rgb(6 182 212);
  color: rgb(8 145 178);
}

.dark .share-btn {
  border-color: rgb(51 65 85);
}

.series-box,
.author-card {
  border: 1px solid rgb(226 232 240);
  border-radius: 1rem;
  background: rgb(255 255 255 / 0.72);
  padding: 1.5rem;
}

.dark .series-box,
.dark .author-card {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42 / 0.7);
}

.author-card {
  display: flex;
  gap: 1.25rem;
}

.author-avatar {
  display: flex;
  height: 3.5rem;
  width: 3.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: linear-gradient(135deg, #0891b2, #0f172a);
  color: white;
  font-size: 1.4rem;
  font-weight: 600;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.card-thumb {
  margin: -1.75rem -1.75rem 1.25rem;
  overflow: hidden;
  border-radius: 1rem 1rem 0 0;
  background: #0b1220;
}

.card-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

/* ---- Motion layer: page transitions (transitions.dev pattern) ---- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation: 220ms cubic-bezier(.4, 0, 1, 1) both vt-out; }
::view-transition-new(root) { animation: 380ms cubic-bezier(0, 0, .2, 1) both vt-in; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; mix-blend-mode: normal; }

@keyframes vt-out { to { opacity: 0; transform: translateY(-8px) scale(.995); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px) scale(.995); filter: blur(4px); } }

header.sticky { view-transition-name: site-header; }

/* ---- Hero: aurora + spotlight (Aceternity-style) ---- */
.hero-aurora {
  background:
    radial-gradient(40rem 24rem at 15% 10%, rgb(34 211 238 / .22), transparent 60%),
    radial-gradient(36rem 22rem at 85% 0%, rgb(99 102 241 / .22), transparent 60%),
    radial-gradient(30rem 20rem at 60% 90%, rgb(16 185 129 / .14), transparent 60%);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}
@keyframes aurora-drift { to { transform: translate3d(0, 18px, 0) scale(1.06); } }

.hero-spotlight {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%), rgb(34 211 238 / .16), transparent 65%);
  transition: background-position .2s;
}

.gradient-text {
  background: linear-gradient(100deg, #0891b2, #6366f1 45%, #10b981 80%, #0891b2);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 8s linear infinite;
}
@keyframes gradient-shift { to { background-position: 250% center; } }

/* ---- Terminal that writes code ---- */
.term {
  border-radius: 1rem;
  background: #0b1220;
  border: 1px solid rgb(148 163 184 / .25);
  box-shadow: 0 30px 80px -30px rgb(8 145 178 / .55), 0 0 0 1px rgb(255 255 255 / .03) inset;
  overflow: hidden;
  color: #e2e8f0;
  font-family: ui-monospace, "Cascadia Code", "Fira Code", Consolas, monospace;
}
.term-bar { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; background: #111a2e; border-bottom: 1px solid rgb(148 163 184 / .15); }
.term-dot { width: .7rem; height: .7rem; border-radius: 9999px; }
.term-title { margin-left: .5rem; font-size: .75rem; color: #94a3b8; }
.term-body { min-height: 17rem; padding: 1.1rem 1.25rem; font-size: .82rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.term-body .k { color: #22d3ee; } .term-body .s { color: #86efac; } .term-body .c { color: #64748b; font-style: italic; }
.term-body .v { color: #c4b5fd; } .term-body .p { color: #34d399; }
.term-cursor { display: inline-block; width: .55ch; height: 1.05em; margin-left: 1px; vertical-align: -2px; background: #22d3ee; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Bento / glow cards ---- */
.glow-card { position: relative; overflow: hidden; border-radius: 1.25rem; border: 1px solid rgb(148 163 184 / .3); padding: 1.6rem; background: rgb(255 255 255 / .6); transition: transform .3s ease, border-color .3s ease; }
.dark .glow-card { background: rgb(15 23 42 / .6); border-color: rgb(51 65 85); }
.glow-card::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 50%), rgb(34 211 238 / .16), transparent 70%); }
.glow-card:hover { transform: translateY(-4px); border-color: rgb(6 182 212 / .7); }
.glow-card:hover::before { opacity: 1; }

/* ---- Reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .hero-aurora, .gradient-text, .term-cursor { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Inner pages ---- */
.page-hero { position: relative; overflow: hidden; }
.page-hero .hero-aurora { opacity: .7; }
.title-underline { position: relative; display: inline-block; }
.title-underline::after { content: ""; position: absolute; left: 0; bottom: -.35rem; height: 3px; width: 100%; border-radius: 9999px;
  background: linear-gradient(90deg, #06b6d4, #6366f1, #10b981); transform: scaleX(0); transform-origin: left; animation: underline-in .9s .3s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes underline-in { to { transform: scaleX(1); } }

.card-thumb { overflow: hidden; border-radius: .75rem; }
.card-thumb img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.glow-card:hover .card-thumb img { transform: scale(1.05); }

.tag-pill { border: 1px solid rgb(148 163 184 / .4); border-radius: 9999px; padding: .15rem .6rem; font-size: .7rem; letter-spacing: .04em; }

.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 0; top: .3rem; bottom: .3rem; width: 2px; background: linear-gradient(#06b6d4, #6366f1, transparent); }
.timeline > li { position: relative; list-style: none; }
.timeline > li::before { content: ""; position: absolute; left: -1.78rem; top: .55rem; width: .6rem; height: .6rem; border-radius: 9999px; background: #06b6d4; box-shadow: 0 0 0 4px rgb(6 182 212 / .2); }

.avatar-ring { display: inline-grid; place-items: center; width: 7.5rem; height: 7.5rem; flex: none; overflow: hidden; border-radius: 9999px; padding: 3px;
  background: conic-gradient(from 0deg, #06b6d4, #6366f1, #10b981, #06b6d4); animation: avatar-glow 3s ease-in-out infinite; }
.avatar-ring > img { width: 100%; height: 100%; border-radius: 9999px; object-fit: cover; object-position: center; }
.certification-card { display: flex; min-height: 8rem; align-items: center; gap: 1rem; }
.certification-card img { flex: none; object-fit: contain; }
@keyframes avatar-glow {
  0%, 100% { box-shadow: 0 0 12px 1px rgb(6 182 212 / .28); }
  50% { box-shadow: 0 0 24px 7px rgb(99 102 241 / .48); }
}

#scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, #06b6d4, #6366f1, #10b981); }

@media (prefers-reduced-motion: reduce) {
  .title-underline::after { animation: none; transform: scaleX(1); }
  .avatar-ring { animation: none; box-shadow: 0 0 12px 2px rgb(6 182 212 / .3); }
  .card-thumb img { transition: none; }
}
