/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --bg: #FAFAF8;
  --surface: #F2F1EC;
  --card: #ffffff;
  --ink: #16181D;
  --muted: #5A5F6B;
  --border: #E8E7E2;
  --border-light: #E0DFD9;
  --accent: #2452D6;
  --accent-hover: #1B3FAE;
  --accent-hover-soft: #3B67E8;
  --orange: #F0691E;
  --orange-hover: #D4570F;
  --dark-bg: #14151A;
  --dark-text: #F5F5F2;
  --dark-muted: #A9ADB8;
  --dark-border: #2C2F38;
  --dark-input: #1E2027;
  --dark-subtle: #6B707C;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --container: 1200px;
  --font-sans: 'Manrope', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ==========================================================================
   Reset
   ========================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }
input::placeholder, textarea::placeholder { color: #9AA0AC; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

.h2 {
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 14px 0 0;
}

.section { padding: 96px 0; }
.section--alt { background: var(--surface); }

/* ==========================================================================
   Language toggle (client-side, no reload)
   Only the "hide" side is styled, with !important so it always wins over
   component display rules (e.g. .btn's inline-flex). The "show" side is
   left to each element's own CSS, so nothing needs to be re-declared.
   ========================================================================== */
html:not([data-lang="en"]) [data-lang-en] { display: none !important; }
html[data-lang="en"] [data-lang-ua] { display: none !important; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn--lg { padding: 16px 28px; border-radius: 10px; font-size: 16px; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--accent); color: #fff; }
.btn--outline { border: 1.5px solid var(--border-light); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: var(--accent-hover); color: #fff; }
.btn--orange { background: var(--orange); color: #fff; }
.btn--orange:hover { background: var(--orange-hover); color: #fff; }
.btn--sm { padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; }
.btn--white { background: #fff; color: var(--dark-bg); }
.btn--white:hover { background: var(--accent); color: #fff; }
.btn--full { width: 100%; justify-content: center; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex-shrink: 0;
}
.brand-mark {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
}
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; color: var(--ink); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}
.main-nav a { color: var(--muted); }
.main-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
}
.lang-switch button {
  padding: 6px 12px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}
.lang-switch button.is-active { background: var(--ink); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 4px 32px 20px;
  border-top: 1px solid var(--border);
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { padding: 10px 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.mobile-nav-divider { height: 1px; background: var(--border); margin: 8px 0 14px; }
.mobile-nav .lang-switch { align-self: flex-start; margin-bottom: 12px; }
.mobile-nav-btn { justify-content: center; margin-top: 10px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 88px 0 96px; }
.hero .container {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 64px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 20px 0 0;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 540px;
  margin: 28px 0 0;
}
.hero-ctas { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.hero-tag {
  font-family: var(--font-mono);
  font-size: 12.5px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 7px 14px;
  color: var(--muted);
}
.hero-media { position: relative; }
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
  border-radius: var(--radius-xl);
}
.hero-badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(20, 21, 26, 0.14);
}
.hero-badge-num { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.hero-badge-label { font-size: 13px; color: var(--muted); }

/* ==========================================================================
   Services
   ========================================================================== */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
.service-card { background: var(--card); border-radius: var(--radius-lg); padding: 36px; }
.service-card h3 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.service-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 22px;
  font-size: 15.5px;
  line-height: 1.5;
  color: #3A3E48;
  list-style: none;
  padding: 0;
}
.service-list li { display: flex; gap: 10px; }
.service-list li::before { content: '—'; color: var(--accent); font-weight: 700; }

/* ==========================================================================
   Pricing
   ========================================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.price-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.price-card-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.price-row { display: flex; flex-direction: column; gap: 14px; }
.price-item-label { font-size: 15px; color: var(--muted); }
.price-item-value { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.pricing-note {
  margin-top: 24px;
  border: 1px dashed var(--border-light);
  border-radius: 14px;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.pricing-note strong { font-weight: 800; }
.pricing-note-link { font-weight: 700; font-size: 15px; white-space: nowrap; }

/* ==========================================================================
   Why me
   ========================================================================== */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.why-card { background: var(--card); border-radius: 14px; padding: 26px; }
.why-check { color: var(--accent); font-weight: 800; font-size: 20px; }
.why-text { font-size: 16px; font-weight: 700; margin-top: 10px; line-height: 1.45; }

/* ==========================================================================
   Portfolio cards
   ========================================================================== */
.portfolio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}
.portfolio-head-link { font-weight: 700; font-size: 15px; }
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}
.project-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}
.project-media {
  height: 220px;
  background: var(--surface);
  position: relative;
}
.project-media img { width: 100%; height: 100%; object-fit: cover; }
.project-media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9A988F;
  font-size: 13px;
  font-family: var(--font-mono);
  background: linear-gradient(135deg, #F2F1EC 0%, #E8E7E2 100%);
  text-align: center;
  padding: 12px;
}
.project-body { padding: 24px 26px 28px; }
.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.project-title { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.project-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  white-space: nowrap;
}
.project-desc { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 10px 0 0; }
.portfolio-footnote { font-size: 15px; color: var(--muted); margin: 32px 0 0; max-width: 720px; line-height: 1.6; }

/* full portfolio page variants */
.portfolio-page-grid .project-body { padding: 22px 24px 26px; }
.portfolio-page-grid .project-title { font-size: 19px; }
.portfolio-page-grid .project-desc { font-size: 14.5px; margin-top: 8px; }

.portfolio-cta {
  margin-top: 64px;
  background: var(--dark-bg);
  border-radius: var(--radius-xl);
  padding: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.portfolio-cta-title { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.portfolio-cta-sub { font-size: 16px; color: var(--dark-muted); margin-top: 8px; }

.empty-state {
  margin-top: 48px;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

/* ==========================================================================
   About
   ========================================================================== */
.about-block { max-width: 820px; }
.about-block p { font-size: 17px; line-height: 1.65; color: #3A3E48; margin: 24px 0 0; }
.about-block p + p { margin-top: 16px; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-section { padding: 96px 0 72px; background: var(--dark-bg); color: var(--dark-text); }
.contact-section .eyebrow { color: #7C9BF5; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.contact-h2 { color: #fff; }
.contact-lede { font-size: 17px; line-height: 1.65; color: var(--dark-muted); margin: 24px 0 0; }
.contact-tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: #fff;
  padding: 18px 30px;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 700;
  margin-top: 32px;
}
.contact-tg-btn:hover { background: var(--accent-hover-soft); color: #fff; }
.contact-response-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dark-subtle);
  margin-top: 20px;
}

.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field {
  background: var(--dark-input);
  border: 1px solid var(--dark-border);
  border-radius: 10px;
  padding: 15px 16px;
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
}
select.field {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239AA0AC' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}
textarea.field { resize: vertical; }
.form-hint { font-size: 13px; color: var(--dark-subtle); line-height: 1.5; }

.footer-bar {
  max-width: var(--container);
  margin: 72px auto 0;
  padding: 28px 32px 0;
  border-top: 1px solid var(--dark-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand { font-weight: 800; font-size: 15px; color: #fff; }
.footer-stack { font-family: var(--font-mono); font-size: 13px; color: var(--dark-subtle); }
.footer-year { font-size: 13px; color: var(--dark-subtle); }

/* ==========================================================================
   Full-portfolio page header
   ========================================================================== */
.page-hero { padding: 80px 0 96px; }
.page-hero h1 {
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 18px 0 0;
}
.page-hero p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 640px;
  margin: 24px 0 0;
}

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-shell { min-height: 100vh; background: var(--surface); }
.admin-topbar {
  background: var(--ink);
  color: #fff;
  padding: 18px 0;
}
.admin-topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-topbar-brand { font-weight: 800; font-size: 16px; }
.admin-topbar a.btn--sm { }
.admin-main { padding: 48px 0 96px; }
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.admin-flash {
  background: #E8F0FF;
  border: 1px solid #C7D9FB;
  color: var(--accent-hover);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14.5px;
  font-weight: 600;
}
.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.admin-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  vertical-align: middle;
}
.admin-thumb {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface);
}
.admin-thumb-placeholder {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9A988F;
  font-size: 10px;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge--on { background: #E4F5E9; color: #1C7A3B; }
.badge--off { background: #F0F0EE; color: #8A8A82; }
.admin-row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.icon-btn {
  border: 1px solid var(--border-light);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn--danger:hover { border-color: #C0392B; color: #C0392B; }

.admin-form { max-width: 640px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.form-help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.text-input, textarea.text-input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.text-input:focus, textarea.text-input:focus, select.text-input:focus {
  outline: none;
  border-color: var(--accent);
}
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; }
.current-image { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark-bg);
  padding: 24px;
}
.login-card {
  background: #1E2027;
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 380px;
}
.login-card h1 { color: #fff; font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.login-card p.sub { color: var(--dark-muted); font-size: 14px; margin: 0 0 28px; }
.login-error {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.4);
  color: #F0958B;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .container { padding: 0 24px; }
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions .header-only-action { display: none; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero-media { order: -1; max-width: 360px; }
  .service-grid, .why-grid, .portfolio-grid, .pricing-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .section { padding: 64px 0; }
  .service-grid, .why-grid, .portfolio-grid, .pricing-grid, .service-list, .form-row { grid-template-columns: 1fr; }
  .portfolio-cta, .pricing-note { flex-direction: column; align-items: flex-start; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}
