/* ============================================================
   Bluebeam Studio — single-file design system
   Light default, dark via [data-theme="dark"]. White / blue / black.
   ============================================================ */
:root {
  --white: #ffffff;
  --ink: #0b0e14;
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --blue-soft: #dbeafe;

  --bg: var(--white);
  --bg-alt: #f4f7fd;
  --surface: #ffffff;
  --text: var(--ink);
  --muted: #4b5568;
  --line: #e3e9f4;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --card-shadow: 0 20px 45px -20px rgba(11, 14, 20, 0.18);
  --glow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  --grid-line: rgba(37, 99, 235, 0.10);
  --orb-opacity: 0.55;
  --preview-ink: #0b0e14;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius: 20px;
  --maxw: 1160px;
}

[data-theme="dark"] {
  --bg: #070a12;
  --bg-alt: #0b0f1a;
  --surface: #0e1422;
  --text: #eef2fb;
  --muted: #9aa6bd;
  --line: #1c2740;
  --nav-bg: rgba(7, 10, 18, 0.78);
  --card-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 4px rgba(59, 130, 246, 0.22);
  --grid-line: rgba(59, 130, 246, 0.14);
  --orb-opacity: 0.4;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }
img, svg { display: block; }
.container { width: min(var(--maxw), 100% - 3rem); margin-inline: auto; }
.section { padding: 6.5rem 0; }
.section-alt { background: var(--bg-alt); }
::selection { background: var(--blue); color: #fff; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--blue); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

.eyebrow {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue);
  margin-bottom: 1rem;
}
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 3rem; }
.section-head h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: 0; }
.section-head p { max-width: 34ch; color: var(--muted); margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  padding: 0.9rem 1.7rem; border-radius: 999px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 12px 30px -10px rgba(37, 99, 235, 0.55); }
.btn-primary:hover { background: var(--blue-bright); box-shadow: 0 18px 38px -10px rgba(37, 99, 235, 0.65); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); }
.btn-sm { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

/* ---------- Navbar ---------- */
.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.brand-mark {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 0;
  box-shadow: none; flex: none; padding: 0; overflow: visible;
}
.brand-mark svg { display: block; }
/* PNG не меняем: длинная тонкая стрелка тянется к краям кадра и заставляет B выглядеть мелко,
   поэтому кропим прозрачные края/кончики стрелки scale + overflow:hidden */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; background: transparent; border-radius: 0; display: block; transform: scale(1.2); }
/* No tile behind the logo: the blue-B mark reads on white and dark alike,
   and a faint edge keeps the white arrow readable on light backgrounds. */
.brand-mark img { transform: none; }
.brand-mark img.brand-logo--dark { display: none; }
.brand-mark img.brand-logo--light { filter: drop-shadow(0 1px 1px rgba(11, 14, 20, 0.45)); }
[data-theme="dark"] .brand-mark img.brand-logo--light { filter: none; }
/* Navbar: знак без подложки, на ~25% крупнее и выровнен по строке названия */
.nav .brand-mark { width: 50px; height: 50px; transform: translateY(-2px); }
.nav-links { display: flex; gap: 1.6rem; margin-left: auto; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 500; position: relative; transition: color 0.2s; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0; background: var(--blue); border-radius: 2px; transition: width 0.25s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 0.8rem; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer;
  display: grid; place-items: center; transition: border-color 0.2s, transform 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); transform: rotate(15deg); }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; padding: 7rem 0 5rem; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, black 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity); animation: drift 14s ease-in-out infinite alternate; }
.orb-1 { width: 480px; height: 480px; left: -140px; top: -120px; background: #93c5fd; }
.orb-2 { width: 420px; height: 420px; right: -120px; top: 10%; background: #60a5fa; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; left: 40%; bottom: -160px; background: #1d4ed8; opacity: calc(var(--orb-opacity) * 0.5); animation-delay: -9s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.12); } }
.hero-inner { position: relative; text-align: left; }
.hero-title { font-size: clamp(2.8rem, 7.5vw, 5.4rem); margin: 0.4rem 0 1.2rem; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: inline-block; animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.hero-title .line:nth-child(2) > span { animation-delay: 0.12s; }
.hero-title em { font-style: normal; color: var(--blue); position: relative; }
@keyframes rise { from { transform: translateY(110%); } to { transform: translateY(0); } }
.hero-sub { font-size: 1.2rem; color: var(--muted); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 3rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 0; padding: 0; }
.hero-stats div { display: grid; gap: 0.1rem; }
.hero-stats dt { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-stats dd { margin: 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.scroll-hint {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.scroll-hint::after { content: ""; width: 1.5px; height: 34px; background: linear-gradient(var(--blue), transparent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0%, 100% { transform: scaleY(0.6); opacity: 0.5; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--ink); color: #fff; overflow: hidden; padding: 1rem 0; }
[data-theme="dark"] .marquee { background: #000; border-color: var(--line); }
.marquee-track { display: inline-flex; align-items: center; gap: 2.2rem; white-space: nowrap; padding-right: 2.2rem; animation: marquee 26s linear infinite; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.95rem; }
.marquee-track i { color: var(--blue-bright); font-style: normal; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Works ---------- */
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.work-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.work-card:hover { transform: translateY(-8px); border-color: var(--blue); }
/* Per-case identity: colored edge + matching button */
.work-card.case-harbor, .work-card.case-petal, .work-card.case-bloom, .work-card.case-copper { border-top: 5px solid; }
.case-harbor { border-top-color: #ff6a00; }
.case-petal { border-top-color: #a2545c; }
.case-bloom { border-top-color: #0ea47a; }
.case-copper { border-top-color: #96591f; }
.case-harbor .btn-primary { background: #ff6a00; box-shadow: 0 12px 30px -10px rgba(255, 106, 0, 0.55); }
.case-harbor .btn-primary:hover { background: #d95700; }
.case-petal .btn-primary { background: #a2545c; box-shadow: 0 12px 30px -10px rgba(162, 84, 92, 0.55); }
.case-petal .btn-primary:hover { background: #8a4550; }
.case-bloom .btn-primary { background: #0ea47a; box-shadow: 0 12px 30px -10px rgba(14, 164, 122, 0.55); }
.case-bloom .btn-primary:hover { background: #0b7a5c; }
.case-copper .btn-primary { background: #96591f; box-shadow: 0 12px 30px -10px rgba(150, 89, 31, 0.55); }
.case-copper .btn-primary:hover { background: #7d4c1a; }
.work-preview { height: 220px; position: relative; display: block; overflow: hidden; background: var(--bg-alt); }
/* Real site screenshots */
.work-preview img.pv-shot { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform 0.5s ease; }
.work-card:hover .work-preview img.pv-shot { transform: scale(1.04); }
/* Soft fade at the bottom so any crop looks like an intentional peek */
.work-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 84px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
/* "Your project" placeholder card */
.preview-6 { background: repeating-linear-gradient(45deg, #dbeafe 0 18px, #fff 18px 36px); display: grid; place-items: center; }
.preview-6::after { content: "+"; font-family: var(--font-display); font-size: 4rem; font-weight: 700; color: var(--blue); opacity: 0.5; }
.work-body { padding: 1.6rem; }
.work-body h3 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.work-body p { color: var(--muted); margin-bottom: 1rem; }
.work-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.work-meta span { font-size: 0.78rem; font-weight: 600; background: var(--blue-soft); color: var(--blue); padding: 0.25rem 0.7rem; border-radius: 999px; }
[data-theme="dark"] .work-meta span { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
.service-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 2.2rem; overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.service-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--blue), var(--blue-bright)); transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease; }
.service-card:hover { transform: translateY(-6px); border-color: var(--blue); box-shadow: var(--card-shadow); }
.service-card:hover::before { transform: scaleX(1); }
.service-num { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: transparent; -webkit-text-stroke: 1.5px var(--blue); line-height: 1; display: block; margin-bottom: 1rem; }
.service-card h3 { font-size: 1.45rem; }
.service-card p { color: var(--muted); }
.service-card ul { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.service-card li { font-size: 0.85rem; border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.85rem; color: var(--muted); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 3.5rem; align-items: center; }
.about-photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background: linear-gradient(150deg, var(--blue) 0%, #0b0e14 78%);
  display: grid; place-items: center; position: relative; overflow: hidden;
  box-shadow: var(--card-shadow);
}
.about-photo::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.35), transparent 55%); }
.about-photo img.about-logo { width: 62%; height: auto; object-fit: contain; background: transparent; display: block; position: relative; z-index: 1; }
.about-photo img.about-logo--dark { display: none; }
.about-grid h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 0.2em; }
.about-role { font-family: var(--font-display); font-weight: 600; color: var(--blue); font-size: 1.05rem; margin-bottom: 1.2em; }
.about-grid p { color: var(--muted); max-width: 60ch; }
.tech-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 1.4rem 0 2rem; }
.tech-chips li { font-family: var(--font-display); font-size: 0.88rem; font-weight: 600; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 1rem; transition: border-color 0.2s, transform 0.2s; }
.tech-chips li:hover { border-color: var(--blue); transform: translateY(-3px); }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 800px; }
.faq-wrap h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 2rem; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 0.9rem; overflow: hidden; transition: border-color 0.25s; }
.faq-item[open] { border-color: var(--blue); }
.faq-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 1.2rem; transition: transform 0.3s, background 0.3s, color 0.3s; }
[data-theme="dark"] .faq-item summary::after { background: rgba(59, 130, 246, 0.16); }
.faq-item[open] summary::after { transform: rotate(45deg); background: var(--blue); color: #fff; }
.faq-item p { padding: 0 1.5rem 1.4rem; margin: 0; color: var(--muted); }

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-title { font-size: clamp(2.4rem, 6vw, 4.2rem); }
.contact-title em { font-style: normal; color: var(--blue); }
.contact > .container > p { color: var(--muted); font-size: 1.15rem; }
.contact-actions { margin: 2rem 0; }
.socials { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.9rem; padding: 0; margin: 0; }
.socials a {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none;
  color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.7rem 1.3rem; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.socials a:hover { transform: translateY(-4px); border-color: var(--blue); color: var(--blue); box-shadow: var(--glow); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 2rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.to-top { color: var(--muted); text-decoration: none; font-weight: 600; }
.to-top:hover { color: var(--blue); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .works-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-photo { max-width: 320px; }
}
@media (max-width: 860px) {
  .burger { display: flex; }
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--nav-bg); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line); padding: 0.6rem 1.5rem 1.2rem;
    transform: translateY(-130%); transition: transform 0.3s ease;
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 0.7rem 0; border-top: 1px solid var(--line); }
  .nav-actions .btn { display: none; }
}
@media (max-width: 640px) {
  .section { padding: 4.5rem 0; }
  .works-grid, .services-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 4.5rem; }
  .scroll-hint { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title .line > span { animation: none; }
}
