:root {
  color-scheme: light;
  --bg: #f8f8f5;
  --surface: #ffffff;
  --text: #121a20;
  --muted: #5d6866;
  --line: #d9d9d2;
  --teal: #064338;
  --teal-dark: #002f29;
  --teal-soft: #e7f0ed;
  --gold: #c4913a;
  --gold-soft: #f4ead8;
  --shadow: 0 18px 55px rgba(0, 47, 41, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 42%, #f2f3ef 100%);
  color: var(--text);
  line-height: 1.6;
}

.home-page {
  overflow: hidden;
}

a {
  color: inherit;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(217, 222, 217, 0.8);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  left: 0;
  min-height: 76px;
  padding: 12px clamp(20px, 5vw, 72px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  align-items: center;
  display: inline-flex;
  text-decoration: none;
}

.brand img {
  height: clamp(36px, 5vw, 48px);
  object-fit: contain;
  width: clamp(170px, 22vw, 248px);
}

.nav {
  display: flex;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  font: inherit;
  padding: 10px 12px;
  text-decoration: none;
}

.nav a:hover,
.nav a.is-active {
  color: var(--gold);
}

.language-switch {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  font-size: 1.15rem;
  height: 40px;
  justify-content: center;
  text-decoration: none;
  width: 44px;
}

.language-switch:hover {
  border-color: var(--gold);
}

.hero {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(0, 47, 41, 0.055) 0 1px, transparent 1px 118px),
    linear-gradient(30deg, rgba(196, 145, 58, 0.08) 0 1px, transparent 1px 92px),
    linear-gradient(135deg, #ffffff 0%, #fbfaf6 46%, #eef4f1 100%);
  display: flex;
  height: calc(100dvh - 76px);
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

.hero::before {
  background: rgba(0, 47, 41, 0.08);
  border-left: 2px solid rgba(196, 145, 58, 0.42);
  content: "";
  height: 100%;
  left: 58%;
  position: absolute;
  top: 0;
  transform: skewX(-21deg);
  width: 34vw;
}

.hero::after {
  border: 1px solid rgba(196, 145, 58, 0.28);
  content: "";
  height: min(42vw, 440px);
  position: absolute;
  right: -12vw;
  top: 18%;
  transform: rotate(28deg);
  width: min(42vw, 440px);
}

.hero__content {
  align-items: center;
  color: var(--text);
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  grid-template-columns: minmax(220px, 0.8fr) minmax(220px, 0.7fr);
  max-width: 1180px;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 72px);
  position: relative;
  width: 100%;
  z-index: 1;
}

.hero__logo-wrap {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 280px;
  position: relative;
}

.hero__logo {
  height: auto;
  max-width: min(460px, 78vw);
  position: relative;
  width: 100%;
  z-index: 1;
}

.hero__text {
  max-width: 460px;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 0;
  max-width: 12ch;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin-bottom: 0;
}

h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 12px;
}

.hero__intro {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  max-width: 620px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 800;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  text-decoration: none;
}

.button--primary {
  background: var(--teal);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(0, 47, 41, 0.18);
}

.button--primary:hover {
  background: var(--teal-dark);
}

.button--secondary {
  background: #ffffff;
  border-color: var(--line);
  color: var(--teal-dark);
}

.section {
  margin: 0 auto;
  max-width: 1180px;
  padding: clamp(48px, 7vw, 88px) clamp(20px, 5vw, 72px);
}

.intro {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.85fr) minmax(280px, 1fr);
}

.intro p,
.contact p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 690px;
}

.section__header {
  margin-bottom: 34px;
}

.page-intro {
  padding-bottom: 24px;
}

.page-intro p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 760px;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.page-nav a {
  background: var(--gold-soft);
  border: 1px solid rgba(196, 145, 58, 0.26);
  border-radius: 8px;
  color: var(--teal-dark);
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
}

.page-nav a:hover {
  background: #ffffff;
  border-color: var(--gold);
}

.section--compact {
  padding-top: 0;
}

.portfolio-stack {
  display: grid;
  gap: 18px;
}

.project-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.case-study {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr);
  min-height: 320px;
  padding: 24px;
}

.chatbot-case {
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.9fr);
}

.case-study__content {
  display: flex;
  flex-direction: column;
}

.case-study__content p {
  color: var(--muted);
}

.case-study__list {
  color: var(--muted);
  margin: 6px 0 0;
  padding-left: 20px;
}

.case-study__list li + li {
  margin-top: 8px;
}

.case-study__visual {
  align-items: center;
  background: #fbfaf6;
  border: 1px solid rgba(0, 47, 41, 0.14);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 800;
  justify-content: center;
  min-height: 220px;
  overflow: hidden;
  text-transform: uppercase;
}

.case-study__visual img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  width: 100%;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tech-stack span {
  background: var(--gold-soft);
  border: 1px solid rgba(196, 145, 58, 0.24);
  border-radius: 8px;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 800;
  padding: 7px 10px;
}

.chat-widget {
  background: #fbfaf6;
  border: 1px solid rgba(0, 47, 41, 0.18);
  border-radius: 8px;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  min-height: 420px;
  overflow: hidden;
}

.home-chat {
  bottom: clamp(18px, 3vw, 34px);
  box-shadow: var(--shadow);
  max-height: min(430px, calc(100dvh - 116px));
  min-height: 0;
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  width: min(380px, calc(100vw - 36px));
  z-index: 2;
}

.home-chat .chat-widget__messages {
  min-height: 160px;
}

.chat-widget__header {
  align-items: center;
  background: var(--teal-dark);
  color: #ffffff;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 16px;
}

.chat-widget__header strong,
.chat-widget__header span {
  display: block;
}

.chat-widget__header span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.chat-widget__toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.home-chat.is-minimized {
  grid-template-rows: auto;
}

.home-chat.is-minimized .chat-widget__messages,
.home-chat.is-minimized .chat-widget__form {
  display: none;
}

.chat-widget__messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
}

.chat-message {
  border-radius: 8px;
  max-width: 88%;
  padding: 10px 12px;
}

.chat-message--bot {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
}

.chat-message--user {
  align-self: flex-end;
  background: var(--teal);
  color: #ffffff;
}

.chat-widget__form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

.chat-widget__form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 46px;
  padding: 0 12px;
}

.chat-widget__form button {
  background: var(--gold);
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 24px;
}

.project-card p {
  color: var(--muted);
}

.project-card__actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.project-card__actions a,
.project-card__status {
  color: var(--teal-dark);
  display: inline-flex;
  font-weight: 800;
  text-decoration: none;
}

.project-card__actions a:hover {
  color: var(--gold);
}

.project-card__meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.project-card__meta span {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 4px;
}

.skill-list {
  margin-left: auto;
  margin-right: auto;
  max-width: 1036px;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
}

.skills-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 42px;
}

.skill-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 246, 0.96)),
    var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
  position: relative;
}

.skill-card::after {
  background: var(--gold);
  content: "";
  height: 4px;
  left: 24px;
  position: absolute;
  top: -4px;
  width: 54px;
}

.skill-card h2 {
  color: var(--teal-dark);
  font-size: 1.28rem;
  line-height: 1.2;
  margin-bottom: 12px;
}

.skill-card p,
.skill-card li,
.skills-summary p {
  color: var(--muted);
}

.skill-card ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.skill-card li + li {
  margin-top: 8px;
}

.skills-summary {
  margin-bottom: 18px;
}

.skills-summary h2 {
  color: var(--teal-dark);
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.skill-list li {
  background: var(--gold-soft);
  border: 1px solid rgba(196, 145, 58, 0.26);
  border-radius: 8px;
  color: var(--teal-dark);
  font-weight: 800;
  padding: 12px 14px;
}

.contact {
  text-align: left;
}

.contact .button {
  margin-top: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px clamp(20px, 5vw, 72px);
}

.site-footer p {
  margin: 0 auto;
  max-width: 1180px;
}

@media (max-width: 820px) {
  .site-header {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 2px;
    width: 100%;
  }

  .language-switch {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .hero {
    height: calc(100dvh - 120px);
    min-height: 0;
  }

  .hero__content {
    grid-template-columns: 1fr;
    padding-bottom: 128px;
    padding-top: 42px;
  }

  .hero__logo-wrap {
    min-height: 230px;
  }

  .hero__logo {
    max-width: min(360px, 82vw);
  }

  h1 {
    max-width: 12ch;
  }

  .intro,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .case-study,
  .chatbot-case {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

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

@media (min-width: 821px) and (max-width: 1120px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .brand img {
    width: 190px;
  }

  .nav a {
    padding-left: 8px;
    padding-right: 8px;
  }

  .hero__actions,
  .button,
  .chat-widget__form button {
    width: 100%;
  }

  .home-chat {
    bottom: 12px;
    max-height: min(310px, calc(100dvh - 154px));
    position: fixed;
    right: 12px;
    width: calc(100vw - 32px);
  }

  .home-chat .chat-widget__messages {
    min-height: 88px;
  }

  .home-chat:not(.is-minimized) {
    grid-template-rows: auto minmax(88px, 1fr) auto;
  }

  .chat-widget__form {
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 52px;
  }
}
