:root {
  --ad-bg: #050712;
  --ad-bg-elevated: #0d1021;
  --ad-bg-soft: #111528;
  --ad-border-subtle: rgba(255, 255, 255, 0.06);
  --ad-border-strong: rgba(255, 255, 255, 0.16);
  --ad-text: #f3f4ff;
  --ad-text-muted: #a4a8c4;
  --ad-accent: #6c5ce7;
  --ad-accent-soft: rgba(108, 92, 231, 0.14);
  --ad-accent-strong: #8e7cff;
  --ad-surface-glow: rgba(141, 120, 255, 0.35);
  --ad-danger: #ff7675;
  --ad-radius-lg: 18px;
  --ad-radius-md: 12px;
  --ad-radius-pill: 999px;
  --ad-shadow-soft: 0 18px 50px rgba(0, 0, 0, 0.6);
  --ad-shadow-subtle: 0 10px 30px rgba(0, 0, 0, 0.45);
  --ad-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: var(--ad-font-sans);
  color: var(--ad-text);
  background: radial-gradient(
      circle at top left,
      rgba(88, 101, 242, 0.25),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(108, 92, 231, 0.18),
      transparent 55%
    ),
    var(--ad-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] {
  --ad-bg: #f5f5fb;
  --ad-bg-elevated: #ffffff;
  --ad-bg-soft: #eef1ff;
  --ad-border-subtle: rgba(148, 163, 184, 0.22);
  --ad-border-strong: rgba(148, 163, 184, 0.4);
  --ad-text: #020617;
  --ad-text-muted: #4b5563;
  --ad-accent: #4f46e5;
  --ad-accent-soft: rgba(79, 70, 229, 0.08);
  --ad-accent-strong: #3730a3;
  --ad-surface-glow: rgba(79, 70, 229, 0.14);
  --ad-shadow-soft: 0 18px 45px rgba(148, 163, 184, 0.35);
  --ad-shadow-subtle: 0 12px 30px rgba(148, 163, 184, 0.25);
}

[data-theme="light"] body {
  background: radial-gradient(
      circle at top left,
      rgba(129, 140, 248, 0.14),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.12),
      transparent 55%
    ),
    var(--ad-bg);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  display: block;
}

.ad-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 5vw;
  background: linear-gradient(
    to bottom,
    rgba(5, 7, 18, 0.9),
    rgba(5, 7, 18, 0.7),
    transparent
  );
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

[data-theme="light"] .ad-header {
  background: linear-gradient(
    to bottom,
    rgba(248, 250, 252, 0.96),
    rgba(248, 250, 252, 0.88),
    transparent
  );
  border-bottom-color: rgba(148, 163, 184, 0.35);
}

.ad-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.ad-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: radial-gradient(
    circle at 20% 20%,
    #ffd166,
    #ff6b6b 42%,
    #6c5ce7 80%
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0b1020;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}

.ad-logo-text {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ad-text-muted);
}

.ad-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.92rem;
}

.ad-nav a {
  position: relative;
  color: var(--ad-text-muted);
  padding-bottom: 0.15rem;
}

.ad-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a855f7, #6366f1, #22d3ee);
  transition: width 0.18s ease-out;
}

.ad-nav a:hover::after,
.ad-nav a:focus-visible::after {
  width: 100%;
}

/* Current page: show which menu item is active */
body.ad-page-home .ad-nav a[href="/"],
body.ad-page-about .ad-nav a[href="/about/"],
body.ad-page-projects .ad-nav a[href="/projects/"],
body.ad-page-blog .ad-nav a[href="/blog/"],
body.ad-page-contact .ad-nav a[href="/contact/"] {
  color: var(--ad-text);
  font-weight: 600;
}
body.ad-page-home .ad-nav a[href="/"]::after,
body.ad-page-about .ad-nav a[href="/about/"]::after,
body.ad-page-projects .ad-nav a[href="/projects/"]::after,
body.ad-page-blog .ad-nav a[href="/blog/"]::after,
body.ad-page-contact .ad-nav a[href="/contact/"]::after {
  width: 100%;
}

.ad-nav-cta {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: var(--ad-text-muted);
}

body.ad-page-contact .ad-nav-cta {
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.32), transparent 60%);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.6);
  color: var(--ad-text);
}

[data-theme="light"] body.ad-page-contact .ad-nav-cta {
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.3);
}

.ad-main {
  padding: 2.5rem 5vw 4rem;
  max-width: 1120px;
  margin: 0 auto;
}

.ad-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr);
  gap: 2.8rem;
  padding: 2.4rem 2.2rem;
  border-radius: 26px;
  background: radial-gradient(circle at top left, rgba(79, 70, 229, 0.4), transparent 60%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.25), transparent 55%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 40px 120px rgba(15, 23, 42, 0.95);
  margin-bottom: 3rem;
}

[data-theme="light"] .ad-hero {
  background: radial-gradient(
      circle at top left,
      rgba(129, 140, 248, 0.2),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.16),
      transparent 60%
    ),
    linear-gradient(135deg, #ffffff, #eef2ff);
  border-color: var(--ad-border-subtle);
  box-shadow: var(--ad-shadow-soft);
}

.ad-hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ad-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(226, 232, 240, 0.75);
}

.ad-hero h1 {
  font-size: clamp(2.4rem, 2.4vw + 1.6rem, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0;
}

.ad-accent {
  background: linear-gradient(120deg, #e879f9, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  color: transparent;
}

.ad-hero-body {
  margin: 0;
  color: var(--ad-text-muted);
  font-size: 0.98rem;
  max-width: 34rem;
}

.ad-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: var(--ad-radius-pill);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out,
    background 0.12s ease-out, border-color 0.12s ease-out;
}

.ad-btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: rgba(191, 219, 254, 0.25);
  color: #eef2ff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.6);
}

.ad-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.7);
}

.ad-btn-ghost {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--ad-text-muted);
}

.ad-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.95);
  color: var(--ad-text);
}

[data-theme="light"] .ad-btn-ghost {
  background: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.7);
  color: #0f172a;
}

[data-theme="light"] .ad-btn-ghost:hover {
  background: #d1d5db;
  color: #020617;
}

.ad-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
}

.ad-hero-panel {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.ad-hero-portrait {
  width: 100%;
  max-width: 327px;
  height: auto;
  aspect-ratio: 327 / 490;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.85);
}

[data-theme="light"] .ad-hero-portrait {
  border-color: var(--ad-border-subtle);
  box-shadow: var(--ad-shadow-subtle);
}

.ad-hero-card {
  padding: 1.1rem 1.2rem;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.85);
}

[data-theme="light"] .ad-hero-card {
  background: #ffffff;
  border-color: var(--ad-border-subtle);
  box-shadow: var(--ad-shadow-subtle);
}

.ad-hero-card h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.ad-hero-card p {
  margin: 0 0 0.5rem;
  color: var(--ad-text-muted);
  font-size: 0.9rem;
}

.ad-hero-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ad-text-muted);
  font-size: 0.9rem;
}

.ad-hero-card--highlight {
  background: radial-gradient(
      circle at 10% 0%,
      rgba(244, 114, 182, 0.7),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(56, 189, 248, 0.6),
      transparent 55%
    ),
    rgba(15, 23, 42, 0.96);
  border-color: rgba(244, 114, 182, 0.6);
}

[data-theme="light"] .ad-hero-card--highlight {
  background: radial-gradient(
      circle at 10% 0%,
      rgba(244, 114, 182, 0.16),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(56, 189, 248, 0.16),
      transparent 55%
    ),
    #ffffff;
}

.ad-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.88rem;
  color: #bfdbfe;
}

.ad-inline-link::after {
  content: "↗";
  font-size: 0.75rem;
}

[data-theme="light"] .ad-inline-link {
  color: #1d4ed8;
}

.ad-inline-link:hover,
.ad-inline-link:focus-visible {
  text-decoration: underline;
}

.ad-section {
  margin-bottom: 3rem;
}

.ad-section-head {
  max-width: 40rem;
  margin-bottom: 1.4rem;
}

.ad-section-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.ad-section-head p {
  margin: 0;
  color: var(--ad-text-muted);
  font-size: 0.95rem;
}

.ad-grid {
  display: grid;
  gap: 1.2rem;
}

.ad-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ad-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ad-card {
  padding: 1rem 1rem 1.1rem;
  border-radius: var(--ad-radius-md);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: var(--ad-shadow-subtle);
}

[data-theme="light"] .ad-card {
  background: #ffffff;
  border-color: var(--ad-border-subtle);
}

.ad-card h3 {
  font-size: 1.02rem;
  margin: 0 0 0.4rem;
}

.ad-card p {
  margin: 0 0 0.6rem;
  color: var(--ad-text-muted);
  font-size: 0.93rem;
}

.ad-card-meta {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
}

.ad-card--project {
  position: relative;
  overflow: hidden;
}

.ad-card--project::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(96, 165, 250, 0.32),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.ad-card--project:hover::before {
  opacity: 1;
}

.ad-card--project > * {
  position: relative;
}

.ad-card--blog {
  border-style: dashed;
}

.ad-pill-list,
.ad-tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ad-pill-list li,
.ad-tag-list li {
  font-size: 0.75rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(226, 232, 240, 0.88);
}

.ad-section-link-row {
  margin-top: 0.8rem;
}

.ad-section--accent {
  padding: 1.8rem 1.6rem;
  border-radius: 22px;
  background: radial-gradient(
      circle at 0% 0%,
      rgba(52, 211, 153, 0.35),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(59, 130, 246, 0.4),
      transparent 55%
    ),
    rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(52, 211, 153, 0.6);
}

.ad-section--accent .ad-section-head p {
  color: rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .ad-section--accent {
  background: radial-gradient(
      circle at 0% 0%,
      rgba(45, 212, 191, 0.18),
      transparent 55%
    ),
    radial-gradient(
      circle at 100% 0%,
      rgba(59, 130, 246, 0.2),
      transparent 55%
    ),
    #ffffff;
  border-color: rgba(45, 212, 191, 0.7);
}

[data-theme="light"] .ad-section--accent .ad-section-head p {
  color: #0f172a;
}

.ad-contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0.6rem;
}

.ad-contact-note {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(226, 232, 240, 0.9);
}

.ad-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding: 1.2rem 5vw 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--ad-text-muted);
}

[data-theme="light"] .ad-footer {
  background: rgba(248, 250, 252, 0.9);
}

.ad-footer-social {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ad-footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ad-text-muted);
  transition: color 0.15s ease;
}

.ad-footer-social a:hover,
.ad-footer-social a:focus-visible {
  color: var(--ad-text);
}

.ad-social-icon {
  flex-shrink: 0;
}

.ad-social-label {
  font-size: 0.8rem;
}

@media (max-width: 720px) {
  .ad-social-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.ad-footer nav {
  display: flex;
  gap: 1.4rem;
}

.ad-footer-name {
  font-weight: 500;
}

.ad-page {
  padding: 1.8rem 2.2rem 2.2rem;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .ad-page {
  background: #ffffff;
  border-color: var(--ad-border-subtle);
  box-shadow: var(--ad-shadow-soft);
}

.ad-page-header {
  margin-bottom: 1.4rem;
}

.ad-page-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(148, 163, 184, 0.9);
  margin: 0 0 0.4rem;
}

.ad-page-title {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.ad-page-summary {
  margin: 0;
  color: var(--ad-text-muted);
  font-size: 0.98rem;
}

.ad-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 1.8rem;
}

.ad-prose {
  font-size: 0.96rem;
  color: var(--ad-text-muted);
  line-height: 1.7;
}

.ad-prose p {
  margin-top: 0;
  margin-bottom: 0.8rem;
}

.ad-prose strong {
  color: var(--ad-text);
}

.ad-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px dashed rgba(148, 163, 184, 0.5);
}

.ad-timeline-item {
  padding-left: 1rem;
  margin-bottom: 1.2rem;
  position: relative;
}

.ad-timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.2rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid #a855f7;
  background: #020617;
}

.ad-timeline-role {
  font-weight: 500;
  font-size: 0.95rem;
}

.ad-timeline-meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(148, 163, 184, 0.95);
  margin-top: 0.08rem;
}

.ad-timeline-body {
  margin: 0.45rem 0 0.1rem;
  color: var(--ad-text-muted);
  font-size: 0.9rem;
}

.ad-list-check {
  list-style: none;
  margin: 0.3rem 0 0;
  padding-left: 0;
}

.ad-list-check li {
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--ad-text-muted);
  margin-bottom: 0.3rem;
}

.ad-list-check span:first-child {
  color: #22c55e;
}

.ad-card-stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ad-card-compact {
  padding: 0.8rem 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .ad-card-compact {
  background: #ffffff;
  border-color: var(--ad-border-subtle);
}

.ad-card-compact-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.ad-card-compact p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ad-text-muted);
}

.ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.72rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(226, 232, 240, 0.9);
}

.ad-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.ad-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.ad-project-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.9);
}

.ad-blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ad-blog-item {
  padding: 0.9rem 1rem;
  border-radius: 0.95rem;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.9);
}

[data-theme="light"] .ad-blog-item {
  background: #ffffff;
  border-style: solid;
  border-color: var(--ad-border-subtle);
}

.ad-blog-item h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.ad-blog-meta {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 0.3rem;
}

.ad-blog-item h2 a {
  color: inherit;
}

.ad-blog-item h2 a:hover,
.ad-blog-item h2 a:focus-visible {
  text-decoration: underline;
}

.ad-contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1.8rem;
}

.ad-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ad-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.ad-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(148, 163, 184, 0.95);
}

.ad-input,
.ad-textarea {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: var(--ad-text);
  padding: 0.6rem 0.8rem;
  font: inherit;
  resize: vertical;
  min-height: 2.4rem;
}

.ad-input:focus-visible,
.ad-textarea:focus-visible {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1;
}

.ad-helper {
  font-size: 0.8rem;
  color: var(--ad-text-muted);
}

.ad-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ad-chip {
  font-size: 0.78rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .ad-input,
[data-theme="light"] .ad-textarea {
  background: #f9fafb;
}

[data-theme="light"] .ad-chip {
  background: #f9fafb;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.6);
}

.ad-note {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
}

.ad-diagram {
  font-size: 0.8rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
}

[data-theme="light"] .ad-diagram {
  background: #0b1120;
  border-color: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
}

.ad-diagram table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.ad-diagram th,
.ad-diagram td {
  padding: 0.55rem 0.6rem;
  vertical-align: top;
}

.ad-diagram thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.ad-diagram tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.7);
}

.ad-diagram tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.4);
}

.ad-diagram tbody td:first-child {
  white-space: nowrap;
  width: 18%;
  font-weight: 600;
}

[data-theme="light"] .ad-diagram tbody tr:nth-child(odd) {
  background: rgba(15, 23, 42, 0.16);
}

[data-theme="light"] .ad-diagram tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.08);
}

.ad-figure {
  margin: 0;
}

.ad-figure-img {
  width: 100%;
  height: auto;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  display: block;
}

.ad-figure-img--light {
  display: none;
}

[data-theme="light"] .ad-figure-img--dark {
  display: none;
}

[data-theme="light"] .ad-figure-img--light {
  display: block;
}

.ad-figure-full {
  grid-column: 1 / -1;
  margin-top: 0.8rem;
}

.ad-scroll-fade {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.ad-scroll-fade--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .ad-header {
    padding-inline: 4vw;
  }

  .ad-main {
    padding-inline: 4vw;
  }

  .ad-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .ad-hero-panel {
    order: -1;
  }

  .ad-grid--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-two-column,
  .ad-contact-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .ad-header {
    padding-inline: 5vw;
    gap: 0.7rem;
  }

  .ad-nav {
    gap: 0.9rem;
    font-size: 0.82rem;
  }

  .ad-main {
    padding-inline: 5vw;
  }

  .ad-hero {
    padding: 1.6rem 1.4rem;
    border-radius: 20px;
  }

  .ad-grid--two,
  .ad-grid--three {
    grid-template-columns: minmax(0, 1fr);
  }

  .ad-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

