/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: rgba(255, 255, 255, 0.85);

  --text-body: #1c2233;
  --text-muted: #6b7280;

  --accent: #2453aa;

  --radius-lg: 20px;
  --radius-md: 14px;

  --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, 0.12);
}

body.dark-mode {
  --text-body: #e7e9ec;
  --text-strong: #f3f4f6;
}

/* =========================================================
     BASE / RESET
     ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
}

h1,
h2,
h3 {
  font-family: "EB Garamond", serif;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

/* =========================================================
     NAVBAR
     ========================================================= */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(0.5px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 1000;
}

.nav-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #112244;
  border-bottom-color: var(--accent);
}

.dark-toggle {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  background: #ececec;
}

/* =========================================================
     MAIN CONTAINER
     ========================================================= */
main {
  max-width: 90%;
  margin: 96px auto 64px;
  padding: 24px 20px;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

/* =========================================================
     PROFILE
     ========================================================= */
.profile-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 20px;
}

.profile-header {
  margin-bottom: 72px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 56px;
  align-items: flex-start;
}

.profile-avatar {
  display: flex;
  justify-content: center;
}

.profile-avatar .profile-img {
  width: 160px;
  height: 160px;
  border-radius: 50%; /* round avatar restored */
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.profile-content h1 {
  margin: 0;
  font-size: 3rem;
  letter-spacing: -0.03em;
}

.profile-content .hero-sub {
  margin-top: 8px;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.profile-content .hero-lede {
  margin-top: 18px;
}

.hero-lede {
  font-size: 1.1rem;
}

.cred-list {
  align-items: flex;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);

  text-align: left;
  align-self: flex-start;
}

.cred-list li {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.profile-contact {
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

/* =========================================================
     CONTACT + SOCIAL
     ========================================================= */
.contact-section {
  text-align: center;
  margin-bottom: 8px;
}

.contact-email {
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px dotted currentColor;
}

.social-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 18px;
}

.social-links img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f1f2fa;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-links img:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* =========================================================
     PROJECT CARDS
     ========================================================= */

.section-head {
  margin-bottom: 40px;
  text-align: center;
}

.section-title {
  margin-bottom: 8px;
  text-align: left;
  font-size: 2.5rem;
  color: var(--accent);
}

.section-sub {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1rem;
  text-align: left;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.featured-grid {
  margin-bottom: 4rem;
}

.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr; /* image + text */
}

.featured-card .card-media {
  height: 100%;
}

.secondary-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  position: relative;
  height: 240px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-tags {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
}

.card-tags span {
  font-size: 0.7rem;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
}

.card-text {
  padding: 20px 24px 24px;
}

.card-text h3 {
  color: var(--accent);
  margin-bottom: 6px;
}

.card-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.card-text .featured {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================================
     CASE STUDY
     ========================================================= */
.case-study {
  max-width: 960px;
  margin: 0 auto 96px;
  text-align: left;
}

.case-header img {
  width: 100%;
  border-radius: 16px;
}

.case-header h1 {
  text-align: center;
  font-size: 2.4rem;
  margin-top: 24px;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
}

.case-meta {
  margin-top: 24px;
  padding-left: 16px;
  border-left: 3px solid rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
}

.case-study section {
  margin-top: 64px;
}

.case-study h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.case-study p,
.case-study li {
  font-size: 1.05rem;
  line-height: 1.7;
}

.case-study img,
.case-study video {
  width: 100%;
  border-radius: 12px;
}

/* =========================================================
     SLIDESHOW
     ========================================================= */
.case-slideshow {
  position: relative;
  margin: 32px 0;
}

.slideshow-viewport {
  overflow: hidden;
  border-radius: 12px;
}

.slideshow-track {
  display: flex;
  transition: transform 0.6s ease;
}

.slideshow-track img {
  width: 100%;
  flex-shrink: 0;
}

.slideshow-controls {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.slideshow-controls button {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

/* =========================================================
     FOOTER
     ========================================================= */
footer {
  text-align: center;
  font-size: 0.9rem;
  margin-top: -20px;
  color: var(--text-muted);
}

/* =========================================================
     DARK MODE
     ========================================================= */
body.dark-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  background: #16181e;
  z-index: -1;
}

body.dark-mode {
  background: #16181e;
  color: #e7e9ec;
}

body.dark-mode .navbar {
  background: rgba(35, 36, 51, 0.9);
}

body.dark-mode .nav-link {
  color: #e1cfae;
}

body.dark-mode .profile-card {
  background: #232433;
}

body.dark-mode .project-card {
  background: #2a2b3d;
}

body.dark-mode footer {
  color: #cab88b;
}

body.dark-mode .cred-strip {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* =========================================================
     RESPONSIVE
     ========================================================= */
@media (max-width: 700px) {
  main {
    padding: 32px 20px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .profile-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-content {
    text-align: center;
  }

  .cred-list {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    max-width: 520px;
  }

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

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

/* =========================================================
   SCROLLING MOTION
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* =========================================================
   BACK BUTTON
   ========================================================= */
#back-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-family: "EB Garamond", serif;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 18px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0.85;
  z-index: 999;
  transition: opacity 0.3s ease;
}

#back-btn:hover {
  opacity: 1;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
}
