:root {
  --bg: #0d100f;
  --surface: #151a18;
  --surface-strong: #1c2320;
  --text: #f2efe6;
  --muted: #abb4af;
  --line: #303936;
  --green: #2fbd8d;
  --amber: #f2a93b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    linear-gradient(120deg, rgba(47, 189, 141, 0.09), transparent 32%),
    linear-gradient(250deg, rgba(242, 169, 59, 0.07), transparent 34%),
    var(--bg);
}

body.viewer-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 54px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  border-bottom: 1px solid rgba(48, 57, 54, 0.82);
  background: rgba(13, 16, 15, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.top-actions,
.language-toggle,
.button-row,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.language-toggle {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(24, 29, 27, 0.85);
}

.language-button {
  min-width: 38px;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.language-button.active {
  color: #07100d;
  background: var(--green);
}

.back-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 36px;
  align-items: center;
  padding: 68px 0 42px;
}

.eyebrow,
.mini-title {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 70px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 19px;
}

.lead {
  max-width: 720px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.62;
}

.tag-list {
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dce3df;
  background: rgba(24, 29, 27, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.tag-list li.accent {
  border-color: rgba(47, 189, 141, 0.62);
  color: #8be1c3;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 900;
}

.button.primary {
  border-color: var(--green);
  color: #07100d;
  background: var(--green);
}

.button.secondary {
  border-color: rgba(242, 169, 59, 0.58);
}

.gallery {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(21, 26, 24, 0.92);
  box-shadow: var(--shadow);
}

.gallery-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid #313a37;
  border-radius: 9px;
  background: #050706;
  cursor: zoom-in;
  touch-action: pan-y;
}

.gallery-frame.portrait {
  width: min(100%, 340px);
  margin: 0 auto;
  aspect-ratio: 9 / 16;
}

.gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 320ms ease;
}

.gallery-image {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.gallery-button,
.viewer-button,
.viewer-close {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: 22px;
  cursor: pointer;
}

.gallery-counter {
  min-width: 52px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 54px;
}

.proof {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(21, 26, 24, 0.86);
}

.proof b {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 25px;
}

.proof span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.section {
  padding: 42px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-note {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.case-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(21, 26, 24, 0.9);
}

.case-card p,
.case-card li,
.content-list li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.case-card p:last-child {
  margin-bottom: 0;
}

.content-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.architecture-flow span {
  padding: 14px;
  border-left: 3px solid var(--green);
  border-radius: 7px;
  color: #dfe6e2;
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 800;
}

.next-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.next-project {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.next-project strong {
  display: block;
  margin-bottom: 7px;
  font-size: 18px;
}

.next-project span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

footer {
  padding: 34px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 16px 16px;
  background: rgba(5, 7, 6, 0.96);
  backdrop-filter: blur(8px);
}

.viewer.open {
  display: grid;
}

.viewer-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  font-size: 28px;
}

.viewer-frame {
  align-self: center;
  justify-self: center;
  width: min(100%, 1120px);
  height: calc(100dvh - 112px);
  overflow: hidden;
}

.viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 320ms ease;
}

.viewer-image {
  flex: 0 0 100%;
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.viewer-counter {
  min-width: 58px;
  color: var(--muted);
  text-align: center;
}

.viewer-button[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .case-hero,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .case-hero {
    padding-top: 46px;
  }

  .proof-strip,
  .architecture-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-hero .gallery {
    order: -1;
  }
}

@media (max-width: 620px) {
  .page {
    width: 100%;
    padding: 0 16px 42px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand language"
      "back back";
    align-items: center;
    gap: 10px 12px;
    min-height: 0;
    padding: 14px 0;
  }

  .brand {
    grid-area: brand;
  }

  .top-actions {
    display: contents;
  }

  .language-toggle {
    grid-area: language;
    justify-self: end;
  }

  .back-link {
    grid-area: back;
    justify-self: end;
    width: auto;
    text-align: right;
  }

  .case-hero {
    gap: 24px;
    padding: 34px 0 30px;
  }

  .case-hero .gallery {
    order: 0;
  }

  h1 {
    font-size: 39px;
  }

  .lead {
    font-size: 16px;
  }

  .proof-strip,
  .architecture-flow,
  .next-projects {
    grid-template-columns: 1fr;
  }

  .proof-strip {
    margin-bottom: 36px;
  }

  .section {
    padding: 34px 0;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .button-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .gallery-frame.portrait {
    width: min(100%, 300px);
  }
}
