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

:root {
  /* Palette inspired by your photo */
  --primary-bg: #111827;             /* deep slate blue */
  --secondary-bg: #1f2937;           /* softer dark panel */
  --accent-blue: #60a5fa;            /* sky blue */
  --accent-blue-soft: #93c5fd;
  --accent-warm: #f97416bb;            /* terracotta / brick */
  --accent-warm-soft: #fed7aa;
  --text-primary: #f9fafb;           /* almost white */
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.5);
  --radius-lg: 18px;
  --radius-md: 12px;
  --header-height: 72px;

  /* background: #1b244e; 
                #121b44;
                #004953;
                #002B36; */

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #60a5fa 0%, #c27035 30%, #a855f7 50%);
  --gradient-soft: radial-gradient(circle at 0 0, rgba(96,165,250,0.25), transparent 55%),
                   radial-gradient(circle at 100% 20%, rgba(248,113,113,0.30), transparent 55%);
                   
                   
  /* ADDED: Consistent spacing scale */
  --space-xs: 0.5rem;   /* 8px */
  --space-sm: 1rem;     /* 16px */
  --space-md: 1.5rem;   /* 24px */
  --space-lg: 2rem;     /* 32px */
  --space-xl: 3rem;     /* 48px */
}


html {
  scroll-behavior: smooth;
}

body {
  font-family: "Dosis", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: #002B36;
  overflow-x: hidden;
}

/* ===========================
   Typography — FIXED SCALE
   =========================== */

h1, h2, h3 {
  font-weight: 400;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem); /* 28px → 40px */
  background: linear-gradient(135deg, var(--accent-blue-soft), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h1:first-of-type {
  font-size: clamp(1.5rem, 3.5vw, 2rem); /* 24px → 32px */
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  display: inline-block;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(148,163,184,0.7);
  /* border-bottom-color: linear-gradient(135deg, var(--accent-blue-soft), var(--accent-warm)); */
}

.hero h1:nth-of-type(2) {
  margin-top: 0.5rem;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem); /* 24px → 32px */
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.375rem); /* 18px → 22px */
  color: var(--text-primary);
}

p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: left;
  margin-bottom: 1rem;
  max-width: 60rem;
  padding: 0px;
}

/* Center only hero copy */
.hero p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   Layout
   =========================== */

main {
  min-height: calc(100vh - var(--header-height));
  padding: calc(var(--header-height) + var(--space-md)) var(--space-sm) var(--space-xl);
  display: flex;
  justify-content: center;
}

#main > section > p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 40rem;      /* slightly narrower for nicer line length */
  font-size: 1rem;       /* same as global p */
}

/* Case Study Page - Force Vertical Layout */
#main section {
  display: block;
  width: 100%;
  margin-bottom: 40px;
}

.page-content {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
}

.profile {
  max-width: 900px;
  margin: 0 auto var(--space-lg); /* CHANGED: now uses spacing var */
}

.profile2 {
  max-width: 900px;
  margin: 0 auto var(--space-lg);
}

/* ===========================
   Header & Navigation
   =========================== */

.page-header {
  position: sticky;
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  background: #002B36;
  /* border-bottom: 1px solid rgba(121, 131, 145, 0.9); */
  z-index: 1000;
  padding: 0.7rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  -webkit-backdrop-filter: blur(14px); /* Safari */
  backdrop-filter: blur(14px);       /* Other browsers */
}


/* Nav */

.main-navigation {
  display: flex;
}

#main-nav[hidden] {
  display: none;
}


.page-header.is-open .main-navigation {
  position: absolute;
  top: 100%;
  right: 1.5rem;              /* aligns under toggle */
  width: max-content;
  min-width: 120px;
  background: rgba(15,23,42,0.98);
  border-radius: 8px;
  padding: 0.5rem;
  box-shadow: 0 20px 40px rgba(30,46,84,1);
}

.page-header.is-open .navigation-list {
  flex-direction: column;
  gap: 0.25rem;
}

.page-header.is-open .navigation-list a {
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
}

.navigation-list {
  display: flex;
  list-style: none;
  gap: 0.75rem;
  align-items: center;
}

.navigation-list a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 700px;
  font-weight: 400;
  font-size: 1rem;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.navigation-list a:hover,
.navigation-list a:focus {
  background: rgba(184, 165, 148, 0.28);
  transform: translateY(1px);
}

/* Mobile nav toggle */
.nav-toggle {
  display: flex;
  background: #111827;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 700px;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
}

.nav-toggle__text {
  font: inherit;
  line-height: 1;
}

/* ===========================
   Hero (Home)
   =========================== */

.hero {
  position: relative;
  padding-top: var(--space-md);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #002B36;
  pointer-events: none;
  z-index: -1;
}

.illustration-container {
  margin: var(--space-lg) auto;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md);
}

.illustration-container img {
  width: 260px;
  height: 340px;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.8);
  border: 3px solid rgba(30,46,84,0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.illustration-container img:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 22px 50px rgba(15,23,42,0.9);
  border-color: rgba(252,211,77,0.9);
}

.hero h3 {
  color: var(--accent-blue-soft);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: var(--space-sm);
}

/* ===========================
   Buttons
   =========================== */

.button-link {
  display: inline-block;
  background: var(--gradient-soft);
  color: var(--text-primary) !important;
  padding: 0.5rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
  box-shadow: 0 16px 35px rgba(15,23,42,0.9);
  border: 1px solid rgba(148,163,184,0.9);
  cursor: pointer;
  
}

.button-link:hover,
.button-link:focus {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 45px rgba(15,23,42,1);
  filter: brightness(1.05);
}

/* Secondary button */
.button-secondary {
  background: transparent;
  border: 1px solid rgba(148,163,184,0.9);
  box-shadow: none;
}

.button-secondary:hover,
.button-secondary:focus {
  background: rgba(15,23,42,0.8);
  box-shadow: 0 12px 30px rgba(15,23,42,0.8);
}

.contact-email {
  color: var(--accent-blue-soft);
  text-decoration: underline;
}

.contact-email:hover,
.contact-email:focus {
  color: var(--accent-warm-soft);
}

/* ===========================
   Work Grid
   =========================== */

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.grid-item {
  /* background: radial-gradient(circle at top, #111827, #020617); */
  background: #111827;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(55,65,81,0.9);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 16px 40px rgba(15,23,42,0.9);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.grid-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(96,165,250,0.16), transparent 60%);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.grid-item:hover {
  transform: scale(0.99);
  box-shadow: 0 22px 55px rgba(15,23,42,1);
  /* border-color: rgba(148,163,184,0.9); */
}

.grid-item:hover::before {
  opacity: 0.15;
}

.grid-item h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.grid-item h3 {
  font-size: 1rem;
  text-align: left;
  font-weight: 600;
}

.grid-item p {
  max-width: none;
  font-size: 0.95rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.skill-card {
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(98, 109, 126, 0.9);
  padding: 1.25rem 1.3rem;
  box-shadow: 0 12px 30px rgba(15,23,42,0.85);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.skill-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-align: left;
}

.skill-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15,23,42,1);
  border-color: rgba(174, 186, 201, 0.9);
  background: radial-gradient(circle at top, rgba(31,41,55,0.98), rgba(15,23,42,0.98));
}


/* Project cover image */
.project-cover {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: var(--space-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  filter: brightness(0.8);
}

.project-cover:hover {
  transform: scale(1.02);
  box-shadow: 0 18px 40px rgba(15,23,42,0.9);
}

/* Hidden extra screenshots / video */
.project-screenshot {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  background-color: var(--secondary-bg);
}

.project-video {
  width: 100%;
  border-radius: var(--radius-md);
}

/* Buttons inside cards */
.grid-item .button-link {
  margin: 0.25rem 0.5rem 0.25rem 0;
}

/* ===========================
   Modal
   =========================== */

.img-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3,7,18,0.9);
  z-index: 1100;
  justify-content: center;
  align-items: center;
  padding: var(--space-md);
}

.img-modal.show {
  display: flex;
}

#modalContent {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 92vw;
  max-height: 86vh;
  background: radial-gradient(circle at top, rgba(31,41,55,0.98), rgba(15,23,42,0.98));
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.6);
  padding: 1rem;
  box-shadow: 0 24px 70px rgba(0,0,0,0.95);
}

#modalContent img,
#modalContent video {
  max-width: 88vw;
  max-height: 78vh;
  border-radius: 14px;
}

/* Modal controls */
.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: #e5e7eb;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.nav-modal {
  position: absolute;
  top: 50%;
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 2rem;
  cursor: pointer;
  transform: translateY(-50%);
  opacity: 0.85;
}

.nav-prev { left: 1rem; }
.nav-next { right: 1rem; }

.nav-modal:hover {
  opacity: 1;
}

/* ===========================
   Tables (About)
   =========================== */

table {
  width: 100%;
  max-width: 900px;
  margin: var(--space-lg) auto;
  border-collapse: collapse;
  background: radial-gradient(circle at top, #111827, #020617);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

th {
  background: linear-gradient(135deg, rgba(248,113,113,0.30), #1f2937);
  color: var(--text-primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(55,65,81,0.9);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

tr:hover td {
  background: linear-gradient(135deg, #111827, #1f2937);
  color: var(--text-primary);
}

tr:last-child td {
  border-bottom: none;
}

/* ===========================
   Forms (Contact)
   =========================== */

.standar_label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background: rgba(17,24,39,0.95);
  border: 2px solid rgba(55,65,81,0.9);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  margin-bottom: 1rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(96,165,250,0.35);
}

input[type="submit"] {
  width: auto;
}

/* ===========================
   Lists
   =========================== */

.bulleted {
  max-width: 900px;
  margin: var(--space-lg) auto;
  color: var(--text-secondary);
  list-style: disc;
  padding-left: 1.5rem;
  text-align: left;
  font-size: 1rem;
}

.bulleted li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* ===========================
   Footer
   =========================== */

.page-footer {
  background: #002B36;
  padding: 1px;
  text-align: center;
  /* border-top: 1px solid rgba(121, 131, 145, 0.9); */
}

.page-footer p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 1rem;
}

.social-media {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.page-footer img {
  width: 40px;
  height: 40px;
  filter: brightness(1.4);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.page-footer a:hover img,
.page-footer a:focus img {
  filter: brightness(1.1);
  transform: translateY(-2px) scale(1.06);
}

/* ===========================
   Skip link & Accessibility
   =========================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1001;
  border-radius: 8px;
}

a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  /* outline: 2px solid var(--accent-blue); */
  outline-offset: 2px;
}

/* Motion & contrast prefs */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --primary-bg: #000;
    --secondary-bg: #111;
    --text-primary: #fff;
    --border-color: #666;
  }
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
  :root {
    --header-height: 88px;
  }

  main {
    padding: calc(var(--header-height) + 1rem) 1rem var(--space-lg);
  }

  .illustration-container {
    margin: var(--space-md) auto;
    padding: var(--space-md) var(--space-sm);
  }

  .illustration-container img {
    width: 220px;
    height: 290px;
  }

  .hero h1:nth-of-type(2) {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .hero h3 {
    font-size: 1rem;
  }

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

  /* ADDED: slightly smaller buttons on mobile */
  .button-link {
    padding: 0.5rem 0.5rem;
    font-size: 0.95rem;
  }
}


/* ===========================
   Case Study Page Only
   =========================== */

/* Wrapper for case study content */
.case-study-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--space-md);
}

/* Force vertical stacking for case study sections */
.case-study-section {
  display: block;
  width: 100%;
  margin-bottom: var(--space-xl);
}

/* Override grid behavior ONLY on case study page */
.case-study-wrapper .grid-container {
  display: block;
  grid-template-columns: none;
}

.case-study-wrapper .grid-item {
  max-width: 100%;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

/* Case study cover image styling */
.case-study-wrapper .project-cover {
  max-width: 700px;
  width: 100%;
  height: auto;
  cursor: pointer;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15,23,42,0.8);
  margin: 0 auto;
  display: block;
}

.case-study-wrapper .project-cover:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 50px rgba(15,23,42,0.9);
}

/* Text alignment for case study */
.case-study-section h1,
.case-study-section h2 {
  text-align: center;
}

.case-study-section h3 {
  text-align: left;
  margin-top: var(--space-md);
}

.case-study-section p {
  text-align: left;
}

.case-study-section ul {
  text-align: left;
  margin-left: var(--space-md);
  color: var(--text-secondary);
}

.case-study-section ul li {
  margin-bottom: var(--space-xs);
}

/* Button container centering */
.case-study-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}

/* ===========================
   Language Switcher
   =========================== */

.lang-switcher {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.2rem 1rem;
  border-radius: 20px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-left: auto; /* Pushes it to the right on desktop */
  margin-right: 1rem;
}

.lang-switcher a {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.lang-switcher a:hover {
  color: #f8fafc;
}

.lang-switcher a.active {
  color: #60a5fa; /* Your accent blue */
  background: rgba(96, 165, 250, 0.1);
}

.lang-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
}

/* Mobile: stack language switcher below nav items */
@media (max-width: 768px) {
  .lang-switcher {
    margin-right: 0.5rem;
    padding: 0.3rem 0.6rem;
  }
}