:root {
  --text: rgba(255, 255, 255, 0.92);
  --ink: #38414b;
  --ease-wipe: cubic-bezier(0.76, 0, 0.24, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  background: #15252e;
  font-family: "Jost", "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A distant rainy neighborhood, outdoor rain, then an unframed wet pane. */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #15252e;
  animation: scene-in 1.6s ease-out both;
}

.scene-image {
  --scene-margin: 32px;
  position: absolute;
  inset: calc(-1 * var(--scene-margin));
  width: calc(100% + 2 * var(--scene-margin));
  height: calc(100% + 2 * var(--scene-margin));
  display: block;
  object-fit: cover;
  object-position: center;
}

.weather-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#rain {
  opacity: 0.65;
}

.distant-mist {
  background: linear-gradient(180deg,
    rgba(25, 58, 63, 0.14),
    rgba(57, 85, 88, 0.075) 55%,
    rgba(22, 47, 53, 0.025) 80%);
}

.glass-surface {
  background:
    radial-gradient(ellipse at 46% 44%, transparent 40%, rgba(5, 15, 23, 0.2) 100%),
    linear-gradient(110deg, rgba(74, 109, 115, 0.025), transparent 52%, rgba(5, 18, 27, 0.065));
}

#glass-soft {
  inset: calc(-1 * var(--glass-margin, 32px));
  width: calc(100% + 2 * var(--glass-margin, 32px));
  height: calc(100% + 2 * var(--glass-margin, 32px));
  opacity: 0.6;
}

#glass-refraction {
  opacity: 0;
}

.glass-reflections {
  /* Only a trace of window light on the pane; no reflected architecture. */
  background:
    radial-gradient(ellipse 52px 116px at var(--light-one-x, 35%) var(--light-y, 60%),
      rgba(186, 190, 151, 0.018), rgba(186, 190, 151, 0.004) 38%, transparent 75%),
    radial-gradient(ellipse 28px 76px at var(--light-two-x, 43%) var(--light-y, 60%),
      rgba(186, 190, 151, 0.012), transparent 75%);
}

@keyframes scene-in {
  from { opacity: 0; }
}

/* ---------- right-side UI ---------- */

.site {
  position: fixed;
  top: 33.5%;
  right: clamp(1.5rem, 3.3vw, 5rem);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
  animation: scene-in 1.8s 0.15s ease-out both;
}

.site-title {
  font-size: clamp(2.3rem, 2.87vw, 3.5rem);
  font-weight: 200;
  letter-spacing: 0.42em;
  margin-right: -0.42em;
  margin-bottom: clamp(2.5rem, 3.1vw, 3.8rem);
  color: var(--text);
  line-height: 1;
  text-shadow: 0 1px 16px rgba(64, 74, 84, 0.4);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 2.2vw, 2.8rem);
  pointer-events: auto;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.nav-rule {
  width: 1px;
  height: clamp(5.5rem, 6vw, 7rem);
  background: rgba(255, 255, 255, 0.78);
}

/* ---------- links + one-directional wipe ---------- */

.nav-link {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: 0.3em 0.15em;
  font-size: clamp(1.1rem, 1.44vw, 1.6rem);
  font-weight: 300;
  letter-spacing: 0.045em;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(64, 74, 84, 0.4);
  transition: color 0.2s ease 0.18s, text-shadow 0.2s ease 0.18s;
}

.nav-link::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.08em -0.45em;
  background: rgba(255, 255, 255, 0.94);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s var(--ease-wipe);
  will-change: transform;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--ink);
  text-shadow: none;
  transition: color 0.2s ease 0.08s, text-shadow 0.2s ease 0.08s;
}

.nav-link:hover::before,
.nav-link:focus-visible::before {
  transform: scaleX(1);
  transform-origin: right center;
}

.nav-link:focus-visible {
  outline: none;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .site {
    top: 30%;
    right: 1.7rem;
  }

  .scene-image {
    object-position: 44% center;
  }

  .site-title {
    font-size: 1.9rem;
    margin-bottom: 2.1rem;
  }

  .nav-list {
    gap: 0.8rem;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .scene,
  .site {
    animation: none;
  }

  .scene-image {
    transition: none;
  }

  .nav-link,
  .nav-link:hover,
  .nav-link:focus-visible {
    transition: color 0.12s linear;
  }

  .nav-link::before {
    transition: opacity 0.12s linear;
    transform: none;
    opacity: 0;
  }

  .nav-link:hover::before,
  .nav-link:focus-visible::before {
    transform: none;
    opacity: 1;
  }
}
