:root {
  color-scheme: dark;
  --bg: #050505;
  --panel: #101010;
  --panel-strong: #171717;
  --text: #f7f7f1;
  --muted: #a8a8a0;
  --line: rgba(255, 255, 255, 0.14);
  --white: #ffffff;
  --black: #050505;
  --cyan: #20d7ff;
  --amber: #f4b84f;
  --pink: #f05aa8;
  --green: #76f18a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background:
    radial-gradient(circle at 84% 18%, rgba(32, 215, 255, 0.16), transparent 30%),
    radial-gradient(circle at 14% 78%, rgba(240, 90, 168, 0.12), transparent 28%),
    #050505;
}

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

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

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.17;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: rgba(5, 5, 5, 0.68);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--white);
  color: var(--black);
  font-size: 0.86rem;
  font-weight: 900;
}

.site-nav {
  gap: clamp(12px, 2vw, 26px);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav button:hover,
.site-nav button:focus-visible {
  color: var(--text);
}

.nav-admin {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  min-width: 94px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.language-switch button {
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.language-switch button.is-active {
  background: var(--white);
  color: var(--black);
}

.language-switch button:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.hero {
  position: relative;
  min-height: 94svh;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 128px clamp(18px, 5vw, 72px) 86px;
  border-bottom: 1px solid var(--line);
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  z-index: -3;
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.72) 42%, rgba(5, 5, 5, 0.2) 100%),
    linear-gradient(0deg, rgba(5, 5, 5, 0.88) 0%, transparent 45%);
}

.hero-content {
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(2.65rem, 6.4vw, 5.9rem);
  line-height: 0.98;
  letter-spacing: 0;
  max-width: 13.5ch;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.75rem, 3.15vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.22rem;
}

.hero-copy {
  width: min(680px, 100%);
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.16rem);
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--white);
  font-weight: 800;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button-light {
  background: var(--white);
  color: var(--black);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
}

.hero-metrics {
  position: absolute;
  left: clamp(18px, 5vw, 72px);
  right: clamp(18px, 5vw, 72px);
  bottom: 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.hero-metrics span {
  min-width: 0;
  padding: 13px 12px;
  background: rgba(5, 5, 5, 0.78);
  color: var(--muted);
  text-align: center;
  font-size: 0.84rem;
  font-weight: 700;
}

.section {
  padding: clamp(70px, 10vw, 130px) clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
}

.blog-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: clamp(28px, 6vw, 90px);
  align-items: end;
  padding-top: 170px;
}

.blog-page-hero h1 {
  max-width: none;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
}

.blog-page-hero > p {
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.intro-section,
.split-section,
.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1fr);
  gap: clamp(26px, 6vw, 92px);
  align-items: start;
}

.intro-section > p,
.signal-list p,
.project-card p,
.blog-card p,
.admin-note {
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.project-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card,
.blog-card,
.admin-shell {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
}

.project-card,
.blog-card {
  min-height: 100%;
  padding: 22px;
}

.project-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.project-card li,
.blog-card .tag {
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.project-visual {
  position: relative;
  height: 160px;
  margin: -6px -6px 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent),
    #090909;
  border: 1px solid var(--line);
}

.project-visual::before {
  position: absolute;
  inset: 18px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.project-visual span {
  position: absolute;
  width: 42px;
  height: 42px;
  border: 2px solid var(--cyan);
}

.project-visual span:nth-child(1) {
  top: 28px;
  left: 34px;
}

.project-visual span:nth-child(2) {
  top: 68px;
  left: 96px;
}

.project-visual span:nth-child(3) {
  right: 42px;
  bottom: 30px;
}

.nodes span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 42px rgba(244, 184, 79, 0.5);
}

.pulse span {
  border-color: var(--pink);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(240, 90, 168, 0.4);
}

.accent-cyan {
  border-top-color: var(--cyan);
}

.accent-amber {
  border-top-color: var(--amber);
}

.accent-pink {
  border-top-color: var(--pink);
}

.signal-list {
  display: grid;
  gap: 18px;
}

.signal-list > div {
  position: relative;
  padding: 24px 24px 24px 58px;
  border-left: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.signal-dot {
  position: absolute;
  top: 29px;
  left: 24px;
  width: 14px;
  height: 14px;
  background: var(--white);
}

.signal-dot.cyan {
  background: var(--cyan);
}

.signal-dot.amber {
  background: var(--amber);
}

.signal-dot.pink {
  background: var(--pink);
}

.blog-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 620px;
  color: var(--muted);
}

.blog-card time {
  color: var(--muted);
  font-size: 0.84rem;
}

.blog-card h3 {
  margin-top: 18px;
}

.blog-card p {
  flex: 1;
}

.blog-card .tag {
  align-self: flex-start;
}

.admin-section {
  display: none;
}

.admin-section.is-visible {
  display: block;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding: clamp(22px, 5vw, 46px);
}

.admin-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
}

.dialog-panel {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: min(88vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.94);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.56);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

body.admin-dialog-open {
  overflow: hidden;
}

body.admin-dialog-open .site-header,
body.admin-dialog-open main,
body.admin-dialog-open .site-footer {
  filter: blur(10px);
  transform: scale(0.992);
  pointer-events: none;
  user-select: none;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #090909;
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--white);
}

textarea {
  resize: vertical;
}

.form-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-status {
  min-height: 24px;
  color: var(--green);
  font-weight: 800;
}

.admin-post-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.admin-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.admin-post strong,
.admin-post span {
  display: block;
}

.admin-post span {
  color: var(--muted);
  font-size: 0.84rem;
}

.admin-post-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.mini-button.danger {
  background: transparent;
  color: var(--text);
}

.hidden {
  display: none;
}

.contact-section {
  align-items: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 72px);
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-header {
    position: sticky;
    align-items: flex-start;
    flex-direction: column;
    padding-block: 14px;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .language-switch {
    width: 120px;
  }

  .hero {
    min-height: auto;
    padding-top: 72px;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(5, 5, 5, 0.95), rgba(5, 5, 5, 0.58)),
      linear-gradient(0deg, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.2));
  }

  .hero-metrics,
  .project-grid,
  .blog-grid,
  .intro-section,
  .split-section,
  .contact-section,
  .blog-page-hero,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-post {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    position: static;
    margin-top: 46px;
  }

  h1 {
    max-width: 11ch;
  }
}

@media (max-width: 560px) {
  .brand {
    width: 100%;
  }

  .hero {
    padding-inline: 16px;
  }

  .section {
    padding-inline: 16px;
  }

  .hero-actions,
  .form-actions,
  .site-footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-metrics span {
    text-align: left;
  }
}
