/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }

/* ============ TOKENS ============ */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f6f8;
  --surface: #ffffff;
  --text: #0d0d12;
  --text-muted: #5a5a66;
  --border: #e7e7ec;
  --accent: #6d4dff;
  --accent-hover: #5a3eea;
  --accent-soft: rgba(109, 77, 255, 0.1);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.12);
  --radius: 14px;
}
:root[data-theme="dark"] {
  --bg: #0a0a0d;
  --bg-alt: #101015;
  --surface: #14141b;
  --text: #f5f5f7;
  --text-muted: #9b9ba6;
  --border: #23232c;
  --accent: #8b6dff;
  --accent-hover: #a085ff;
  --accent-soft: rgba(139, 109, 255, 0.15);
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }
.logo { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--text-muted); font-size: .95rem; font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); color: var(--text);
  transition: all .2s;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.lang-switch { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; }
.flag-btn {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: .5; transition: opacity .2s, transform .2s;
}
.flag-btn:hover { opacity: 1; }
.flag-btn.active { opacity: 1; transform: scale(1.05); }
.flag { display: block; width: 22px; height: 22px; border-radius: 50%; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.flag-br { background-image: url("https://flagcdn.com/w80/br.png"); }
.flag-uk { background-image: url("https://flagcdn.com/w80/gb.png"); }

/* ============ HERO ============ */
.hero { padding: 80px 0 60px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 60px; align-items: center; }
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .82rem; font-weight: 600; margin-bottom: 22px;
}
.hero-text h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.accent { color: var(--accent); }
.hero-text p { color: var(--text-muted); font-size: 1.1rem; max-width: 480px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px;
  font-weight: 600; font-size: .95rem;
  transition: all .2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-ghost { color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn.disabled { opacity: .5; cursor: not-allowed; }

.mock-window {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  transform: rotate(-1deg);
  transition: transform .4s ease;
}
.mock-window:hover { transform: rotate(0); }
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.mock-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.mock-window img { width: 100%; height: 360px; object-fit: cover; object-position: top; }
.img-wrap-hero { height: 360px; }
.img-wrap-hero img { height: 360px !important; }

/* ============ IMG WRAP + LAZY FALLBACK ============ */
.img-wrap { position: relative; width: 100%; height: 100%; background: var(--bg-alt); overflow: hidden; }
.img-wrap img {
  width: 100%; height: 100%; object-fit: cover; object-position: top;
  opacity: 0; transition: opacity .5s ease;
}
.img-wrap img[src]:not([src=""]) { opacity: 1; }
.img-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-muted); opacity: 0; pointer-events: none;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}
.img-fallback i { font-size: 2.4rem; color: var(--accent); opacity: .55; }
.img-fallback small { font-size: .75rem; font-family: ui-monospace, monospace; opacity: .7; }
.img-fallback-soft i { font-size: 4rem; opacity: .4; }
.img-wrap.img-fail img, .img-wrap.img-fail-soft img { display: none; }
.img-wrap.img-fail .img-fallback, .img-wrap.img-fail-soft .img-fallback { opacity: 1; }

/* ============ SECTIONS ============ */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: 48px; }
.section-head.center { text-align: center; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 12px;
}
.section h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.lead { color: var(--text-muted); font-size: 1.05rem; margin-top: 10px; }

/* ============ FEATURED PROJECT ============ */
.featured-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.featured-img { background: var(--bg-alt); overflow: hidden; min-height: 340px; }
.featured-img .img-wrap { min-height: 340px; }
.featured-info { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.featured-info h3 { font-size: 2rem; font-weight: 800; margin: 12px 0; letter-spacing: -0.02em; }
.featured-info p { color: var(--text-muted); margin-bottom: 24px; }
.tag {
  display: inline-block; padding: 5px 12px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 600; width: fit-content;
}
.tag-soon { background: color-mix(in oklab, var(--text-muted) 15%, transparent); color: var(--text-muted); }
.featured-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ SERVICES ============ */
.services-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
}
.services-grid li {
  display: flex; align-items: center; gap: 14px;
  padding: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-weight: 500;
  transition: all .2s;
}
.services-grid li:hover { border-color: var(--accent); transform: translateY(-2px); }
.services-grid i { color: var(--accent); font-size: 1.2rem; width: 24px; text-align: center; }

/* ============ STEPS ============ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; }
.step { padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step-num { font-size: 2.4rem; font-weight: 800; color: var(--accent); letter-spacing: -0.04em; display: block; margin-bottom: 12px; line-height: 1; }
.step h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: .95rem; }

/* ============ CONTACT ============ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 820px; margin: 0 auto; }
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
  transition: all .25s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow); }
.contact-card i { font-size: 2rem; color: var(--accent); margin-bottom: 8px; }
.contact-card span { font-weight: 700; font-size: 1.05rem; }
.contact-card small { color: var(--text-muted); font-size: .85rem; }

/* ============ PANTERUM ============ */
.panterum-section { padding: 60px 0; }
.panterum-card {
  text-align: center; padding: 60px 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff; border-radius: 20px;
}
.panterum-card .eyebrow { color: rgba(255,255,255,.85); }
.panterum-card h2 { color: #fff; margin-bottom: 14px; }
.panterum-card p { max-width: 540px; margin: 0 auto 28px; opacity: .9; }
.panterum-card .btn-primary { background: #fff; color: var(--accent); }
.panterum-card .btn-primary:hover { background: #f0f0f0; }

/* ============ ABOUT ============ */
.about-wrap { max-width: 680px; }
.about-wrap h2 { margin-bottom: 16px; }
.about-wrap p { color: var(--text-muted); font-size: 1.05rem; }

/* ============ PROJECTS PAGE ============ */
.page-head { padding: 60px 0 30px; border-bottom: 1px solid var(--border); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; margin-top: 8px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; transition: color .2s; }
.back-link:hover { color: var(--accent); }

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: all .25s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.project-img { aspect-ratio: 16 / 10; background: var(--bg-alt); overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.placeholder-img {
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; color: var(--accent); opacity: .35;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}
.project-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.project-body h3 { font-size: 1.4rem; font-weight: 700; }
.project-body p { color: var(--text-muted); font-size: .95rem; }

/* ============ FOOTER ============ */
.footer { padding: 30px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: .9rem; }
.footer-social { display: flex; gap: 16px; }
.footer-social a { font-size: 1.15rem; transition: color .2s; }
.footer-social a:hover { color: var(--accent); }

/* ============ REVEAL ============ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ============ HAMBURGER + MOBILE MENU ============ */
.hamburger {
  display: none;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  transition: all .2s;
  position: relative; z-index: 70;
}
.hamburger:hover { border-color: var(--accent); }
.hamburger.open { border-color: var(--accent); }
.hamburger span {
  display: block; width: 16px; height: 1.5px;
  background: var(--text); border-radius: 2px;
  transition: transform .3s ease, opacity .25s ease, background .2s;
  transform-origin: center;
}
.hamburger.open span { background: var(--accent); }
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in oklab, var(--bg) 40%, transparent);
  backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(86vw, 340px); z-index: 45;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 96px 32px 32px;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -20px rgba(0,0,0,.25);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-links a {
  font-size: 1.35rem; font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color .2s, padding-left .2s;
}
.mobile-links a:hover, .mobile-links a.active { color: var(--accent); padding-left: 6px; }

body.menu-open { overflow: hidden; }

/* ============ RESPONSIVE ============ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hamburger { display: inline-flex; }
  .nav-inner { gap: 10px; }
  .nav-actions { gap: 8px; }
  .lang-switch { padding: 3px; gap: 2px; }
  .flag-btn { width: 26px; height: 26px; }
  .flag { width: 18px; height: 18px; }
  .icon-btn { width: 36px; height: 36px; }
  .hero { padding: 50px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-info { padding: 28px; }
  .section { padding: 60px 0; }
  .footer-inner { flex-direction: column; gap: 14px; }
}
@media (max-width: 380px) {
  .lang-switch { display: none; }
}
