:root {
  --bg: #12181F;
  --surface: #1B232C;
  --surface-2: #222C36;
  --text: #E8ECEF;
  --text-muted: #8FA0AC;
  --accent: #E2672B;       /* sienna orange */
  --accent-rgb: 226, 103, 43;
  --accent-2: #F2A65A;      /* warm amber, secondary */
  --line: #2A3541;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --max-width: 1040px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0;
}

p { margin: 0 0 1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Topbar ---------- */

.topbar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.topbar__name:hover { text-decoration: none; color: var(--accent); }

.topbar__nav { display: flex; gap: 28px; }
.topbar__nav a { color: var(--text-muted); font-size: 0.95rem; }
.topbar__nav a:hover { color: var(--accent); text-decoration: none; }

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

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero__role { color: var(--accent); font-weight: 500; margin: 0 0 14px; font-size: 1rem; }

.hero__title {
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.hero__desc { max-width: 48ch; font-size: 1.05rem; }

.hero__location { font-size: 0.9rem; color: var(--text-muted); margin-top: -6px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95rem;
}
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--accent); color: #17100B; }
.btn--primary:hover { background: #ef7d43; }

.btn--ghost { border: 1px solid var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero photo (half-tone + face highlight) ---------- */

.hero__photo {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 320px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.hero__photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__photo-img--base { filter: saturate(1.05) contrast(1.03); }
.hero__photo-img--mono {
  filter: grayscale(1) brightness(0.8) contrast(1.05);
  clip-path: polygon(0 0, 42% 0, 68% 100%, 0 100%);
}

.hero__photo-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 26%, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0) 42%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  border-radius: inherit;
  pointer-events: none;
}

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

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 24px;
  border-top: 1px solid var(--line);
}

.section__head { margin-bottom: 36px; }

.section__label { color: var(--accent); font-weight: 500; font-size: 0.9rem; margin: 0 0 8px; }
.section__title { font-size: 1.6rem; font-weight: 600; color: var(--text); }

.about { max-width: 68ch; }
.about p { margin-bottom: 1em; }

/* ---------- Projects: cards + carousel ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.carousel { position: relative; }

.carousel__viewport {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface-2);
}

.carousel__track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}

.carousel__track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }

.carousel__prev,
.carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(18, 24, 31, 0.7);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel__prev:hover,
.carousel__next:hover { background: var(--accent); color: #17100B; }
.carousel__prev { left: 10px; }
.carousel__next { right: 10px; }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  background: var(--surface);
}

.carousel__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--line);
  padding: 0;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}
.carousel__dot.is-active { width: 18px; border-radius: 4px; background: var(--accent); }

.project-card__body { padding: 22px; display: flex; flex-direction: column; gap: 12px; }

.project-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.project-card__row h3 { font-size: 1.05rem; color: var(--text); }

.badge {
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.project-card__body p { font-size: 0.94rem; margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.tags li {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.tags--wide li { font-size: 0.85rem; }

.project-cta {
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.project-cta p { margin: 0; color: var(--text); font-size: 1rem; }

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

.timeline { display: flex; flex-direction: column; gap: 8px; margin-bottom: 48px; }

.timeline__item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.timeline__item:first-child { border-top: none; padding-top: 0; }

.timeline__index { font-family: var(--font-display); color: var(--text-muted); font-size: 0.9rem; padding-top: 3px; }

.timeline__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.timeline__item h3 { font-size: 1.05rem; color: var(--text); }
.timeline__date { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.timeline__org { font-size: 0.92rem; color: var(--accent-2); margin: 4px 0 12px; }
.timeline__item ul { max-width: 70ch; }

.timeline__item li {
  list-style: none;
  position: relative;
  padding-left: 18px;
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.timeline__item li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Subsections: Skills / Certifications / Education ---------- */

.subsection { margin-bottom: 40px; }
.subsection:last-child { margin-bottom: 0; }
.subsection__title { font-size: 1.02rem; color: var(--text); margin-bottom: 16px; }

.cert-list { display: flex; flex-direction: column; gap: 12px; }
.cert-list li {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cert-list li:first-child { border-top: none; padding-top: 0; }
.cert-list__name { font-size: 0.96rem; color: var(--text); font-weight: 500; }
.cert-list__meta { font-size: 0.85rem; color: var(--text-muted); }

.education { font-size: 0.96rem; }
.education strong { color: var(--text); }

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

.contact__list { margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact__list li { list-style: none; }
.contact__list a { font-size: 1.02rem; }
.contact__list span { color: var(--text-muted); font-size: 0.95rem; }

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

.footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px 56px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .hero__photo { order: -1; max-width: 220px; }
  .project-grid { grid-template-columns: 1fr; }
  .timeline__row { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (max-width: 560px) {
  .topbar { flex-direction: column; gap: 14px; align-items: flex-start; }
  .topbar__nav { gap: 18px; flex-wrap: wrap; }
  .hero__actions { flex-wrap: wrap; }
  .project-cta { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .carousel__track { transition: none; }
}
