:root {
  color-scheme: light dark;
  --blue: #00c8ff;
  --pink: #ff1493;
  --yellow: #ffd700;
  --green: #00ff88;
  --purple: #9b59ff;
  --bg: #040415;
  --bg-card: #0b0b28;
  --bg-card-hover: #10103a;
  --bg-glass: rgba(11, 11, 40, 0.7);
  --border: rgba(0, 200, 255, 0.15);
  --border-glow: rgba(0, 200, 255, 0.4);
  --text: #ddddf5;
  --text-muted: #6b6b9a;
  --text-dim: #4a4a7a;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 30px rgba(0, 200, 255, 0.15);
  --shadow-pink: 0 0 30px rgba(255, 20, 147, 0.15);
  --font: "Mona Sans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: "Hubot Sans", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'SF Mono', 'Fira Code', monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --blue: #0369a1;
    --pink: #be185d;
    --yellow: #b45309;
    --green: #047857;
    --purple: #7c3aed;
    --bg: #f7f8fc;
    --bg-card: #ffffff;
    --bg-card-hover: #eef0fa;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border: rgba(15, 23, 42, 0.1);
    --border-glow: rgba(3, 105, 161, 0.35);
    --text: #14142b;
    --text-muted: #52526e;
    --text-dim: #82829e;
    --shadow-glow: 0 0 30px rgba(3, 105, 161, 0.12);
    --shadow-pink: 0 0 30px rgba(190, 24, 93, 0.12);
  }
}

@font-face {
  font-family: 'Hubot Sans';
  src:
    url('/HubotSans/Hubot-Sans.woff2') format('woff2 supports variations'),
    url('/HubotSans/Hubot-Sans.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-stretch: 75% 125%;
}

@font-face {
  font-family: 'Mona Sans';
  src:
    url('/HubotSans/Mona-Sans.woff2') format('woff2 supports variations'),
    url('/HubotSans/Mona-Sans.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-stretch: 75% 125%;
}

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

@view-transition {
  navigation: auto;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(0, 200, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(155, 89, 255, 0.06) 0%, transparent 50%);
}

/* ─── Typography ─────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--yellow); }

ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
li { margin-bottom: 0.35rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--pink) 50%, var(--yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2rem;
}

/* ─── Site Header ────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s;
}
.nav-logo:hover { color: var(--blue); }

.nav-logo img {
  height: 32px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.4));
  transition: filter 0.3s;
}
.nav-logo img:hover {
  filter: drop-shadow(0 0 16px rgba(0, 200, 255, 0.7));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover {
  color: var(--blue);
  background: rgba(0, 200, 255, 0.08);
}

.nav-cta {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white !important;
  border-radius: 8px;
  padding: 0.4rem 0.9rem !important;
  font-weight: 700;
  transition: opacity 0.2s, transform 0.2s !important;
}
.nav-cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
  background: rgba(0, 200, 255, 0.08) !important;
  color: white !important;
}

/* ─── Page Wrapper ───────────────────────────────── */

.page-wrapper {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Hero ───────────────────────────────────────── */

.hero {
  text-align: center;
  padding: clamp(3rem, 8vw, 7rem) 1rem clamp(3rem, 6vw, 5rem);
}

.hero h1 {
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Buttons ────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(0, 200, 255, 0.3);
  animation: glow-pulse 3s ease-in-out infinite;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 200, 255, 0.5);
  color: white;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  border: 2px solid var(--border-glow);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn-secondary:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-2px);
}

/* ─── Section Labels ─────────────────────────────── */

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  background: rgba(0, 200, 255, 0.1);
  border: 1px solid rgba(0, 200, 255, 0.25);
  color: var(--blue);
}

/* ─── Sections ───────────────────────────────────── */

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

/* ─── Feature Grid ───────────────────────────────── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color 0.3s, background 0.3s, transform 0.2s, box-shadow 0.3s;
}
.feature-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.feature-card h3 {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.feature-card p, .feature-card li {
  color: var(--text);
  font-size: 0.95rem;
  margin: 0;
}

.feature-card ul {
  margin: 0;
  padding-left: 1.25rem;
}

/* ─── CTA Section ────────────────────────────────── */

.cta-section {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 1rem;
  border-top: 1px solid var(--border);
}
.cta-section h2 { margin-bottom: 1rem; }
.cta-section p { margin-bottom: 2rem; color: var(--text-muted); }

/* ─── Contact Form ───────────────────────────────── */

.contact-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.contact-section .section-header {
  margin-bottom: 2rem;
}

.contact-card {
  max-width: 580px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-glow);
}

.contact-card p {
  color: var(--text);
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  display: block;
  margin-bottom: 1.25rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

textarea { resize: vertical; min-height: 150px; }

button[type="submit"] {
  background: linear-gradient(135deg, var(--blue), var(--pink));
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}
button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 200, 255, 0.35);
}

.response-iframe {
  width: 100%;
  height: 0;
  border: none;
  margin-bottom: 0;
  background: transparent;
  transition: height 0.15s ease;
}

/* ─── About / Article ────────────────────────────── */

.about-hero {
  text-align: center;
  padding: clamp(3rem, 6vw, 5rem) 1rem 2rem;
}

.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--border);
}

.about-content h3 {
  color: var(--blue);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.about-content p {
  color: var(--text);
}

.about-content strong {
  color: var(--text);
}

.author-block {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.author-block img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-glow);
  filter: drop-shadow(0 0 8px rgba(0, 200, 255, 0.3));
}

.author-block .signature {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}

/* ─── Blog Index ──────────────────────────────────── */

.blog-hero {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem);
}

.blog-hero h1 {
  margin-bottom: 1rem;
}

.blog-hero .lead {
  margin-bottom: 0;
}

.post-list {
  max-width: 720px;
  margin: 0 auto;
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-item {
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
}

.post-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.post-title {
  margin-bottom: 0.5rem;
}

.post-title a {
  color: var(--text);
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--blue);
}

.post-excerpt {
  color: var(--text-muted);
  margin: 0;
}

.empty-state {
  max-width: 720px;
  margin: 0 auto;
  color: var(--text-muted);
  font-style: italic;
}

/* ─── Blog Post — markdown content typography ───────── */

.page-wrapper blockquote {
  margin: 1.75rem auto;
  max-width: 720px;
  padding: 0.75rem 1.5rem;
  border-left: 3px solid var(--blue);
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

.page-wrapper blockquote p:last-child {
  margin-bottom: 0;
}

.page-wrapper code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 6px;
  color: var(--yellow);
}

.page-wrapper pre {
  max-width: 720px;
  margin: 1.75rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
}

.page-wrapper pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.page-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
  margin: 1.75rem auto;
}

.page-wrapper hr {
  max-width: 720px;
  margin: 2.5rem auto;
  border: none;
  border-top: 1px solid var(--border);
}

.page-wrapper table {
  max-width: 720px;
  margin: 1.75rem auto;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.page-wrapper th,
.page-wrapper td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  text-align: left;
}

.page-wrapper th {
  background: var(--bg-card);
  font-weight: 700;
}

.page-wrapper figure.diagram {
  max-width: 760px;
  margin: 2.25rem auto;
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.page-wrapper figure.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}

.page-wrapper figure.diagram figcaption {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Markdown posts render h1/p/ul directly into .page-wrapper — constrain to reading width */
.page-wrapper > h1,
.page-wrapper > h2,
.page-wrapper > h3,
.page-wrapper > p,
.page-wrapper > ul,
.page-wrapper > ol {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.page-wrapper > h1 {
  margin-top: 1rem;
}

/* ─── Footer ─────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.footer-inner p {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.footer-inner a {
  color: var(--text-muted);
  font-weight: 700;
}
.footer-inner a:hover { color: var(--blue); }

.sparkle {
  display: inline-block;
  color: var(--yellow);
  animation: sparkle 2s ease-in-out infinite;
}

/* ─── Animations ─────────────────────────────────── */

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 200, 255, 0.3); }
  50%       { box-shadow: 0 4px 40px rgba(255, 20, 147, 0.4); }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50%       { opacity: 0.6; transform: scale(1.3) rotate(20deg); }
}

/* ─── Responsive ─────────────────────────────────── */

@media (max-width: 768px) {
  .nav-inner { padding: 0.6rem 1rem; }
  .nav-links a { font-size: 0.8rem; padding: 0.3rem 0.5rem; }
  .page-wrapper { padding: 1.5rem 1rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 1.5rem; }
}
