:root {
  color-scheme: dark;
  --font-display: "Oxanium", monospace;
  --font-body: "Rajdhani", sans-serif;
  --bg: #0d1117;
  --bg-2: #171a21;
  --card: #1b2838;
  --card-soft: rgba(27, 40, 56, 0.72);
  --text: #e8f4ff;
  --sub: #8ba3bb;
  --accent: #66c0f4;
  --accent-2: #1a6ea8;
  --border: rgba(102, 192, 244, 0.15);
  --border-hover: rgba(102, 192, 244, 0.38);
  --shadow: 0 0 18px rgba(102, 192, 244, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  margin: 0;
  background:
    radial-gradient(circle at 30% 16%, rgba(26, 110, 168, 0.24), transparent 34rem),
    linear-gradient(180deg, #0f1823 0, var(--bg) 24rem);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100vw - 1100px) / 2 + 16px));
  border-bottom: 1px solid var(--border);
  background: rgba(23, 26, 33, 0.9);
  backdrop-filter: blur(10px);
}

.brand,
.site-nav,
.hero-actions,
.link-list {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, #1a4a6b, var(--accent-2));
  color: white;
  font-size: 13px;
}

.site-nav {
  gap: 10px;
}

.site-nav a {
  border-radius: 6px;
  color: var(--sub);
  font-size: 17px;
  font-weight: 500;
  padding: 6px 10px;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  background: rgba(102, 192, 244, 0.1);
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(102, 192, 244, 0.08);
  color: var(--text);
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: currentColor;
}

.hero,
.section {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 16px;
  align-items: stretch;
  padding-top: 34px;
}

.hero-copy,
.hero-panel,
.feature-main,
.feature-list > div,
.resource-card,
.project-card,
.archive-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-soft);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.hero-copy {
  padding: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sub);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.eyebrow:empty {
  display: none;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
}

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

h1 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1;
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.15;
}

#projects h2,
#archive h2 {
  font-size: clamp(24px, 3vw, 32px);
}

h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

p {
  color: var(--sub);
  font-weight: 500;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 15px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.resource-card > a,
.link-list a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-weight: 700;
  padding: 7px 12px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.button:hover,
.resource-card > a:hover,
.link-list a:hover {
  border-color: var(--border-hover);
  background: rgba(102, 192, 244, 0.1);
  color: var(--text);
}

.button.primary,
.resource-card > a {
  border: 0;
  background: linear-gradient(135deg, #1a4a6b, var(--accent-2));
  color: white;
}

.hero-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.hero-panel a {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 76px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(13, 17, 23, 0.36);
  padding: 12px;
}

.hero-panel a:hover,
.project-card:hover,
.archive-card:hover,
.feature-list > div:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.feature-main:hover,
.resource-card:hover {
  border-color: var(--border-hover);
}

.hero-panel span,
.card-kicker,
.product-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-panel strong {
  font-size: 16px;
  line-height: 1.2;
}

.section {
  scroll-margin-top: 58px;
}

.section-heading {
  margin-bottom: 14px;
}

.feature-grid,
.rutony-showcase {
  display: grid;
  gap: 10px;
}

.feature-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.rutony-showcase {
  grid-template-columns: minmax(0, 1fr);
}

.feature-main,
.feature-list > div,
.resource-card,
.project-card,
.archive-card {
  padding: 16px;
}

.feature-main h3 {
  max-width: 640px;
  margin: 12px 0 10px;
  font-size: clamp(24px, 3vw, 32px);
}

.product-card {
  background:
    linear-gradient(135deg, rgba(26, 110, 168, 0.18), transparent 54%),
    var(--card-soft);
  padding: clamp(16px, 2.4vw, 28px);
}

.product-logo {
  flex: 0 0 auto;
  width: clamp(104px, 14vw, 168px);
}

.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.product-copy h3 {
  grid-column: 2;
  max-width: 620px;
}

.product-brand {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: clamp(16px, 3vw, 28px);
  row-gap: 14px;
  align-items: start;
}

.product-copy {
  display: contents;
}

.product-copy p {
  grid-column: 1 / -1;
  margin-bottom: 0;
  max-width: none;
  font-size: 18px;
}

.product-copy p + p {
  margin-top: 12px;
}

.product-copy .hero-actions {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.product-card .button.primary {
  min-height: 44px;
  padding: 11px 20px;
  font-size: 17px;
}

.preview-carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  width: min(390px, 100%);
  align-self: stretch;
  border: 1px solid var(--border-hover);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(102, 192, 244, 0.1), transparent 40%),
    rgba(13, 17, 23, 0.72);
  padding: 10px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22);
}

.archive-carousel {
  width: 100%;
  margin-top: 10px;
  min-height: 360px;
}

.archive-carousel .preview-frame {
  min-height: 320px;
}

.archive-carousel .preview-frame img {
  object-fit: contain;
  object-position: center;
}

.archive-carousel[data-single-slide="true"] .carousel-button,
.archive-carousel[data-single-slide="true"] .carousel-progress {
  display: none;
}

.preview-frame {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 340px;
  border-radius: 7px;
  background: rgba(13, 17, 23, 0.7);
}

.preview-frame img {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.preview-frame img.is-active {
  opacity: 1;
}

.carousel-button {
  position: absolute;
  top: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-hover);
  border-radius: 50%;
  background: rgba(13, 17, 23, 0.78);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition:
    background 0.2s ease,
    opacity 0.2s ease;
}

.preview-carousel:hover .carousel-button,
.preview-carousel:focus-within .carousel-button {
  opacity: 1;
  pointer-events: auto;
}

.carousel-button:hover,
.carousel-button:focus-visible {
  background: rgba(102, 192, 244, 0.2);
}

.carousel-button.prev {
  left: 18px;
}

.carousel-button.next {
  right: 18px;
}

.carousel-progress {
  overflow: hidden;
  width: min(160px, 56%);
  height: 3px;
  margin-top: 10px;
  margin-right: auto;
  margin-left: auto;
  border-radius: 999px;
  background: rgba(139, 163, 187, 0.22);
}

.carousel-progress span {
  display: block;
  width: var(--carousel-progress, 5%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.compact-features {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(18px, 3vw, 28px);
}

.compact-features > div {
  min-height: auto;
}

.compact-features h3 {
  font-size: clamp(18px, 2vw, 22px);
}

.compact-features p {
  font-size: 18px;
}

.product-inside > div,
.product-card .music-card {
  background: rgba(13, 17, 23, 0.28);
}

.product-label,
.card-kicker {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(102, 192, 244, 0.08);
  padding: 4px 8px;
}

.feature-list {
  display: grid;
  gap: 10px;
}

.rutonychat-resources {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 10px;
  margin-top: 10px;
}

.resource-card.accent {
  background: linear-gradient(135deg, rgba(26, 110, 168, 0.24), rgba(27, 40, 56, 0.72));
}

.music-card {
  margin-top: 10px;
}

.support-card {
  margin-top: 10px;
}

.link-list {
  flex-wrap: wrap;
  gap: 8px;
}

.link-list a {
  gap: 7px;
}

.link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  filter: brightness(0) invert(1);
  object-fit: contain;
  opacity: 0.92;
}

.link-list.compact {
  margin-top: 12px;
}

.project-grid,
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.project-card,
.archive-card {
  position: relative;
  display: flex;
  min-height: 170px;
  flex-direction: column;
}

a.project-card::after {
  position: absolute;
  right: 13px;
  bottom: 10px;
  color: rgba(102, 192, 244, 0.55);
  content: "↗";
  font-size: 19px;
}

.project-card p,
.archive-card p {
  margin-bottom: 0;
}

.archive-section {
  padding-bottom: 52px;
}

.archive-card {
  opacity: 0.64;
}

.archive-card:hover {
  opacity: 1;
}

.archive-card.illustrated img {
  width: 88px;
  max-height: 44px;
  margin-bottom: 12px;
  object-fit: contain;
  object-position: left center;
}

.portfolio-page {
  min-height: calc(100vh - 92px);
}

.portfolio-page h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 10px;
}

.archive-detail-page {
  width: 100%;
  padding-bottom: 52px;
}

.archive-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 10px;
  align-items: stretch;
}

.archive-hero .feature-main {
  display: grid;
  align-content: center;
  min-height: 360px;
  background:
    linear-gradient(135deg, rgba(102, 192, 244, 0.16), transparent 58%),
    var(--card-soft);
}

.archive-logo-panel {
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    radial-gradient(circle at center, rgba(102, 192, 244, 0.18), transparent 64%),
    rgba(13, 17, 23, 0.36);
  padding: 22px;
}

.archive-logo-panel img {
  width: min(240px, 82%);
  max-height: 170px;
  object-fit: contain;
}

.archive-logo-fallback {
  display: grid;
  width: min(220px, 82%);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(102, 192, 244, 0.24), rgba(26, 110, 168, 0.32)),
    rgba(13, 17, 23, 0.62);
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(54px, 9vw, 86px);
  font-weight: 800;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.detail-grid .resource-card {
  min-height: 170px;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--sub);
  font-weight: 500;
}

.detail-list li + li {
  margin-top: 6px;
}

.detail-actions {
  margin-top: 16px;
}

.site-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-top: 1px solid var(--border);
  background: rgba(23, 26, 33, 0.95);
  color: var(--sub);
  font-size: 15px;
}

.site-footer a {
  color: var(--accent);
}

@media (max-width: 860px) {
  .hero,
  .feature-grid,
  .rutonychat-resources,
  .product-hero,
  .portfolio-grid,
  .archive-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header {
    padding: 10px 12px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 6px);
    right: 12px;
    left: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(23, 26, 33, 0.98);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 9px 10px;
  }

  .hero,
  .section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero-copy,
  .feature-main,
  .feature-list > div,
  .resource-card,
  .project-card,
  .archive-card {
    padding: 14px;
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 22px;
  }

  .button {
    width: 100%;
  }

  .product-brand {
    grid-template-columns: 1fr;
  }

  .product-copy h3,
  .product-copy p,
  .product-copy .hero-actions {
    grid-column: 1;
  }

  .compact-features {
    grid-template-columns: 1fr;
  }

  .archive-carousel,
  .archive-carousel .preview-frame {
    min-height: 240px;
  }
}
