:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #0b1220;
  --muted: rgba(11, 18, 32, 0.66);
  --border: rgba(11, 18, 32, 0.12);
  --shadow: 0 14px 40px rgba(11, 18, 32, 0.07);
  --shadow-soft: 0 10px 24px rgba(11, 18, 32, 0.06);
  --accent: #2457d6; /* steel/icy blue */
  --accent-2: rgba(36, 87, 214, 0.14);
  --accent-3: rgba(125, 211, 252, 0.22); /* airy sky */
  --radius: 16px;
  --radius-sm: 12px;
  --maxw: 1100px;
  --header-h: 72px;
  --grid: radial-gradient(circle at 1px 1px, rgba(2, 6, 23, 0.06) 1px, transparent 0);
}

[data-theme="dark"] {
  --bg: #0a0f18;
  --surface: #0f1725;
  --surface-2: #0c1320;
  --text: #e7eefc;
  --muted: rgba(231, 238, 252, 0.72);
  --border: rgba(231, 238, 252, 0.14);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.34);
  --accent: #7dd3fc;
  --accent-2: rgba(125, 211, 252, 0.14);
  --accent-3: rgba(36, 87, 214, 0.22);
  --grid: radial-gradient(circle at 1px 1px, rgba(231, 238, 252, 0.08) 1px, transparent 0);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(900px 520px at 18% 0%, var(--accent-3), transparent 60%),
    radial-gradient(760px 520px at 88% 6%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 62%),
    linear-gradient(180deg, rgba(11, 18, 32, 0.02), transparent 18%),
    var(--bg);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

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

.container {
  width: min(100%, calc(var(--maxw) + 48px));
  padding: 0 24px;
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}
.skip-link:focus {
  left: 12px;
  z-index: 9999;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.header[data-elevate="true"] {
  border-bottom-color: var(--border);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.05);
}

.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 160ms ease;
}
.brand:hover {
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}
.brand__mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, transparent));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}
.brand__text {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav {
  margin-left: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.nav__link {
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  transition: color 160ms ease, background 160ms ease;
}
.nav__link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-2) 70%, transparent);
}

.header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.theme-toggle:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}
.theme-toggle__track {
  width: 34px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  display: inline-flex;
  align-items: center;
  padding: 1px;
}
.theme-toggle__thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 6px 14px rgba(2, 6, 23, 0.18);
  transform: translateX(0);
  transition: transform 220ms ease;
}
[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(16px);
}
.theme-toggle__label {
  font-size: 13px;
  font-weight: 500;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}
.button:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}
.button:active {
  transform: translateY(0);
}
.button--primary {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 90%, white), var(--accent));
  color: white;
  box-shadow: 0 16px 34px color-mix(in srgb, var(--accent) 18%, transparent);
}
[data-theme="dark"] .button--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #ffffff), var(--accent));
}
.button--ghost {
  background: transparent;
}

.hero {
  position: relative;
  padding: 72px 0 42px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -240px -40px auto -40px;
  height: 520px;
  background:
    radial-gradient(900px 420px at 20% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    radial-gradient(820px 520px at 78% 5%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 24px 24px;
  background-image: var(--grid);
  opacity: 0.35;
  mask-image: radial-gradient(ellipse at 30% 10%, rgba(0, 0, 0, 0.8), transparent 55%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
}

.kicker {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.lead {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 54ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 88%, transparent), var(--surface));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel__top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
}
.panel__dots {
  display: inline-flex;
  gap: 6px;
}
.panel__dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
}
.panel__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.panel__status {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  padding: 5px 10px;
  border-radius: 999px;
}

/* subtle media */
.media {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.media img {
  width: 100%;
  height: auto;
  display: block;
}
.media svg {
  width: 100%;
  height: auto;
  display: block;
}

.media--photo img {
  height: clamp(180px, 32vw, 320px);
  object-fit: cover;
  object-position: 60% 48%;
  filter: saturate(0.85) contrast(1.06);
}

/* Make real photos match the site's icy/steel palette */
.media--photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 360px at 18% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10));
  mix-blend-mode: multiply;
  opacity: 0.55;
}
[data-theme="dark"] .media--photo::after {
  background:
    radial-gradient(900px 360px at 18% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 62%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), transparent 58%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22));
  mix-blend-mode: screen;
  opacity: 0.50;
}

.media--clipart img {
  height: clamp(140px, 22vw, 220px);
  object-fit: contain;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}
.panel__code {
  margin: 0;
  padding: 14px 16px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  overflow: auto;
  color: color-mix(in srgb, var(--text) 90%, transparent);
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.02), transparent 35%),
    transparent;
}
.panel__code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.section {
  padding: 56px 0;
}
.section--subtle {
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-2) 60%, transparent));
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.section__head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 22px;
  max-width: 72ch;
}

h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

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

.services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.services__col {
  display: grid;
  gap: 12px;
}
.service {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-soft);
}
.service p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.approach {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.approach__item {
  grid-column: span 4;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  padding: 14px;
}
.approach__item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.approach__item:nth-child(4) {
  grid-column: 3 / span 5;
}
.approach__item:nth-child(5) {
  grid-column: 8 / span 5;
}

.work {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.work__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.work__item ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.work__item li {
  margin: 6px 0;
}

.contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.form {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.contact .media {
  max-width: 860px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.field--full {
  grid-column: 1 / -1;
}
.field__label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.field__input {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  font: inherit;
}
.field__input::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.field__input:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 4px var(--accent-2);
}
.field__textarea {
  resize: vertical;
  min-height: 130px;
}

.form__row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.form__note {
  font-size: 13px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.link {
  display: inline-flex;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  transition: transform 150ms ease, background 150ms ease;
}
.link:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.footer {
  padding: 26px 0 40px;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* Articles page */
.article-tools {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 12px;
  margin: 14px 0 16px;
}
.search {
  display: grid;
  gap: 8px;
}
.article-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 14px;
  align-items: start;
}
.article-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.article-list__meta {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
  font-size: 13px;
}
.article-list__items {
  display: grid;
}
.article-item {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  cursor: pointer;
  transition: background 150ms ease;
}
.article-item:hover {
  background: color-mix(in srgb, var(--surface-2) 65%, transparent);
}
.article-item[aria-current="true"] {
  background: color-mix(in srgb, var(--accent-2) 80%, transparent);
}
.article-item__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.article-item__meta {
  margin: 6px 0 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12.5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 74%, transparent);
}
.badge--accent {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: var(--accent-2);
  color: color-mix(in srgb, var(--accent) 85%, var(--text));
}
.tag-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  flex: 0 0 auto;
}

.article-view {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-soft);
}
.article-view__inner {
  padding: 18px 18px 16px;
}
.article-title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}
.article-sub {
  margin: 10px 0 0;
  color: var(--muted);
}
.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.prose {
  margin-top: 14px;
  color: color-mix(in srgb, var(--text) 92%, transparent);
}
.prose p {
  margin: 12px 0;
  color: var(--muted);
}
.prose h3 {
  margin-top: 18px;
}
.prose ul {
  margin: 10px 0 14px;
  padding-left: 18px;
  color: var(--muted);
}
.prose li {
  margin: 6px 0;
}
.codeblock {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.codeblock__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-2) 56%, transparent);
  font-size: 12.5px;
  color: var(--muted);
}
.codeblock pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.55;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.02), transparent 35%);
}
.codeblock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.link--inline {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link--inline:hover {
  transform: none;
  background: transparent;
  color: var(--text);
}

@media (max-width: 920px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }
  .nav {
    display: none;
  }
  .contact {
    grid-template-columns: 1fr;
  }
  .approach__item {
    grid-column: span 6;
  }
  .approach__item:nth-child(4),
  .approach__item:nth-child(5) {
    grid-column: span 6;
  }
}

@media (max-width: 560px) {
  .header__inner {
    gap: 10px;
  }
  .header__actions .button--primary {
    display: none;
  }
  .services {
    grid-template-columns: 1fr;
  }
  .approach__item {
    grid-column: span 12;
  }
  .approach__item:nth-child(4),
  .approach__item:nth-child(5) {
    grid-column: span 12;
  }
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .article-tools {
    grid-template-columns: 1fr;
  }
  .article-layout {
    grid-template-columns: 1fr;
  }
}
