/* ============ Design tokens ============ */
:root {
  --bg: #0B1120;
  --bg-card: #131B2E;
  --accent: #2F6FED;
  --accent-text: #6EA1FF; /* AA-safe variant of --accent for small text on dark cards */
  --accent-2: #F2A93C;
  --text: #E8EAED;
  --text-dim: #8B96A8;
  --border: #1F2A44;

  --font-display: "Fraunces", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Faint dashboard grid texture — reinforces the "data cockpit" identity
   without competing with content (kept at very low opacity). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 234, 237, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 234, 237, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 75%);
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-display); margin: 0; }

p { margin: 0; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

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

/* ============ Layout helpers ============ */
.section {
  padding: clamp(4rem, 9vw, 7.5rem) 1.5rem;
}
.section__inner {
  max-width: var(--container);
  margin: 0 auto;
}
.section__inner--narrow {
  max-width: 760px;
}
.section__title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.section__subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  max-width: 640px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn__icon { width: 20px; height: 20px; flex-shrink: 0; }

.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover { background: #4a82f0; }

.btn--secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn--secondary:hover { border-color: var(--accent-2); color: var(--accent-2); }

.btn--lg {
  padding: 1.1rem 2rem;
  font-size: 1.1rem;
}

/* ============ Hero ============ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem 1.5rem 3rem;
  position: relative;
  background:
    radial-gradient(circle at 85% 15%, rgba(47, 111, 237, 0.16), transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(242, 169, 60, 0.08), transparent 45%);
}

.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 1.25rem;
}

.hero__headline {
  font-size: clamp(2.3rem, 5.6vw, 4.2rem);
  font-weight: 600;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text-dim);
  max-width: 46ch;
  margin-bottom: 2rem;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.hero__mention {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hero__cv-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border-bottom: 1px solid transparent;
}
.hero__cv-link:hover {
  color: var(--accent-text);
  border-bottom-color: var(--accent-text);
}
.hero__cv-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.hero__portrait {
  display: flex;
  justify-content: center;
}
.hero__portrait-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 30px 60px -25px rgba(47, 111, 237, 0.35);
}
.hero__portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__status {
  position: absolute;
  left: 0.9rem;
  bottom: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  background: rgba(11, 17, 32, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 234, 237, 0.14);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
.hero__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35c46a;
  box-shadow: 0 0 0 0 rgba(53, 196, 106, 0.6);
  animation: statusPulse 2.2s ease-out infinite;
}
@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(53, 196, 106, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(53, 196, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 196, 106, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__status-dot { animation: none; }
}

/* Hero load sequence */
.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  animation: heroIn 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
.hero__eyebrow.reveal-item { animation-delay: 0.05s; }
.hero__headline.reveal-item { animation-delay: 0.15s; }
.hero__subtitle.reveal-item { animation-delay: 0.28s; }
.hero__ctas.reveal-item { animation-delay: 0.4s; }
.hero__mention.reveal-item { animation-delay: 0.5s; }
.hero__cv-link.reveal-item { animation-delay: 0.58s; }
.hero__portrait.reveal-item { animation-delay: 0.35s; }

@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ============ Ticker ============ */
.ticker {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ticker__label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  padding: 0 1.5rem;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-2);
  white-space: nowrap;
}
.ticker__label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: statusPulse 2.2s ease-out infinite;
}
.ticker__viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  padding: 1.1rem 0;
}
.ticker__viewport::before,
.ticker__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  z-index: 1;
  pointer-events: none;
}
.ticker__viewport::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-card), transparent);
}
.ticker__viewport::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-card), transparent);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: tickerScroll 34s linear infinite;
}
.ticker__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ticker__item {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
  padding: 0 1.5rem;
  white-space: nowrap;
}
.ticker__dot {
  color: var(--accent-2);
  font-weight: 700;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 640px) {
  .ticker__track { animation-duration: 50s; }
  .ticker__item { font-size: 0.8rem; padding: 0 1rem; }
  .ticker__label { padding: 0 1rem; font-size: 0.68rem; }
}

@media (max-width: 420px) {
  .ticker__label-text { display: none; }
  .ticker__label { padding: 0 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation-duration: 90s; }
}

/* ============ Reveal on scroll ============ */
/* Progressive enhancement: content is visible by default. Only once the
   "js" class lands on <html> (script.js ran) does it start hidden, so a
   blocked/failed script never leaves the page looking empty. */
.reveal {
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============ Cards (Pourquoi moi) ============ */
.cards--4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card__icon {
  width: 26px;
  height: 26px;
  color: var(--accent-2);
  flex-shrink: 0;
}
.card__mark {
  font-family: var(--font-mono);
  color: var(--accent-text);
  font-size: 0.85rem;
  font-weight: 600;
}
.card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.9rem 0 0.6rem;
  font-family: var(--font-body);
}
.card__text {
  color: var(--text-dim);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .cards--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .cards--4 { grid-template-columns: 1fr; }
}

/* ============ Projects ============ */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.project {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.project:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.project__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Flagship project: full-width feature card above the grid */
.project--flagship {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 2.25rem;
  margin-bottom: 1.5rem;
  border-color: rgba(47, 111, 237, 0.35);
  background: linear-gradient(160deg, rgba(47, 111, 237, 0.07), var(--bg-card) 55%);
}
.project--flagship:hover {
  transform: none;
}
.project--flagship .project__title {
  font-size: 1.5rem;
}
.project--flagship .project__result {
  background: rgba(47, 111, 237, 0.12);
}
.project--flagship .project__result-num {
  font-size: 2rem;
}
.project__body {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .project--flagship {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Interactive embed preview (Power BI / Streamlit) */
.project__embed {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}
.project__embed--compact {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.project__embed-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem;
  border: none;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(47, 111, 237, 0.14), rgba(242, 169, 60, 0.05));
  color: var(--text);
  font-family: var(--font-body);
  text-align: center;
  transition: background 0.2s ease;
}
.project__embed-placeholder:hover {
  background: linear-gradient(160deg, rgba(47, 111, 237, 0.22), rgba(242, 169, 60, 0.08));
}
.project__embed-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  margin-bottom: 0.3rem;
}
.project__embed-icon svg { width: 20px; height: 20px; }
.project__embed-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.project__embed-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.project__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  text-transform: uppercase;
}
.badge--excel { color: #2f9e5c; border-color: #2f9e5c44; background: #2f9e5c14; }
.badge--powerbi { color: var(--accent-2); border-color: #f2a93c44; background: #f2a93c14; }
.badge--python { color: var(--accent-text); border-color: #2f6fed44; background: #2f6fed14; }
.badge--r { color: #6ea8fe; border-color: #6ea8fe44; background: #6ea8fe14; }
.badge--sql { color: #e8894a; border-color: #e8894a44; background: #e8894a14; }

.project__title {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--font-body);
  margin-bottom: 0.9rem;
}
.project__result {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.9rem;
  padding: 0.9rem 1rem;
  background: rgba(47, 111, 237, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.project__result-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 0.2rem;
}
.project__desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}
.project__link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent-text);
  align-self: flex-start;
}
.project__link:hover { color: var(--accent-2); }

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

/* ============ About ============ */
.about {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-size: 1.08rem;
  color: var(--text-dim);
}
.about p:first-child {
  color: var(--text);
  font-size: 1.2rem;
  font-family: var(--font-display);
}

/* ============ Skills ============ */
.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.skills__label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 1rem;
}
.skills__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 500;
}
.tag--accent {
  border-color: rgba(242, 169, 60, 0.4);
  color: var(--accent-2);
}

/* Tool tags echo the badge colors used in the Projets section, tying the
   two together as one color-coded system. */
.tag--excel { border-left: 3px solid #2f9e5c; }
.tag--powerbi { border-left: 3px solid var(--accent-2); }
.tag--sql { border-left: 3px solid #e8894a; }
.tag--python { border-left: 3px solid var(--accent-text); }
.tag--r { border-left: 3px solid #6ea8fe; }

@media (max-width: 780px) {
  .skills { grid-template-columns: 1fr; gap: 1.75rem; }
}

/* ============ CTA final ============ */
.cta-final {
  padding: clamp(4.5rem, 10vw, 8rem) 1.5rem;
  background: linear-gradient(180deg, var(--bg) 0%, #0d1526 100%);
  border-top: 1px solid var(--border);
  text-align: center;
}
.cta-final__inner {
  max-width: 780px;
  margin: 0 auto;
}
.cta-final__title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  margin-bottom: 1rem;
}
.cta-final__subtitle {
  color: var(--text-dim);
  font-size: 1.15rem;
  margin-bottom: 2rem;
}

.cta-final__reasons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1rem;
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
}
.cta-final__reasons li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.cta-final__reasons li::before {
  content: "✓";
  color: var(--accent-2);
  font-weight: 700;
}

@media (max-width: 560px) {
  .cta-final__reasons { flex-direction: column; align-items: center; }
}
.cta-final__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.contact-details {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  margin: 0;
  text-align: left;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.contact-details__item dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}
.contact-details__item dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  word-break: break-word;
}
.contact-details__item a:hover { color: var(--accent-text); }

@media (max-width: 900px) {
  .contact-details { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .contact-details { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .contact-details { grid-template-columns: 1fr; }
}

/* Non-link placeholder text — clearly flagged as "to fill in" without
   behaving like a dead/broken link when clicked. */
.todo-placeholder {
  color: var(--text-dim);
  border-bottom: 1px dashed var(--text-dim);
  padding-bottom: 1px;
}
.todo-placeholder em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-2);
  margin-left: 0.35rem;
}

/* ============ Footer ============ */
.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.footer__inner a:hover {
  color: var(--accent-text);
}
.footer__mention {
  margin-left: auto;
}
@media (max-width: 640px) {
  .footer__inner { justify-content: flex-start; }
  .footer__mention { margin-left: 0; }
}

/* ============ Mobile hero adjustments ============ */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }
  .hero__portrait { order: -1; }
  .hero__portrait-frame { max-width: 140px; aspect-ratio: 1 / 1; border-radius: 100px; }
  .hero__status { display: none; }
  .hero {
    padding: 5rem 1.25rem 2.5rem;
    min-height: unset;
  }
}

@media (max-width: 480px) {
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { justify-content: center; }
}

/* Compact vertical rhythm on short mobile viewports so the hero's CTAs
   and mention line stay above the fold without scrolling. */
@media (max-height: 720px) and (max-width: 900px) {
  .hero { padding: 3rem 1.25rem 1.25rem; }
  .hero__inner { gap: 1rem; }
  .hero__portrait-frame { max-width: 92px; }
  .hero__eyebrow { margin-bottom: 0.6rem; }
  .hero__headline { margin-bottom: 0.6rem; }
  .hero__subtitle { margin-bottom: 1.1rem; }
  .hero__ctas { margin-bottom: 0.6rem; gap: 0.6rem; }
  .btn { padding: 0.7rem 1.2rem; font-size: 0.92rem; }
  .hero__cv-link { margin-top: 0.5rem; font-size: 0.74rem; }
}
