/*─────────────────────────────────────────────────────────────────────────────
  VARIABLES & THEMES
─────────────────────────────────────────────────────────────────────────────*/
:root {
  --bg-light: #f9f7f1;
  --text-light: #2a2a2a;
  --sub-title-text: #6c6c6c;
  --card-light: #ffffff;
  --accent: #c1a57b;
  --project-divider: #e0e0e0;
}

[data-theme="dark"] {
  --bg-light: #1a1a1a;
  --text-light: #eaeaea;
  --sub-title-text: #b0b0b0;
  --card-light: #2f2e2e;
  --accent: #8b7e66;
  --project-divider: #444444;
}

/*─────────────────────────────────────────────────────────────────────────────
  RESET & BASE
─────────────────────────────────────────────────────────────────────────────*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-light);
  color: var(--text-light);
  line-height: 1.6;
  scroll-behavior: smooth;
  padding-top: 70px;
}

/*─────────────────────────────────────────────────────────────────────────────
  NAVBAR
─────────────────────────────────────────────────────────────────────────────*/
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-light);
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

/* left: brand */
.nav-brand a {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-light);
  text-decoration: none;
}

/* center: links */
.nav-links {
  flex: 1; /* take all available middle space */
  display: flex;
  justify-content: center; /* center them horizontally */
  gap: 1.25rem;
}

.nav-links a {
  color: var(--text-light);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

/* right: actions (theme + burger) */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* theme toggle */
#theme-toggle {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  transition: color 0.2s;
  cursor: pointer;
}
#theme-toggle:hover {
  color: var(--accent);
}

/* hide both icons by default */
#theme-toggle .icon-moon,
#theme-toggle .icon-sun {
  display: none;
}
body[data-theme="light"] #theme-toggle .icon-moon {
  display: inline;
}
body[data-theme="dark"] #theme-toggle .icon-sun {
  display: inline;
}

/* hamburger (hidden desktop) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 64px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle .bar {
  width: 100%;
  height: 2px;
  background: var(--text-light);
  border-radius: 1px;
  transition: background 0.2s;
}

.nav-toggle:hover .bar {
  background: var(--accent);
}

/*─────────────────────────────────────────────────────────────────────────────
  MOBILE BEHAVIOR
─────────────────────────────────────────────────────────────────────────────*/
@media (max-width: 768px) {
  /* show burger, hide theme toggle in collapsed menu */
  .nav-toggle {
    display: flex;
  }

  /* hide links by default */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  .navbar.open .nav-links {
    max-height: 500px; /* big enough for all items */
  }

  /* make each link + theme toggle full width */
  .nav-links a,
  #theme-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
  }
}

/*─────────────────────────────────────────────────────────────────────────────
  LAYOUT CONTAINER
─────────────────────────────────────────────────────────────────────────────*/
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

header,
section {
  margin-bottom: 2rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  LANDING / HERO
─────────────────────────────────────────────────────────────────────────────*/
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  background: var(--bg-light);
  text-align: center;
}

.landing-content {
  max-width: 600px;
  padding: 2rem 1rem;
}

.landing-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
}

.landing h1 {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.landing .subtitle {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.landing .description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  ACTION BUTTONS: RESUME + APPOINTMENT SIDE-BY-SIDE
─────────────────────────────────────────────────────────────────────────────*/
.action-buttons {
  display: flex;
  align-items: center; /* vertical center */
  justify-content: center; /* horizontal center */
  gap: 1rem; /* space between buttons */
  flex-wrap: wrap; /* wrap on narrow screens */
  margin-bottom: 2rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  SOCIAL ICONS
─────────────────────────────────────────────────────────────────────────────*/
.social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.social-link {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--card-light);
  color: var(--accent);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s,
    transform 200ms cubic-bezier(0.19, 1, 0.22, 1),
    opacity 200ms cubic-bezier(0.19, 1, 0.22, 1);
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.social-link:hover {
  background: var(--accent);
  color: var(--bg-light);
  transform: scale(1.04);
  opacity: 0.92;
}

/*─────────────────────────────────────────────────────────────────────────────
  INTERESTS CHIPS
─────────────────────────────────────────────────────────────────────────────*/
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/*─────────────────────────────────────────────────────────────────────────────
  HEADINGS & UTILITIES
─────────────────────────────────────────────────────────────────────────────*/
h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: inline-block;
  border-bottom: 2px solid var(--accent);
}

.padding-top-small {
  padding-top: 0.5rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  CHIPS
─────────────────────────────────────────────────────────────────────────────*/
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  background: var(--accent);
  color: #fff;
  border-radius: 16px;
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  EDUCATION SECTION
─────────────────────────────────────────────────────────────────────────────*/
.education {
  margin-top: 1.5rem; /* tighten from default */
  margin-bottom: 2rem;
}

.education-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.education-item {
  background: var(--card-light);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.education-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.education-item h3 {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
  color: var(--text-light);
}

.education-item p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-light);
  opacity: 0.8;
}

@media (max-width: 600px) {
  .education-grid {
    grid-template-columns: 1fr;
  }
}

/*─────────────────────────────────────────────────────────────────────────────
  PROJECTS GRID & CARDS
─────────────────────────────────────────────────────────────────────────────*/
#projects .project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  #projects .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  #projects .project-grid {
    grid-template-columns: 1fr;
  }
}

#projects .project-card {
  background: var(--card-light);
  color: var(--text-light);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#projects .project-card h3 {
  font-size: 1.25rem;
  margin: 0;
}

#projects .card-desc {
  flex-grow: 1;
  margin: 1rem 0;
  line-height: 1.4;
}

#projects .card-divider {
  border: none;
  height: 1px;
  background: var(--project-divider);
  margin: 1rem 0;
}

#projects .project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#projects .project-link-btn {
  margin-left: auto;
}

#projects .project-link-btn a {
  color: var(--bg-light);
}

#projects .project-card .chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  EXPERIENCE TIMELINE
─────────────────────────────────────────────────────────────────────────────*/
#experience .timeline {
  position: relative;
  padding-left: 2.5rem;
  margin-top: 2rem;
}

#experience .timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  bottom: 0;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

#experience .timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

#experience .timeline-item::before {
  content: "";
  position: absolute;
  left: -1.85rem;
  top: 0.25rem;
  width: 16px;
  height: 16px;
  background: var(--accent);
  border: 4px solid var(--bg-light);
  border-radius: 50%;
  z-index: 1;
}

#experience .timeline-item > * {
  margin-left: 1.5rem; /* offset to align with the line */
}

/*─────────────────────────────────────────────────────────────────────────────
  CONTENT STYLING
─────────────────────────────────────────────────────────────────────────────*/
#experience .timeline-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
  margin-left: auto;
}

#experience .timeline-role {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
}

#experience .timeline-company {
  font-style: italic;
  color: var(--sub-title-text);
  margin-bottom: 0.75rem;
}

#experience .timeline-details {
  list-style: disc inside;
}

#experience .timeline-details li {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

#experience .timeline-item .chips,
#experience .timeline-item .links {
  margin-top: 0.5rem;
}

#experience .timeline-item .links a {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  margin-right: 1rem;
}

/*─────────────────────────────────────────────────────────────────────────────
  BLOG
─────────────────────────────────────────────────────────────────────────────*/
#blog .grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  #blog .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

#blog .card {
  display: flex;
  flex-direction: column;
  background: var(--card-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#blog .card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

#blog .card h3 {
  margin: 1rem;
  font-size: 1.25rem;
}

#blog .card p {
  flex-grow: 1;
  margin: 0 1rem 1rem;
  line-height: 1.4;
}

#blog .card .read-more {
  margin: 0 1rem 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

/*─────────────────────────────────────────────────────────────────────────────
  CONTACT FORM & MODAL
─────────────────────────────────────────────────────────────────────────────*/
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

form input,
form textarea {
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

/* success modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-light);
  color: var(--text-light);
  padding: 2rem;
  border-radius: 8px;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/*─────────────────────────────────────────────────────────────────────────────
  APPOINTMENT BUTTON CONTAINER
─────────────────────────────────────────────────────────────────────────────*/
.appointment-btn-container {
  background: transparent;
  padding: 0;
  margin: 0;
  margin-top: clamp(16px, 4%, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.appointment-btn-container p {
  margin: 0;
  color: var(--text-light);
  font-size: 1rem;
  text-align: center;
}

.appointment-btn-container .appointment-btn {
  display: inline-flex;
  width: auto;
  margin: 0;
}

/*─────────────────────────────────────────────────────────────────────────────
  APPOINTMENT BUTTON (JS-INJECTED)
─────────────────────────────────────────────────────────────────────────────*/
.appointment-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/*─────────────────────────────────────────────────────────────────────────────
  FOOTER & SOCIAL ICONS
─────────────────────────────────────────────────────────────────────────────*/
.footer {
  background: var(--bg-light);
  color: var(--text-light);
  border-top: 1px solid var(--project-divider);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  gap: 1rem;
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--card-light);
  color: var(--accent);
  border-radius: 50%;
  transition: background 0.2s, color 0.2s,
    transform 200ms cubic-bezier(0.19, 1, 0.22, 1),
    opacity 200ms cubic-bezier(0.19, 1, 0.22, 1);
}

.social-link svg {
  width: 1.25rem;
  height: 1.25rem;
}

.social-link:hover {
  background: var(--accent);
  color: var(--bg-light);
  transform: scale(1.04);
  opacity: 0.92;
}

.footer-credit {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* Resume Modal Custom Styles */
.resume-modal-content {
  max-width: 1100px;
  width: 100vw;
  height: 90vh;
  padding: 1rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  margin-top: 2.5rem;
}
.resume-modal-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: #222;
  padding: 0.5rem 1.5rem 0.5rem 1.5rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  min-height: 3.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.5rem;
}
.resume-iframe {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  border-radius: 6px;
  background: #fff;
  min-height: 500px;
  margin-bottom: 1rem;
}
.modal-close-btn {
  position: absolute;
  top: -3.5rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  color: #fff;
  border: none;
  border-radius: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28), 0 2px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  padding: 0.5rem 2.2rem 0.5rem 1.5rem;
  z-index: 2000;
  min-width: 8.5rem;
  min-height: 3.5rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  outline: none;
}
.modal-close-btn .close-icon {
  font-size: 2rem;
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
}
.modal-close-btn .close-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.modal-close-btn:hover,
.modal-close-btn:focus {
  background: #fff;
  color: #222;
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

.resume-modal-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  color: var(--text-light);
  padding: 0.5rem 1.5rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  min-height: 3.5rem;
  box-shadow: none;
  border-bottom: none;
  margin-bottom: 0.5rem;
}
.resume-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.resume-modal-close-simple {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s, transform 0.2s;
}
.resume-modal-close-simple:hover,
.resume-modal-close-simple:focus {
  background: none;
  color: var(--accent);
  outline: none;
  transform: scale(1.2);
}

.resume-modal-content .close-btn:hover {
  transform: scale(1.02);
  opacity: 0.92;
}

.gc-appointment-button {
  background: var(--accent);
  color: #fff !important;
  font-size: 1rem;
  padding: 0.75rem 1.5rem !important;
  border: none;
  border-radius: 8px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .gc-appointment-button {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 8px;
}

/* Utility button class for all main buttons, including injected appointment button */
.btn {
  background: var(--accent);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px !important;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 42px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms cubic-bezier(0.19, 1, 0.22, 1),
    opacity 200ms cubic-bezier(0.19, 1, 0.22, 1);
  text-decoration: none;
}
.btn:hover {
  transform: scale(1.04);
  opacity: 0.92;
}
.btn:active {
  transform: scale(0.98);
}

/* Remove redundant form button/input rules, keep only context-specific overrides */
form input,
form textarea {
  width: 100%;
  background: var(--card-light);
  color: var(--text-light);
  border: 1px solid var(--project-divider);
  border-radius: 8px;
  padding: 0.75rem;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
form input::placeholder,
form textarea::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}
form input:focus,
form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

#contact-form .btn {
  width: 95%;
  margin: 0 auto;
}

/* Document: Use .btn for all main buttons in HTML (resume, send message, appointment, etc.) */

/*─────────────────────────────────────────────────────────────────────────────
  FINAL OVERRIDES & PRINT STYLES
─────────────────────────────────────────────────────────────────────────────*/
@media print {
  body {
    background: #fff;
    color: #000;
    padding-top: 0;
  }
  .navbar,
  .footer,
  .landing-buttons,
  .social-icons,
  .appointment-btn-container {
    display: none;
  }
  section {
    margin-bottom: 1.5rem;
  }
  h1,
  h2,
  h3 {
    page-break-after: avoid;
  }
  a {
    text-decoration: none;
    color: inherit;
  }
}