/* =========================================
   PORTFOLIO — Style principal
   Mobile-first | Coloré & Créatif
   ========================================= */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ── Variables ── */
:root {
  --pink:       #d9789e;
  --purple:     #9370c8;
  --deep-blue:  #7068b8;
  --cyan:       #70bcd8;
  --yellow:     #e8c860;
  --green:      #6eb898;
  --orange:     #dfa070;

  --text-dark:  #2e2e3a;
  --text-muted: #6b7280;
  --bg-white:   #ffffff;
  --bg-light:   #f5f3fb;
  --border:     #e8e4f0;

  --grad-hero:   linear-gradient(135deg, #d9789e 0%, #9370c8 50%, #7068b8 100%);
  --grad-dessins: linear-gradient(135deg, #d9789e, #b870c0);
  --grad-photo:  linear-gradient(135deg, #70bcd8, #7888d8);
  --grad-logos:  linear-gradient(135deg, #dfa070, #e8c860);
  --grad-motion: linear-gradient(135deg, #6eb898, #98cc80);
  --grad-code:   linear-gradient(135deg, #7888d8, #7068b8);

  --radius:    16px;
  --radius-sm: 8px;
  --nav-h:     60px;
  --pad:       16px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.18);
  --ease:      all .3s cubic-bezier(.4,0,.2,1);
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Poppins', system-ui, sans-serif; line-height: 1.15; }
h1 { font-size: clamp(2rem, 9vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 5vw, 2.5rem); font-weight: 700; }
h3 { font-size: clamp(1rem, 3vw, 1.4rem); font-weight: 600; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
/* Le blur est sur ::before, pas sur .navbar lui-même.
   Sans backdrop-filter sur l'élément, il ne devient pas
   un bloc conteneur pour ses enfants position:fixed,
   ce qui permet au nav-menu de se positionner
   correctement par rapport à la viewport. */
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: -1;
}
.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad);
}
.nav-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: .95rem;       /* plus petit sur mobile */
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 1;          /* peut légèrement rétrécir */
  min-width: 0;            /* empêche le débordement flex */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;             /* zone de clic plus large */
  height: 20px;
  position: relative;      /* active le z-index */
  z-index: 201;
  flex-shrink: 0;
  margin-left: 12px;       /* espace garanti avec le logo */
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--ease);
  transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu */
.nav-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0; bottom: 0;
  background: white;
  padding: 20px var(--pad);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateX(-100%);
  transition: transform .3s ease;
  overflow-y: auto;
  z-index: 199;
}
.nav-menu.is-open { transform: translateX(0); }

.nav-link {
  display: block;
  padding: 13px 16px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}
.nav-link:not(.nav-link--cta):hover,
.nav-link:not(.nav-link--cta).active {
  background: var(--bg-light);
  color: var(--purple);
}
.nav-link--cta {
  margin-top: 8px;
  background: var(--grad-hero);
  color: white !important;
  text-align: center;
  border-radius: var(--radius);
}
.nav-link--cta:hover { opacity: .88; }

/* =========================================
   MOBILE BOTTOM NAV
   ========================================= */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0,0,0,.07);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 600;
  text-decoration: none;
  min-width: 52px;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}
.bnav-item.active { color: var(--purple); }
.bnav-icon { font-size: 1.3rem; line-height: 1; }

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: var(--ease);
  white-space: nowrap;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad-hero);
  color: white;
  box-shadow: 0 4px 16px rgba(217,120,158,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(217,120,158,.45); }
.btn-outline {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.6);
  color: white;
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: rgba(255,255,255,.28); border-color: white; }
.btn-dark {
  background: var(--text-dark);
  color: white;
}
.btn-dark:hover { background: #2d3748; }

/* =========================================
   HERO
   ========================================= */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) var(--pad) 80px;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
}
.hero-bg-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .25;
  pointer-events: none;
}
.hero-bg-circle:nth-child(1) { width: 400px; height: 400px; background: var(--cyan); top: -150px; right: -80px; }
.hero-bg-circle:nth-child(2) { width: 300px; height: 300px; background: var(--yellow); bottom: -80px; left: 20%; }
.hero-bg-circle:nth-child(3) { width: 200px; height: 200px; background: white; top: 30%; left: -60px; }

.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 100px;
  color: white;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}
.hero h1 { color: white; margin-bottom: 14px; }
.hero h1 .accent {
  background: linear-gradient(90deg, var(--cyan), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tagline {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: rgba(255,255,255,.85);
  margin-bottom: 32px;
  max-width: 560px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* =========================================
   SECTION COMMON
   ========================================= */
section { padding: 56px 0; }
.section-header { text-align: center; margin-bottom: 36px; }
.section-tag {
  display: inline-block;
  padding: 4px 14px;
  background: var(--bg-light);
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
.section-title { color: var(--text-dark); margin-bottom: 10px; }
.section-title .grad {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-desc { color: var(--text-muted); max-width: 580px; margin: 0 auto; }

/* =========================================
   PAGE HEADER (inner pages)
   ========================================= */
.page-header {
  padding: calc(var(--nav-h) + 36px) var(--pad) 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header h1, .page-header p { color: white; position: relative; z-index: 1; }
.page-header p { opacity: .85; font-size: 1.05rem; margin-top: 8px; }
.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.08);
}

.ph-dessins { background: var(--grad-dessins); }
.ph-photo   { background: var(--grad-photo); }
.ph-logos   { background: var(--grad-logos); }
.ph-motion  { background: var(--grad-motion); }
.ph-code    { background: var(--grad-code); }
.ph-contact { background: var(--grad-hero); }

/* =========================================
   CATEGORIES GRID (homepage)
   ========================================= */
.cats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 12px;
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: .95rem;
  min-height: 130px;
  box-shadow: var(--shadow-md);
  transition: var(--ease);
  position: relative;
  overflow: hidden;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cat-icon { font-size: 2rem; }
.cat-dessins { background: var(--grad-dessins); }
.cat-photo   { background: var(--grad-photo); }
.cat-logos   { background: var(--grad-logos); }
.cat-motion  { background: var(--grad-motion); }
.cat-code    { background: var(--grad-code); }

/* =========================================
   ABOUT (homepage)
   ========================================= */
.about-section { background: var(--bg-light); }
.about-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--grad-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  box-shadow: 0 8px 30px rgba(147,112,200,.3);
  flex-shrink: 0;
}
.about-text { text-align: center; }
.about-text h2 { margin-bottom: 10px; color: var(--text-dark); }
.about-text p { color: var(--text-muted); margin-bottom: 20px; }
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.skill {
  padding: 5px 13px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  background: white;
  border: 2px solid var(--border);
  color: var(--text-dark);
}

/* =========================================
   GALLERY GRID
   ========================================= */
.gallery-section { padding: 36px 0 60px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.g-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--ease);
  cursor: pointer;
}
.g-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.g-card-img {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.g-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.g-card:hover .g-card-img img { transform: scale(1.06); }
.g-emoji {
  font-size: 2.8rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
  pointer-events: none;
}
.g-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 55%);
  opacity: 0;
  transition: var(--ease);
  display: flex;
  align-items: flex-end;
  padding: 12px;
}
.g-card:hover .g-overlay { opacity: 1; }
.g-overlay-title { color: white; font-size: .88rem; font-weight: 700; }

.g-info { padding: 10px 12px; background: white; }
.g-info h3 {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-tag {
  font-size: .73rem;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 2px 8px;
  border-radius: 100px;
}

/* =========================================
   LIGHTBOX
   ========================================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox.open { display: flex; }
.lb-inner {
  position: relative;
  max-width: min(600px, 90vw);
  width: 100%;
  text-align: center;
}
.lb-card {
  width: 100%;
  aspect-ratio: 1/1;
  max-height: 60vh;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}
.lb-card img { width:100%; height:100%; object-fit:cover; border-radius: var(--radius); }
.lb-title { color: white; margin-top: 16px; font-size: 1.3rem; }
.lb-tag { color: rgba(255,255,255,.65); font-size: .9rem; margin-top: 4px; }
.lb-close {
  position: absolute;
  top: -48px; right: 0;
  color: white;
  font-size: 2rem;
  line-height: 1;
  padding: 4px;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}
.lb-close:hover { background: rgba(255,255,255,.25); }
.lb-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}
.lb-nav button {
  color: white;
  font-size: 1.3rem;
  padding: 8px 20px;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius-sm);
  transition: var(--ease);
}
.lb-nav button:hover { background: rgba(255,255,255,.25); }

/* =========================================
   CODE PAGE
   ========================================= */
.code-page-section { padding: 36px 0 80px; }

/* Snippet selector */
.snippet-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.snip-btn {
  padding: 7px 16px;
  border-radius: 100px;
  font-size: .83rem;
  font-weight: 600;
  background: var(--bg-light);
  color: var(--text-muted);
  border: 2px solid transparent;
  transition: var(--ease);
}
.snip-btn.active {
  background: white;
  color: var(--purple);
  border-color: var(--purple);
}

/* Mobile view toggle */
.view-tabs {
  display: flex;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 16px;
}
.view-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--ease);
  text-align: center;
}
.view-tab.active {
  background: white;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

/* Editor layout */
.editor-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}
.editor-panel { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.preview-panel { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); display: none; }
.editor-layout.show-preview .editor-panel { display: none; }
.editor-layout.show-preview .preview-panel { display: flex; flex-direction: column; }

/* Panel headers */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1e1e2e;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
/* Bouton Exécuter */
.run-btn {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  background: rgba(110,184,152,.2);
  color: #98dbb8;
  border: 1px solid rgba(110,184,152,.35);
  transition: var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.run-btn:hover {
  background: rgba(110,184,152,.35);
  color: #c0f0d8;
}
/* Indicateur "JS modifié, en attente d'exécution" */
.run-btn.pending {
  background: rgba(232,200,96,.2);
  color: #f0d87a;
  border-color: rgba(232,200,96,.4);
  animation: pulse-pending 1.5s ease-in-out infinite;
}
@keyframes pulse-pending {
  0%, 100% { opacity: 1; }
  50%       { opacity: .65; }
}

/* Note sandbox */
.sandbox-note {
  font-size: .82rem;
  color: var(--text-muted);
  background: var(--bg-light);
  border-left: 3px solid var(--green);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 20px;
  line-height: 1.5;
}
.code-tabs { display: flex; gap: 4px; }
.code-tab {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  transition: var(--ease);
}
.code-tab.active { background: rgba(255,255,255,.1); color: white; }

/* Textarea */
.code-textarea {
  width: 100%;
  min-height: 340px;
  padding: 16px;
  background: #1e1e2e;
  color: #cdd6f4;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: .84rem;
  line-height: 1.75;
  border: none;
  resize: vertical;
  outline: none;
  tab-size: 2;
  -moz-tab-size: 2;
  display: none;
}
.code-textarea.active { display: block; }

/* Preview */
.preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.preview-dots { display: flex; gap: 6px; }
.preview-dot { width: 12px; height: 12px; border-radius: 50%; }
.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #febc2e; }
.preview-dot:nth-child(3) { background: #28c840; }
.preview-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; }

.preview-frame {
  width: 100%;
  height: 340px;
  border: none;
  background: white;
  display: block;
}

/* =========================================
   CONTACT
   ========================================= */
.contact-section { padding: 36px 0 80px; }
.contact-inner { display: flex; flex-direction: column; gap: 40px; }

.contact-info h2 { margin-bottom: 12px; color: var(--text-dark); }
.contact-info p { color: var(--text-muted); margin-bottom: 24px; }

.contact-links { display: flex; flex-direction: column; gap: 10px; }
.c-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--ease);
  font-weight: 600;
  font-size: .93rem;
}
.c-link:hover { background: var(--purple); color: white; }
.c-link-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .88rem; font-weight: 600; color: var(--text-dark); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 13px 15px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .96rem;
  font-family: inherit;
  color: var(--text-dark);
  background: white;
  transition: var(--ease);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(147,112,200,.15);
}
.form-textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; gap: 16px; }

/* Flash messages */
.flash-success, .flash-error {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: 20px;
}
.flash-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }

/* Honeypot hidden field */
.hp-field { display: none !important; }

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,.55);
  padding: 40px 0 72px; /* space for mobile bottom nav */
  text-align: center;
}
.footer-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  margin-bottom: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}
.footer-links a {
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  transition: var(--ease);
}
.footer-links a:hover { color: white; }
.footer-copy { font-size: .78rem; }

/* =========================================
   UTILITY
   ========================================= */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-content > * { animation: fadeInUp .6s ease both; }
.hero-content > *:nth-child(1) { animation-delay: .05s; }
.hero-content > *:nth-child(2) { animation-delay: .15s; }
.hero-content > *:nth-child(3) { animation-delay: .25s; }
.hero-content > *:nth-child(4) { animation-delay: .35s; }

/* =========================================
   DESKTOP (768px+)
   ========================================= */
@media (min-width: 768px) {
  :root { --pad: 24px; --nav-h: 68px; }
  section { padding: 72px 0; }

  /* Nav: horizontal */
  .nav-toggle { display: none; }
  .nav-logo { font-size: 1.1rem; flex-shrink: 0; margin-left: 0; }
  .nav-menu {
    position: static;
    flex-direction: row;
    padding: 0;
    gap: 4px;
    transform: none;
    background: none;
    overflow: visible;
  }
  .nav-link { padding: 8px 12px; font-size: .88rem; }
  .nav-link--cta { margin-top: 0; padding: 8px 18px; }

  /* Hide mobile bottom nav */
  .bottom-nav { display: none; }
  /* Hide view toggle */
  .view-tabs { display: none; }

  /* Gallery: 3 cols */
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }

  /* Categories: 3 cols */
  .cats-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-card:last-child:nth-child(odd) { grid-column: auto; }

  /* About */
  .about-inner { flex-direction: row; }
  .about-text { text-align: left; }
  .skills { justify-content: flex-start; }

  /* Code editor: side by side */
  .editor-layout {
    flex-direction: row;
    height: 560px;
  }
  .editor-panel,
  .preview-panel { flex: 1; display: flex !important; flex-direction: column; }
  .code-textarea { min-height: unset; flex: 1; resize: none; }
  .preview-frame { flex: 1; height: unset; }

  /* Contact: side by side */
  .contact-inner { flex-direction: row; align-items: flex-start; }
  .contact-info { flex: 1; }
  .contact-form-wrap { flex: 1.4; }

  /* Footer: no bottom-nav padding */
  .footer { padding-bottom: 40px; }

  /* Form row: 2 cols */
  .form-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  :root { --pad: 40px; }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .cats-grid { grid-template-columns: repeat(5, 1fr); }
}
