/* ====================== ROOT VARIABLES ====================== */

/* DEFAULT = LIGHT MODE */
:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2564eb;
  --border: rgba(0, 0, 0, 0.08);
}

/* DARK MODE */
body.dark {
  --bg: #0b0f17;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #60a5fa;
  --border: rgba(255, 255, 255, 0.08);
}

/* ====================== GLOBAL ====================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Manrope, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: 40px 20px;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

/* ====================== LAYOUT ====================== */

.container {
  max-width: 1200px;
  margin: auto;
}

.top,
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

section {
  margin-bottom: 50px;
}

h1 {
  font-size: 44px;
  font-weight: 500;
}

h2 {
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--accent);
}

.role {
  color: var(--muted);
  font-size: 14px;
}

/* ====================== BUTTONS ====================== */
.toggle{
   position: fixed; 
  top: 5%;   
  right: 10%;     
  z-index: 1000; 
}

.theme-btn,
.toggle,
.filter-btn,
.project-btn,
.send-btn,
.project-link {
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Outline Buttons */
.toggle,
.project-btn {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--text);
}

/* Filled Buttons */
.theme-btn,
.filter-btn {
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Primary Buttons */
.send-btn,
.project-link {
  padding: 14px 18px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

/* Hover Effects */
.theme-btn:hover,
.filter-btn:hover,
.send-btn:hover,
.project-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.25);
}

/* ====================== FILTERS ====================== */

.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 35px;
}

/* ====================== GRID & CARDS ====================== */

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  padding: 12px;
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.25);
}

.thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #d1d5db;
}

body.dark .thumb {
  background: #1f2937;
}

.content {
  padding: 22px;
}

.content h3,
.card h4 {
  margin-bottom: 10px;
  font-size: 20px;
  font-weight: 700;
}

.content p,
.card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.tag {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ====================== MODALS ====================== */

.contact-modal,
.detail,
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;

  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
}

.contact-box,
.detail-box,
.modal-content {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;

  transform: scale(0.8);
  opacity: 0;

  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}

.contact-box,
.modal-content {
  max-width: 500px;
  padding: 30px;
}

.detail-box {
  max-width: 850px;
  overflow: hidden;
}

.detail-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.detail-content {
  padding: 32px;
}

.detail-content h2 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* ====================== FORM ====================== */

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-form input,
.contact-form textarea {
  padding: 14px;
  border-radius: 14px;
  outline: none;

  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);

  color: var(--text);
}

body.dark .contact-form input,
body.dark .contact-form textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
/* =========================
   FORM TRANSITIONS
========================= */

.contact-form input,
.contact-form textarea,
.send-btn {
  transition:
    border 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    transform 0.2s ease;
}

/* =========================
   INPUT FOCUS
========================= */

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: rgba(59, 130, 246, 0.5);

  box-shadow:
    0 0 0 4px rgba(59, 130, 246, 0.08);

  transform: translateY(-1px);
}

body.dark .contact-form input:focus,
body.dark .contact-form textarea:focus {
  border-color: rgba(96, 165, 250, 0.5);

  box-shadow:
    0 0 0 4px rgba(96, 165, 250, 0.08);
}

/* =========================
   ERROR INPUTS
========================= */

.contact-form input.error,
.contact-form textarea.error {
  border-color: rgba(239, 68, 68, 0.6);

  background: rgba(239, 68, 68, 0.04);

  box-shadow:
    0 0 0 4px rgba(239, 68, 68, 0.08);
}

body.dark .contact-form input.error,
body.dark .contact-form textarea.error {
  background: rgba(239, 68, 68, 0.08);
}

/* =========================
   RESPONSE BOX
========================= */

#formResponse {
  margin-top: 14px;
}

/* =========================
   ALERT BASE
========================= */

.form-alert {
  position: relative;

  padding: 16px 18px;

  border-radius: 16px;

  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;

  overflow: hidden;

  backdrop-filter: blur(14px);

  border: 1px solid transparent;

  animation: alertSlide 0.35s ease;
}

/* =========================
   SUCCESS ALERT
========================= */

.form-alert.success {
  color: #16a34a;

  background:
    rgba(34, 197, 94, 0.08);

  border-color:
    rgba(34, 197, 94, 0.25);

  box-shadow:
    0 10px 30px rgba(34, 197, 94, 0.08);
}

body.dark .form-alert.success {
  color: #4ade80;

  background:
    rgba(34, 197, 94, 0.12);
}

/* =========================
   ERROR ALERT
========================= */

.form-alert.error {
  color: #dc2626;

  background:
    rgba(239, 68, 68, 0.08);

  border-color:
    rgba(239, 68, 68, 0.25);

  box-shadow:
    0 10px 30px rgba(239, 68, 68, 0.08);
}

body.dark .form-alert.error {
  color: #f87171;

  background:
    rgba(239, 68, 68, 0.12);
}

/* =========================
   LOADING ALERT
========================= */

.form-alert.loading {
  color: #2563eb;

  background:
    rgba(59, 130, 246, 0.08);

  border-color:
    rgba(59, 130, 246, 0.2);
}

body.dark .form-alert.loading {
  color: #60a5fa;

  background:
    rgba(59, 130, 246, 0.12);
}

/* =========================
   SEND BUTTON LOADING
========================= */

.send-btn.loading {
  opacity: 0.75;
  pointer-events: none;
}

.send-btn.loading::after {
  content: "";

  width: 16px;
  height: 16px;

  margin-left: 10px;

  border-radius: 50%;

  border: 2px solid white;
  border-top-color: transparent;

  display: inline-block;

  vertical-align: middle;

  animation: spin 0.8s linear infinite;
}

/* =========================
   ALERT ANIMATION
========================= */

@keyframes alertSlide {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =========================
   SPINNER
========================= */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ====================== CLOSE BUTTON ====================== */

.close {
  position: absolute;
  top: 18px;
  right: 18px;

  width: 42px;
  height: 42px;

  border: none;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.5);
  color: white;

  cursor: pointer;
  font-size: 20px;
  z-index: 10;

  transition: transform 0.3s ease;
}

.close:hover {
  transform: rotate(90deg);
}

/* ====================== FOOTER ====================== */

.footer {
  padding: 40px 20px;
  margin-top: 60px;
  border-top: 1px solid rgba(154, 148, 148, 0.046);

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;

  gap: 12px;
}

/* LOGO */
.footer-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-logo img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 50%;
}

/* NAME */
.footer h3 {
  color: var(--text);
  font-size: 1.2rem;
  margin: 0;
}

/* DESCRIPTION */
.footer p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 10px;
}

/* BUTTON */
.contact-btn {
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  border: none;
  cursor: pointer;

  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;

  transition: 0.3s ease;
}

.contact-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* ====================== RESPONSIVE ====================== */

@media (max-width: 768px) {
  body {
    padding: 25px 16px;
  }

  h1 {
    font-size: 34px;
  }

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

  .detail-image {
    height: 240px;
  }
}