/* Portfolio — même univers que le linktree ("YATO OS") */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #07040f;
  --panel:       #110d22;
  --panel-inner: #0d091c;
  --border:      #5030a0;
  --border-hi:   #9060e0;
  --gold:        #d4a020;
  --pink:        #d040a0;
  --pink-hi:     #f060c0;
  --text:        #ece4f8;
  --text-dim:    #7060a0;
  --red:         #e03068;
  --green:       #50b888;
  --yellow:      #f0d000;
  --font-pixel:  'Press Start 2P', 'Courier New', monospace;
  --font-body:   'Space Grotesk', sans-serif;
}

html { scroll-behavior: smooth; }

html, body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
}

/* grille pixel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(144, 80, 220, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(144, 80, 220, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* scanlines CRT, derrière le panneau : le contenu et les images restent nets */
.crt-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0, transparent 3px,
    rgba(0, 0, 0, 0.12) 3px, rgba(0, 0, 0, 0.12) 4px
  );
}

a { color: var(--pink-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

/* ── Layout ── */
.wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 64px;
}

.panel {
  width: 100%;
  max-width: 1100px;
  background: var(--panel);
  border: 4px solid var(--border);
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 6px var(--border),
    0 0 60px rgba(144, 80, 220, 0.2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Layout 2 colonnes ── */
.layout { display: flex; flex-direction: column; gap: 24px; }
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.side-links { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-pixel); font-size: 7px; }
.side-links a { color: var(--text-dim); }
.side-links a:hover { color: var(--pink-hi); }

@media (min-width: 900px) {
  .layout { flex-direction: row; align-items: flex-start; gap: 28px; }
  .sidebar { width: 300px; flex-shrink: 0; position: sticky; top: 24px; }
  .content { flex: 1; }
  .npc-row { flex-direction: column; text-align: center; padding-top: 22px; }
  .npc-info { align-items: center; }
}

/* ── Header ── */
.npc-row {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--panel-inner);
  border: 2px solid var(--border);
}

.portrait {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  background: #1a0d30;
  border: 2px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sprite-img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  image-rendering: pixelated;
}

.npc-info { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; align-items: flex-start; }

.npc-name {
  font-family: var(--font-pixel);
  font-size: 14px;
  font-weight: normal;
  color: var(--pink-hi);
  text-shadow: 0 0 12px rgba(240, 96, 192, 0.5);
  letter-spacing: 2px;
  line-height: 1.4;
}

.npc-class { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

.lang-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 6px 8px;
  background: var(--panel);
  border: 2px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--border-hi); color: var(--pink-hi); }

/* badge Twitch */
.twitch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-pixel);
  font-size: 7px;
  padding: 4px 8px;
  border: 2px solid var(--border);
  color: var(--text-dim);
  text-decoration: none !important;
}
.twitch-dot { width: 6px; height: 6px; background: var(--text-dim); }
.twitch-badge.live { border-color: var(--red); color: var(--red); }
.twitch-badge.live .twitch-dot { background: var(--red); animation: blink 1s step-end infinite; }

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ── Dialogue "now" ── */
.dialog {
  position: relative;
  background: var(--panel-inner);
  border: 3px solid var(--text);
  box-shadow: inset 0 0 0 2px var(--panel);
  padding: 20px 14px 14px;
}
.dialog-speaker {
  position: absolute;
  top: -9px;
  left: 10px;
  font-family: var(--font-pixel);
  font-size: 7px;
  background: var(--panel);
  padding: 0 5px;
  color: var(--pink-hi);
}

/* ── Menu de navigation ── */
.menu {
  display: flex;
  flex-direction: column;
  background: var(--panel-inner);
  border: 2px solid var(--border);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--text);
  text-decoration: none !important;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 8px;
  transition: background 0.08s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover, .menu-item:focus-visible { background: #261450; outline: none; }
.menu-item .sel { color: var(--yellow); visibility: hidden; width: 10px; }
.menu-item:hover .sel, .menu-item:focus-visible .sel { visibility: visible; }

/* ── Sections ── */
.block {
  background: var(--panel-inner);
  border: 2px solid var(--border);
  padding: 18px 16px 16px;
  position: relative;
  scroll-margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.block-title {
  position: absolute;
  top: -9px;
  left: 10px;
  font-family: var(--font-pixel);
  font-size: 8px;
  font-weight: normal;
  background: var(--panel);
  padding: 0 6px;
  color: var(--pink-hi);
}
.block-title::before { content: '▶ '; color: var(--yellow); }

/* ── Tags ── */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  padding: 1px 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--panel);
}

/* ── Projets ── */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .projects-grid { grid-template-columns: 1fr 1fr; } .project.featured { grid-column: 1 / -1; } }

.project {
  padding: 12px;
  background: var(--panel);
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project.featured { border-color: var(--pink); box-shadow: 0 0 16px rgba(208, 64, 160, 0.15); }
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shot { display: block; padding: 0; background: none; border: 0; cursor: zoom-in; min-width: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; border: 2px solid var(--border); background: var(--panel-inner); display: block; transition: border-color 0.08s; }
.shot:hover img, .shot:focus-visible img { border-color: var(--pink-hi); }
.shot:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.shot:first-child img { object-position: 50% 30%; }
.shot:not(:first-child) { aspect-ratio: 9 / 16; }
.shot:not(:first-child) img { object-position: top; }
@media (min-width: 640px) {
  .shots { grid-template-columns: 2fr 1fr 1fr; height: 320px; }
  .shot:first-child { grid-column: auto; aspect-ratio: auto; }
  .shot:not(:first-child) { aspect-ratio: auto; }
}

/* ── Lightbox ── */
.lightbox { margin: auto; max-width: 96vw; max-height: 96vh; background: var(--panel); border: 4px solid var(--border); padding: 8px; color: var(--text); cursor: zoom-out; }
.lightbox::backdrop { background: rgba(7, 4, 15, 0.92); }
.lightbox img { display: block; max-width: calc(96vw - 24px); max-height: calc(96vh - 24px); width: auto; height: auto; }
.lightbox-close { position: absolute; top: 12px; right: 12px; font-family: var(--font-pixel); font-size: 10px; padding: 8px 10px; background: var(--panel); border: 2px solid var(--border-hi); color: var(--text); cursor: pointer; }
.lightbox-close:hover { color: var(--pink-hi); border-color: var(--pink-hi); }
.project-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.status { font-family: var(--font-pixel); font-size: 6px; padding: 3px 6px; border: 1px solid; }
.status-wip { color: var(--green); border-color: var(--green); }
.status-archived { color: var(--text-dim); border-color: var(--border); }
.project h3 { font-family: var(--font-pixel); font-size: 9px; font-weight: normal; color: var(--text); line-height: 1.6; }
.project p { font-size: 14px; color: var(--text); flex: 1; }
.project-links { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.project-links a::before { content: '▶ '; font-size: 9px; color: var(--yellow); }

/* ── Expériences ── */
.timeline { list-style: none; display: flex; flex-direction: column; gap: 14px; border-left: 2px solid var(--border); padding-left: 14px; }
.timeline li { position: relative; }
.timeline li::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 5px;
  width: 8px;
  height: 8px;
  background: var(--pink);
}
.exp-date { font-family: var(--font-pixel); font-size: 7px; color: var(--pink); margin-bottom: 4px; }
.timeline h3 { font-size: 15px; font-weight: 500; line-height: 1.4; }
.exp-place { font-size: 13px; color: var(--text-dim); }
.timeline p { font-size: 14px; margin-top: 2px; }

/* ── Contact ── */
.contact-form { display: flex; flex-direction: column; gap: 12px; }
.contact-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-dim); }
.contact-form input, .contact-form textarea {
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--border);
  padding: 8px 10px;
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--border-hi); }

.btn {
  align-self: flex-start;
  font-family: var(--font-pixel);
  font-size: 8px;
  padding: 12px 16px;
  background: var(--panel);
  border: 2px solid var(--pink);
  color: var(--pink-hi);
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.08s, box-shadow 0.08s;
}
.btn:hover { background: #3a1060; box-shadow: 0 0 16px rgba(208, 64, 160, 0.3); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #261450; border-color: var(--border-hi); box-shadow: none; }

.form-status { font-size: 13px; min-height: 1.2em; }
.form-status.success { color: var(--green); }
.form-status.error { color: var(--red); }
.contact-fallback { font-size: 13px; color: var(--text-dim); }

/* ── Pied de page ── */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--border);
  font-family: var(--font-pixel);
  font-size: 6px;
  color: var(--text-dim);
}
.status-bar .links { display: flex; gap: 14px; }
.status-bar a { color: var(--text-dim); }
.status-bar a:hover { color: var(--pink-hi); }

/* ── 404 ── */
.lost { text-align: center; align-items: center; padding: 32px 20px; }
.lost .big { font-family: var(--font-pixel); font-size: 32px; color: var(--pink-hi); text-shadow: 0 0 16px rgba(240, 96, 192, 0.5); }
.lost .code { font-family: var(--font-pixel); font-size: 6px; color: var(--text-dim); }

@media (max-width: 480px) {
  .panel { padding: 14px; }
  .npc-row { flex-direction: column; text-align: center; padding-top: 22px; }
  .npc-info { align-items: center; }
  .npc-name { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .twitch-badge.live .twitch-dot { animation: none; }
}

.skill-group { display: flex; flex-direction: column; gap: 6px; }
.skill-group h3 { font-family: var(--font-pixel); font-size: 7px; font-weight: normal; color: var(--pink); }

.availability { font-family: var(--font-pixel); font-size: 6px; line-height: 1.6; color: var(--green); border: 2px solid var(--green); padding: 4px 8px; }
.side-cta { display: flex; flex-direction: column; gap: 8px; }
.side-cta .btn { align-self: stretch; text-align: center; }

/* ── À propos ── */
.about-photo { width: 160px; height: 160px; object-fit: cover; border: 2px solid var(--border-hi); display: block; }
@media (min-width: 640px) {
  #about { flex-direction: row; align-items: flex-start; gap: 18px; }
  #about .block-title { position: absolute; }
  #about .about-photo { flex-shrink: 0; }
}
