/* =====================================================
   BTHess SIO — dark, Linear / Vercel register
   ===================================================== */

/* ── Fonts ────────────────────────────────────────── */
@font-face {
  font-family: "Aptos";
  src: url("Aptos.ttf");
  font-display: swap;
}
@font-face {
  font-family: "Child";
  src: url("Child.ttf");
  font-display: swap;
}

/* ── Tokens ───────────────────────────────────────── */
:root {
  /* Surface */
  --bg:          oklch(0.08  0.005 265);
  --surface-1:   oklch(0.11  0.006 265);
  --surface-2:   oklch(0.15  0.007 265);
  --border:      oklch(0.20  0.008 265);
  --border-hi:   oklch(0.30  0.012 265);

  /* Ink */
  --ink:         oklch(0.97  0.003 265);
  --ink-2:       oklch(0.65  0.010 265);
  --ink-3:       oklch(0.50  0.009 265);  /* ≥4.5:1 sur --bg */
  /* alias compat */
  --text-600:    oklch(0.50  0.009 265);

  /* Accent */
  --accent:      oklch(0.72  0.22  285);
  --accent-dim:  oklch(0.72  0.22  285 / 0.14);
  --accent-glow: oklch(0.72  0.22  285 / 0.22);

  /* Easing */
  --ease-expo:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-quart:  cubic-bezier(0.25, 1, 0.5, 1);

  /* Space — 4pt scale */
  --sp-1:  4px;   --sp-2:  8px;   --sp-3:  12px;  --sp-4:  16px;
  --sp-5:  24px;  --sp-6:  32px;  --sp-7:  48px;  --sp-8:  64px;
  --sp-9:  96px;  --sp-10: 128px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar off */
html, body { scrollbar-width: none; -ms-overflow-style: none; }
::-webkit-scrollbar { display: none; }

/* ── Body ─────────────────────────────────────────── */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  /* Dot grid — Vercel signature */
  background-image: radial-gradient(circle at 1px 1px,
    oklch(1 0 0 / 0.055) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  font-family: "Aptos", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}

/* Top glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 40% at 50% -5%,
    oklch(0.72 0.22 285 / 0.11) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Container ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
  position: relative;
  z-index: 1;
}

/* ── Header ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition:
    background-color 280ms var(--ease-quart),
    border-color     280ms var(--ease-quart);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background-color: oklch(0.08 0.005 265 / 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: var(--border);
}

.site-header__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  position: relative;
  z-index: 1;
}

/* ── Wordmark ─────────────────────────────────────── */
.wordmark {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 150ms ease;
}

.wordmark:hover { opacity: 0.55; }
.wordmark__dot  { color: var(--accent); }

/* ── Nav ──────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__link {
  padding: var(--sp-2) var(--sp-3);
  border-radius: 6px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: color 140ms ease, background 140ms ease;
  white-space: nowrap;
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--ink);
  background: oklch(1 0 0 / 0.065);
}

/* ── Main ─────────────────────────────────────────── */
main {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  padding: clamp(var(--sp-8), 14vh, var(--sp-10)) 0
           clamp(var(--sp-7), 10vh, var(--sp-9));
}

.hero__title {
  font-family: "Child", system-ui, sans-serif;
  font-size: clamp(3.5rem, 10.5vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: var(--sp-5);
  text-wrap: balance;
  animation: heroReveal 850ms var(--ease-expo) both;
}

/* Accent dot — identité */
.dot {
  color: var(--accent);
  display: inline-block;
  animation: dotGlow 5s ease-in-out infinite;
  animation-delay: 1.8s;
}

.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  color: var(--ink-2);
  line-height: 1.65;
  max-width: 50ch;
  margin-bottom: var(--sp-7);
  text-wrap: pretty;
  animation: heroReveal 850ms var(--ease-expo) both 110ms;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  animation: heroReveal 850ms var(--ease-expo) both 210ms;
}

/* ── Keyframes ────────────────────────────────────── */
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes dotGlow {
  0%, 100% { text-shadow: none; }
  50%       { text-shadow: 0 0 28px oklch(0.72 0.22 285 / 0.65); }
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 9px 17px;
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--ink);
  cursor: pointer;
  transition:
    background    150ms ease,
    border-color  150ms ease,
    transform     180ms var(--ease-expo),
    box-shadow    180ms ease,
    opacity       150ms ease;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--border-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.4);
}

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: oklch(0.98 0.003 265);
  box-shadow:
    0 0 0 1px oklch(0.72 0.22 285 / 0.35),
    0 4px 20px var(--accent-glow);
}

.btn--primary:hover {
  background: oklch(0.78 0.20 285);
  box-shadow:
    0 0 0 1px oklch(0.72 0.22 285 / 0.45),
    0 8px 28px oklch(0.72 0.22 285 / 0.32);
  transform: translateY(-2px);
}

.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-2);
}

.btn--ghost:hover {
  color: var(--ink);
  background: var(--surface-1);
  border-color: var(--border-hi);
}

/* ── Divider ──────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--border) 20%,
    var(--border) 80%,
    transparent 100%
  );
  margin-bottom: var(--sp-8);
}

/* ── Scroll reveal ────────────────────────────────── */
[data-reveal].is-hidden {
  opacity: 0;
  transform: translateY(18px);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity   620ms var(--ease-expo) var(--reveal-delay, 0ms),
    transform 620ms var(--ease-expo) var(--reveal-delay, 0ms);
}

/* ── Links section (index.php) ────────────────────── */
.links-section {
  padding-bottom: clamp(var(--sp-9), 12vh, var(--sp-10));
}

/* 3-column grid, collapses to 1 on mobile */
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

@media (max-width: 640px) {
  .link-grid { grid-template-columns: 1fr; }
}

/* Entire card is the anchor */
.link-card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color  200ms ease,
    background    200ms ease,
    transform     200ms var(--ease-expo);
}

.link-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.link-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.link-card__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.link-card__arrow {
  font-size: 0.9375rem;
  color: var(--ink-3);
  display: inline-block;
  transition: transform 200ms var(--ease-expo), color 200ms ease;
}

.link-card:hover .link-card__arrow {
  transform: translate(3px, -3px);
  color: var(--ink-2);
}

.link-card__title {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.link-card__desc {
  font-size: 0.8125rem;
  color: var(--ink-2);
  line-height: 1.5;
  margin-top: auto;
  padding-top: var(--sp-2);
}

/* ── Project section (projetap.php) ───────────────── */
.project-section {
  padding-bottom: clamp(var(--sp-9), 12vh, var(--sp-10));
}

.project-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.project {
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--border);
}

.project__header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.project__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.project__tag {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.project__desc {
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-bottom: var(--sp-4);
  max-width: 52ch;
}

.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  align-items: center;
}

.project__link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border);
  transition: color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}

.project__link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project__restricted {
  font-size: 0.875rem;
  color: var(--ink-3);
  font-style: italic;
}

/* Sub-link list (Animaux) */
.project__sub-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.project__sub-links li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.project__sub-links li::before {
  content: "↳";
  color: var(--ink-3);
  font-size: 0.8125rem;
  flex-shrink: 0;
  line-height: 1;
}

.project__sub-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  transition: color 140ms ease, border-color 140ms ease;
}

.project__sub-links a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.site-footer .container {
  padding-top: var(--sp-5);
  padding-bottom: var(--sp-5);
}

.site-footer__text {
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-align: center;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
  .site-header__inner { padding: var(--sp-3) var(--sp-4); }
  .nav__link { padding: var(--sp-2); font-size: 0.8125rem; }
  .btn { padding: 9px 14px; font-size: 0.875rem; }
  .project__header { gap: var(--sp-2); }
}

/* ── Reduced motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  [data-reveal].is-hidden {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── Compat global (animaux, template pages) ──────── */
h1, h2, h3 { color: var(--ink); }
p { color: var(--ink-2); }

section.legacy {
  margin: 40px 0;
  padding: var(--sp-5);
  background: var(--surface-1);
  border-radius: 10px;
  border: 1px solid var(--border);
}

ul.projets {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
}

ul.projets li a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 140ms ease;
}

ul.projets li a:hover { opacity: 0.75; }
