:root {
  --bg: #0a0a0f;
  --bg-alt: #101018;
  --text: #f5f5f7;
  --text-muted: #a3a3b0;
  --accent: #1FC27E;
  --accent-hover: 	#1fc22d;
  --button-outline: #FFA500;
  --border: #22222e;
  --nav-bg: rgba(10, 10, 15, 0.85);
  --max-width: 960px;
  --nav-height: 72px;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f4f4f7;
  --text: #14141c;
  --text-muted: #56565f;
  --accent: #1FC27E;
  --accent-hover: 	#1fc22d;
  --border: #e3e3ea;
  --nav-bg: rgba(255, 255, 255, 0.85);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

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

ul {
  list-style: none;
}

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

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s ease, border-color 0.25s ease;
  z-index: 100;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  justify-self: start;
  display: flex;
  align-items: center;
}

.nav-logo img {
  display: block;
  height: 40px;
  width: auto;
}

.nav-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--button-outline);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--button-outline);
  color: var(--accent);
  transform: translateY(-1px);
}

.theme-icon {
  width: 18px;
  height: 18px;
}

.icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

.nav-contact {
  padding: 10px 22px;
  font-size: 0.9rem;
}

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

.hero {
  padding: calc(var(--nav-height) + 48px) 24px 48px;
}

.hero + .section {
  padding-top: 24px;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.hero-name {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 20px;
}

.hero-headline {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 16px;
}

.hero-tagline {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 56px;
}

.hero-photo {
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  text-align: center;
}

.hero-intro {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 400;
  color: var(--text);
  margin-top: 16px;
}

.wave {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
  0%, 60%, 100% { transform: rotate(0deg); }
  10%, 30% { transform: rotate(14deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(-4deg); }
  50% { transform: rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .wave {
    animation: none;
  }
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--border);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--button-outline);
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  border-color: var(--button-outline);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--button-outline);
  color: var(--accent);
  transform: translateY(-2px);
}

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

.section {
  padding: 80px 24px;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

p,
li {
  line-height: 1.75;
}

.section-alt {
  background: var(--bg-alt);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-heading {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}

.section-subheading {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: -20px;
  margin-bottom: 40px;
}

.about-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 720px;
  margin-bottom: 24px;
}

.about-text:last-child {
  margin-bottom: 0;
}

/* ---------- Experience timeline ---------- */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

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

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.timeline-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 16px;
}

.timeline-list {
  margin-top: 4px;
}

.timeline-list li {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-left: 24px;
  position: relative;
  margin-bottom: 12px;
}

.timeline-list li:last-child {
  margin-bottom: 0;
}

.timeline-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

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

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.25s ease;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Link cards (homepage teasers + projects listing) ---------- */

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

.link-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.25s ease, box-shadow 0.2s ease;
}

.link-card:hover,
.link-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(0, 0, 0, 0.5);
}

.image-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.image-card {
  padding: 0;
  overflow: hidden;
  line-height: 0;
}

.image-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 657 / 422;
  object-fit: cover;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.card-link {
  display: inline-block;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.link-card:hover .card-link,
.link-card:focus-visible .card-link {
  transform: translateX(4px);
}

/* ---------- Sub-page hero (About / Experience / Skills / Projects / Contact / project detail) ---------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
}

.page-hero {
  padding: calc(var(--nav-height) + 48px) 24px 40px;
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin-bottom: 28px;
}

.page-tagline:last-child {
  margin-bottom: 0;
}

.page-body {
  padding-top: 0;
}

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

.contact-form {
  max-width: 560px;
  margin: 0 auto;
}

.contact {
  text-align: center;
}

.contact .section-heading {
  margin-bottom: 16px;
}

.contact-text {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

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

.footer {
  padding: 32px 24px;
  text-align: center;
  background: #FFA500;
  color: #14140f;
  font-size: 0.85rem;
}

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

@media (max-width: 768px) {
  .nav-inner {
    padding: 0 16px;
    gap: 10px;
  }

  .nav-logo img {
    height: 28px;
  }

  .nav-name {
    font-size: 0.85rem;
  }

  .nav-right {
    gap: 10px;
  }

  .nav-contact {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .section {
    padding: 64px 20px;
  }

  .hero {
    padding: calc(var(--nav-height) + 24px) 20px 32px;
  }

  .hero + .section {
    padding-top: 16px;
  }

  .hero-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-photo {
    order: -1;
  }

  .hero-photo {
    max-width: 180px;
    margin: 0 auto;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Bold text accent ---------- */

.nav-name,
.hero-name,
.hero-tagline,
.section-heading,
.timeline-role,
.card-title,
.pill {
  color: var(--accent);
}

@media (max-width: 480px) {
  .nav-name {
    display: none;
  }
}
