/* Layout : page perso de créateur — gros titre + portrait, bandeau défilant, grille "bento" de tuiles */
:root {
  --bg: #f3f4f7;
  --surface: #ffffff;
  --ink: #0f1115;
  --muted: #5b6270;
  --line: #e1e4ea;
  --accent: #3b3bff;
  --accent-ink: #ffffff;
  --pop: #ffd84d;
  --pop-ink: #1d1700;
  --feature-bg: #0f1115;
  --feature-ink: #f4f5f8;
  --feature-muted: #a2a9b6;
  --feature-line: #2a2e37;
  --live: #19c37d;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --radius: 28px;
  --radius-sm: 999px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c10;
    --surface: #15171d;
    --ink: #f2f3f6;
    --muted: #9aa1ae;
    --line: #262a33;
    --accent: #5b5bff;
    --accent-ink: #ffffff;
    --feature-bg: #1c1f27;
    --feature-line: #323744;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c10;
  --surface: #15171d;
  --ink: #f2f3f6;
  --muted: #9aa1ae;
  --line: #262a33;
  --accent: #5b5bff;
  --accent-ink: #ffffff;
  --feature-bg: #1c1f27;
  --feature-line: #323744;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 12px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 24px;
}

/* ---------- Header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 24px;
}
.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}
.logo-dot { color: var(--accent); }

.top nav { display: flex; align-items: center; gap: 6px; }
.top nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.top nav a:hover { color: var(--ink); background: var(--surface); }
.top nav .nav-cta { background: var(--ink); color: var(--bg); }
.top nav .nav-cta:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 48px;
  padding-block: 72px 56px;
}
.hero-text { min-width: 0; }

.hello {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--muted);
}
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 0.6s 2; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
}

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 6.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin: 0 0 24px;
  text-wrap: balance;
}
.hl {
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 34ch;
  margin: 0;
}
.lead strong { color: var(--ink); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 26px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Portrait */
.portrait { position: relative; justify-self: end; }
.avatar {
  width: clamp(180px, 26vw, 300px);
  aspect-ratio: 1;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.5rem, 8vw, 6rem);
  letter-spacing: -0.05em;
  color: var(--accent-ink);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(140deg, var(--accent), #7a2ff0 60%, #d43a74);
  box-shadow: 0 30px 60px -25px rgba(10, 12, 20, 0.45);
}
.sticker {
  position: absolute;
  bottom: 8%;
  left: -14%;
  padding: 10px 18px;
  background: var(--pop);
  color: var(--pop-ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: var(--radius-sm);
  transform: rotate(-8deg);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---------- Marquee ---------- */
.marquee {
  margin-inline: -24px;
  overflow: hidden;
  background: var(--ink);
  color: var(--bg);
  padding-block: 18px;
  transform: rotate(-1.2deg);
  margin-block: 8px 72px;
}
.marquee-track {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: scroll 28s linear infinite;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.marquee-track span:nth-child(even) { color: var(--pop); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(190px, auto);
  gap: 16px;
  scroll-margin-top: 24px;
}

.tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
a.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px -28px rgba(15, 17, 21, 0.45);
}

.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.chip {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}
.chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.chip-live { background: rgba(25, 195, 125, 0.14); border-color: transparent; color: var(--live); }
.chip-live::before { opacity: 1; box-shadow: 0 0 0 3px rgba(25, 195, 125, 0.25); }

.tile h2, .tile h3 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0;
  text-wrap: balance;
}
.tile h3 { font-size: 1.6rem; }
.tile p { margin: 0; color: var(--muted); }

.tile-link {
  margin-top: auto;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

/* Feature : Reglette */
.tile-feature {
  grid-column: span 2;
  grid-row: span 2;
  background: var(--feature-bg);
  border-color: var(--feature-line);
  color: var(--feature-ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  overflow: hidden;
}
.feature-text { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tile-feature h2 { font-size: clamp(2.4rem, 5vw, 3.4rem); line-height: 1; }
.tile-feature p { color: var(--feature-muted); }
.tile-feature .tile-link { color: var(--feature-ink); }
.tile-feature:hover .tile-link { color: var(--pop); }

.tags { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--feature-line);
  color: var(--feature-muted);
}

/* Mini téléphone */
.phone {
  align-self: end;
  width: 190px;
  margin-bottom: -60px;
  padding: 16px 12px 28px;
  border-radius: 28px 28px 0 0;
  background: #ffffff;
  color: #111;
  border: 6px solid #2b2f39;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: rotate(4deg) translateY(8px);
  transition: transform 0.35s;
}
.tile-feature:hover .phone { transform: rotate(0deg) translateY(-6px); }
.phone-head {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  margin: 2px 4px 4px;
}
.route {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #f2f3f6;
  font-size: 0.72rem;
}
.route-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.grade {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 6px;
  color: #fff;
}
.g-blue { background: #3b3bff; }
.g-yellow { background: #f2b705; color: #1d1700; }
.g-red { background: #d42a42; }
.tick { color: #19a86c; font-weight: 600; }
.tick-try { color: #5b6270; font-weight: 500; font-size: 0.65rem; }
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 56px;
  margin-top: 6px;
  padding: 0 4px;
}
.bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: #dcdcff; }
.bars i:last-child { background: #3b3bff; }

/* À propos */
.tile-about { grid-column: span 2; background: var(--pop); border-color: transparent; color: var(--pop-ink); }
.tile-about .label { color: rgba(29, 23, 0, 0.78); }
.about {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--pop-ink) !important;
}
.about strong { font-weight: 800; }

/* Bientôt */
.tile-soon { background: transparent; border: 1.5px dashed var(--line); }

/* Petites tuiles */
.tile-small { justify-content: flex-end; }
.tile-small .icon { width: 30px; height: 30px; margin-bottom: auto; }
.small-title { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.03em; }
.small-sub { font-size: 0.9rem; color: var(--muted); }
.tile-github:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile-github:hover .small-sub { color: inherit; opacity: 0.7; }
.tile-cv:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tile-cv:hover .small-sub { color: inherit; opacity: 0.8; }

/* Contact */
.tile-contact { grid-column: span 2; background: var(--accent); border-color: transparent; color: var(--accent-ink); justify-content: space-between; }
.tile-contact .label { color: rgba(255, 255, 255, 0.88); }
.tile-contact h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.05; }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.mail {
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.5);
  word-break: break-all;
}
.mail:hover { border-bottom-color: #fff; }
.copy {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 0;
  background: #ffffff;
  color: #1a1a6e;
  font: 600 0.85rem var(--sans);
  cursor: pointer;
  transition: transform 0.15s;
}
.copy:hover { transform: scale(1.04); }

/* ---------- Footer ---------- */
.foot { padding-block: 96px 32px; overflow: hidden; }
.wordmark {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(4.5rem, 19vw, 15rem);
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: var(--ink);
  opacity: 0.08;
  user-select: none;
  white-space: nowrap;
}
.foot-meta { margin: 24px 0 0; font-size: 0.85rem; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-feature, .tile-about, .tile-contact { grid-column: span 2; }
  .tile-feature { grid-row: auto; }
}

@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .top nav a:not(.nav-cta) { display: none; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 40px 32px; }
  .portrait { justify-self: center; order: -1; }
  .sticker { left: -10%; font-size: 1rem; }
  .marquee { margin-inline: -16px; margin-block: 0 48px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .bento { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; grid-auto-rows: minmax(160px, auto); }
  .tile { padding: 22px; border-radius: 22px; }
  .tile-feature { grid-template-columns: 1fr; }
  .phone { justify-self: center; margin-bottom: -50px; }
  .tile-soon { grid-column: span 1; }
  .tile-soon h3 { font-size: 1.3rem; }
  .foot { padding-block: 64px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .wave, .marquee-track { animation: none; }
  *, *::before, *::after { transition: none !important; }
}

/* Tuiles masquées (attribut hidden) : le contact prend toute la largeur */
[hidden] { display: none !important; }
.bento:not(:has(.tile-small:not([hidden]))) .tile-contact { grid-column: 1 / -1; }
