:root {
  --color-bg: #ffffff;
  --color-bg-alt: #eef2fb;
  --color-text: #1a1d23;
  --color-text-soft: #565c66;
  --color-border: #e1e6f2;
  --color-accent: #2952e3;
  --color-accent-dark: #1d3aa8;
  --color-accent-soft: #eef1fd;
  --color-navy: #0a1340;
  --color-navy-2: #101f6b;
  --color-navy-soft: #c7d2ff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1080px;
  --radius: 10px;
}

/* Reusable tech grid + circuit-dot texture, tiled as a background image */
.tech-texture {
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255,255,255,0.16) 1.4px, transparent 1.4px),
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px, 28px 28px;
  background-position: 0 0, 0 0, 0 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 0 0 0.5em 0;
  font-weight: 700;
}

p { margin: 0 0 1em 0; }

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

ul, ol { margin: 0; padding: 0; list-style: none; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  gap: 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--color-accent); }

.nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}

.nav a {
  color: var(--color-text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--color-text); text-decoration: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text);
  border-radius: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn-text {
  background: transparent;
  color: var(--color-text-soft);
  padding: 12px 8px;
}
.btn-text:hover { color: var(--color-accent); }

.btn-small {
  padding: 8px 16px;
  font-size: 0.875rem;
  white-space: nowrap;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 108px 0 76px;
  background:
    radial-gradient(ellipse 900px 500px at 85% -10%, rgba(90, 122, 255, 0.35), transparent 60%),
    radial-gradient(ellipse 700px 500px at 0% 110%, rgba(60, 200, 255, 0.16), transparent 60%),
    linear-gradient(150deg, var(--color-navy) 0%, var(--color-navy-2) 60%, #1d3fcf 130%);
  color: #fff;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255,255,255,0.14) 1.4px, transparent 1.4px),
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 30px 30px, 30px 30px, 30px 30px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 85%);
          mask-image: linear-gradient(180deg, rgba(0,0,0,0.9), rgba(0,0,0,0.15) 85%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  right: 6%;
  top: 12%;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  transform: rotate(18deg);
  pointer-events: none;
}

.hero-inner { max-width: 760px; position: relative; z-index: 1; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-navy-soft);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 20px;
  color: #fff;
}

.hero-lead {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.82);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  align-items: center;
}

.hero .btn-primary {
  background: #fff;
  color: var(--color-navy-2);
}
.hero .btn-primary:hover { background: #e7ebff; }

.hero .btn-outline {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.hero .btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }

.hero .btn-text {
  color: rgba(255, 255, 255, 0.75);
}
.hero .btn-text:hover { color: #fff; }

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section-alt { background: var(--color-bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin-bottom: 40px;
  position: relative;
  padding-left: 18px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.22em;
  bottom: 0.22em;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--color-accent), #7c96ff);
}

.group-title {
  font-size: 1.1rem;
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 48px 0 20px;
}
.group-title:first-of-type { margin-top: 0; }

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-text p { color: var(--color-text-soft); }

.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.fact {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fact-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-accent);
}

.fact-label {
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

/* ---------- Skills ---------- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.skill-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
}

.tag-list li {
  color: var(--color-text-soft);
  font-size: 0.92rem;
  padding: 5px 0;
  border-top: 1px solid var(--color-border);
}
.tag-list li:first-child { border-top: none; }

/* ---------- Timeline ---------- */

.timeline {
  position: relative;
  margin: 0;
  padding: 0 0 0 28px;
  border-left: 2px solid var(--color-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -35px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-accent-soft);
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.role-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent-dark);
  background: var(--color-accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 8px;
}

.timeline-org {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.timeline-content p:last-child {
  color: var(--color-text-soft);
  margin-bottom: 0;
}

/* ---------- Projects ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 12px 28px rgba(41, 82, 227, 0.12);
}

.project-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}

.app-shots {
  display: flex;
  gap: 8px;
  padding: 14px 14px 0;
  overflow-x: auto;
  background: var(--color-bg-alt);
}

.app-shots img {
  height: 190px;
  width: auto;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(10, 19, 64, 0.08);
}

.project-card-body {
  padding: 24px 24px 8px;
  flex: 1;
}

.project-card-body h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.project-tags {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.project-card-body p:not(.project-tags) {
  color: var(--color-text-soft);
  font-size: 0.94rem;
}

.project-card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.project-card-footer a { font-weight: 600; }

.status-pill {
  display: inline-block;
  background: var(--color-accent-soft);
  color: var(--color-accent-dark);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

/* ---------- Contact ---------- */

.contact-wrap { text-align: center; max-width: 640px; }

.contact-lead {
  color: var(--color-text-soft);
  font-size: 1.05rem;
  margin-bottom: 36px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
}
.contact-link:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.contact-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  font-weight: 700;
}

.contact-value {
  font-weight: 600;
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-2) 100%);
  padding: 28px 0;
}

.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 2px 2px, rgba(255,255,255,0.1) 1.4px, transparent 1.4px);
  background-size: 28px 28px;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 16px;
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
  }
  .nav-toggle { display: flex; }
  .header-inner .btn-outline.btn-small { display: none; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 56px 0; }
  .contact-link { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }
}
