:root {
  --bg: #2f9ea0;
  --bg-deep: #237f86;
  --bg-active: #2f9ea0;
  --bg-active-deep: #237f86;
  --text: #ffffff;
  --muted: #def6f3;
  --accent: #ffcc05;
  --accent-text: #3f4347;
  --content-text: #f6fffe;
  --content-muted: #f0fffc;
  --content-quote: #dff8f3;
  --content-stars: #ffdf57;
  --content-border: rgba(255, 255, 255, 0.36);
  --divider: rgba(255, 255, 255, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --contact-bar-height: 72px;
  --section-height: calc(100svh - var(--contact-bar-height) - var(--safe-top));
}

@property --bg-active {
  syntax: "<color>";
  inherits: true;
  initial-value: #2f9ea0;
}

@property --bg-active-deep {
  syntax: "<color>";
  inherits: true;
  initial-value: #237f86;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: transparent;
  padding: var(--safe-top) 0 var(--contact-bar-height);
  position: relative;
  isolation: isolate;
}

body.is-loading {
  overflow: hidden;
}

body.is-loading > :not(.page-loader):not(.persistent-lang-switch) {
  opacity: 0;
  pointer-events: none;
}

body.is-loading > :not(.page-loader):not(.persistent-lang-switch),
.page-loader {
  transition: opacity 380ms ease;
}

.page-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.9rem;
  background: linear-gradient(180deg, #2f9ea0 0%, #237f86 100%);
}

.loader-mark {
  width: 3.2rem;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  animation: loaderSpin 0.9s linear infinite;
}

.loader-text {
  margin: 0;
  color: #ffffff;
  font-family: "Cardo", serif;
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  letter-spacing: 0.02em;
}

body:not(.is-loading) .page-loader {
  opacity: 0;
  pointer-events: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -2;
  background: linear-gradient(180deg, var(--bg-active) 0%, var(--bg-active-deep) 100%);
  transition: --bg-active 450ms ease, --bg-active-deep 450ms ease;
}

body::after {
  z-index: -1;
  background:
    radial-gradient(circle at 10% 8%, rgba(42, 176, 173, 0.28) 0, transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(19, 109, 112, 0.32) 0, transparent 34%);
  background-size: 120% 120%, 130% 130%;
  animation: bgDrift 18s ease-in-out infinite alternate;
}

html {
  scroll-snap-type: y mandatory;
}

.site-header {
  max-width: 1100px;
  min-height: var(--section-height);
  margin: 0 auto;
  padding: clamp(1rem, 2.2vw, 2rem) 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.persistent-lang-switch {
  position: fixed;
  top: clamp(0.7rem, 2.2vw, 1.4rem);
  right: 0.75rem;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  color: #f3fffe;
  background: rgba(9, 61, 73, 0.28);
  border: none;
  border-radius: 999px;
  padding: 0.24rem 0.56rem;
  box-shadow: 0 2px 8px rgba(6, 47, 58, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  opacity: 0.01;
  transform: translateY(-4px);
  transition: opacity 420ms ease 700ms, transform 420ms ease 700ms;
}

body:not(.is-loading) .persistent-lang-switch {
  opacity: 1;
  transform: translateY(0);
}

.lang-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2ch;
  padding: 0.08rem 0.34rem;
  border-radius: 999px;
  font-weight: 800;
  color: #063843;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 4px rgba(4, 35, 42, 0.24);
}

.lang-sep {
  opacity: 0.6;
}

.persistent-lang-link {
  color: #f3fffe;
  text-decoration: none;
  font-weight: 500;
  opacity: 0.92;
}

.persistent-lang-link:hover,
.persistent-lang-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 3px solid #0b3d67;
  outline-offset: 3px;
  border-radius: 4px;
}

.hero-main {
  text-align: center;
}

.hero-main > * {
  opacity: 0;
  transform: translateY(12px);
}

.site-header.is-visible .hero-main > * {
  animation: heroItemIn 620ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.site-header.is-visible .hero-title {
  animation-delay: 140ms;
}

.site-header.is-visible .logo {
  animation-delay: 240ms;
}

.site-header.is-visible .starting-price {
  animation-delay: 340ms;
}

.site-header.is-visible .hero-scroll-cue {
  animation-delay: 420ms;
}

.hero-title {
  margin: 0 0 clamp(0.8rem, 2.2vw, 1.3rem);
  font-family: "Cardo", serif;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.2;
  color: #f6fffe;
  font-weight: 700;
}

.hero-title span {
  position: relative;
  display: inline-block;
  padding-bottom: 0.06em;
}

.hero-title span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.06em;
  height: 6px;
  background: #8fe7df;
  transform-origin: left center;
  transform: scaleX(0);
}

.site-header.is-visible .hero-title span::after {
  animation: underlineDraw 680ms cubic-bezier(0.22, 1, 0.36, 1) 460ms forwards;
}

.logo {
  width: min(820px, 78vw);
  height: auto;
  display: block;
  margin: 0 auto 0.35rem;
  transform-origin: center;
  animation: logoFloat 5s ease-in-out infinite;
}

.starting-price {
  margin: 0;
  font-family: "Cardo", serif;
  font-size: clamp(1.45rem, 2.1vw, 2.1rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #ddf8f5;
}

.starting-price span {
  color: #f6fffe;
}

.hero-scroll-cue {
  margin: 0.85rem 0 0;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: #e8fcf8;
  font-family: "Cardo", serif;
  font-size: clamp(1.08rem, 1.5vw, 1.4rem);
  letter-spacing: 0.01em;
}

.hero-scroll-cue span:first-child,
.hero-scroll-cue span:last-child {
  font-size: 1.1em;
  line-height: 1;
}

.site-header.is-visible .hero-scroll-cue span:first-child,
.site-header.is-visible .hero-scroll-cue span:last-child {
  animation: cueArrowNudge 2.2s ease-in-out 1.2s infinite;
}

.portfolio {
  width: 100%;
  max-width: none;
  margin: 0;
}

h1 {
  margin: 0 0 1.25rem;
  font-family: "Cardo", serif;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  letter-spacing: 0.02em;
}

.portfolio-list {
  display: grid;
  gap: 0;
}

.project-card {
  padding: 0;
  min-height: var(--section-height);
  display: flex;
  align-items: center;
  position: relative;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 520ms ease,
    transform 640ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 320ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.project-card::before {
  display: none;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 12% 4% auto;
  height: 44%;
  border-radius: 40px;
  background: radial-gradient(circle at 20% 40%, rgba(255, 255, 255, 0.16) 0%, transparent 62%);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 500ms ease,
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-visible,
.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-header.is-visible,
.project-card.is-visible {
  transition: opacity 340ms ease, transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header.is-visible.is-active-section,
.project-card.is-visible.is-active-section {
  opacity: 1;
}

.site-header.is-visible.is-neighbor-section,
.project-card.is-visible.is-neighbor-section {
  opacity: 0.25;
}

.site-header.is-visible.is-dimmed-section,
.project-card.is-visible.is-dimmed-section {
  opacity: 0.24;
}

.project-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 0.95rem;
  padding: 1rem 1rem 1.35rem;
}

.project-main {
  display: grid;
  gap: 0.8rem;
}

.project-mobile,
.project-desktop {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.project-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
  transition: transform 360ms ease, filter 360ms ease;
}

.project-mobile .project-image {
  aspect-ratio: auto;
}

.project-desktop {
  aspect-ratio: 16 / 9;
}

.project-mobile {
  aspect-ratio: 9 / 19.5;
}

.project-meta h2 {
  margin: 0 0 0.35rem;
  font-family: "Cardo", serif;
  font-size: 1.3rem;
  color: var(--content-text);
}

.project-meta {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 0.9rem 0.95rem;
  backdrop-filter: blur(2px);
}

.project-review-label {
  margin: 0 0 0.24rem;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--content-muted);
  font-weight: 700;
}

.project-review {
  margin: 0 0 0.85rem;
  color: var(--content-text);
  font-family: "Cardo", serif;
  font-size: clamp(1.12rem, 1.38vw, 1.42rem);
  line-height: 1.52;
  max-width: 46ch;
  position: relative;
  padding-left: 1rem;
  border-left: 2px solid var(--content-border);
}

.project-review-text::before,
.project-review-text::after {
  color: var(--content-quote);
  font-size: 1.15em;
  line-height: 0;
}

.project-review-text::before {
  content: '"';
  margin-right: 0.12em;
}

.project-review-text::after {
  content: '"';
  margin-left: 0.12em;
}

.project-review-stars {
  display: block;
  margin-top: 0.45rem;
  color: var(--content-stars);
  font-size: 0.9em;
  letter-spacing: 0.06em;
}

.project-link {
  color: var(--accent-text);
  background: var(--accent);
  display: inline-block;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 220ms ease, filter 220ms ease, box-shadow 220ms ease;
}

.project-link:hover,
.project-link:focus-visible {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.project-link:focus-visible {
  outline-color: #1b2328;
}

.project-card:hover .project-image {
  transform: translateY(-2px);
  filter: saturate(1.05);
}

.contact-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  min-height: var(--contact-bar-height);
  padding: 0.8rem 1rem calc(0.8rem + var(--safe-bottom));
  background: #ffffff;
  color: #1d1d1d;
  border-top: 3px solid var(--accent);
  opacity: 0;
  transform: translateY(110%);
  transition: transform 560ms cubic-bezier(0.22, 1, 0.36, 1), opacity 380ms ease;
}

body.is-ready .contact-bar {
  opacity: 1;
  transform: translateY(0);
}

.contact-bar p {
  margin: 0;
  font-size: 1rem;
}

.contact-bar a {
  color: #0b3d67;
  font-weight: 700;
  transition: color 200ms ease, opacity 200ms ease;
}

.contact-bar a:hover,
.contact-bar a:focus-visible {
  color: #083252;
  opacity: 0.9;
}

.contact-bar a:focus-visible,
.persistent-lang-link:focus-visible {
  text-decoration-thickness: 2px;
}

@keyframes bgDrift {
  0% {
    background-position: 0% 0%, 100% 0%, 0 0;
  }
  100% {
    background-position: 8% 7%, 92% 12%, 0 0;
  }
}

@keyframes logoFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes underlineDraw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes cueArrowNudge {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
  50% {
    transform: translateY(2px);
    opacity: 1;
  }
}

@media (min-width: 768px) {
  .project-inner {
    grid-template-columns: 68% 32%;
    align-items: start;
    column-gap: 1rem;
    padding: 1rem 1rem 1.15rem;
  }

  .project-card.is-even .project-inner {
    grid-template-columns: 32% 68%;
  }

  .project-card.is-even .project-main {
    order: 2;
  }

  .project-card.is-even .project-mobile {
    order: 1;
  }

  .project-card:not(.is-even) .project-meta {
    text-align: right;
    margin-left: auto;
    max-width: min(520px, 92%);
  }

  .project-card:not(.is-even) .project-review {
    margin-left: auto;
    padding-left: 0;
    padding-right: 1rem;
    border-left: 0;
    border-right: 2px solid var(--content-border);
  }

  .project-mobile {
    max-height: calc(var(--section-height) - 2rem);
  }

  .project-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
  }

  .project-card.is-even .project-meta {
    max-width: min(520px, 92%);
  }

  .project-card:nth-child(2n + 1) .project-desktop {
    border-radius: 16px 16px 8px 16px;
  }

  .project-card:nth-child(2n) .project-desktop {
    border-radius: 16px 16px 16px 8px;
  }

  .project-card:nth-child(2n + 1) .project-mobile {
    transform: translateY(6px);
  }

  .project-card:nth-child(2n) .project-mobile {
    transform: translateY(-6px);
  }
}

@media (max-width: 767px) {
  .site-header {
    min-height: var(--section-height);
  }

  .project-card {
    min-height: auto;
    padding: 0.4rem 0;
  }

  .project-inner {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.85rem;
  }

  .project-mobile {
    display: none;
  }

  .project-desktop {
    max-height: min(52svh, 420px);
  }

  .project-meta h2 {
    font-size: 1.12rem;
  }

  .project-meta {
    padding: 0.75rem 0.8rem;
  }

  .project-review {
    font-size: 1.03rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    max-width: none;
  }

  .contact-bar {
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
  }

  .contact-bar p {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 767px) {
  .persistent-lang-switch {
    right: 0.6rem;
    font-size: 0.95rem;
  }

  .hero-title {
    font-size: clamp(1.65rem, 9.2vw, 2.2rem);
    margin-bottom: 1rem;
  }

  .hero-title span {
    border-bottom-width: 0;
  }

  .hero-title span::after {
    height: 4px;
  }

  .starting-price {
    font-size: clamp(1.25rem, 6.4vw, 1.8rem);
  }

  .hero-scroll-cue {
    font-size: clamp(1rem, 4.8vw, 1.22rem);
    gap: 0.45rem;
  }
}

@media (max-width: 420px) {
  .logo {
    width: min(620px, 94vw);
  }

  .persistent-lang-switch {
    font-size: 0.88rem;
  }

  .project-mobile {
    max-height: min(34svh, 280px);
  }

  .project-desktop {
    max-height: min(46svh, 340px);
  }
}

@media (max-height: 760px) and (min-width: 768px) {
  .project-inner {
    padding: 0.65rem 1rem;
    gap: 0.65rem;
  }

  .project-mobile {
    max-height: calc(var(--section-height) - 5rem);
  }

  .project-desktop {
    max-height: calc(var(--section-height) * 0.5);
  }

  .project-meta h2 {
    font-size: 1.12rem;
  }

  .project-review {
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .site-header,
  .project-card {
    opacity: 1;
    transform: none;
  }

  .contact-bar {
    opacity: 1;
    transform: none;
  }

  .hero-main > *,
  .persistent-lang-switch {
    opacity: 1;
    transform: none;
  }

  .hero-title span::after {
    transform: scaleX(1);
  }

  .project-card:nth-child(2n + 1) .project-mobile,
  .project-card:nth-child(2n) .project-mobile {
    transform: none;
  }
}
