/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg: #0a0b10;
  --bg-panel: #12141c;
  --bg-elevated: #181a24;
  --border: #23252f;
  --border-soft: #1a1c25;

  --text: #e7e7ef;
  --text-dim: #8a8f9c;
  --text-faint: #4d5160;

  --purple: #b48cf0;
  --cyan: #7fe0d4;
  --yellow: #e8c579;
  --green: #8fd19e;

  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;

  --topbar-h: 56px;
  --gutter-w: 56px;
  --radius: 12px;
  --radius-sm: 8px;

  --ease: cubic-bezier(.22,1,.36,1);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--topbar-h);
  position: relative;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--purple); color: #0a0b10; }

/* ============================================================
   SYNTAX TOKENS (reused across sections)
   ============================================================ */
.kw   { color: var(--purple); font-weight: 600; }
.fn   { color: var(--yellow); }
.tag  { color: var(--cyan); }
.punc { color: var(--text-dim); }
.com  { color: var(--text-faint); font-style: italic; }
.str  {
  color: var(--green);
  font-family: var(--mono);
  font-size: .78rem;
  background: rgba(143,209,158,.08);
  border: 1px solid rgba(143,209,158,.2);
  border-radius: 5px;
  padding: .2em .55em;
  white-space: nowrap;
}

.eyebrow {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-faint);
  margin: 0 0 .9rem;
}

/* ============================================================
   AMBIENT BACKGROUND
   ============================================================ */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--bg);
}

.bg__grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(231,231,239,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(231,231,239,.045) 1px, transparent 1px),
    linear-gradient(to right, rgba(231,231,239,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(231,231,239,.09) 1px, transparent 1px);
  background-size: 32px 32px, 32px 32px, 160px 160px, 160px 160px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 45%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 45%, transparent 100%);
}

.bg__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}
.bg__glow--1 {
  width: 620px; height: 620px;
  top: -220px; left: 6%;
  background: radial-gradient(circle, rgba(180,140,240,.35) 0%, transparent 70%);
  animation: drift1 26s ease-in-out infinite;
}
.bg__glow--2 {
  width: 560px; height: 560px;
  top: 38vh; right: -160px;
  background: radial-gradient(circle, rgba(127,224,212,.28) 0%, transparent 70%);
  animation: drift2 32s ease-in-out infinite;
}
.bg__glow--3 {
  width: 520px; height: 520px;
  bottom: -180px; left: 32%;
  background: radial-gradient(circle, rgba(232,197,121,.18) 0%, transparent 70%);
  animation: drift3 30s ease-in-out infinite;
}

@keyframes drift1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 60px); }
}
@keyframes drift2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-50px, -40px); }
}
@keyframes drift3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, -50px); }
}

@media (prefers-reduced-motion: reduce) {
  .bg__glow { animation: none; }
}
@media (max-width: 700px) {
  .bg__glow { filter: blur(70px); opacity: .4; }
}

/* ============================================================
   GUTTER (decorative line numbers)
   ============================================================ */
.gutter {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--gutter-w);
  border-right: 1px solid var(--border-soft);
  background: var(--bg);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
  text-align: right;
  padding-top: 6px;
  overflow: hidden;
  z-index: 5;
  user-select: none;
}
.gutter span {
  display: block;
  height: 24px;
  line-height: 24px;
  padding-right: 14px;
}
@media (max-width: 900px) {
  .gutter { display: none; }
}
body { padding-left: 0; }
@media (min-width: 901px) {
  .topbar__inner, main, .statusbar { padding-left: var(--gutter-w); }
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: rgba(10,11,16,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 0 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
}
.topbar__lights { display: flex; gap: 7px; flex-shrink: 0; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot--red { background: #ec6a5e; }
.dot--yellow { background: #f4bf50; }
.dot--green { background: #61c454; }

.tabs {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: .25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 .9rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
  border-top: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.tab__icon { width: 13px; height: 13px; opacity: .7; flex-shrink: 0; }
.tab:hover { color: var(--text); background: var(--bg-panel); }
.tab.is-active {
  color: var(--text);
  background: var(--bg-panel);
  border-top-color: var(--purple);
}

.topbar__status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
  flex-shrink: 0;
  white-space: nowrap;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(143,209,158,.15);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

.menu-btn {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  width: 32px; height: 32px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.menu-btn span { width: 18px; height: 1.5px; background: var(--text); display: block; }

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a {
  padding: .9rem 1.25rem;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-soft);
}
.mobile-menu.is-open { display: flex; }

@media (max-width: 780px) {
  .tabs { display: none; }
  .topbar__status { display: none; }
  .menu-btn { display: flex; }
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
main { max-width: 1400px; margin: 0 auto; }
section { padding: 0 1.25rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: calc(100vh - var(--topbar-h));
  display: flex;
  align-items: center;
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.hero__inner { max-width: 880px; }

.code-frame {
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.9;
}
.code-line { color: var(--text-dim); }

.hero__title {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: var(--text);
  margin: .5rem 0 .5rem 1.6rem;
  text-transform: lowercase;
}

.cursor {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  background: var(--cyan);
  margin-left: .35em;
  vertical-align: -.15em;
  animation: blink 1.05s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__comment {
  font-family: var(--mono);
  font-size: .92rem;
  line-height: 1.8;
  margin-top: 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .85rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 500;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.btn--primary {
  background: var(--green);
  color: #0a1a10;
  border: 1px solid var(--green);
}
.btn--primary:hover { transform: translateY(-2px); background: #a3dbb0; }
.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--text-dim); transform: translateY(-2px); }

/* reveal-on-load lines in hero */
.reveal-lines {
  animation: lineIn .6s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 90ms + 120ms);
}
.code-frame .reveal-lines { animation-name: lineIn; }
@keyframes lineIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   WHY / COMMENTS STRIP
   ============================================================ */
.why {
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-panel);
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.why__inner { max-width: 1400px; margin: 0 auto; }
.why__label { margin-bottom: 1.25rem; font-family: var(--mono); font-size: .92rem; }
.why__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2rem;
}
.why__list li {
  font-family: var(--mono);
  font-size: .88rem;
  line-height: 1.75;
  color: var(--text-dim);
}
.why__list li .com { color: var(--text-faint); }
@media (max-width: 860px) {
  .why__list { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ============================================================
   SECTION HEAD (shared)
   ============================================================ */
.section-head {
  padding-top: 6rem;
  max-width: 640px;
}
.section-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -.01em;
  margin-bottom: 1rem;
}
.section-sub {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 52ch;
}

/* ============================================================
   PROJECTS
   ============================================================ */
.projects { padding-bottom: 6rem; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

/* на планшетах — тоже в 1 колонку, но пока не карусель */
@media (max-width: 900px) and (min-width: 641px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* на телефонах — горизонтальная карусель со свайпом вправо, а не столбик вниз */
@media (max-width: 640px) {
  .project-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: visible;
    gap: 1rem;
    margin: 2.5rem -1rem 0;
    padding: .25rem 1rem 1rem;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .project-grid::-webkit-scrollbar { display: none; }

  .project {
    flex: 0 0 84%;
    scroll-snap-align: start;
  }

  /* подсказка, что карточки листаются: следующая чуть выглядывает справа */
  .project-grid::after {
    content: '';
    flex: 0 0 .5rem;
  }
}

/* индикатор-подсказка "листай вправо" под заголовком секции проектов, только на телефоне */
.projects__hint {
  display: none;
}
@media (max-width: 640px) {
  .projects__hint {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--text-faint);
  }
  .projects__hint svg { animation: hintSlide 1.6s ease-in-out infinite; }
}
@keyframes hintSlide {
  0%, 100% { transform: translateX(0); opacity: .5; }
  50% { transform: translateX(5px); opacity: 1; }
}

.project {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease),
              border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.project.in-view { opacity: 1; transform: translateY(0); }
.project:hover {
  border-color: var(--text-faint);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.6);
}

.project__tabbar {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem 1rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.project__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex-shrink: 0; }

.project__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 1rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.project__index {
  font-family: var(--mono);
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 5px;
  padding: .2em .55em;
  backdrop-filter: blur(4px);
}

.cover--megmad    { background-image: url('assets/cover-megmad.jpg'); }
.cover--kakdoma   { background-image: url('assets/cover-kakdoma.jpg'); background-color: #1c1712; }
.cover--nova      { background-image: url('assets/cover-nova.jpg'); }
.cover--perfume   { background-image: url('assets/cover-perfume.jpg'); }
.cover--synthesis { background-image: url('assets/cover-synthesis.jpg'); }
.cover--goldman   { background-image: url('assets/cover-goldman.jpg'); background-color: #241c10; }

.project__body { padding: 1.4rem 1.25rem 1.6rem; display: flex; flex-direction: column; gap: .7rem; flex: 1; }
.project__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .01em;
}
.project__desc { font-size: .88rem; line-height: 1.65; color: var(--text-dim); }
.project__desc .com { color: var(--text-faint); }
.project__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .1rem; }
.project__link {
  margin-top: auto;
  padding-top: .6rem;
  font-family: var(--mono);
  font-size: .85rem;
  color: var(--cyan);
  transition: gap .15s var(--ease);
  align-self: flex-start;
}
.project__link:hover { text-decoration: underline; }

/* ============================================================
   SERVICES / EXPLORER
   ============================================================ */
.services { padding-bottom: 6rem; }
.services__grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 3rem;
  align-items: start;
  padding-top: 6rem;
}
@media (max-width: 900px) {
  .services__grid { grid-template-columns: 1fr; padding-top: 4rem; }
}
.services .section-head { padding-top: 0; }

.explorer {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.explorer.in-view { opacity: 1; transform: translateY(0); }

.explorer__head {
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
}
.explorer__list li {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--mono);
  font-size: .88rem;
  flex-wrap: wrap;
}
.explorer__list li:last-child { border-bottom: none; }
.file-icon { color: var(--purple); font-size: .6rem; }
.file-name { color: var(--text); flex-shrink: 0; }
.file-desc { color: var(--text-faint); font-family: var(--sans); font-size: .85rem; }

/* ============================================================
   CONTACT / TERMINAL
   ============================================================ */
.contact { padding: 6rem 1.25rem 7rem; }

.terminal {
  max-width: 760px;
  margin: 0 auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.terminal.in-view { opacity: 1; transform: translateY(0); }

.terminal__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.terminal__title {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
}

.terminal__body { padding: 1.6rem 1.5rem 1.9rem; font-family: var(--mono); font-size: .92rem; line-height: 1.9; }
.terminal__body p { margin-bottom: .2rem; }
.prompt { color: var(--green); }
.path { color: var(--cyan); }
.out { color: var(--text-dim); margin-bottom: 1.1rem !important; }

.terminal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.6rem;
}

.contact-phone {
  color: var(--yellow);
  font-weight: 600;
  border-bottom: 1px dashed rgba(232,197,121,.4);
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.contact-phone:hover { color: var(--text); border-color: var(--text); }

/* ============================================================
   FOOTER / STATUS BAR
   ============================================================ */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text-faint);
  max-width: 1400px;
  margin: 0 auto;
  flex-wrap: wrap;
}
.statusbar__left, .statusbar__right { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.statusbar__made { color: var(--text-faint); }

/* ============================================================
   CASE STUDY PAGE
   ============================================================ */
.case-hero {
  padding-top: 5rem;
  padding-bottom: 3rem;
  max-width: 880px;
}
.case-hero__back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-dim);
  margin-bottom: 2rem;
  transition: color .15s var(--ease);
}
.case-hero__back:hover { color: var(--cyan); }

.case-hero__title {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.case-hero__lede {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 62ch;
}
.case-hero__tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }

.case-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 2.5rem;
}
.case-meta__item {
  background: var(--bg-panel);
  padding: 1.1rem 1.25rem;
}
.case-meta__label {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .4rem;
}
.case-meta__value {
  font-family: var(--mono);
  font-size: .98rem;
  color: var(--text);
}
@media (max-width: 700px) {
  .case-meta { grid-template-columns: 1fr; }
}

/* task / solution / result blocks */
.case-block {
  padding-top: 4.5rem;
  max-width: 780px;
}
.case-block__num {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--cyan);
  margin-bottom: .6rem;
}
.case-block__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}
.case-block__text {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.8;
}
.case-block__text + .case-block__text { margin-top: .9rem; }

/* git-style commit timeline */
.case-timeline {
  padding-top: 4.5rem;
  padding-bottom: 5rem;
  max-width: 780px;
}
.commit-log {
  margin-top: 2rem;
  border-left: 2px solid var(--border);
  padding-left: 0;
}
.commit {
  position: relative;
  padding: 0 0 2.1rem 2rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.commit.in-view { opacity: 1; transform: translateY(0); }
.commit:last-child { padding-bottom: 0; }
.commit::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--cyan);
}
.commit--launch::before { background: var(--green); border-color: var(--green); }
.commit__hash {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-faint);
}
.commit__msg {
  font-family: var(--mono);
  font-size: .98rem;
  color: var(--text);
  margin: .3rem 0 .45rem;
  font-weight: 600;
}
.commit__desc {
  color: var(--text-dim);
  font-size: .9rem;
  line-height: 1.65;
  max-width: 56ch;
}
.commit__day {
  display: inline-block;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .15em .55em;
  margin-top: .55rem;
}

/* screenshot gallery for case pages — one photo at a time, arrows to slide */
.case-gallery {
  position: relative;
  max-width: 900px;
  margin: 2.5rem 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0d0e14;
}
.case-gallery__track {
  display: flex;
  transition: transform .35s var(--ease);
}
.case-gallery__item {
  flex: 0 0 100%;
  min-width: 0;
}
.case-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
}
.case-gallery__caption {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-faint);
  padding: .6rem .9rem;
  border-top: 1px solid var(--border);
}
.case-gallery__arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to var(--dir, right), rgba(10,11,16,.55), transparent);
  border: none;
  color: #fff;
  font-family: var(--mono);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.case-gallery:hover .case-gallery__arrow,
.case-gallery:focus-within .case-gallery__arrow { opacity: 1; }
.case-gallery__arrow--prev { left: 0; --dir: left; justify-content: flex-start; padding-left: .4rem; }
.case-gallery__arrow--next { right: 0; --dir: right; justify-content: flex-end; padding-right: .4rem; }
.case-gallery__arrow:disabled { opacity: 0 !important; pointer-events: none; }
.case-gallery__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: .7rem;
  display: flex;
  justify-content: center;
  gap: .4rem;
}
.case-gallery__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  border: none;
  padding: 0;
  cursor: pointer;
}
.case-gallery__dot.is-active { background: var(--cyan); }

/* touch devices: arrows always visible, no hover state */
@media (hover: none) {
  .case-gallery__arrow { opacity: 1; }
}

/* honest placeholder note (no fake screenshots) */
.case-note {
  max-width: 780px;
  margin: 3rem 0 0;
  padding: 1.1rem 1.25rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--text-faint);
  line-height: 1.7;
}

.case-cta {
  padding: 5rem 1.25rem 7rem;
  text-align: center;
}
.case-cta__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 1.5rem;
}

/* ============================================================
   PROCESS / CI-CD PIPELINE
   ============================================================ */
.process { padding-bottom: 6rem; }

.pipeline-panel {
  margin-top: 2.5rem;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.pipeline-panel.in-view { opacity: 1; transform: translateY(0); }

.pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 1.15rem;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: .82rem;
}
.pipeline-head__id { color: var(--text-dim); }
.pipeline-head__id .tag { margin-right: .2rem; }
.pipeline-head__status {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--green);
}

.pipeline {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}

.pipeline__stage {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 1.6rem 1.35rem 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.pipeline__stage:last-child { border-right: none; }
.pipeline__stage--launch {
  background: linear-gradient(180deg, rgba(143,209,158,.09), transparent 60%);
}

.pipeline__arrow {
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--cyan);
}

.pipeline__num {
  font-family: var(--mono);
  font-weight: 700;
  font-size: .8rem;
  color: var(--c, var(--cyan));
}
.pipeline__title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
}
.pipeline__desc {
  color: var(--text-dim);
  font-size: .85rem;
  line-height: 1.6;
  flex: 1;
}
.pipeline__day {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .15em .55em;
}
.pipeline__badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--green);
  background: rgba(143,209,158,.1);
  border: 1px solid rgba(143,209,158,.3);
  border-radius: 999px;
  padding: .3em .75em;
}
.pipeline__badge .status-dot { width: 6px; height: 6px; box-shadow: none; }

@media (max-width: 900px) {
  .pipeline { flex-direction: column; }
  .pipeline__stage {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .pipeline__stage:last-child { border-bottom: none; }
  .pipeline__arrow {
    right: auto;
    left: 20px;
    top: auto;
    bottom: -11px;
    transform: rotate(90deg);
  }
}

/* ============================================================
   PHONE FINE-TUNING (небольшие экраны — телефоны)
   ============================================================ */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; overflow-x: hidden; }

  section { padding-left: 1rem; padding-right: 1rem; }
  main { overflow-x: hidden; }

  .topbar__inner { padding: 0 1rem; gap: 1rem; }

  .hero { padding-top: 2.5rem; padding-bottom: 2.5rem; min-height: auto; }
  .hero__title {
    margin-left: .9rem;
    font-size: clamp(1.9rem, 9vw, 2.6rem);
  }
  .code-frame { font-size: .82rem; line-height: 1.7; }
  .hero__comment { font-size: .82rem; }
  .hero__actions { gap: .75rem; }
  .hero__actions .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

  .section-head { padding-top: 3.5rem; }
  .section-title { font-size: clamp(1.5rem, 7vw, 2rem); }

  .why { padding-top: 2.5rem; padding-bottom: 2.5rem; }
  .why__list li { font-size: .85rem; line-height: 1.65; }

  .project__title { font-size: 1.15rem; }
  .project__body { padding: 1.1rem 1rem 1.3rem; }

  .explorer__list li { padding: .8rem .9rem; }

  .contact { padding: 3.5rem 1rem 4.5rem; }
  .terminal__body { padding: 1.25rem 1.1rem 1.5rem; font-size: .85rem; }
  .terminal__actions { flex-direction: column; }
  .terminal__actions .btn { width: 100%; justify-content: center; text-align: center; }

  .statusbar { padding: .8rem 1rem; font-size: .7rem; gap: .5rem; }
  .statusbar__left, .statusbar__right { gap: .8rem; }

  .case-hero { padding-top: 3.5rem; padding-bottom: 2rem; }
  .case-block { padding-top: 3rem; }
  .case-timeline { padding-top: 3rem; padding-bottom: 3.5rem; }
  .case-cta { padding: 3.5rem 1rem 4.5rem; }
}

@media (max-width: 380px) {
  .hero__title { margin-left: .5rem; font-size: clamp(1.6rem, 9vw, 2.1rem); }
  .code-line { font-size: .76rem; }
  .btn { padding: .75rem 1.1rem; font-size: .82rem; }
}
