:root {
  --bg-deep: #071525;
  --bg-mid: #10243a;
  --house: rgba(120, 84, 58, 0.16);
  --house-line: rgba(181, 136, 93, 0.1);

  --text-main: #ecd2b3;
  --text-soft: #d0b294;

  --window-core: #ffcb72;
  --window-core-soft: #f0b760;
  --window-glow: rgba(255, 170, 71, 0.42);

  --button-border: rgba(237, 190, 126, 0.24);
  --shadow: rgba(0, 0, 0, 0.32);

  --open-window-bg-top: rgba(83, 52, 34, 0.34);
  --open-window-bg-bottom: rgba(60, 37, 24, 0.28);
  --open-window-border: rgba(238, 194, 135, 0.16);

  --closed-window-bg-top: rgba(59, 45, 38, 0.18);
  --closed-window-bg-bottom: rgba(44, 33, 29, 0.16);
  --closed-window-border: rgba(205, 170, 133, 0.08);

  --closed-text: rgba(236, 210, 179, 0.56);
  --closed-subtext: rgba(208, 178, 148, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 50% 31%, rgba(111, 128, 100, 0.18), transparent 24%),
    radial-gradient(circle at 50% 45%, rgba(66, 109, 113, 0.2), transparent 36%),
    linear-gradient(180deg, #05111e 0%, var(--bg-mid) 41%, #091320 100%);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.45) 0,
      rgba(255,255,255,0.45) 1px,
      transparent 1px,
      transparent 86px
    ),
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.35) 0,
      rgba(255,255,255,0.35) 1px,
      transparent 1px,
      transparent 82px
    );
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 164, 74, 0.06), transparent 17%),
    radial-gradient(circle at 50% 23%, rgba(255, 208, 118, 0.05), transparent 10%);
}

.house-silhouette {
  position: fixed;
  left: 50%;
  top: 6.5rem;
  transform: translateX(-50%);
  width: min(86vw, 900px);
  height: 460px;
  pointer-events: none;
  opacity: 0.95;
}

.house-silhouette::before,
.house-silhouette::after {
  content: "";
  position: absolute;
}

.house-silhouette::before {
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 100%;
  height: 190px;
  background: var(--house);
  clip-path: polygon(50% 0%, 100% 70%, 84% 66%, 50% 24%, 16% 66%, 0% 70%);
  filter: blur(1px);
}

.house-silhouette::after {
  left: 12%;
  right: 12%;
  top: 126px;
  bottom: 0;
  background: rgba(132, 94, 66, 0.08);
  border-top: 1px solid var(--house-line);
}

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10;
}

.logo {
  position: absolute;
  top: 24px;
  left: 20px;
  display: block;
  text-decoration: none;
}

.logo img {
  display: block;
  width: 96px;
  height: auto;
  opacity: 0.96;
}

.hero {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem;
  min-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-window {
  width: 72px;
  height: 72px;
  border-radius: 18px 18px 12px 12px;
  margin-top: 2rem;
  background:
    linear-gradient(90deg, transparent 47%, rgba(101, 66, 39, 0.62) 47%, rgba(101, 66, 39, 0.62) 53%, transparent 53%),
    linear-gradient(transparent 47%, rgba(101, 66, 39, 0.62) 47%, rgba(101, 66, 39, 0.62) 53%, transparent 53%),
    linear-gradient(180deg, #ffdb8a 0%, #f0b15c 100%);
  box-shadow:
    0 0 22px rgba(255, 188, 82, 0.46),
    0 0 70px rgba(255, 163, 64, 0.18);
}

.hero-copy {
  text-align: center;
  margin-top: 4rem;
}

.hero h1 {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.2rem, 6vw, 6rem);
  line-height: 0.95;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #efd6ba;
  text-wrap: balance;
}

.hero-subtitle {
  margin: 1rem 0 0;
  font-size: clamp(1.2rem, 2vw, 2rem);
  line-height: 1.3;
  color: var(--text-soft);
  font-weight: 300;
}

.enter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  min-height: 74px;
  margin-top: 2.15rem;
  padding: 0.95rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  color: #f6dfc2;
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 400;
    background: linear-gradient(180deg, rgba(151, 91, 53, 0.35), rgba(98, 55, 31, 0.55));
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 176, 0.12),
    0 0 18px rgba(255, 160, 68, 0.12);
  border: 1px solid var(--button-border);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.enter-button:hover,
.enter-button:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 227, 176, 0.22),
    0 0 30px rgba(255, 160, 68, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.18);
}

.projects {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: clamp(1rem, 2vw, 2.2rem);
  margin-top: clamp(7rem, 14vh, 10rem);
  padding-bottom: 2rem;
}

/* ОКНА */
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 240px);
  min-height: 300px;
  padding: 2rem 1.35rem 1.8rem;
  text-decoration: none;
  color: var(--text-main);
  border-radius: 32px 32px 18px 18px;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0.02) 0%,
      rgba(255,255,255,0.06) 18%,
      rgba(255,255,255,0.02) 34%,
      rgba(255,255,255,0.01) 100%
    );
  pointer-events: none;
}

.project-card::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -2px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 191, 93, 0.9), rgba(255, 191, 93, 0.1) 56%, transparent 74%);
  filter: blur(2px);
  pointer-events: none;
}

.card-top-light {
  display: none;
}

#project-1 {
  background:
    linear-gradient(180deg, var(--open-window-bg-top), var(--open-window-bg-bottom));
  border: 1px solid var(--open-window-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 211, 154, 0.1),
    inset 0 0 34px rgba(255, 184, 90, 0.05),
    0 16px 28px rgba(0, 0, 0, 0.16),
    0 0 36px rgba(255, 160, 68, 0.08);
}

#project-1:hover,
#project-1:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(244, 197, 137, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 211, 154, 0.14),
    inset 0 0 40px rgba(255, 184, 90, 0.07),
    0 18px 30px rgba(0, 0, 0, 0.18),
    0 0 44px rgba(255, 160, 68, 0.1);
}

/* Закрытые окна */
#project-2,
#project-3 {
  background:
    linear-gradient(180deg, var(--closed-window-bg-top), var(--closed-window-bg-bottom));
  border: 1px solid var(--closed-window-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 211, 154, 0.04),
    0 10px 20px rgba(0, 0, 0, 0.12);
  opacity: 0.72;
  filter: saturate(0.82);
  pointer-events: none;
  cursor: default;
}

#project-2::after,
#project-3::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 191, 93, 0.28), rgba(255, 191, 93, 0.04) 56%, transparent 74%);
  filter: blur(2px);
}

#project-2 .project-title,
#project-3 .project-title {
  color: var(--closed-text);
}

#project-2 .project-description,
#project-3 .project-description {
  color: var(--closed-subtext);
}

.project-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #f3dbbf;
  text-wrap: balance;
  max-width: 9ch;
}

.project-description {
  margin: 0.95rem 0 0;
  max-width: 11ch;
  text-align: center;
  font-size: clamp(0.96rem, 1.05vw, 1.2rem);
  line-height: 1.38;
  color: #efcea7;
  font-weight: 300;
  text-wrap: balance;
}

/* Небольшая подпись "soon" для закрытых */
#project-2 .project-description::after,
#project-3 .project-description::after {
  content: "Soon";
  display: block;
  margin-top: 0.85rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

/* TABLET */
@media (max-width: 980px) {
  .house-silhouette {
    top: 4.7rem;
    width: min(96vw, 760px);
    height: 390px;
  }

  .hero {
    padding: 2.5rem 1.2rem 4.5rem;
    min-height: auto;
  }

  .hero-copy {
    margin-top: 3.1rem;
  }

  .projects {
    grid-template-columns: 1fr;
    width: min(320px, 100%);
    gap: 1.2rem;
    margin-top: 4.5rem;
  }

  .project-card {
    width: 100%;
    min-height: 250px;
  }
}

/* MOBILE */
@media (max-width: 640px) {
  body::before {
    opacity: 0.025;
  }

  .logo {
    top: 16px;
    left: 14px;
  }

  .logo img {
    width: 72px;
  }

  .hero {
    padding: 1.2rem 1rem 3.5rem;
  }

  .house-silhouette {
    width: 122vw;
    top: 4.3rem;
    height: 285px;
    opacity: 0.9;
  }

  .house-silhouette::before {
    height: 132px;
  }

  .house-silhouette::after {
    top: 88px;
    left: 14%;
    right: 14%;
  }

  .top-window {
    width: 54px;
    height: 54px;
    border-radius: 14px 14px 10px 10px;
    margin-top: 1.15rem;
  }

  .hero-copy {
    margin-top: 2.2rem;
    max-width: 92%;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 12vw, 4.2rem);
    line-height: 0.98;
  }

  .hero-subtitle {
    margin-top: 0.8rem;
    font-size: 1.08rem;
  }

  .enter-button {
    min-width: min(100%, 280px);
    min-height: 58px;
    margin-top: 1.7rem;
    font-size: 1.15rem;
    padding: 0.8rem 1.4rem;
  }

  .projects {
    width: min(280px, 100%);
    gap: 1rem;
    margin-top: 3.5rem;
  }

  .project-card {
    min-height: 220px;
    padding: 1.5rem 1rem 1.35rem;
    border-radius: 26px 26px 14px 14px;
  }

  .project-title {
    font-size: 1.32rem;
    max-width: 9ch;
  }

  .project-description {
    margin-top: 0.7rem;
    font-size: 0.95rem;
    max-width: 12ch;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}