@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,300&family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap");

:root {
  --bg: #081020;
  --bg-blueberry: #12133b;
  --bg-navy: #0c1829;
  --panel: #0e1c33;
  --panel-soft: #101a31;
  --text: #f0e8d8;
  --text-muted: rgba(240, 232, 216, 0.7);
  --text-soft: rgba(240, 232, 216, 0.48);
  --gold: #c49840;
  --gold-soft: rgba(196, 152, 64, 0.22);
  --gold-faint: rgba(196, 152, 64, 0.08);
  --line: rgba(240, 232, 216, 0.1);
  --line-gold: rgba(196, 152, 64, 0.34);
  --max-width: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  transform: translateY(-150%);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--text);
  text-decoration: none;
}

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

.site-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 75% 60% at 18% 22%, rgba(12, 20, 52, 0.65) 0%, transparent 70%),
    radial-gradient(ellipse 65% 50% at 82% 75%, rgba(16, 14, 48, 0.5) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 50% 45%, rgba(14, 18, 50, 0.45) 0%, transparent 72%),
    linear-gradient(158deg, #0f2040 0%, #0c1a32 20%, #10173a 50%, #0b1528 75%, #0d1a30 100%);
}

.site-shell::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.032;
}

.site-topbar {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid rgba(240, 232, 216, 0.05);
  background:
    linear-gradient(180deg, rgba(11, 24, 45, 0.98), rgba(8, 17, 32, 0.98));
}

.masthead {
  position: relative;
  min-height: clamp(430px, 58vh, 560px);
  overflow: hidden;
  background: var(--bg-navy);
}

.masthead::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(rgba(10, 18, 36, 0.52), rgba(10, 18, 36, 0.52)),
    url("./assets/hero-texture.png");
  background-position: center;
  background-size: cover;
}

.masthead::after {
  position: absolute;
  inset: auto 0 0;
  height: 190px;
  content: "";
  background: linear-gradient(
    to bottom,
    rgba(12, 24, 41, 0),
    rgba(12, 24, 41, 0.72) 58%,
    #0c1829
  );
}

main {
  position: relative;
}

.hero,
.projects,
.site-footer {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 0 18px;
}

.brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.brand__name,
.project-card h2 {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
}

.brand__name {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.1;
}

.brand__tagline {
  color: var(--text-soft);
  font-size: 0.6875rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.telegram-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-top: 4px;
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.telegram-link:hover,
.telegram-link:focus-visible {
  color: #dbb85d;
  transform: translateY(-1px);
}

.hero {
  display: flex;
  align-items: center;
  min-height: clamp(430px, 56vh, 540px);
  padding: 78px 0 118px;
}

.hero__content {
  max-width: 780px;
}

.hero h1 {
  margin: 0 0 18px;
  color: var(--gold);
  font-family: "DM Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1;
  text-transform: uppercase;
}

.hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(240, 232, 216, 0.85);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1.55;
}

.hero__rule {
  display: block;
  width: 88px;
  height: 2px;
  margin-top: 46px;
  background: var(--gold);
}

.projects {
  margin-top: -78px;
  padding-bottom: 74px;
}

.projects::before {
  position: absolute;
  z-index: 0;
  top: -112px;
  bottom: 0;
  left: 50%;
  width: 100vw;
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
  background: linear-gradient(
    to bottom,
    rgba(12, 24, 41, 0),
    #0c1829 190px,
    rgba(16, 19, 59, 0.72) 315px,
    rgba(10, 18, 36, 0.94)
  );
}

.projects__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.project-card {
  position: relative;
  display: flex;
  min-height: 390px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px 32px 30px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--panel);
  text-decoration: none;
}

.project-card::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  content: "";
  pointer-events: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.project-card--active {
  border-color: var(--line-gold);
  background:
    linear-gradient(145deg, var(--gold-faint), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(196, 152, 64, 0.14),
    0 28px 70px rgba(0, 0, 0, 0.22);
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.project-card--active::after {
  border-color: var(--line-gold);
  box-shadow: inset 0 0 0 1px rgba(196, 152, 64, 0.14);
}

.project-card--active:hover,
.project-card--active:focus-visible {
  border-color: rgba(196, 152, 64, 0.72);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.32);
  transform: translateY(-4px);
}

.project-card--active:hover::after,
.project-card--active:focus-visible::after {
  border-color: rgba(196, 152, 64, 0.76);
  box-shadow: inset 0 0 0 1px rgba(196, 152, 64, 0.62);
}

.project-card--future {
  background:
    linear-gradient(145deg, rgba(196, 152, 64, 0.045), rgba(255, 255, 255, 0)),
    var(--panel-soft);
}

.project-card--quiet {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0)),
    #0d182d;
}

.project-card__badge {
  align-self: flex-start;
  margin-bottom: 58px;
  border-radius: 5px;
  padding: 7px 11px;
  color: rgba(240, 232, 216, 0.55);
  background: rgba(240, 232, 216, 0.07);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
}

.project-card__badge--active {
  color: #d9b45f;
  background: rgba(196, 152, 64, 0.15);
}

.project-card h2 {
  margin: 0 0 24px;
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.3;
}

.project-card p {
  margin: 0 0 36px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 300;
  line-height: 1.72;
}

.project-card__action,
.project-card__caption {
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 700;
}

.project-card__action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
}

.project-card__caption {
  color: rgba(240, 232, 216, 0.5);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid rgba(240, 232, 216, 0.08);
  padding: 28px 0 34px;
  color: rgba(240, 232, 216, 0.62);
}

.site-footer p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .masthead {
    min-height: auto;
  }

  .hero {
    min-height: 420px;
    padding: 78px 0 104px;
  }

  .hero p {
    font-size: 1.28rem;
  }

  .projects__grid {
    gap: 16px;
  }

  .project-card {
    padding: 30px 24px 28px;
    min-height: 300px;
  }

  .project-card__badge {
    margin-bottom: 38px;
  }
}

@media (max-width: 640px) {
  .site-header,
  .hero,
  .projects,
  .site-footer {
    width: min(calc(100% - 34px), var(--max-width));
  }

  .site-header {
    align-items: flex-start;
    padding-top: 24px;
  }

  .brand__tagline {
    max-width: 220px;
  }

  .hero {
    min-height: 390px;
    padding: 70px 0 92px;
  }

  .hero p {
    font-size: 1.08rem;
    line-height: 1.68;
  }

  .hero__rule {
    width: 64px;
    margin-top: 34px;
  }

  .projects {
    width: 100%;
    margin-top: -54px;
    padding-bottom: 52px;
  }

  .projects__grid {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    margin-top: -6px;
    padding: 6px 17px 12px;
    scroll-padding-inline: 17px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .projects__grid::-webkit-scrollbar {
    display: none;
  }

  .project-card {
    flex: 0 0 min(82vw, 350px);
    min-height: 0;
    padding: 28px 24px 26px;
    scroll-snap-align: start;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 30px;
  }
}

@media (max-width: 420px) {
  .site-header {
    gap: 14px;
  }

  .project-card__badge {
    margin-bottom: 30px;
  }
}
