:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: rgba(13, 16, 18, 0.88);
  --panel-strong: rgba(18, 22, 24, 0.94);
  --text: #f5f1e8;
  --muted: #b9b2a5;
  --line: rgba(142, 211, 205, 0.28);
  --cyan: #77d8db;
  --gold: #f2cf63;
  --green: #8ed88c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 22%, rgba(119, 216, 219, 0.12), transparent 24rem),
    radial-gradient(circle at 87% 12%, rgba(242, 207, 99, 0.09), transparent 26rem),
    linear-gradient(180deg, #07090b 0%, #15100f 54%, #08090b 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(7, 9, 11, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand,
.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 1px solid var(--cyan);
  background: rgba(5, 7, 9, 0.78);
  color: var(--cyan);
  font-size: 0.82rem;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar nav a {
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.94rem;
}

.topbar nav a:hover {
  color: var(--text);
}

.hero,
.tools-hero {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  width: 100%;
  min-height: 78vh;
  display: grid;
  align-items: center;
  padding: clamp(6rem, 10vh, 8rem) max(1rem, calc((100vw - 72rem) / 2)) clamp(2rem, 5vh, 3.25rem);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 9, 0.96) 0%, rgba(5, 7, 9, 0.82) 38%, rgba(5, 7, 9, 0.34) 72%, rgba(5, 7, 9, 0.56) 100%),
    linear-gradient(180deg, rgba(5, 7, 9, 0.2) 0%, rgba(5, 7, 9, 0.88) 100%),
    url("assets/traceforge-home-hero.png");
  background-size: cover;
  background-position: center right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tools-hero {
  min-height: auto;
  padding: clamp(7rem, 12vh, 9rem) 0 clamp(2rem, 5vh, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 22rem);
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.tools-title {
  grid-column: 1 / -1;
}

.hero-visual {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(119, 216, 219, 0.24);
  background: rgba(8, 12, 14, 0.72);
  overflow: hidden;
}

.hero-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 6;
  object-fit: cover;
  object-position: center;
  opacity: 0.92;
}

.tools-copy {
  align-self: start;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 14ch;
  margin-bottom: 1rem;
  font-size: clamp(3.2rem, 7.8vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.tools-hero h1 {
  max-width: 100%;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  line-height: 1.12;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.tools-hero .lead {
  max-width: 46rem;
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  line-height: 1.55;
}

.tools-page h2 {
  max-width: 32ch;
  font-size: clamp(1.35rem, 2.15vw, 2.05rem);
}

.tools-page .section-heading {
  max-width: 48rem;
}

.tools-page .section-heading h2 {
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.45rem, 2.7vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: 0;
}

.lead {
  max-width: 48rem;
  color: #f7f1e7;
  font-size: clamp(1.18rem, 2.1vw, 2rem);
  line-height: 1.28;
}

.hero-actions,
.game-callout,
.team-grid,
.service-grid,
.tool-list {
  display: grid;
  gap: 0.9rem;
}

.hero-actions {
  grid-template-columns: repeat(2, minmax(0, max-content));
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.25rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-decoration: none;
  font-weight: 800;
}

.button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #16130a;
}

.button.secondary {
  background: rgba(8, 12, 14, 0.72);
  border-color: var(--cyan);
  color: var(--text);
}

.intro,
.section,
.legal-note,
.game-callout,
footer {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
}

footer a {
  color: var(--cyan);
  text-decoration: none;
}

.legal-note {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(119, 216, 219, 0.22);
  background: rgba(8, 12, 14, 0.72);
}

.legal-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.contact-hero {
  width: min(72rem, calc(100% - 2rem));
  margin-inline: auto;
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 26rem);
  gap: clamp(1.2rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(7rem, 13vh, 9rem) 0 clamp(2rem, 5vh, 4rem);
}

.contact-page h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 6vw, 5.5rem);
}

.contact-card {
  border: 1px solid rgba(119, 216, 219, 0.32);
  background:
    linear-gradient(145deg, rgba(119, 216, 219, 0.14), rgba(242, 207, 99, 0.08)),
    var(--panel-strong);
  padding: clamp(1.2rem, 3vw, 2rem);
}

.contact-card h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
}

.contact-card p {
  color: var(--muted);
  line-height: 1.55;
}

.privacy-note {
  margin-bottom: 0;
}

.contact-form-section {
  padding-top: 1rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
  border: 1px solid rgba(119, 216, 219, 0.26);
  background: var(--panel-strong);
  padding: clamp(1rem, 3vw, 1.5rem);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 800;
}

.contact-form label span {
  font-size: 0.92rem;
}

.contact-form em {
  color: var(--gold);
  font-style: normal;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 7, 9, 0.88);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 0.85rem 0.9rem;
}

.contact-form button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-form textarea {
  min-height: 12rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid rgba(119, 216, 219, 0.52);
  outline-offset: 2px;
}

.consent-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.consent-row input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
}

.form-status {
  min-height: 1.4rem;
  margin: 0;
  color: var(--gold);
  font-size: 0.95rem;
  line-height: 1.45;
}

.required-note {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.legal-page .contact-hero {
  min-height: auto;
  padding-bottom: 1.5rem;
}

.legal-list {
  display: grid;
  gap: 1rem;
}

.legal-list article {
  background: var(--panel-strong);
}

.intro {
  padding: clamp(2.25rem, 6vw, 5rem) 0;
  color: #e8e1d6;
  font-size: clamp(1.2rem, 2.15vw, 1.85rem);
  line-height: 1.38;
}

.section {
  padding: clamp(1.8rem, 4vw, 3.4rem) 0;
}

.section-heading {
  max-width: 54rem;
  margin-bottom: 1.6rem;
}

.section-intro {
  color: var(--muted);
  max-width: 44rem;
  line-height: 1.55;
}

.service-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

article,
.identity-card,
.text-panel,
.tool-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel);
  padding: clamp(1rem, 2vw, 1.25rem);
  overflow: hidden;
}

article h3,
.tool-card h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.28;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

article p,
.tool-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.identity-card {
  background: var(--panel-strong);
}

.identity-card h2 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.16;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.identity-card strong {
  display: block;
  margin-top: 1rem;
  color: var(--gold);
  line-height: 1.35;
}

.identity-tag,
.tool-card span {
  display: inline-flex;
  margin-bottom: 0.85rem;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.4rem;
  align-items: start;
}

.text-panel p {
  color: #e4ded2;
  font-size: 1rem;
  line-height: 1.62;
}

.text-panel p:last-child {
  margin-bottom: 0;
}

.tool-list {
  grid-auto-columns: minmax(16rem, calc((100% - 2.7rem) / 4));
  grid-auto-flow: column;
  grid-template-columns: none;
  margin-top: 1.2rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding-bottom: 0.65rem;
  scroll-snap-type: inline mandatory;
  scrollbar-color: var(--cyan) rgba(255, 255, 255, 0.08);
}

.tool-list .tool-card {
  scroll-snap-align: start;
}

.tool-list .tool-card:nth-child(n + 9) {
  display: none;
}

#outils {
  padding-top: clamp(2.4rem, 5vw, 4rem);
}

.tool-card {
  background: var(--panel-strong);
  min-height: 22rem;
}

.tool-thumb {
  height: 5.8rem;
  margin: -0.25rem -0.25rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 25% 30%, rgba(119, 216, 219, 0.26), transparent 38%),
    radial-gradient(circle at 76% 72%, rgba(242, 207, 99, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(119, 216, 219, 0.12), rgba(242, 207, 99, 0.08)),
    #090d10;
  position: relative;
  overflow: hidden;
}

.tool-thumb::before,
.tool-thumb::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.tool-thumb::before {
  width: 4.8rem;
  height: 4.8rem;
  border: 1px solid rgba(119, 216, 219, 0.42);
  background: rgba(119, 216, 219, 0.07);
}

.tool-thumb::after {
  width: 2.6rem;
  height: 2.6rem;
  border: 1px solid rgba(242, 207, 99, 0.5);
  background: rgba(242, 207, 99, 0.08);
}

.tool-thumb.quote::before {
  border-radius: 0.35rem;
}

.tool-thumb.quote::after {
  width: 3.2rem;
  height: 0.9rem;
  box-shadow: 0 1.15rem 0 rgba(242, 207, 99, 0.12), 0 -1.15rem 0 rgba(119, 216, 219, 0.12);
}

.tool-thumb.checklist::before {
  width: 3.9rem;
  height: 5.1rem;
  border-radius: 0.25rem;
  box-shadow: 1.5rem 0 0 rgba(119, 216, 219, 0.06);
}

.tool-thumb.checklist::after {
  width: 2.4rem;
  height: 0.65rem;
  box-shadow: 0 1rem 0 rgba(242, 207, 99, 0.12), 0 -1rem 0 rgba(119, 216, 219, 0.12);
}

.tool-thumb.demo::before {
  border-radius: 999px;
}

.tool-thumb.demo::after {
  width: 3rem;
  height: 3rem;
  clip-path: polygon(32% 18%, 78% 50%, 32% 82%);
}

.tool-thumb.theme::before {
  width: 5.2rem;
  height: 3.4rem;
  border-radius: 0.45rem;
  box-shadow:
    0 0 0 0.9rem rgba(119, 216, 219, 0.05),
    0 0 2.2rem rgba(119, 216, 219, 0.22);
}

.tool-thumb.theme::after {
  width: 3.3rem;
  height: 1.2rem;
  border-color: rgba(119, 216, 219, 0.72);
  background:
    linear-gradient(90deg, rgba(119, 216, 219, 0.42), rgba(242, 207, 99, 0.22)),
    rgba(5, 7, 9, 0.7);
  box-shadow:
    -1.7rem -1.15rem 0 -0.35rem rgba(242, 207, 99, 0.22),
    1.6rem 1.1rem 0 -0.4rem rgba(119, 216, 219, 0.22);
}

.tool-card h3 {
  font-size: clamp(1rem, 1.1vw, 1.12rem);
}

.tool-card p {
  min-height: 0;
  margin-bottom: 0.8rem;
}

.tool-card .button {
  min-height: 2.8rem;
  padding: 0.72rem 0.9rem;
}

.all-tools-link {
  display: inline-flex;
  margin-top: 0.85rem;
  color: var(--cyan);
  font-weight: 800;
  text-decoration: none;
}

.all-tools-link::after {
  content: " ->";
}

.tool-card.available {
  border-color: rgba(142, 216, 140, 0.5);
}

.tool-card.planned {
  border-color: rgba(119, 216, 219, 0.32);
}

.tool-card.backlog {
  border-color: rgba(242, 207, 99, 0.32);
}

.team-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-callout {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-top: 2rem;
  margin-bottom: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(119, 216, 219, 0.12), rgba(242, 207, 99, 0.09)),
    var(--panel);
}

.game-callout p:not(.eyebrow) {
  max-width: 44rem;
  margin-bottom: 0;
  color: #ddd6ca;
  line-height: 1.5;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar {
    position: absolute;
    align-items: flex-start;
  }

  .topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero-actions,
  .form-grid,
  .service-grid,
  .team-grid,
  .game-callout,
  .contact-hero,
  .tools-hero,
  .split-section,
  .tool-list {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .tool-list {
    grid-auto-columns: minmax(17rem, 84vw);
    grid-template-columns: none;
  }
}

@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
  }

  .topbar nav {
    justify-content: flex-start;
  }

  .hero,
  .tools-hero {
    padding-top: 11rem;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 17vw, 5rem);
  }

  .tools-hero h1 {
    font-size: clamp(1.85rem, 8.5vw, 2.65rem);
    line-height: 1.12;
  }
}
