:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --ink: #14202b;
  --muted: #65717c;
  --line: #dce2e7;
  --navy: #0b2239;
  --navy-2: #173c59;
  --accent: #0b756c;
  --accent-soft: #def1ee;
  --shadow: 0 18px 50px rgba(11, 34, 57, .10);
  --radius: 24px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

.container { width: min(calc(100% - 40px), var(--container)); margin: 0 auto; }
.section { padding: 104px 0; }
.section-muted { background: var(--surface-2); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 248, 250, .88);
  border-bottom: 1px solid rgba(220, 226, 231, .8);
  backdrop-filter: blur(18px);
}
.nav-wrap { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  background: var(--navy);
  border-radius: 12px;
  font-size: 12px;
  letter-spacing: .08em;
}
.brand-text { font-size: 15px; }
.primary-nav { display: flex; align-items: center; gap: 28px; color: #43505b; font-size: 14px; font-weight: 650; }
.primary-nav a:hover { color: var(--navy); }
.nav-cta { padding: 10px 16px; border-radius: 12px; background: var(--navy); color: #fff !important; }
.menu-toggle { display: none; border: 0; background: transparent; padding: 8px; }
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

.hero { padding-top: 90px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.18fr .82fr; gap: 84px; align-items: center; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 760px; font-size: clamp(46px, 6vw, 78px); line-height: .99; letter-spacing: -.055em; }
.hero h1 span { color: var(--accent); }
.hero-lead { max-width: 720px; margin: 28px 0 0; color: var(--muted); font-size: 19px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 13px; font-size: 14px; font-weight: 800; border: 1px solid transparent; transition: .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: var(--navy); box-shadow: 0 10px 26px rgba(11,34,57,.18); }
.btn-secondary { color: var(--navy); background: #fff; border-color: var(--line); }
.btn-ghost { color: var(--navy); background: transparent; border-color: var(--line); }
.hero-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 52px; border-top: 1px solid var(--line); }
.hero-meta div { padding: 20px 22px 0 0; }
.hero-meta strong, .hero-meta span { display: block; }
.hero-meta strong { font-size: 14px; }
.hero-meta span { margin-top: 4px; color: var(--muted); font-size: 12px; }

.hero-visual { position: relative; min-height: 600px; }
.portrait-card { position: absolute; inset: 0 0 0 42px; background: #fff; border-radius: 34px; padding: 16px; box-shadow: var(--shadow); transform: rotate(1.4deg); }
.portrait-card img { width: 100%; height: 500px; object-fit: cover; object-position: 52% 28%; border-radius: 24px; background: #0c0d84; }
.portrait-caption { display: flex; align-items: center; justify-content: space-between; padding: 18px 8px 4px; }
.portrait-caption span { color: var(--muted); font-size: 12px; }
.portrait-caption strong { font-size: 13px; }
.floating-card { position: absolute; z-index: 3; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 11px 15px; box-shadow: 0 12px 30px rgba(11,34,57,.10); font-size: 12px; font-weight: 800; }
.floating-card-a { top: 32px; left: 4px; }
.floating-card-b { right: -26px; bottom: 80px; background: var(--accent-soft); border-color: #b7dfd8; color: #075c55; }

.about-grid, .experience-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 80px; align-items: start; }
.section-heading h2 { margin: 0; font-size: clamp(34px, 4vw, 54px); line-height: 1.08; letter-spacing: -.045em; }
.section-heading-wide { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 48px; }
.section-heading-wide h2 { max-width: 760px; }
.section-note { color: var(--muted); }
.text-link { color: var(--navy); font-size: 14px; font-weight: 800; white-space: nowrap; border-bottom: 1px solid #aeb8c0; padding-bottom: 3px; }
.about-copy > p { margin: 0 0 20px; color: #394650; font-size: 18px; }
.skill-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 42px; }
.skill-groups h3 { margin: 0 0 14px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span, .mini-meta span { border: 1px solid var(--line); background: rgba(255,255,255,.72); border-radius: 999px; padding: 7px 10px; color: #52606a; font-size: 11px; font-weight: 700; }

.project { background: var(--navy); color: #fff; border-radius: 30px; overflow: hidden; }
.project-featured { display: grid; grid-template-columns: 1.12fr .88fr; min-height: 520px; }
.project-media { background: #eaf0f4; padding: 28px; display: flex; align-items: center; }
.project-media img { width: 100%; height: 100%; max-height: 470px; object-fit: cover; object-position: center; border-radius: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.14); }
.project-copy { padding: 54px 48px; display: flex; flex-direction: column; justify-content: center; }
.project-index { margin: 0 0 14px; color: #8fb4c5; font-size: 11px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.project-copy h3, .project-card h3 { margin: 0; letter-spacing: -.025em; }
.project-copy h3 { font-size: 34px; }
.project-copy > p { color: #c7d3db; font-size: 16px; }
.project-meta { display: grid; gap: 15px; margin: 28px 0 0; }
.project-meta div { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.14); }
.project-meta dt { color: #8fb4c5; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.project-meta dd { margin: 4px 0 0; color: #f5f8fa; font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; margin-top: 22px; }
.project-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; transition: .25s ease; }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.project-card-media { height: 280px; padding: 18px; background: #edf1f4; }
.project-card-media img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; }
.project-card-body { padding: 28px; }
.project-card h3 { font-size: 24px; }
.project-card-body > p:not(.project-index) { color: var(--muted); margin-bottom: 20px; }
.mini-meta { display: flex; flex-wrap: wrap; gap: 7px; }

.timeline { border-left: 1px solid #c7cfd6; margin-left: 7px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 28px; padding: 0 0 42px 34px; }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 8px; width: 11px; height: 11px; background: var(--accent); border: 3px solid var(--surface-2); border-radius: 50%; }
.timeline-date { color: var(--accent); font-size: 12px; font-weight: 850; letter-spacing: .08em; }
.timeline-item h3 { margin: 0; font-size: 20px; }
.timeline-item .role { margin: 4px 0 9px; font-weight: 750; }
.timeline-item p:last-child { margin: 0; color: var(--muted); font-size: 14px; }

.credentials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.credential-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.credential-card h3 { margin: 0; font-size: 23px; }
.credential-card p:not(.eyebrow) { margin: 7px 0 0; }
.credential-card span { display: block; margin-top: 20px; color: var(--muted); font-size: 12px; }

.contact-section { padding-top: 36px; }
.contact-card { display: grid; grid-template-columns: 1.25fr .75fr; gap: 60px; align-items: center; background: var(--navy); color: #fff; border-radius: 30px; padding: 58px; }
.contact-card .eyebrow { color: #86d4ca; }
.contact-card h2 { margin: 0; max-width: 760px; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.04em; }
.contact-card p:not(.eyebrow) { color: #c3d0d9; }
.contact-actions { display: flex; flex-direction: column; gap: 10px; }
.contact-actions .btn { width: 100%; }
.contact-actions .btn-primary { background: #fff; color: var(--navy); }
.contact-actions .btn-secondary, .contact-actions .btn-ghost { color: #fff; background: transparent; border-color: rgba(255,255,255,.25); }

.site-footer { padding: 30px 0 42px; color: var(--muted); font-size: 12px; }
.footer-wrap { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding-top: 24px; }
.footer-wrap p { margin: 0; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .project-card:hover { transform: none; }
}

@media (max-width: 920px) {
  .section { padding: 78px 0; }
  .hero-grid, .about-grid, .experience-grid, .project-featured, .contact-card { grid-template-columns: 1fr; }
  .hero-grid { gap: 44px; }
  .hero-visual { min-height: 560px; max-width: 580px; width: 100%; margin: 0 auto; }
  .portrait-card { inset: 0 18px 0 18px; }
  .project-grid { grid-template-columns: 1fr; }
  .project-featured { min-height: 0; }
  .project-copy { padding: 38px 32px; }
  .credentials-grid { grid-template-columns: 1fr; }
  .section-heading-wide { align-items: start; flex-direction: column; }
  .contact-card { padding: 40px 32px; }
  .skill-groups { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 28px), var(--container)); }
  .brand-text { display: none; }
  .menu-toggle { display: block; }
  .primary-nav {
    display: none;
    position: absolute;
    left: 14px;
    right: 14px;
    top: 66px;
    padding: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 11px 10px; border-radius: 10px; }
  .hero { padding-top: 58px; }
  .hero h1 { font-size: clamp(44px, 13vw, 64px); }
  .hero-lead { font-size: 17px; }
  .hero-meta { grid-template-columns: 1fr; }
  .hero-meta div { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .hero-visual { min-height: 490px; }
  .portrait-card img { height: 400px; }
  .floating-card-a { left: 0; }
  .floating-card-b { right: 0; bottom: 38px; }
  .project-media { padding: 16px; }
  .project-card-media { height: 230px; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; padding-left: 26px; }
  .contact-card { padding: 34px 24px; border-radius: 24px; }
  .footer-wrap { flex-direction: column; gap: 5px; }
}

/* ===== Portfolio v2 additions: Data Engineering & Automation ===== */
.project-featured-light {
  margin-top: 22px;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.project-featured-light .project-index { color: var(--accent); }
.project-featured-light .project-copy > p { color: var(--muted); }
.project-featured-light .project-meta div { border-top-color: var(--line); }
.project-featured-light .project-meta dt { color: var(--accent); }
.project-featured-light .project-meta dd { color: var(--ink); }
.project-featured-light .project-media { background: #edf3f8; }
.powerbi-feature .project-media img { object-fit: contain; background: #fff; }

.section-automation {
  background:
    radial-gradient(circle at 10% 0%, rgba(11,117,108,.08), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(23,60,89,.08), transparent 30%),
    var(--bg);
}
.section-side-note {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.case-study {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: 0 16px 44px rgba(11,34,57,.07);
}
.case-media { min-height: 580px; background: #0d1015; padding: 22px; display: flex; align-items: center; }
.case-media img { width: 100%; height: 100%; max-height: 545px; object-fit: contain; border-radius: 18px; }
.case-copy { padding: 48px; align-self: center; }
.case-copy h3 { margin: 0; font-size: clamp(30px, 3.4vw, 45px); line-height: 1.05; letter-spacing: -.04em; }
.case-lead { margin: 20px 0 0; color: var(--muted); font-size: 16px; }
.case-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.case-columns h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.case-columns ul { margin: 0; padding-left: 18px; color: #47545e; font-size: 13px; }
.case-columns li + li { margin-top: 7px; }
.stack-list { display: flex; flex-wrap: wrap; gap: 7px; }
.stack-list span { border-radius: 999px; background: var(--accent-soft); color: #075c55; padding: 7px 10px; font-size: 11px; font-weight: 800; }
.case-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; }

.automation-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 22px; margin-top: 22px; }
.automation-card {
  min-height: 360px;
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
}
.automation-card h3 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.automation-card > p:not(.project-index) { color: var(--muted); }
.siperi-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #0b2239 0%, #173c59 72%, #0b756c 150%);
  color: #fff;
  border-color: transparent;
}
.siperi-card::after {
  content: "SIPERI\A 2.0";
  white-space: pre;
  position: absolute;
  right: -10px;
  bottom: -25px;
  font-size: 88px;
  line-height: .78;
  font-weight: 900;
  letter-spacing: -.07em;
  color: rgba(255,255,255,.055);
  pointer-events: none;
}
.siperi-card .project-index { color: #88d9d0; }
.siperi-card > p:not(.project-index) { color: #c8d6df; max-width: 90%; }
.siperi-card .mini-meta span { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e8f0f4; }
.live-badge { width: fit-content; display: inline-flex; align-items: center; gap: 7px; margin-bottom: auto; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #dff7f3; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.live-badge span { width: 7px; height: 7px; background: #72e3d5; border-radius: 50%; box-shadow: 0 0 0 5px rgba(114,227,213,.10); }
.inline-action { position: relative; z-index: 2; display: inline-flex; width: fit-content; margin-top: 26px; padding-bottom: 3px; border-bottom: 1px solid currentColor; font-size: 13px; font-weight: 800; }

.automation-card-visual {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 30px;
  align-items: center;
}
.automation-flow { border-radius: 20px; padding: 24px; background: #0e1720; }
.flow-node { padding: 12px 14px; border: 1px solid #344453; border-radius: 12px; color: #b7c3cc; background: #17232e; font-size: 11px; font-weight: 800; text-align: center; }
.flow-node.active { background: #173c59; border-color: #376d91; color: #fff; }
.flow-node.success { background: #0d4c46; border-color: #1c756c; color: #d7fff9; }
.flow-line { width: 2px; height: 18px; margin: 0 auto; background: linear-gradient(#405563,#2b826f); }

.colab-project {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 22px;
  margin-top: 22px;
  padding: 28px;
  border-radius: 30px;
  background: #111820;
  color: #fff;
}
.colab-copy { padding: 22px 18px 22px 20px; align-self: center; }
.colab-copy .project-index { color: #8ed9d0; }
.colab-copy h3 { margin: 0; font-size: 34px; line-height: 1.08; letter-spacing: -.035em; }
.colab-copy > p:not(.project-index) { color: #bac7d0; }
.colab-features { display: grid; gap: 10px; margin: 24px 0; }
.colab-features div { padding: 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.colab-features strong, .colab-features span { display: block; }
.colab-features strong { font-size: 12px; }
.colab-features span { margin-top: 4px; color: #adbbc4; font-size: 11px; }
.colab-project .mini-meta span { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #d4dfe6; }
.dual-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dual-media figure { margin: 0; min-width: 0; padding: 10px; border-radius: 18px; background: #fff; }
.dual-media img { width: 100%; height: 390px; object-fit: cover; object-position: top; border-radius: 12px; }
.dual-media figcaption { padding: 9px 4px 3px; color: #64717c; font-size: 10px; font-weight: 700; }
.privacy-note { margin: 18px 2px 0; color: var(--muted); font-size: 11px; }

@media (max-width: 1040px) {
  .case-study, .colab-project { grid-template-columns: 1fr; }
  .case-media { min-height: 420px; }
  .automation-grid { grid-template-columns: 1fr; }
  .automation-card-visual { grid-template-columns: .8fr 1.2fr; }
}

@media (max-width: 720px) {
  .case-copy { padding: 30px 24px; }
  .case-columns { grid-template-columns: 1fr; }
  .case-media { min-height: 330px; padding: 14px; }
  .automation-card { min-height: 330px; padding: 26px; }
  .automation-card-visual { grid-template-columns: 1fr; }
  .colab-project { padding: 18px; }
  .colab-copy { padding: 18px 8px; }
  .dual-media { grid-template-columns: 1fr; }
  .dual-media img { height: 320px; }
  .section-side-note { max-width: none; }
}
