:root {
  --bg-dark: #0b1020;
  --bg-dark-2: #11182b;
  --bg-light: #f7f8fb;
  --bg-muted: #eef1f6;
  --text: #121722;
  --text-soft: #5d6574;
  --white: #ffffff;
  --line: rgba(17, 24, 39, 0.12);
  --line-dark: rgba(255,255,255,.13);
  --accent: #6f8dff;
  --accent-2: #8fc7ff;
  --max: 1180px;
  --radius: 22px;
  --shadow: 0 18px 60px rgba(10, 18, 38, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
:focus-visible { outline:3px solid var(--accent-2); outline-offset:4px; }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.section { padding: 112px 0; }
.section-dark { color: var(--white); background: var(--bg-dark); }
.section-light { background: var(--bg-light); }
.section-muted { background: var(--bg-muted); }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 78px;
  padding: 0 max(20px, calc((100vw - var(--max)) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11,16,32,.78);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; color: white; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; overflow:hidden;
  border: 1px solid rgba(255,255,255,.25); border-radius: 11px;
  background: rgba(255,255,255,.04);
}
.brand-mark img { width:100%; height:100%; object-fit:contain; padding:3px; }
.brand strong { display: block; letter-spacing: .12em; font-size: .92rem; }
.brand small { display: block; opacity: .58; font-size: .68rem; margin-top: -2px; }
.site-nav { display: flex; gap: 23px; align-items: center; color: rgba(255,255,255,.72); font-size: .88rem; }
.site-nav > a { display:inline-flex; align-items:center; gap:7px; }
.site-nav a:hover { color: white; }
.nav-cta { padding: 9px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span { display:block; width:24px; height:2px; margin:5px; background:white; }
.ui-icon { width:1.08em; height:1.08em; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.hero {
  position: relative;
  min-height: 790px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 110px;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}
.hero-glow { position:absolute; border-radius:50%; filter:blur(110px); opacity:.28; }
.hero-glow-one { width:420px; height:420px; background:#566df0; right:7%; top:24%; }
.hero-glow-two { width:300px; height:300px; background:#43b8c8; left:4%; bottom:4%; opacity:.15; }
.hero-layout { position:relative; z-index:1; display:grid; grid-template-columns:1.12fr .88fr; align-items:center; gap:54px; padding-top:52px; padding-bottom:54px; }
.hero-visual { margin:0; min-width:0; position:relative; }
.hero-visual::after { content:""; position:absolute; inset:7%; border:1px solid rgba(143,199,255,.14); border-radius:50%; pointer-events:none; }
.hero-visual img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; border-radius:42px; mask-image:radial-gradient(ellipse at center, black 57%, transparent 93%); }
.hero-content { position:relative; min-width:0; padding:82px 0 70px; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; font-weight: 800; color: var(--accent-2); margin: 0 0 22px; }
.eyebrow.dark { color: #4a63c7; }
.hero h1 {
  margin: 0; max-width: 720px; font-size: clamp(3.65rem, 6.2vw, 6.4rem); line-height: .91; letter-spacing: -.065em; font-weight: 750;
}
.hero h1 span { color: #a9bbff; }
.hero-copy { max-width: 700px; margin: 34px 0 0; color: rgba(255,255,255,.68); font-size: 1.18rem; }
.hero-actions { display:flex; gap:14px; margin-top:34px; flex-wrap:wrap; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:9px; padding: 13px 19px; border-radius:999px; font-weight:750; font-size:.92rem; transition:.2s ease; }
.button-primary { background:white; color:#0b1020; }
.button-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,255,255,.12); }
.button-secondary { border:1px solid rgba(255,255,255,.22); color:white; }
.button-secondary:hover { background:rgba(255,255,255,.06); }
.hero-tags { display:flex; flex-wrap:wrap; gap:10px; margin-top:62px; }
.hero-tags span { display:inline-flex; align-items:center; gap:7px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.035); color:rgba(255,255,255,.65); padding:9px 12px; border-radius:999px; font-size:.82rem; }
.hero-tags .ui-icon { color:var(--accent-2); width:1.2em; height:1.2em; }

.section-heading { max-width: 760px; margin-bottom: 54px; }
.section-heading h2 { margin: 0 0 18px; font-size: clamp(2.3rem, 5vw, 4.7rem); line-height: .98; letter-spacing: -.05em; }
.section-heading p:last-child { color: var(--text-soft); font-size: 1.08rem; margin:0; }
.section-dark .section-heading p:last-child { color: rgba(255,255,255,.62); }

.cards-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:18px; }
.service-card {
  padding: 0 30px 30px; min-height: 430px; border: 1px solid var(--line); border-radius: var(--radius);
  background:white; overflow:hidden; box-shadow: 0 1px 0 rgba(255,255,255,.9) inset; transition:.25s ease;
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.service-card-accent { background:#e9edff; border-color:#d6ddff; }
.service-media { height:142px; margin:0 -30px 28px; position:relative; overflow:hidden; background:#10182b; }
.service-media::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(7,13,28,.04),rgba(7,13,28,.18)); pointer-events:none; }
.service-media img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .45s ease; }
.service-card:hover .service-media img { transform:scale(1.045); }
.service-card h3 { font-size:1.34rem; line-height:1.2; margin:0 0 13px; letter-spacing:-.02em; }
.service-card p { color: var(--text-soft); margin:0 0 18px; }
.service-card ul { padding-left:18px; margin:0; color:#454d5b; font-size:.9rem; }

.projects-grid { display:grid; grid-template-columns: 1.25fr .75fr; gap:18px; }
.project {
  min-height:300px; padding:0; border-radius:var(--radius); background:white; border:1px solid var(--line);
  display:block; position:relative; overflow:hidden; transition:.25s ease;
}
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-large { min-height:390px; }
.project-wide { grid-column:1 / -1; min-height:260px; }
.project-image { display:block; width:100%; height:210px; object-fit:cover; background:#10182b; }
.project-large .project-image { height:260px; }
.project-wide .project-image { height:280px; }
.project > div { padding:28px 30px 30px; }
.project-number { position:absolute; top:18px; left:18px; z-index:1; color:white; background:rgba(8,12,22,.78); backdrop-filter:blur(8px); border:1px solid rgba(255,255,255,.16); border-radius:999px; padding:6px 9px; font-size:.72rem; letter-spacing:.14em; font-weight:800; }
.project-label { margin:0 0 8px; color:#5c6bb2; font-size:.76rem; text-transform:uppercase; font-weight:850; letter-spacing:.14em; }
.project h3 { margin:0 0 14px; font-size:1.7rem; line-height:1.1; letter-spacing:-.03em; }
.project p:not(.project-label) { color:var(--text-soft); max-width:720px; }
.project-tags { display:flex; gap:8px; flex-wrap:wrap; margin-top:20px; }
.project-tags span { font-size:.76rem; padding:7px 9px; background:#f1f3f8; border-radius:8px; color:#596170; }

.process-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:46px; position:relative; }
.process-step { position:relative; z-index:1; min-height:250px; padding:18px 18px 24px; border:1px solid rgba(255,255,255,.12); border-radius:20px; background:linear-gradient(145deg,rgba(255,255,255,.07),rgba(255,255,255,.025)); box-shadow:0 18px 45px rgba(2,7,20,.18); }
.process-step:not(:last-child)::after { content:"→"; position:absolute; right:-42px; top:50%; transform:translateY(-50%); width:38px; height:38px; display:grid; place-items:center; color:#a6b5ff; background:#111c35; border:1px solid rgba(143,164,255,.42); border-radius:8px; font-size:1.55rem; font-weight:500; line-height:1; box-shadow:0 0 20px rgba(104,128,255,.22); }
.process-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.process-head span { color:#8fa4ff; font-size:.77rem; font-weight:800; letter-spacing:.12em; }
.process-icon { width:44px; height:44px; display:grid; place-items:center; border-radius:14px; color:#8fdcf0; background:#111c35; border:1px solid rgba(143,220,240,.24); box-shadow:0 8px 24px rgba(3,8,20,.28); }
.process-icon svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.process-step h3 { font-size:1.3rem; margin:30px 0 8px; }
.process-step p { color:rgba(255,255,255,.57); font-size:.92rem; margin:0; }
.stack { margin-top:50px; padding-top:4px; }
.stack > p { color:rgba(255,255,255,.46); font-size:.78rem; text-transform:uppercase; letter-spacing:.15em; }
.tech-grid { display:grid; grid-template-columns:repeat(6,1fr); gap:12px; margin-top:18px; }
.tech-item { min-width:0; min-height:104px; padding:16px 10px 13px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; border:1px solid rgba(255,255,255,.11); border-radius:14px; background:rgba(255,255,255,.035); color:rgba(255,255,255,.74); font-size:.76rem; text-align:center; transition:.2s ease; }
.tech-item:hover { transform:translateY(-3px); border-color:rgba(143,199,255,.38); background:rgba(255,255,255,.06); }
.tech-icon { width:40px; height:40px; display:grid; place-items:center; border-radius:12px; background:#17223b; color:#8fc7ff; font-size:.84rem; font-weight:850; letter-spacing:-.03em; box-shadow:inset 0 0 0 1px rgba(255,255,255,.08); }
.tech-icon.python { color:#ffd95b; background:#253d60; }
.tech-icon.pytorch { color:#ff6948; }
.tech-icon.sklearn { color:#f5a23b; background:#1f334b; }
.tech-icon.cpp { color:#8fc7ff; background:#173154; font-size:.72rem; }
.tech-icon.databricks { color:#ff674d; background:#352027; font-size:1.25rem; }
.tech-icon.opencv { color:#61d38d; }
.tech-icon.numpy { color:#72a6ff; }
.tech-icon.pandas { color:#c6a8ff; }
.tech-icon.spark { color:#ef9a52; }
.tech-icon.sql { color:#67c7eb; }
.tech-icon.docker { color:#5aaeff; }
.tech-icon.git { color:#f06a4f; }
.tech-icon.cloud { color:#83d5ff; }
.tech-icon.mlops { color:#6ee7cb; }

.about-layout { display:grid; grid-template-columns: .72fr 1.28fr; gap:80px; align-items:center; }
.about-portrait { width:100%; aspect-ratio:1; max-width:390px; margin:0; border-radius:36px; overflow:hidden; position:relative; background:#dfe4f3; box-shadow:var(--shadow); }
.about-portrait::after { content:""; position:absolute; inset:0; pointer-events:none; box-shadow:inset 0 0 0 1px rgba(255,255,255,.42); border-radius:inherit; }
.about-portrait img { width:100%; height:100%; display:block; object-fit:cover; filter:saturate(.82) contrast(1.04); }
.about-content h2 { font-size:clamp(2.3rem,4vw,4rem); letter-spacing:-.05em; margin:0 0 20px; }
.about-content p { color:var(--text-soft); }
.about-lead { color:var(--text)!important; font-size:1.2rem; }
.about-points { display:flex; flex-direction:column; gap:11px; margin-top:26px; }
.about-points span { padding-left:22px; position:relative; font-weight:650; }
.about-points span:before { content:""; position:absolute; left:0; top:.7em; width:7px; height:7px; border-radius:50%; background:#6378d9; }
.publications { margin-top:34px; padding-top:26px; border-top:1px solid var(--line); }
.publications h3 { margin:0 0 15px; font-size:.76rem; text-transform:uppercase; letter-spacing:.15em; color:#4a63c7; }
.publications ol { list-style:none; margin:0; padding:0; display:grid; gap:10px; }
.publications li { position:relative; padding-left:48px; color:#697180; font-size:.76rem; line-height:1.48; }
.publications li > span { position:absolute; left:0; top:.05em; color:#3f4b60; font-size:.7rem; font-weight:800; letter-spacing:.05em; }
.publications cite { color:#343c4b; font-style:normal; font-weight:680; }

.contact { position:relative; overflow:hidden; padding:82px 0; }
.contact-glow { position:absolute; width:600px; height:340px; border-radius:50%; background:#5169df; filter:blur(140px); opacity:.22; left:50%; transform:translateX(-50%); bottom:-200px; }
.contact-grid { position:relative; z-index:1; display:grid; grid-template-columns:1.1fr 1.25fr 1.15fr .8fr; gap:42px; align-items:start; }
.contact-intro .eyebrow { margin-bottom:14px; }
.contact-intro h2 { margin:0 0 14px; max-width:290px; font-size:clamp(2rem,3vw,3.25rem); line-height:1; letter-spacing:-.045em; }
.contact-intro > p:last-child { margin:0; color:rgba(255,255,255,.58); font-size:.92rem; }
.contact-list { display:flex; flex-direction:column; gap:24px; padding-top:8px; }
.contact-item { display:grid; grid-template-columns:28px minmax(0,1fr); gap:11px; color:rgba(255,255,255,.78); }
.contact-item > span:last-child { min-width:0; display:flex; flex-direction:column; }
.contact-icon { width:26px; height:26px; display:grid; place-items:center; color:#7fd6ff; font-size:.9rem; font-weight:850; border:1px solid rgba(127,214,255,.22); border-radius:7px; }
.contact-item small { color:rgba(255,255,255,.4); font-size:.68rem; text-transform:uppercase; letter-spacing:.1em; }
.contact-item strong { font-size:.79rem; font-weight:650; overflow-wrap:anywhere; }
.contact-item em { color:rgba(255,255,255,.43); font-size:.7rem; font-style:normal; }
a.contact-item:hover strong { color:white; }
.contact-brand { display:flex; flex-direction:column; align-items:flex-start; }
.contact-brand img { width:58px; height:58px; object-fit:contain; margin-bottom:7px; }
.contact-brand > strong { color:#a8dfff; font-size:1.35rem; letter-spacing:.12em; }
.contact-brand > span { color:rgba(255,255,255,.42); font-size:.58rem; }
.contact-brand p { color:white; margin:12px 0 8px; font-size:.83rem; font-weight:700; }
.contact-languages { display:flex; gap:9px; font-size:20px; }
.contact-languages a:hover { transform:translateY(-2px); }

.site-footer { background:#080c16; color:white; border-top:1px solid rgba(255,255,255,.08); padding:38px 0; }
.footer-inner { display:flex; justify-content:space-between; gap:40px; align-items:flex-end; }
.footer-inner strong { letter-spacing:.14em; }
.footer-inner p, .footer-meta { color:rgba(255,255,255,.45); font-size:.78rem; }
.footer-inner p { margin:4px 0 0; }
.footer-meta { display:flex; gap:18px; flex-wrap:wrap; justify-content:flex-end; }
.footer-meta a:hover { color:white; }

.reveal { opacity:0; transform: translateY(18px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity:1; transform:none; }

@media (max-width: 960px) {
  .hero { min-height:auto; }
  .hero-layout { grid-template-columns:1fr; gap:0; padding-top:60px; padding-bottom:70px; }
  .hero-content { order:1; padding-bottom:36px; }
  .hero-visual { order:2; width:min(100%,470px); justify-self:center; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns:1fr; gap:58px; width:min(100%,720px); margin-inline:auto; }
  .process-step { min-height:auto; }
  .process-step:not(:last-child)::after { display:grid; content:"↓"; left:50%; right:auto; top:auto; bottom:-48px; transform:translateX(-50%); width:38px; height:38px; font-size:1.55rem; }
  .about-layout { grid-template-columns:1fr; gap:44px; }
  .about-portrait { max-width:300px; }
  .tech-grid { grid-template-columns:repeat(4,1fr); }
  .contact-grid { grid-template-columns:1fr 1fr; }
}

@media (max-width: 780px) {
  .site-header { height:68px; }
  .brand small { display:none; }
  .nav-toggle { display:block; }
  .site-nav {
    position:absolute; left:16px; right:16px; top:76px; padding:18px; border-radius:18px;
    background:#11182b; border:1px solid rgba(255,255,255,.1); flex-direction:column; align-items:stretch; gap:6px;
    opacity:0; transform:translateY(-10px); pointer-events:none; transition:.2s ease;
  }
  .site-nav.open { opacity:1; transform:none; pointer-events:auto; }
  .site-nav a { padding:11px; }
  .hero { min-height:auto; padding-top:86px; }
  .hero-layout { padding-top:34px; }
  .hero-content { padding-top:28px; }
  .hero h1 { font-size: clamp(3.4rem, 17vw, 5rem); }
  .section { padding:82px 0; }
  .cards-grid, .projects-grid { grid-template-columns:1fr; }
  .project-wide { grid-column:auto; }
  .project-image, .project-large .project-image, .project-wide .project-image { height:220px; }
  .contact-grid { gap:34px 28px; }
  .footer-inner { flex-direction:column; align-items:flex-start; }
  .footer-meta { justify-content:flex-start; flex-direction:column; gap:5px; }
}

@media (max-width: 560px) {
  .container { width:min(calc(100% - 28px), var(--max)); }
  .cards-grid { grid-template-columns:1fr; }
  .service-card { min-height:auto; }
  .process-step, .process-step + .process-step, .process-step:nth-child(4) { padding:20px; }
  .project { flex-direction:column; gap:10px; }
  .project > div { padding:24px; }
  .tech-grid { grid-template-columns:repeat(3,1fr); gap:8px; }
  .tech-item { min-height:92px; padding:12px 6px; font-size:.7rem; }
  .contact-grid { grid-template-columns:1fr; }
  .contact-brand { padding-top:12px; }
  .hero-actions .button { width:100%; }
  .hero-tags { margin-top:38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior:auto; }
  .reveal { opacity:1; transform:none; transition:none; }
  * { transition:none!important; }
}

/* Language selector */
.language-switch { display:flex; align-items:center; gap:.45rem; margin-left:.35rem; }
.language-switch a { display:grid; place-items:center; width:34px; height:28px; border:1px solid rgba(255,255,255,.18); border-radius:6px; font-size:20px; line-height:1; text-decoration:none; opacity:.72; transition:.2s ease; }
.language-switch a:hover, .language-switch a.active { opacity:1; border-color:rgba(82,199,255,.75); background:rgba(82,199,255,.08); transform:translateY(-1px); }
@media (max-width: 820px) { .language-switch { margin:.75rem 0 0; } }
