:root,
html[data-theme="light"] {
  --ink: #101820;
  --ink-soft: #334155;
  --muted: #64748b;
  --paper: #e8eef4;
  --panel: rgba(248, 251, 255, 0.72);
  --line: rgba(16, 24, 32, 0.12);
  --accent: #0b6e6a;
  --glow-a: #b9d4e8;
  --glow-b: #9fd0c8;
  --missing: #94a3b8;
  --toggle-bg: rgba(248, 251, 255, 0.85);
  --toggle-border: rgba(16, 24, 32, 0.14);
  --atmosphere:
    radial-gradient(40rem 26rem at 6% -10%, var(--glow-a), transparent 70%),
    radial-gradient(34rem 22rem at 96% 0%, var(--glow-b), transparent 68%),
    linear-gradient(165deg, #eef3f8 0%, #e2eaf2 45%, #e8eef4 100%);
  --radius: 16px;
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --ink: #e8eef4;
  --ink-soft: #c2ccd6;
  --muted: #93a1b0;
  --paper: #0f161d;
  --panel: rgba(22, 32, 42, 0.78);
  --line: rgba(232, 238, 244, 0.12);
  --accent: #5ec4b8;
  --glow-a: #1a3a4d;
  --glow-b: #15403c;
  --missing: #6b7a88;
  --toggle-bg: rgba(22, 32, 42, 0.9);
  --toggle-border: rgba(232, 238, 244, 0.16);
  --atmosphere:
    radial-gradient(40rem 26rem at 6% -10%, var(--glow-a), transparent 70%),
    radial-gradient(34rem 22rem at 96% 0%, var(--glow-b), transparent 68%),
    linear-gradient(165deg, #121a22 0%, #0f161d 45%, #0c1218 100%);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--atmosphere);
  animation: wash 16s ease-in-out infinite alternate;
}

@keyframes wash {
  from { filter: saturate(1); }
  to { filter: saturate(1.1); }
}

.site-header {
  width: min(1100px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 3.5rem 0 2rem;
  animation: rise 0.7s ease both;
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.header-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--toggle-bg));
}

.nav-btn:hover,
.nav-btn:focus-visible,
.icon-btn:hover,
.icon-btn:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.icon-btn,
.theme-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--toggle-border);
  border-radius: 999px;
  background: var(--toggle-bg);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.theme-icon {
  display: none;
  line-height: 0;
}

html[data-theme="light"] .theme-icon-moon,
html[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  margin: 0.85rem 0 0;
  max-width: 34rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.view {
  width: min(1100px, calc(100% - 2.5rem));
  margin: 0 auto 4rem;
  animation: rise 0.45s ease both;
}

.catalog .project {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--line);
  animation: rise 0.65s ease both;
}

.catalog .project:nth-child(1) { animation-delay: 0.04s; }
.catalog .project:nth-child(2) { animation-delay: 0.08s; }
.catalog .project:nth-child(3) { animation-delay: 0.12s; }
.catalog .project:nth-child(4) { animation-delay: 0.16s; }
.catalog .project:nth-child(5) { animation-delay: 0.2s; }
.catalog .project:nth-child(6) { animation-delay: 0.24s; }
.catalog .project:nth-child(7) { animation-delay: 0.28s; }
.catalog .project:nth-child(n+8) { animation-delay: 0.32s; }

.catalog .project:last-child {
  border-bottom: 1px solid var(--line);
}

.project-meta {
  flex: 1 1 16rem;
  min-width: 0;
}

.project-meta h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.project-meta p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 38rem;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.badge-btn:hover,
.badge-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.badge-prod {
  color: #1f6b45;
  background: #d8f0e2;
  border-color: #a8d9bb;
}

.badge-prod:hover,
.badge-prod:focus-visible {
  color: #145334;
  background: #c7e8d5;
  border-color: #7fc49a;
}

.badge-demo {
  color: #8a5a12;
  background: #f7e7c4;
  border-color: #e4c78a;
}

.badge-demo:hover,
.badge-demo:focus-visible {
  color: #6d450b;
  background: #f1dbad;
  border-color: #d4b36a;
}

html[data-theme="dark"] .badge-prod {
  color: #b7ebc9;
  background: rgba(46, 125, 80, 0.28);
  border-color: rgba(126, 196, 154, 0.45);
}

html[data-theme="dark"] .badge-prod:hover,
html[data-theme="dark"] .badge-prod:focus-visible {
  color: #d4f5e0;
  background: rgba(46, 125, 80, 0.4);
  border-color: rgba(126, 196, 154, 0.65);
}

html[data-theme="dark"] .badge-demo {
  color: #f0d49a;
  background: rgba(168, 110, 30, 0.28);
  border-color: rgba(228, 199, 138, 0.45);
}

html[data-theme="dark"] .badge-demo:hover,
html[data-theme="dark"] .badge-demo:focus-visible {
  color: #f7e4b5;
  background: rgba(168, 110, 30, 0.4);
  border-color: rgba(228, 199, 138, 0.65);
}

.badge-lock {
  display: block;
  flex-shrink: 0;
  opacity: 0.9;
}

.info-view {
  max-width: min(960px, calc(100% - 2.5rem));
}

.info-intro {
  margin: 0 0 1.5rem;
  max-width: 46rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.info-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin: 0;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.info-section:last-child {
  border-bottom: 1px solid var(--line);
}

.info-media {
  width: min(100%, 11.5rem);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.info-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info-copy h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.service-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.service-list li {
  position: relative;
  padding-left: 0.95rem;
}

.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

@media (min-width: 560px) {
  .service-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .info-section {
    grid-template-columns: 11.5rem minmax(0, 1fr);
    gap: 1.5rem;
    padding: 1.65rem 0;
    align-items: start;
  }

  .info-media {
    width: 11.5rem;
  }
}

@media (min-width: 960px) {
  .service-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.site-footer {
  width: min(1100px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.footer-company {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.footer-copy {
  margin-top: 0.35rem;
}

.footer-updated {
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 820px) {
  .site-header {
    padding: 4.5rem 0 2.4rem;
  }

  .catalog .project {
    align-items: center;
    padding: 1.5rem 0;
  }
}

@media (max-width: 640px) {
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .nav-btn {
    min-height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .site-header,
  .view,
  .catalog .project {
    animation: none;
  }

  .badge-btn,
  .nav-btn,
  .icon-btn,
  .theme-toggle {
    transition: none;
  }
}
