/* ===================== CSS Variables ===================== */
:root {
  --bg: #111111;
  --card: #191919;
  --card-hover: #1e1e1e;
  --midnight-green: #1C272D;
  --text: #DBE2EF;
  --text-muted: #a0a8b8;
  --white: #F9F7F7;
  --green: #3DDC84;
  --blue: #4285F4;
  --dark-blue: #114C76;
  --light-blue: #3582B8;
  --border: rgba(255,255,255,0.08);
  --navbar-h: 70px;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

/* ===================== Reset & Base ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Montserrat', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ===================== Scrollbar ===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--card); border-radius: 3px; }

/* ===================== Utility ===================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--light-blue), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 1rem;
}

/* ===================== Navbar ===================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--navbar-h);
  background: rgba(17,17,17,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}


.nav-brand-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}

.nav-link:hover { color: var(--green); background: rgba(61,220,132,0.08); }
.nav-link.active { color: var(--green); background: rgba(61,220,132,0.12); }

/* Hamburger menu (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Mobile nav drawer */
.nav-drawer {
  display: none;
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  right: 0;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  padding: 16px;
  z-index: 99;
}

.nav-drawer.open { display: flex; }

.nav-drawer .nav-link {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ===================== Page Layout ===================== */
.app { min-height: 100vh; overflow-x: hidden; }

.page-content {
  padding-top: var(--navbar-h);
}

/* ===================== Footer ===================== */
.footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 32px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a { color: var(--green); }
.footer a:hover { text-decoration: underline; }

/* ===================== Hero Sections ===================== */
.hero-section {
  padding: 80px 40px;
}

.hero-row {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 48px;
}

.hero-row.reversed { flex-direction: row-reverse; }

.lottie-container {
  flex: 0 0 auto;
}


.text-anim-box {
  flex: 1;
  max-width: 480px;
}

.text-anim-box h1,
.text-anim-box h2 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.text-anim-box p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1rem;
  margin-top: 16px;
}

/* ===================== Rotating Text ===================== */
.rotating-text-wrapper {
  height: 2.8rem;
  overflow: hidden;
  position: relative;
  margin: 4px 0;
}

.rotating-text-wrapper span {
  position: absolute;
  font-size: 2rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  animation: rotateText 9s infinite;
}

.rotating-text-wrapper span:nth-child(1) { animation-delay: 0s; color: var(--text); }
.rotating-text-wrapper span:nth-child(2) { animation-delay: 3s; color: var(--green); }
.rotating-text-wrapper span:nth-child(3) { animation-delay: 6s; color: var(--blue); }

@keyframes rotateText {
  0%, 100% { opacity: 0; transform: translateY(12px); }
  5%, 28% { opacity: 1; transform: translateY(0); }
  33% { opacity: 0; transform: translateY(-12px); }
}

/* ===================== Accordion Section ===================== */
.accordion-section {
  padding: 60px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
  text-align: center;
}

.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

details.accordion-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}

details.accordion-item:hover { border-color: rgba(61,220,132,0.3); }
details.accordion-item[open] { border-color: rgba(61,220,132,0.5); }

details.accordion-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  user-select: none;
}

details.accordion-item summary::-webkit-details-marker { display: none; }

details.accordion-item[open] summary { color: var(--green); }

.accordion-toggle {
  font-size: 1.4rem;
  color: var(--green);
  font-weight: 400;
  transition: transform 0.3s;
  flex-shrink: 0;
}

details.accordion-item[open] .accordion-toggle { transform: rotate(45deg); }

.accordion-body {
  padding: 0 24px 20px;
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ===================== CTA / Advertising ===================== */
.cta-section {
  padding: 60px 40px;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-section h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.cta-section p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.cta-link {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  transition: opacity 0.2s;
}

.cta-link:hover { opacity: 0.8; }

/* ===================== Work Page ===================== */
.work-page {
  padding: 60px 40px;
}

.projects-list {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.project-card {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px;
  border: 1px solid var(--border);
}

.project-card:nth-child(even) { flex-direction: row-reverse; }

.project-carousel {
  flex: 0 0 380px;
  position: relative;
}

.carousel-viewport {
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  height: 420px;
  background: var(--midnight-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(30%);
  transition: filter 0.3s;
}

.carousel-img:hover { filter: grayscale(0); }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.carousel-btn {
  background: var(--midnight-green);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.carousel-btn:hover { background: var(--green); color: var(--bg); }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }

.carousel-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-info {
  flex: 1;
  padding-top: 8px;
}

.project-info h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.project-info p {
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ===================== About Page ===================== */
.about-page { padding-bottom: 60px; }

.about-top {
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.about-top-row {
  display: flex;
  align-items: flex-start;
  gap: 64px;
}

.profile-photo {
  flex: 0 0 auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(80%);
  border: 3px solid var(--border);
  transition: filter 0.4s;
}

.profile-photo:hover { filter: grayscale(0); }

.about-bio {
  flex: 1;
  max-width: 560px;
}

.about-bio .gradient-text { font-size: 1rem; }

.timeline-section {
  padding: 0 40px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.timeline {
  position: relative;
  padding-left: 32px;
  margin-top: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), var(--blue));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 36px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--green);
  background: var(--bg);
  z-index: 1;
}

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

.timeline-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.timeline-card:hover { border-color: rgba(61,220,132,0.4); }

.timeline-role {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-company {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}

.timeline-year {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
}

.books-section {
  padding: 0 40px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.book-card:hover {
  border-color: rgba(61,220,132,0.4);
  transform: translateY(-4px);
}

.book-cover {
  width: 120px;
  height: 170px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto 16px;
  filter: grayscale(40%);
  transition: filter 0.3s;
}

.book-card:hover .book-cover { filter: grayscale(0); }

.book-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.book-author {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================== Contact Page ===================== */
.contact-page {
  padding: 60px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-header {
  margin-bottom: 40px;
}

.contact-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.contact-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

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

details.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

details.contact-card:hover { border-color: rgba(61,220,132,0.3); }
details.contact-card[open] { border-color: rgba(61,220,132,0.5); }

details.contact-card summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.contact-card summary::-webkit-details-marker { display: none; }

.contact-icon-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0.8);
}

.contact-icon-svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--green);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-card-info { flex: 1; }

.contact-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

details.contact-card[open] .contact-card-title { color: var(--green); }

.contact-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.contact-toggle {
  font-size: 1.4rem;
  color: var(--green);
  font-weight: 300;
  transition: transform 0.3s;
  flex-shrink: 0;
}

details.contact-card[open] .contact-toggle { transform: rotate(45deg); }

.contact-card-body {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  background: rgba(61,220,132,0.1);
  border-radius: 8px;
  transition: background 0.2s;
}

.contact-link:hover { background: rgba(61,220,132,0.2); }

.jotform-iframe {
  width: 100%;
  min-height: 500px;
  border: none;
  border-radius: 8px;
  margin-top: 8px;
}

/* ===================== Policy Page ===================== */
.policy-page {
  padding: 60px 40px;
  max-width: 860px;
  margin: 0 auto;
}

.policy-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.policy-breadcrumb a { color: var(--green); }

.policy-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.policy-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  text-transform: capitalize;
}

.policy-header .policy-app-name {
  font-size: 1rem;
  color: var(--green);
  font-weight: 600;
}

.policy-content {
  color: var(--text);
  line-height: 1.9;
  font-size: 0.95rem;
}

.policy-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}

.policy-content p { margin-bottom: 16px; }

.policy-content ul {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 16px;
}

.policy-content ul li { margin-bottom: 8px; }

.policy-not-found {
  text-align: center;
  padding: 80px 40px;
}

.policy-not-found h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.policy-not-found p { color: var(--text-muted); }

.policy-not-found a {
  display: inline-block;
  margin-top: 24px;
  color: var(--green);
  font-weight: 600;
  border: 1px solid var(--green);
  padding: 10px 24px;
  border-radius: 8px;
  transition: background 0.2s;
}

.policy-not-found a:hover { background: rgba(61,220,132,0.1); }

/* ===================== 404 Page ===================== */
.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 40px;
}

.not-found h1 {
  font-size: 6rem;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
  margin-bottom: 16px;
}

.not-found h2 {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 12px;
}

.not-found p { color: var(--text-muted); margin-bottom: 32px; }

.btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--green);
  color: var(--bg);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.85; }

/* ===================== Section Headings ===================== */
.headline-section {
  padding: 20px 40px 0;
  max-width: 1100px;
  margin: 0 auto;
}

.headline-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

/* ===================== Responsive ===================== */
@media (max-width: 1200px) {
  .hero-row { gap: 32px; }
  .project-card { gap: 32px; }
  .project-carousel { flex: 0 0 300px; }
}

@media (max-width: 960px) {
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card { flex-direction: column !important; }
  .project-carousel { flex: none; width: 100%; max-width: 380px; margin: 0 auto; }
  .about-top-row { flex-direction: column; align-items: center; }
  .profile-photo { width: 220px; height: 220px; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero-section { padding: 48px 20px; }
  .hero-row { flex-direction: column !important; align-items: center; text-align: center; }
  .lottie-container > div { width: 220px !important; height: 220px !important; }
  .text-anim-box h1, .text-anim-box h2 { font-size: 1.8rem; }
  .rotating-text-wrapper span { font-size: 1.6rem; }
  .rotating-text-wrapper { height: 2.2rem; }

  .accordion-section { padding: 40px 20px; }
  .cta-section { padding: 40px 20px; }
  .work-page { padding: 40px 20px; }
  .about-top { padding: 48px 20px; }
  .timeline-section { padding: 0 20px 40px; }
  .books-section { padding: 0 20px 40px; }
  .books-grid { grid-template-columns: 1fr 1fr; }
  .contact-page { padding: 40px 20px; }
  .policy-page { padding: 40px 20px; }

  .hero-row.reversed { flex-direction: column !important; }
}

@media (max-width: 480px) {
  .books-grid { grid-template-columns: 1fr; }
  .text-anim-box h1, .text-anim-box h2 { font-size: 1.5rem; }
  .contact-header h1 { font-size: 1.8rem; }
  .policy-header h1 { font-size: 1.5rem; }
}
