:root {
  --bg: #f8fafc;
  --bg-soft: #ffffff;
  --text: #0b0b0c;
  --muted: #61616b;
  --card: #ffffff;
  --border: #e5e7eb;
  --accent: #2563eb;
  --shadow: 0 8px 22px rgba(0, 0, 0, .07);
  --radius: 16px;
}

html,
body {
  margin: 0;
  height: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

a {
  text-decoration: none;
  color: inherit
}

img {
  max-width: 100%;
  display: block
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow)
}

.btn {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px
}

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

.muted {
  color: var(--muted)
}

section {
  scroll-margin-top: 84px
}

/* Header */
header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s
}

header.stuck {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08)
}

.nav {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.nav .links {
  display: flex;
  gap: 14px
}

.nav a {
  padding: 6px 10px;
  border-radius: 6px;
  transition: .2s
}

.nav a:hover {
  background: rgba(0, 0, 0, .04)
}

.nav a.active {
  color: var(--accent);
  font-weight: 600
}

/* About */
#about {
  padding: 84px 0 28px
}

.about-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 24px;
  align-items: center
}

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

.about-left {
  text-align: center
}

.pfp {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin: 0 auto 12px;
  overflow: hidden
}

.social-icons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px
}

.icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: #fff
}

.icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: #fff;
  transition: all 0.25s ease;
}

.icon:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.icon:hover svg {
  stroke: white;
}

.icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2
}

.about-right h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.1
}

.subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 6px 0 10px
}

.about-right p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.6
}

/* Section spacing */
.section {
  padding: 34px 0
}

.section h2 {
  margin: 0 0 8px;
  font-size: 22px
}

/* Timeline */
.timeline {
  position: relative;
  padding: 20px
}

.timeline:before {
  content: "";
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border)
}

.tl-item {
  position: relative;
  padding-left: 56px;
  margin: 24px 0
}

.tl-dot {
  position: absolute;
  left: 18px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent)
}

.tag {
  font-size: 11px;
  color: var(--muted)
}

.tl-item h3 {
  margin: 6px 0 4px;
  font-size: 16px
}

.tl-item .org {
  font-size: 13px;
  color: var(--muted)
}

.tl-item ul {
  margin: 8px 0 0 16px;
  font-size: 14px;
  color: var(--muted)
}

/* Projects (visual card with gallery) */
.projects-col {
  display: grid;
  gap: 18px
}

.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px
}

@media(max-width:900px) {
  .project-card {
    grid-template-columns: 1fr
  }
}

.p-title {
  font-weight: 700
}

.p-bullets {
  margin: 8px 0 0 16px;
  color: var(--muted);
  font-size: 14px
}

.p-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px
}

.chip {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted)
}


.gallery {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}


.gallery .main {
  flex: 1 1 auto;
  min-height: 0;
  background: #e6f0ff;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

.gallery .main img {
  width: 180px;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dot.active {
  background: var(--accent);
}

footer {
  padding: 30px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted)
}

/* Buttons inside image area */
.swipe-area {
  position: relative;
  display: grid;
  place-items: center;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  color: black;
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  z-index: 2;
  transition: all 0.2s ease;
}

.arrow.prev { left: 8px; }
.arrow.next { right: 8px; }

.arrow:hover {
  background: var(--accent);
  color: white;
}

/* =========================
   Responsive tweaks
   ========================= */

/* Large tablets / small laptops */
@media (max-width: 1200px){
  .wrap{ max-width: 1000px;padding-left: 20px;padding-right: 20px; }
}

/* Tablets */
@media (max-width: 900px){
  .wrap {padding-left: 20px;padding-right: 20px;}
  /* About card: stack columns */
  #about .card{ grid-template-columns: 1fr !important; }
  #about{ padding: 64px 0 20px; }
  .about-right h1{ font-size: 32px; }

  /* Projects: stack and let image box size nicely */
  .project-card{ grid-template-columns: 1fr; }
  .gallery{ order: 2; }                 /* keep image under text on tablets */
  .gallery .main{ height: 280px; }      /* pleasant fixed box for screenshots */
}

/* Large phones */
@media (max-width: 700px){
  .wrap {padding-left: 20px;padding-right: 20px;}
  .nav{ height: 56px; }
  .nav .links{
    gap: 10px;
    font-size: 14px;
    overflow-x: auto;                    /* avoid wrapping; allow horizontal scroll */
    -webkit-overflow-scrolling: touch;
  }
  section{ scroll-margin-top: 72px; }

  .p-bullets{ font-size: 13px; }
  .tl-item{ padding-left: 42px; }
  .timeline:before{ left: 18px; }
  .tl-dot{ left: 12px; }
}

/* Phones */
@media (max-width: 480px){
  .wrap { padding-left: 14px; padding-right: 14px; }
  .about-right h1{ font-size: 26px; }
  .gallery .main{ height: 220px; }
  .gallery .main img{ width: 150px; }    /* you asked for tighter portrait width on small screens */
  .chip{ padding: 5px 9px; font-size: 11px; }
}
