/* =========================================================
   Yunus Demirel — portfolio · bento sombre
   ========================================================= */

:root {
  --bg: #0a0a0c;
  --panel: #121318;
  --panel-2: #16181e;
  --border: rgba(255,255,255,.08);
  --border-hi: rgba(255,255,255,.16);
  --text: #ededf0;
  --text-soft: #a6a7b0;
  --text-mute: #6a6b76;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --accent-soft: rgba(56,189,248,.14);

  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 20px;
  --shell: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--accent); color: #04263a; }
a { color: inherit; text-decoration: none; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 22px; }
.tile__k { font-family: var(--mono); font-size: .72rem; color: var(--text-mute); letter-spacing: .02em; text-transform: lowercase; }

/* Ambient glow */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(560px circle at 15% -5%, rgba(56,189,248,.10), transparent 60%),
    radial-gradient(620px circle at 100% 8%, rgba(80,120,255,.07), transparent 55%);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.topbar.pinned { border-bottom-color: var(--border); }
.topbar__inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.topbar__brand { display: flex; align-items: center; gap: 10px; }
.topbar__mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--border);
  font-weight: 800; font-size: .72rem; color: var(--accent); letter-spacing: .5px;
}
.topbar__name { font-family: var(--mono); font-size: .8rem; color: var(--text-soft); }
.topbar__nav { display: flex; gap: 20px; margin-left: auto; }
.topbar__nav a { font-family: var(--mono); font-size: .78rem; color: var(--text-mute); transition: color .2s; }
.topbar__nav a:hover, .topbar__nav a.active { color: var(--text); }
.topbar__status {
  font-family: var(--mono); font-size: .72rem; color: var(--accent);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--accent-soft);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,189,248,.5); } 70% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Bento grid ---------- */
.bento {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  padding-top: 34px; padding-bottom: 40px; grid-auto-flow: row dense;
}
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }

.tile {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r);
  padding: 24px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .3s, transform .3s, background .3s;
  opacity: 0; transform: translateY(16px); animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }
.tile:nth-child(1){animation-delay:.02s} .tile:nth-child(2){animation-delay:.06s}
.tile:nth-child(3){animation-delay:.10s} .tile:nth-child(4){animation-delay:.14s}
.tile:nth-child(5){animation-delay:.18s} .tile:nth-child(6){animation-delay:.22s}
.tile:nth-child(7){animation-delay:.26s} .tile:nth-child(8){animation-delay:.30s}
.tile:nth-child(n+9){animation-delay:.34s}

/* Spotlight au survol */
.tile::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,50%), var(--accent-soft), transparent 42%);
  opacity: 0; transition: opacity .35s; z-index: 0;
}
.tile:hover { border-color: var(--border-hi); transform: translateY(-3px); }
.tile:hover::before { opacity: 1; }
.tile > * { position: relative; z-index: 1; }

/* ---------- Intro ---------- */
.tile--intro { justify-content: center; gap: 14px; padding: 32px; }
.hi { font-family: var(--mono); font-size: .84rem; color: var(--text-soft); }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.6s ease-in-out infinite; }
@keyframes wave { 0%,60%,100% { transform: rotate(0); } 10% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 30% { transform: rotate(16deg); } 40% { transform: rotate(-4deg); } }
.intro-name { font-size: clamp(2.2rem, 5vw, 3.3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.02; }
.intro-role { display: flex; align-items: flex-start; gap: 10px; font-family: var(--mono); font-size: 1.05rem; font-weight: 500; color: var(--accent); margin-top: 4px; }
.tag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); margin-top: 9px; flex-shrink: 0; }
.intro-line { color: var(--text-soft); max-width: 46ch; }
.intro-cta { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 11px; font-weight: 600; font-size: .9rem; gap: 8px;
  border: 1px solid var(--border); transition: transform .2s, border-color .2s, box-shadow .2s; cursor: pointer;
}
.btn__logo { width: 17px; height: 17px; }
.btn--accent { background: var(--accent); color: #04263a; border-color: var(--accent); }
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 10px 26px -10px var(--accent); }
.btn--ghost { background: transparent; color: var(--text); }
.btn--ghost:hover { border-color: var(--border-hi); transform: translateY(-2px); }
.btn--lg { padding: 14px 28px; font-size: .96rem; }

/* ---------- Avatar ---------- */
.tile--avatar { align-items: center; justify-content: center; text-align: center; }
.avatar {
  width: 180px; height: 180px; border-radius: 34px; overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 14px 34px -10px rgba(56,189,248,.5);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 32%; display: block; }
.avatar__meta { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); }

/* ---------- Clock ---------- */
.tile--clock { justify-content: center; }
.clock { font-family: var(--mono); font-size: 2.1rem; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.clock__sub { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); }

/* ---------- Available ---------- */
.tile--avail { flex-direction: row; align-items: center; gap: 14px; }
.big-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(56,189,248,.5); animation: pulse 2s infinite; flex-shrink: 0; }
.avail__title { font-weight: 700; }
.avail__sub { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); }

/* ---------- Now ---------- */
.now__text { color: var(--text-soft); }
.now__text strong { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.chips span { font-family: var(--mono); font-size: .72rem; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; }

/* ---------- Focus ---------- */
.tile--focus { justify-content: center; }
.focus__main { font-weight: 700; font-size: 1.05rem; }
.focus__sub { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); }

/* ---------- Prose ---------- */
.prose { display: flex; flex-direction: column; gap: 12px; max-width: 74ch; }
.prose p { color: var(--text-soft); }
.prose strong { color: var(--text); font-weight: 600; }

/* ---------- Stack badges ---------- */
.stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 6px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 15px 8px; border: 1px solid var(--border); border-radius: 13px; background: var(--panel-2);
  transition: transform .2s, border-color .2s, background .2s; cursor: pointer;
}
.badge:hover { transform: translateY(-3px); border-color: var(--accent); background: #1a1c23; }
.badge img { width: 26px; height: 26px; opacity: .92; pointer-events: none; }
.badge span { font-family: var(--mono); font-size: .68rem; color: var(--text-soft); }

/* ---------- Rows (parcours / projets / formation) ---------- */
.rows { display: flex; flex-direction: column; margin-top: 4px; }
.row { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.row:first-child { border-top: none; }
.row__year { font-family: var(--mono); font-size: .74rem; color: var(--text-mute); padding-top: 2px; }
.row__badge { font-family: var(--mono); font-size: .68rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); height: fit-content; padding: 3px 9px; border-radius: 7px; text-align: center; }
.row__badge--alt { color: #fbbf24; background: rgba(251,191,36,.14); }
.row__title { font-weight: 600; }
.row__title em { color: var(--text-soft); font-style: normal; font-weight: 400; }
.row__desc { color: var(--text-soft); font-size: .92rem; margin-top: 3px; }
.row__stack { font-family: var(--mono); font-size: .72rem; color: var(--text-mute); margin-top: 8px; }

/* ---------- Projets (grille) ---------- */
.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
.proj {
  display: flex; flex-direction: column; gap: 7px;
  border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: var(--panel-2);
  transition: transform .2s, border-color .2s, background .2s;
}
.proj:hover { transform: translateY(-2px); border-color: var(--border-hi); background: #1a1c23; }
.proj .row__badge { align-self: flex-start; }

/* ---------- Centres d'intérêt ---------- */
.interests { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.interest {
  display: inline-flex; align-items: center; gap: 9px; font-size: .92rem; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--panel-2);
}

/* ---------- Langs ---------- */
.langs { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.lang { display: grid; grid-template-columns: 90px 1fr auto; align-items: center; gap: 12px; }
.lang > span { font-weight: 500; font-size: .92rem; }
.lang > em { font-family: var(--mono); font-style: normal; font-size: .7rem; color: var(--text-mute); }
.meter { display: flex; gap: 5px; }

/* ---------- Contact ---------- */
.tile--contact { gap: 22px; padding: 34px; }
.contact__title { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.contact__lead { color: var(--text-soft); }
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.contact__link {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 5px;
  padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-2);
  transition: transform .2s, border-color .2s, background .2s; cursor: pointer; font: inherit; color: inherit;
}
.contact__link:hover { transform: translateY(-3px); border-color: var(--accent); background: #1a1c23; }
.contact__k { font-family: var(--mono); font-size: .7rem; color: var(--text-mute); }
.contact__v { font-weight: 600; word-break: break-word; }
.contact__logo { width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; }
.contact__hint { position: absolute; top: 16px; right: 16px; font-family: var(--mono); font-size: .66rem; color: var(--accent); opacity: .7; }

/* ---------- Footer ---------- */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-top: 26px; padding-bottom: 46px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: .72rem; color: var(--text-mute); }
.foot a { color: var(--text-soft); }
.foot a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .span-2, .span-4 { grid-column: span 2; }
  .topbar__nav { display: none; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: span 1; }
  .tile--avail { justify-content: flex-start; }
  .topbar__name { display: none; }
  .proj-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .tile { opacity: 1; transform: none; }
}
