:root {
  --background: 52 50% 96%;
  --foreground: 180 21% 6%;
  --card: 0 0% 100%;
  --card-foreground: 180 21% 6%;
  --primary: 158 48% 40%;
  --primary-foreground: 0 0% 100%;
  --secondary: 52 20% 92%;
  --secondary-foreground: 180 21% 6%;
  --muted-foreground: 180 10% 40%;
  --accent: 27 87% 55%;
  --border: 52 20% 85%;
  --radius: 0.75rem;
  --mesh-1: hsla(158, 48%, 78%, 0.35);
  --mesh-2: hsla(27, 87%, 80%, 0.25);
  --glass-bg: hsla(52, 50%, 96%, 0.82);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 180 21% 6%;
    --foreground: 52 50% 96%;
    --card: 180 20% 9%;
    --card-foreground: 52 50% 96%;
    --primary: 158 48% 50%;
    --primary-foreground: 180 21% 6%;
    --secondary: 180 20% 14%;
    --secondary-foreground: 52 50% 96%;
    --muted-foreground: 180 10% 65%;
    --accent: 27 87% 62%;
    --border: 180 20% 16%;
    --mesh-1: hsla(158, 48%, 22%, 0.28);
    --mesh-2: hsla(27, 87%, 24%, 0.18);
    --glass-bg: hsla(180, 21%, 6%, 0.84);
  }
}

:root[data-theme="dark"] {
  --background: 180 21% 6%;
  --foreground: 52 50% 96%;
  --card: 180 20% 9%;
  --card-foreground: 52 50% 96%;
  --primary: 158 48% 50%;
  --primary-foreground: 180 21% 6%;
  --secondary: 180 20% 14%;
  --secondary-foreground: 52 50% 96%;
  --muted-foreground: 180 10% 65%;
  --accent: 27 87% 62%;
  --border: 180 20% 16%;
  --mesh-1: hsla(158, 48%, 22%, 0.28);
  --mesh-2: hsla(27, 87%, 24%, 0.18);
  --glass-bg: hsla(180, 21%, 6%, 0.84);
}

.theme-toggle-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.theme-toggle-btn:hover {
  border-color: hsl(var(--primary));
}

.theme-toggle-btn .icon-sun {
  display: none;
}

.theme-toggle-btn .icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle-btn .icon-sun {
  display: block;
  color: hsl(42 96% 68%);
}

:root[data-theme="dark"] .theme-toggle-btn .icon-moon {
  display: none;
}

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

html {
  scroll-behavior: smooth;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: hsl(var(--background));
  background-image:
    radial-gradient(at 12% 8%, var(--mesh-1) 0px, transparent 52%),
    radial-gradient(at 88% 14%, var(--mesh-2) 0px, transparent 48%);
  background-attachment: fixed;
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Sticky Glass Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  object-fit: cover;
  border: 1px solid hsl(var(--border));
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
  background: hsl(var(--primary) / 0.14);
  border: 1px solid hsl(var(--primary) / 0.35);
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.brand-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-sub {
  display: block;
  font-size: 0.66rem;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.site-nav a:hover {
  color: hsl(var(--foreground));
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 0.5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.05rem;
  border-radius: 0.5rem;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.15s ease;
}

.btn-secondary:hover {
  border-color: hsl(var(--primary));
}

/* Hero */
.hero {
  padding: 4.5rem 0 3.75rem;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--primary) / 0.3);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 0.74rem;
  font-weight: 500;
  margin-bottom: 1.4rem;
}

.pulse-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 9999px;
  background: hsl(var(--primary));
}

.hero h1 {
  margin: 0 auto 1.15rem;
  max-width: 48rem;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.hero-lead {
  margin: 0 auto 1.85rem;
  max-width: 40rem;
  font-size: 1.06rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.65;
}

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

/* Sections & Cards */
.section {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.section-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--primary));
  margin: 0 0 0.35rem;
}

.section-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

.pillar-card {
  justify-content: space-between;
  padding: 1.6rem;
}

.pillar-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.25rem 0.65rem;
  border-radius: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.pillar-emerald {
  background: hsla(158, 64%, 45%, 0.12);
  color: hsl(158, 52%, 34%);
  border: 1px solid hsla(158, 64%, 45%, 0.25);
}

.pillar-amber {
  background: hsla(32, 92%, 52%, 0.12);
  color: hsl(28, 78%, 38%);
  border: 1px solid hsla(32, 92%, 52%, 0.28);
}

.pillar-sky {
  background: hsla(199, 86%, 48%, 0.12);
  color: hsl(201, 78%, 36%);
  border: 1px solid hsla(199, 86%, 48%, 0.28);
}

@media (prefers-color-scheme: dark) {
  .pillar-emerald {
    color: hsl(158, 62%, 62%);
  }
  .pillar-amber {
    color: hsl(34, 92%, 64%);
  }
  .pillar-sky {
    color: hsl(199, 88%, 64%);
  }
}

.pillar-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--primary));
}

.pillar-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.76rem;
}

.pillar-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pillar-footer {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.73rem;
}

.value-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
}

.tag-pill:hover,
.tag-pill.is-active {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 820px) {
  .contact-grid {
    grid-template-columns: 5fr 7fr;
  }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

@media (min-width: 560px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.78rem;
  font-weight: 600;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: inherit;
  font-size: 0.875rem;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid hsl(var(--primary) / 0.45);
  border-color: hsl(var(--primary));
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.status-line {
  margin: 0;
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
}

.status-line.is-success {
  color: hsl(var(--primary));
  font-weight: 600;
}

.status-line.is-error {
  color: hsl(var(--accent));
  font-weight: 600;
}

.e2ee-note {
  font-size: 0.74rem;
  color: hsl(var(--muted-foreground));
  border-top: 1px solid hsl(var(--border));
  padding-top: 0.75rem;
}

/* Blog Article */
.article-wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.article-meta {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.article-body {
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.75;
}

.article-body h2,
.article-body h3 {
  margin: 1.75rem 0 0.6rem;
  letter-spacing: -0.02em;
}

.article-body p {
  margin: 0 0 1.1rem;
}

.article-body ul {
  margin: 0 0 1.1rem;
  padding-left: 1.35rem;
}

.article-body code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.3rem;
  background: hsl(var(--secondary));
  font-size: 0.88em;
}

.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.post-images img {
  border-radius: 0.55rem;
  border: 1px solid hsl(var(--border));
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--secondary) / 0.45);
  padding: 2.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.location-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 0.35rem;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.25);
  color: hsl(var(--primary));
  font-size: 0.72rem;
}

@media (max-width: 640px) {
  .site-nav {
    gap: 0.85rem;
    font-size: 0.8rem;
  }
}
