:root {
  --bg: #0b1020;
  --card: #111832;
  --card-deep: #0e1733;
  --ink: #e9efff;
  --muted: #aebbdc;
  --accent: #6aa3ff;
  --accent-strong: #1d4ed8;
  --border: #1f2b52;
  --border-bright: #2a3a6a;
  --max-width: 980px;
  --radius: 14px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 7%, rgba(29, 78, 216, 0.14), transparent 24rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 14px/1.6 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(31, 43, 82, 0.9);
  background: rgba(11, 16, 32, 0.9);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
}

.topbar-inner,
.footer-inner {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.topbar-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}

.brand:hover,
.brand:focus-visible {
  color: #9bb8ff;
  text-shadow: 0 0 16px rgba(106, 163, 255, 0.7);
  transform: translateY(-1px);
}

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

.nav a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: var(--card-deep);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav a {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.nav a:hover,
.nav a.active,
.btn:hover {
  border-color: var(--accent);
}

.nav a.active {
  background: #15235a;
  color: #cfe0ff;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  border-color: #365bd6;
  background: linear-gradient(180deg, #1d4ed8, #1e40af);
  color: #fff;
}

.btn.primary:hover {
  border-color: #7aabff;
  background: linear-gradient(180deg, #2459ea, #1e40af);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 38px;
  margin-left: auto;
  padding: 9px;
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  background: var(--card-deep);
  cursor: pointer;
}

.menu-toggle span:not(.sr-only) {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--ink);
}

.wrap {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 18px auto 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(17, 24, 50, 0.98), rgba(14, 23, 51, 0.98));
  box-shadow: var(--shadow);
}

.section-grid.section-highlight > .card,
.section-grid.section-highlight > .project-list .card,
.contact-card.section-highlight {
  animation: section-highlight 900ms ease-out;
}

@keyframes section-highlight {
  0%, 100% {
    border-color: var(--border);
    box-shadow: var(--shadow);
  }
  35% {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(106, 163, 255, 0.18), var(--shadow);
  }
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 64px;
  overflow: hidden;
  padding: clamp(32px, 5vw, 52px);
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -11rem;
  right: -8rem;
  width: 30rem;
  height: 30rem;
  border: 1px solid rgba(106, 163, 255, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 60px rgba(106, 163, 255, 0.025),
    0 0 0 120px rgba(106, 163, 255, 0.018);
}

.eyebrow,
.section-number,
.project-type {
  color: #9bb8ff;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

.hero h1 {
  max-width: none;
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 5.5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.typing-cursor {
  display: inline-block;
  width: 0.075em;
  height: 0.86em;
  margin-left: 0.12em;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -0.08em;
  animation: cursor-idle 1.05s steps(1, end) infinite;
}

@keyframes cursor-idle {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

.hero-intro {
  max-width: 590px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 48px 0 0;
}

.section-heading {
  padding: 0;
}

.section-number {
  margin: 0 0 6px;
}

.section-heading h2,
.contact-card h2 {
  margin: 0;
  color: #fff;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.section-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.content-card {
  padding: clamp(26px, 5vw, 44px);
  color: var(--muted);
}

.policy-card {
  width: 100%;
  max-width: none;
  margin: 0 0 48px;
  padding: clamp(26px, 5vw, 44px);
  color: var(--muted);
}

.policy-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.policy-card h2 {
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: #fff;
  font-size: 22px;
  line-height: 1.25;
}

.policy-card p {
  max-width: none;
  margin: 0 0 16px;
}

.policy-card .eyebrow {
  margin-bottom: 10px;
}

.policy-effective {
  margin-top: 12px !important;
  color: #cfe0ff;
}

.policy-card ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

.policy-card li {
  margin: 6px 0;
}

.policy-card code {
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  background: var(--card-deep);
  color: #cfe0ff;
  padding: 2px 5px;
}

.policy-card a {
  color: #9bb8ff;
}

.policy-card a:hover {
  color: #fff;
}

.tool-card h3 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.tool-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 160ms ease, text-shadow 160ms ease;
}

.tool-title-link:hover,
.tool-title-link:focus-visible {
  color: #9bb8ff;
  text-shadow: 0 0 14px rgba(106, 163, 255, 0.45);
}

.tool-card-content {
  min-width: 0;
}

.tool-detail-card {
  width: 100%;
  margin: 0 0 48px;
}

.tool-detail-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.content-card.tool-detail-card > p {
  max-width: none;
  text-align: justify;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.content-card.tool-card .tool-card-content > p {
  max-width: none;
  text-align: justify;
}

.tool-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  object-fit: contain;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.tool-actions .btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.support-card .btn.primary {
  animation: support-glow 1.8s ease-in-out infinite;
}

.support-card .btn.primary img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

@keyframes support-glow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(246, 195, 67, 0);
  }
  50% {
    box-shadow: 0 0 14px rgba(246, 195, 67, 0.62), 0 0 28px rgba(246, 195, 67, 0.22);
  }
}

.btn:disabled {
  border-color: var(--border);
  opacity: 0.48;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--border);
  transform: none;
}

.content-card p {
  max-width: 650px;
  margin: 0 0 16px;
}

.content-card .lead {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.tag-list span,
.project-meta li {
  border: 1px solid #2b4ca6;
  border-radius: 999px;
  background: #15235a;
  color: #cfe0ff;
  font-size: 12px;
}

.tag-list span {
  padding: 4px 10px;
}

.tool-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.tool-preview {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  border-radius: 12px;
  background: #080d1b;
}

.tool-preview-wide {
  grid-column: 1 / -1;
}

.tool-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.tool-preview figcaption {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tool-resource-links {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0 0;
  padding-top: 16px;
  padding-left: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.tool-resource-links li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tool-resource-links li::before {
  content: "-";
  color: var(--muted);
}

.tool-resource-link {
  color: #9bb8ff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.tool-resource-link:hover,
.tool-resource-link:focus-visible {
  color: #fff;
}

.project-list {
  display: grid;
  gap: 14px;
}

.project-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 28px;
  transition: border-color 180ms ease, transform 180ms ease;
}

.project-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
}

.project-index {
  color: #6f82b6;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.project-type {
  margin: 0 0 4px;
}

.project-card h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
}

.project-card p:not(.project-type) {
  max-width: 560px;
  margin: 10px 0 18px;
  color: var(--muted);
}

.review-card blockquote {
  max-width: none;
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

.project-card.review-card {
  grid-template-columns: minmax(0, 1fr);
}

.review-rating {
  margin-bottom: 8px;
  color: #f6c343;
  font-size: 15px;
  letter-spacing: 0.04em;
  line-height: 1;
}

.review-card .review-author {
  margin: 12px 0 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.project-meta {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-meta li {
  padding: 2px 9px;
}

.project-arrow {
  color: var(--accent);
  font-size: 20px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  margin-top: 48px;
  padding: clamp(30px, 6vw, 56px);
}

.contact-card .eyebrow {
  margin-bottom: 8px;
}

.contact-card p:last-child {
  max-width: 580px;
  margin: 12px 0 0;
  color: var(--muted);
}

.contact-card .btn {
  flex: 0 0 auto;
}

.blog-hero {
  margin: 18px auto 48px;
  padding: clamp(28px, 5vw, 56px);
}

.blog-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.blog-hero p:last-child {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.blog-list-section {
  padding-bottom: 48px;
}

.blog-status {
  padding: 22px 0;
  color: var(--muted);
}

.blog-card h2 {
  margin: 0;
  color: #fff;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.project-card.blog-card {
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
}

.blog-card .project-index {
  align-self: center;
}

.blog-title-link {
  color: inherit;
  text-decoration: none;
}

.blog-title-link:hover,
.blog-title-link:focus-visible {
  color: #9bb8ff;
}

.project-card.blog-card .blog-date {
  margin: 8px 0;
}

.project-card.blog-card .blog-excerpt {
  width: 100%;
  max-width: none;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.blog-read-more {
  color: #9bb8ff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.blog-read-more:hover,
.blog-read-more:focus-visible {
  color: #fff;
}

.blog-date {
  margin: 8px 0 16px;
  color: #9bb8ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-content {
  max-width: none;
  color: var(--muted);
  line-height: 1.75;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  white-space: pre-wrap;
}

.blog-post-card {
  width: 100%;
  max-width: none;
  margin: 0 0 48px;
  padding: 28px;
}

.blog-post-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.blog-post-card .blog-date {
  margin: 8px 0;
}

.blog-back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: #9bb8ff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.blog-back-link:hover {
  color: #fff;
}

.footer {
  position: sticky;
  bottom: 0;
  z-index: 90;
  margin-top: 18px;
  border-top: 1px solid var(--border);
  background: rgba(11, 16, 32, 0.92);
  backdrop-filter: blur(16px);
}

.blog-page,
.policy-page,
.tool-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.blog-page > .wrap,
.policy-page > .wrap,
.tool-page > .wrap {
  flex: 1 0 auto;
  width: min(calc(100% - 32px), var(--max-width));
}

.blog-page > .footer,
.policy-page > .footer,
.tool-page > .footer {
  flex-shrink: 0;
  margin-top: auto;
}

.footer-inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.back-to-top {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 780px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 42px;
    padding: 44px 28px 28px;
  }

  .section-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 40px;
  }

  .section-heading {
    max-width: 520px;
  }

  .contact-card {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 40px;
  }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: 64px;
  }

  .topbar-inner {
    min-height: 52px;
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  .nav {
    display: none;
    width: 100%;
    margin: -2px 0 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .nav.open {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nav a {
    min-height: 40px;
  }

  .hero h1 {
    font-size: clamp(38px, 13vw, 54px);
    white-space: normal;
  }

  .hero-intro {
    font-size: 16px;
  }

  .project-card {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 22px 18px;
  }

  .tool-showcase {
    grid-template-columns: 1fr;
  }

  .tool-preview-wide {
    grid-column: auto;
  }

  .blog-post-card {
    padding: 22px 18px;
  }

  .project-arrow {
    display: none;
  }

  .footer-inner {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0;
  }

  .footer-inner > p {
    margin: 0;
  }

  .footer-links {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
