:root {
  --bg: #eceef2;
  --bg-soft: #f5f6f8;
  --panel: #fbfbfc;
  --panel-2: #f0f1f4;
  --text: #14161b;
  --muted: #545863;
  --accent: #9f6a45;
  --accent-strong: #7f4f30;
  --ring: rgba(159, 106, 69, 0.35);
  --line: rgba(25, 27, 32, 0.11);
  --shadow-lg: 0 38px 72px rgba(26, 30, 39, 0.12);
  --shadow-md: 0 18px 34px rgba(28, 33, 44, 0.08);
  --inactive-width: 92px;
  --active-width: 430px;
  --card-h: 234px;
  --gap: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(0.9rem, 2vw, 1.6rem);
  overflow-x: hidden;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 44%),
    radial-gradient(circle at 90% 100%, rgba(217, 220, 227, 0.8) 0%, rgba(217, 220, 227, 0) 48%),
    linear-gradient(180deg, #e9ebef 0%, #eaecf0 100%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: radial-gradient(#2f3440 0.4px, transparent 0.4px);
  background-size: 4px 4px;
}

.frame {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 2.2rem);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(247, 248, 251, 0.78)),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
  animation: rise 720ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: fit-content;
  min-width: 34px;
  height: 38px;
  padding: 0 0.85rem;
  border-radius: 11px;
  border: 1px solid rgba(20, 22, 27, 0.5);
  display: grid;
  place-items: center;
  text-decoration: none;
  color: var(--text);
  font-family: "Syne", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(242, 244, 248, 0.9));
}

.menu {
  justify-self: center;
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.25rem;
  padding: 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 20px rgba(31, 36, 48, 0.05);
}

.menu-link {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.08em;
  color: #444a55;
  font-weight: 700;
  padding: 0.52rem 0.92rem;
  border-radius: 999px;
  transition: color 220ms ease, background 220ms ease;
}

.menu-link:hover {
  color: #21252d;
}

.menu-link.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(167, 111, 72, 0.98), rgba(142, 88, 51, 0.98));
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.availability {
  margin: 0;
  font-size: 0.72rem;
  color: #4b515e;
  letter-spacing: 0.01em;
}

.contact-btn {
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  border: 1px solid rgba(116, 67, 35, 0.45);
  border-radius: 12px;
  padding: 0.74rem 1.06rem;
  background: linear-gradient(180deg, #b37b53 0%, #915b38 100%);
  box-shadow: 0 10px 24px rgba(143, 91, 56, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.contact-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgba(143, 91, 56, 0.35);
}

.view-stage {
  position: relative;
  margin-top: 0.9rem;
  isolation: isolate;
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
}

.page-view.is-entering {
  will-change: transform, opacity, filter;
  animation: routeInForward 560ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.page-view.is-leaving {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  will-change: transform, opacity, filter;
  animation: routeOutForward 420ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

.view-stage.route-backward .page-view.is-entering {
  animation-name: routeInBackward;
}

.view-stage.route-backward .page-view.is-leaving {
  animation-name: routeOutBackward;
}

.intro {
  margin-top: clamp(1.45rem, 4vw, 3rem);
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666d79;
  font-weight: 700;
}

.intro h1 {
  margin: 0.58rem 0 0;
  max-width: 21ch;
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 3.9vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.intro-copy {
  margin: 1rem 0 0;
  max-width: 58ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.58;
}

.hero-points {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.hero-points p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.42rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: #444b57;
  font-size: 0.74rem;
}

.hero-points span {
  color: #2b3039;
  font-weight: 700;
}

.carousel-block {
  position: relative;
  margin-top: clamp(1.3rem, 3.4vw, 2rem);
  border-radius: 22px;
  border: 1px solid rgba(27, 29, 36, 0.1);
  padding: 0.88rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(242, 244, 248, 0.9)),
    var(--panel-2);
  box-shadow: var(--shadow-md);
}

.carousel-head {
  display: block;
  margin-bottom: 0.62rem;
}

.section-kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #646c79;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 18px;
  padding: 0.42rem 0 0.08rem;
}

.carousel-track {
  display: flex;
  gap: var(--gap);
  transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.portfolio-card {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  width: var(--inactive-width);
  height: var(--card-h);
  border-radius: 15px;
  overflow: hidden;
  background: #2d313d center top / cover no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.24);
  filter: saturate(0.76) brightness(0.8);
  cursor: pointer;
  transition:
    width 470ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 300ms ease,
    filter 300ms ease,
    box-shadow 300ms ease;
}

.portfolio-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 28%, rgba(0, 0, 0, 0.72) 100%);
  z-index: 0;
}

.portfolio-card::after {
  content: attr(data-title);
  position: absolute;
  left: 50%;
  bottom: 0.64rem;
  transform: translateX(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  color: rgba(255, 255, 255, 0.95);
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.portfolio-card.is-active {
  width: var(--active-width);
  filter: saturate(1) brightness(1);
  transform: translateY(-3px);
  box-shadow: 0 24px 40px rgba(20, 25, 35, 0.3);
  background-size: cover;
  background-position: center;
}

.portfolio-card.is-active::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 12%, rgba(0, 0, 0, 0.45) 58%, rgba(0, 0, 0, 0.76) 100%);
}

.portfolio-card.is-active::after {
  display: none;
}

.card-content {
  position: absolute;
  inset: auto 0 0;
  padding: 0.92rem 0.94rem;
  border-radius: 0 0 15px 15px;
  background: linear-gradient(180deg, rgba(13, 14, 18, 0) 0%, rgba(13, 14, 18, 0.64) 42%, rgba(13, 14, 18, 0.86) 100%);
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease;
  pointer-events: none;
  z-index: 3;
}

.portfolio-card.is-active .card-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.card-content h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.38rem, 2.2vw, 1.72rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.card-content p {
  margin: 0.26rem 0 0.72rem;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  line-height: 1.35;
}

.card-content a {
  display: inline-block;
  text-decoration: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.42rem 0.88rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.1);
  transition: background 180ms ease;
}

.card-content a:hover {
  background: rgba(255, 255, 255, 0.22);
}

.card-content a.is-disabled {
  pointer-events: none;
  opacity: 0.42;
  cursor: default;
}

.nav-arrow {
  position: absolute;
  top: 56%;
  transform: translateY(-50%);
  z-index: 8;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(62, 67, 79, 0.43);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.nav-prev {
  left: -12px;
}

.nav-next {
  right: -12px;
}

.nav-arrow:hover {
  background: rgba(34, 39, 48, 0.74);
  transform: translateY(-50%) scale(1.04);
}

.carousel-meta {
  margin-top: 0.72rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.95rem;
}

.carousel-current {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #626977;
  font-weight: 700;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.32rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(36, 39, 45, 0.22);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, width 180ms ease;
}

.carousel-dot:hover {
  transform: scale(1.16);
  background: rgba(36, 39, 45, 0.45);
}

.carousel-dot.is-active {
  width: 24px;
  background: #24272d;
}

.carousel-hint {
  margin: 0;
  text-align: right;
  color: #666c79;
  font-size: 0.75rem;
}

.carousel-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.42rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 35, 42, 0.34);
  background: linear-gradient(180deg, #3e444f 0%, #272c35 100%);
  box-shadow: 0 8px 18px rgba(22, 25, 30, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.carousel-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(22, 25, 30, 0.24);
}

.about-intro h1 {
  max-width: 21ch;
}

.story-cta-row {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.58rem;
}

.story-cta {
  display: inline-block;
  text-decoration: none;
  color: #262a33;
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.78rem;
  background: rgba(255, 255, 255, 0.7);
}

.story-cta.primary {
  color: #fff;
  border-color: rgba(116, 67, 35, 0.45);
  background: linear-gradient(180deg, #b37b53, #915b38);
}

.about-layout {
  margin-top: clamp(1.4rem, 4vw, 2.2rem);
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0.88rem;
}

.about-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 248, 250, 0.82)),
    var(--panel);
  padding: 1rem 1.05rem;
  box-shadow: 0 12px 24px rgba(27, 31, 41, 0.05);
}

.about-highlight {
  grid-row: span 2;
}

.about-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #666d79;
  font-weight: 700;
}

.about-card h2 {
  margin: 0.45rem 0 0.55rem;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.18rem, 1.9vw, 1.6rem);
  line-height: 1.14;
}

.about-card p {
  margin: 0;
  color: #4a505c;
  font-size: 0.93rem;
  line-height: 1.56;
}

.about-list {
  margin: 0.52rem 0 0;
  padding-left: 1rem;
  color: #444a55;
  font-size: 0.89rem;
  line-height: 1.62;
}

.about-tags {
  margin-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.44rem;
}

.about-tags span {
  display: inline-block;
  padding: 0.34rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 38, 46, 0.15);
  background: rgba(255, 255, 255, 0.7);
  color: #303540;
  font-size: 0.76rem;
  font-weight: 600;
}

.contact {
  margin-top: clamp(1.7rem, 4vw, 2.6rem);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.contact-copy {
  margin: 0;
  color: #414651;
  font-size: 1.02rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.56rem;
}

.contact-link-btn {
  text-decoration: none;
  color: #232730;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(27, 29, 36, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(242, 244, 248, 0.94));
  box-shadow: 0 8px 20px rgba(23, 27, 34, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.contact-link-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 29, 36, 0.3);
  box-shadow: 0 12px 24px rgba(23, 27, 34, 0.12);
}

.cv-float-btn {
  display: none;
  text-decoration: none;
}

.logo:focus-visible,
.menu-link:focus-visible,
.contact-btn:focus-visible,
.nav-arrow:focus-visible,
.carousel-dot:focus-visible,
.carousel-action-btn:focus-visible,
.card-content a:focus-visible,
.story-cta:focus-visible,
.contact-link-btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

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

@keyframes routeInForward {
  from {
    opacity: 0;
    transform: translateX(22px) translateY(8px) scale(0.994);
    filter: blur(1.6px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes routeOutForward {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px) translateY(-6px) scale(0.997);
    filter: blur(1.4px);
  }
}

@keyframes routeInBackward {
  from {
    opacity: 0;
    transform: translateX(-22px) translateY(8px) scale(0.994);
    filter: blur(1.6px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes routeOutBackward {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: translateX(20px) translateY(-6px) scale(0.997);
    filter: blur(1.4px);
  }
}

@media (max-width: 980px) {
  :root {
    --inactive-width: 80px;
    --active-width: min(72vw, 380px);
    --card-h: 210px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo cta"
      "menu menu";
    align-items: start;
  }

  .logo {
    grid-area: logo;
  }

  .topbar-actions {
    grid-area: cta;
    justify-self: end;
  }

  .menu {
    grid-area: menu;
    justify-self: start;
    margin-top: 0.44rem;
  }

  .availability {
    display: none;
  }

  .hero-points {
    gap: 0.45rem;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-highlight {
    grid-row: auto;
  }

  .contact {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  :root {
    --inactive-width: 44px;
    --active-width: calc(100% - ((var(--inactive-width) + var(--gap)) * 2));
    --card-h: 176px;
    --gap: 8px;
  }

  body {
    padding: 0.72rem;
  }

  .frame {
    border-radius: 22px;
    padding: 0.92rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "menu"
      "cta";
    gap: 0.56rem;
  }

  .logo {
    justify-self: start;
  }

  .topbar-actions {
    width: 100%;
    justify-self: stretch;
    justify-content: flex-start;
  }

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

  .menu {
    width: 100%;
    justify-content: space-between;
    padding: 0.22rem;
  }

  .menu-link {
    flex: 1 1 0;
    text-align: center;
    padding: 0.5rem 0.45rem;
    font-size: 0.62rem;
  }

  .intro {
    margin-top: 1.15rem;
  }

  .intro h1 {
    font-size: clamp(1.6rem, 8.7vw, 2.2rem);
  }

  .intro-copy {
    font-size: 0.92rem;
  }

  .hero-points p {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.7rem;
  }

  .carousel-block {
    padding: 0.7rem;
    overflow: hidden;
  }

  .nav-arrow {
    width: 32px;
    height: 32px;
    font-size: 0.92rem;
    top: 1.2rem;
    transform: none;
    background: rgba(34, 39, 48, 0.62);
  }

  .nav-prev {
    left: auto;
    right: 2.55rem;
  }

  .nav-next {
    right: 0.58rem;
  }

  .nav-arrow:hover {
    transform: scale(1.04);
  }

  .card-content p {
    display: none;
  }

  .card-content {
    padding: 0.62rem 0.66rem 0.66rem;
  }

  .card-content h2 {
    font-size: 1.08rem;
    line-height: 1.08;
  }

  .card-content a {
    font-size: 0.72rem;
    padding: 0.34rem 0.72rem;
  }

  .portfolio-card {
    transition:
      transform 300ms ease,
      filter 300ms ease,
      box-shadow 300ms ease;
  }

  .portfolio-card.is-active {
    width: var(--active-width);
  }

  .carousel-meta {
    grid-template-columns: 1fr;
    justify-items: flex-start;
    gap: 0.45rem;
  }

  .carousel-action-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.68rem;
    padding: 0.38rem 0.62rem;
  }

  .carousel-hint {
    text-align: left;
  }

  .contact {
    gap: 0.62rem;
  }

  .contact-copy {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .contact-links {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.48rem;
  }

  .contact-link-btn {
    text-align: center;
    padding: 0.56rem 0.35rem;
    font-size: 0.66rem;
    letter-spacing: 0.03em;
  }

  .cv-float-btn {
    display: none;
  }
}

@media (max-width: 420px) {
  :root {
    --inactive-width: 36px;
    --active-width: calc(100% - ((var(--inactive-width) + var(--gap)) * 2));
    --card-h: 138px;
    --gap: 6px;
  }

  body {
    padding: 0.42rem;
  }

  .frame {
    border-radius: 18px;
    padding: 0.72rem;
  }

  .menu-link {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .intro h1 {
    font-size: clamp(1.42rem, 9vw, 1.82rem);
  }

  .intro-copy {
    font-size: 0.86rem;
  }

  .hero-points {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .hero-points p {
    width: 100%;
    justify-content: flex-start;
  }

  .carousel-block {
    padding: 0.62rem;
  }

  .section-kicker {
    font-size: 0.68rem;
  }

  .carousel-current,
  .carousel-hint {
    font-size: 0.68rem;
  }

  .card-content h2 {
    font-size: 0.94rem;
  }

  .contact-links {
    grid-template-columns: 1fr;
  }

  .portfolio-card.is-active {
    background-position: center top;
  }

  .cv-float-btn {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
