/* ══════════════════════════════════════════════════════
   ARPHAN.DEV — Pixel art Minecraft portfolio stylesheet
   ══════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────── */
:root {
  --mc-green:   #5d9c34;
  --mc-dirt:    #8b5e3c;
  --mc-stone:   #7f7f7f;
  --mc-sky:     #87ceeb;
  --mc-dark:    #1a1a2e;
  --mc-gold:    #ffd700;
  --mc-text:    #f0ead6;
  --mc-dim:     rgba(0,0,0,0.72);
  --pixel-font: 'Press Start 2P', monospace;
  --modal-accent: #ffd700;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--mc-sky);
  font-family: var(--pixel-font);
  color: var(--mc-text);
  cursor: default;
}
body.modal-open { overflow: hidden; }

/* ── Screens ────────────────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.5s ease;
}
.screen.hidden   { display: none; }
.screen.active   { opacity: 1; }
.screen-exit     { animation: fadeOut 0.5s ease forwards; }
.screen-enter    { animation: fadeIn  0.5s ease forwards; }

@keyframes fadeOut { from { opacity:1; } to { opacity:0; } }
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }

/* ── Welcome Screen ─────────────────────────────────── */
#screen-welcome {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a0e1a 0%, #1a2a4a 40%, #2a4a7a 70%, #3a6a9a 100%);
  position: relative;
  overflow: hidden;
}

/* Stars in background */
#screen-welcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 8%,  rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(2px 2px at 40% 20%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 5%,  rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 12%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(2px 2px at 80% 7%,  rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 18%, rgba(255,255,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 35%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 30%, rgba(255,255,255,0.4) 0%, transparent 100%);
  pointer-events: none;
}

/* Ground silhouette at bottom of welcome */
#screen-welcome::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: #1a3a10;
  clip-path: polygon(0 60px, 3% 45px, 6% 55px, 9% 40px, 12% 50px, 15% 35px, 18% 48px, 21% 38px, 24% 52px, 28% 42px, 32% 55px, 36% 40px, 40% 58px, 44% 44px, 48% 60px, 52% 40px, 56% 55px, 60% 42px, 64% 58px, 68% 45px, 72% 52px, 76% 38px, 80% 50px, 84% 40px, 88% 55px, 92% 42px, 96% 52px, 100% 45px, 100% 80px, 0 80px);
}

.welcome-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
}

.mc-badge {
  font-size: 7px;
  letter-spacing: 3px;
  color: var(--mc-gold);
  border: 1px solid var(--mc-gold);
  padding: 5px 12px;
  opacity: 0.8;
}

.mc-title {
  font-size: clamp(18px, 4vw, 30px);
  color: #fff;
  text-shadow:
    4px 4px 0 #000,
    -2px -2px 0 #000,
    0 0 20px rgba(255,215,0,0.5);
  letter-spacing: 2px;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 4px 4px 0 #000, 0 0 20px rgba(255,215,0,0.4); }
  50%       { text-shadow: 4px 4px 0 #000, 0 0 35px rgba(255,215,0,0.9); }
}

.mc-subtitle {
  font-size: 8px;
  color: #aac4e0;
  letter-spacing: 1px;
}

/* Instructions panel (Minecraft book style) */
.mc-instructions {
  background: rgba(15, 10, 5, 0.85);
  border: 2px solid #5a4020;
  border-image: none;
  padding: 16px 20px;
  text-align: left;
  width: 100%;
  max-width: 360px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 4px 4px 0 rgba(0,0,0,0.5);
}

.instr-title {
  font-size: 7px;
  color: var(--mc-gold);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,215,0,0.3);
  padding-bottom: 8px;
}

.instr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 7px;
}

.instr-row kbd {
  background: #3a2e1a;
  border: 1px solid #8b7050;
  border-bottom: 2px solid #5a3a18;
  color: var(--mc-gold);
  font-family: var(--pixel-font);
  font-size: 6px;
  padding: 3px 7px;
  min-width: 55px;
  text-align: center;
  white-space: nowrap;
}

.instr-row span { color: #c8bfb0; }

/* Start button (Minecraft pixel button) */
.mc-btn {
  font-family: var(--pixel-font);
  font-size: 12px;
  color: #fff;
  background: #4a7c24;
  border: none;
  padding: 12px 28px;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 4px 0 #2d4e15, 0 5px 0 rgba(0,0,0,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
}
.mc-btn:hover {
  background: #5a9c2e;
  box-shadow: 0 4px 0 #2d4e15, 0 5px 0 rgba(0,0,0,0.4), 0 0 16px rgba(90,156,46,0.6);
}
.mc-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #2d4e15;
}

/* CV button */
.cv-link {
  font-family: var(--pixel-font);
  font-size: 11px;
  color: #fff;
  text-decoration: none;
  letter-spacing: 1px;
  display: inline-block;
  padding: 14px 28px;
  background: #2a6fa8;
  border: 3px solid #5ab0e8;
  box-shadow: 0 4px 0 #154070, 0 5px 0 rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  cursor: pointer;
  image-rendering: pixelated;
  position: relative;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  transition: background 0.1s, box-shadow 0.1s, transform 0.1s;
}
.cv-link:hover {
  background: #3585c8;
  box-shadow: 0 4px 0 #154070, 0 5px 0 rgba(0,0,0,0.4), 0 0 16px rgba(90,176,232,0.6);
  color: #fff;
}
.cv-link:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #154070;
}

/* ── Game canvas ─────────────────────────────────────── */
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Modal backdrop ─────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-backdrop.hidden { display: none; }

/* ── Section modal ──────────────────────────────────── */
.section-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  width: min(860px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #0e1215;
  border: 2px solid var(--modal-accent, #ffd700);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.8),
    0 0 40px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.05);
  animation: modalIn 0.3s ease;
}
.section-modal.hidden { display: none; }

@keyframes modalIn {
  from { transform: translate(-50%, -48%); opacity: 0; }
  to   { transform: translate(-50%, -50%); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 2px solid var(--modal-accent, #ffd700);
  background: rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.modal-title {
  font-size: 10px;
  color: var(--modal-accent, #ffd700);
  letter-spacing: 1px;
  text-shadow: 0 0 10px var(--modal-accent, #ffd700);
}

.modal-close {
  font-family: var(--pixel-font);
  font-size: 7px;
  color: #888;
  background: none;
  border: 1px solid #444;
  padding: 5px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: #fff; border-color: #fff; }

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: #d0ccc4;
  scrollbar-width: thin;
  scrollbar-color: var(--modal-accent, #ffd700) #1a1a1a;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-track { background: #1a1a1a; }
.modal-body::-webkit-scrollbar-thumb { background: var(--modal-accent, #ffd700); border-radius: 3px; }

/* ── Modal content components ───────────────────────── */

.sub-title {
  font-family: var(--pixel-font);
  font-size: 9px;
  color: var(--modal-accent, #ffd700);
  margin: 18px 0 12px;
  letter-spacing: 1px;
}

.section-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 20px 0;
}

.section-intro {
  color: #888;
  font-size: 13px;
  margin-bottom: 16px;
  font-style: italic;
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.profile-avatar {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.profile-info { flex: 1; }
.profile-name {
  font-family: var(--pixel-font);
  font-size: 13px;
  color: #fff;
  margin-bottom: 5px;
}
.profile-title {
  font-size: 13px;
  color: var(--modal-accent, #ffd700);
  margin-bottom: 10px;
}
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 2px;
}
.profile-bio {
  color: #bbb;
  margin-bottom: 14px;
  font-size: 13px;
}

.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--modal-accent, #ffd700);
  text-decoration: none;
  border: 1px solid rgba(255,215,0,0.3);
  padding: 5px 12px;
  transition: background 0.2s, border-color 0.2s;
}
.social-link:hover { background: rgba(255,215,0,0.1); border-color: var(--modal-accent, #ffd700); }

/* Skills badges */
.skills-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.skill-badge {
  font-size: 11px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background 0.2s;
}
.skill-badge:hover {
  background: rgba(255,255,255,0.07);
}

/* Languages */
.langs-list { display: flex; flex-wrap: wrap; gap: 10px; }
.lang-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 12px;
}
.lang-flag { font-size: 16px; }
.lang-name { color: #ccc; }
.lang-level { color: var(--modal-accent, #ffd700); font-size: 10px; }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.timeline-item { position: relative; }
.timeline-dot {
  position: absolute;
  left: -36px;
  top: 0;
  font-size: 18px;
  line-height: 1;
}
.timeline-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid var(--modal-accent, #ffd700);
  padding: 12px 16px;
  transition: background 0.2s;
}
.timeline-card:hover { background: rgba(255,255,255,0.06); }
.timeline-date {
  font-family: var(--pixel-font);
  font-size: 7px;
  color: var(--modal-accent, #ffd700);
  margin-bottom: 4px;
}
.timeline-title { font-size: 13px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.timeline-place { font-size: 11px; color: #888; margin-bottom: 6px; }
.timeline-desc  { font-size: 12px; color: #aaa; line-height: 1.6; }

/* Experiences */
.exp-list { display: flex; flex-direction: column; gap: 14px; }
.exp-item {
  display: flex;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 12px 14px;
}
.exp-icon  { font-size: 22px; flex-shrink: 0; }
.exp-date  { font-family: var(--pixel-font); font-size: 7px; color: var(--modal-accent, #ffd700); margin-bottom: 3px; }
.exp-title { font-size: 13px; font-weight: 600; color: #ddd; margin-bottom: 4px; }
.exp-desc  { font-size: 12px; color: #999; }

/* Passions grid */
.passions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.passion-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-top: 3px solid var(--modal-accent, #ffd700);
  padding: 14px;
  transition: background 0.2s, transform 0.2s;
}
.passion-card:hover { background: rgba(255,255,255,0.07); transform: translateY(-2px); }
.passion-emoji { font-size: 26px; margin-bottom: 8px; }
.passion-title { font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.passion-desc  { font-size: 11px; color: #999; line-height: 1.6; }

/* Contact */
.contact-info { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.contact-row { display: flex; align-items: center; gap: 8px; }
.copy-btn {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ccc;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.copy-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }
.copy-btn--ok { background: #3a8a3a; color: #fff; border-color: #5d9c34; }
.contact-direct {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ddd;
  text-decoration: none;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s, color 0.2s;
}
.contact-direct:hover { background: rgba(255,255,255,0.09); color: #fff; }

.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--link-color, #ccc);
  text-decoration: none;
  border: 1px solid var(--link-color, rgba(255,255,255,0.15));
  padding: 8px 14px;
  transition: background 0.2s;
}
.contact-link:hover { background: rgba(255,255,255,0.06); }
.contact-icon { font-size: 16px; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.form-input {
  font-family: -apple-system, 'Segoe UI', sans-serif;
  font-size: 13px;
  background: #0e1215;
  border: 1px solid #2a3040;
  color: #ddd;
  padding: 10px 12px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}
.form-input:focus { border-color: var(--modal-accent, #ffd700); }
.form-textarea { min-height: 100px; }
.form-btn {
  font-family: var(--pixel-font);
  font-size: 9px;
  background: var(--mc-green);
  color: #fff;
  border: none;
  padding: 11px 20px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 3px 0 #2d4e15;
  transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
}
.form-btn:hover  { background: #5a9c2e; }
.form-btn:active { transform: translateY(2px); box-shadow: none; }
.form-status          { font-size: 11px; min-height: 18px; }
.contact-notice { font-size: 10px; color: #ffcc00; background: rgba(255,204,0,.1); border: 1px solid rgba(255,204,0,.3); padding: 6px 10px; margin-bottom: 6px; text-align: center; }
.form-status.success  { color: #69f0ae; }
.form-status.error    { color: #ff5555; }

/* Projects gallery */
.projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.proj-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-top: 3px solid var(--proj-accent, #ffd700);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s, transform 0.2s;
}
.proj-card:hover { background: rgba(255,255,255,0.07); transform: translateY(-2px); }
.proj-emoji  { font-size: 30px; }
.proj-type   { font-family: var(--pixel-font); font-size: 6px; color: var(--proj-accent, #ffd700); letter-spacing: 1px; }
.proj-title  { font-size: 14px; font-weight: 700; color: #fff; }
.proj-desc   { font-size: 12px; color: #999; line-height: 1.6; flex: 1; }
.proj-tech   { display: flex; flex-wrap: wrap; gap: 5px; }
.tech-tag {
  font-size: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 2px 7px;
  color: #bbb;
}
.proj-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.proj-link {
  font-size: 11px;
  color: var(--proj-accent, #ffd700);
  text-decoration: none;
  border: 1px solid var(--proj-accent, #ffd700);
  padding: 4px 10px;
  transition: background 0.2s;
}
.proj-link:hover { background: rgba(255,215,0,0.1); }

/* ── Toast ──────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,14,20,0.94);
  border: 1px solid var(--mc-gold);
  color: var(--mc-gold);
  font-family: var(--pixel-font);
  font-size: 8px;
  padding: 10px 18px;
  z-index: 500;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 1px;
}
.toast.hidden   { display: none; }
.toast-show     { animation: toastIn 0.3s ease forwards; }
.toast-hide     { animation: toastOut 0.4s ease forwards; }

@keyframes toastIn  {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ── Mobile controls ─────────────────────────────────── */
#mobile-btns {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px 12px;
  background: rgba(0,0,0,0.55);
  z-index: 50;
  backdrop-filter: blur(4px);
  gap: 8px;
}
.mbtn {
  font-family: var(--pixel-font);
  font-size: 14px;
  background: rgba(20,28,40,0.9);
  border: 2px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 60px;
  height: 52px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s, border-color 0.1s;
  flex-shrink: 0;
}
.mbtn:active { background: rgba(60,80,110,0.9); border-color: #fff; }
.mbtn-enter {
  font-size: 7px;
  flex: 1;
  height: 48px;
  background: rgba(70,110,50,0.9);
  border-color: rgba(90,156,46,0.6);
  letter-spacing: 1px;
}
.mbtn-enter:active { background: rgba(90,140,60,0.9); }
.mbtn-close {
  font-size: 7px;
  flex: 1;
  height: 48px;
  background: rgba(100,30,30,0.9);
  border-color: rgba(200,60,60,0.5);
  letter-spacing: 1px;
}
.mbtn-close:active { background: rgba(160,40,40,0.9); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 600px) {
  .modal-body { padding: 14px 14px; font-size: 13px; }
  .profile-header { flex-direction: column; text-align: center; }
  .profile-name { font-size: 10px; }
  .mc-title { font-size: 16px; }
  .passions-grid { grid-template-columns: 1fr 1fr; }
  .projets-grid  { grid-template-columns: 1fr; }
  .timeline { padding-left: 14px; }
  .timeline-dot { left: -26px; font-size: 14px; }
  .skill-name { min-width: 130px; font-size: 9px; }
}
