@property --fade-start {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --fade-end {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

:root {
  --pf-bg: #050811;
  --pf-surface: #0b1120;
  --pf-surface-elevated: #0f172a;
  --pf-border: rgba(148, 163, 184, 0.13);
  --pf-border-strong: rgba(96, 165, 250, 0.42);
  --pf-accent: #60a5fa;
  --pf-emerald: #34d399;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--pf-bg);
  color: #f1f5f9;
  letter-spacing: -0.008em;
}

h1, h2, h3, .pf-display {
  letter-spacing: -0.028em;
}

.font-mono-tech {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Obsidian architectural grid & subtle radial aura */
.pf-hero-canvas {
  position: relative;
  background-color: var(--pf-bg);
  background-image:
    radial-gradient(ellipse 75% 55% at 50% -10%, rgba(37, 99, 235, 0.22), transparent 70%),
    radial-gradient(ellipse 45% 40% at 85% 20%, rgba(16, 185, 129, 0.08), transparent 65%),
    linear-gradient(to right, rgba(148, 163, 184, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.045) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
}

/* Precision Bento & preview cards */
.pf-bento-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86) 0%, rgba(7, 12, 24, 0.96) 100%);
  border: 1px solid var(--pf-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 44px -24px rgba(2, 6, 23, 0.92);
  border-radius: 1.15rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pf-bento-card:hover {
  border-color: rgba(96, 165, 250, 0.34);
}

.pf-window {
  background: linear-gradient(180deg, #0b1325 0%, #060b16 100%);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 60px -20px rgba(0, 0, 0, 0.85);
  border-radius: 1.15rem;
}

/* Accessible single-row horizontal tablist with scroll-driven edge fades */
.pf-tablist-scroller {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: inline proximity;
  scroll-padding-inline: 2.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  --fade-size: 2.25rem;
  --fade-dir: right;
  --fade-start-pos: 0;
  --fade-end-pos: 100%;
  mask:
    linear-gradient(black, black) no-clip subtract,
    linear-gradient(to var(--fade-dir), black, transparent) var(--fade-start-pos) 0 / var(--fade-start) 100% no-repeat no-clip,
    linear-gradient(to var(--fade-dir), transparent, black) var(--fade-end-pos) 0 / var(--fade-end) 100% no-repeat no-clip;
  animation: pf-reveal-fade-start linear both, pf-hide-fade-end linear both;
  animation-timeline: scroll(self inline);
  animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%;
  transition: --fade-start 0.2s, --fade-end 0.2s;
}

.pf-tablist-scroller::-webkit-scrollbar {
  display: none;
}

.pf-tablist-scroller.more-start {
  --fade-start: var(--fade-size);
}

.pf-tablist-scroller.more-end {
  --fade-end: var(--fade-size);
}

@keyframes pf-reveal-fade-start {
  to { --fade-start: var(--fade-size); }
}

@keyframes pf-hide-fade-end {
  from { --fade-end: var(--fade-size); }
}

.pf-tab {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.pf-tab:hover {
  color: #e2e8f0;
}

.pf-tab:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: -2px;
  border-radius: 0.5rem;
}

/* Shape + color indicator on aria-selected (never changes box dimensions, survives forced-colors) */
.pf-tab[aria-selected="true"] {
  color: #ffffff;
}

.pf-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 0.35rem 0;
  border-block-end: 3px solid var(--pf-accent);
}

/* Stack hidden="until-found" tabpanels in a single grid cell so hidden panels add zero gap/height */
.pf-tabpanels-stack {
  display: grid;
  grid-template-areas: "panel";
}

.pf-tabpanels-stack > [role="tabpanel"] {
  grid-area: panel;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.form-control {
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  width: 100%;
  background-color: #030712;
  border: 1.5px solid #334155;
  border-radius: 0.65rem;
  padding: 0.65rem 0.9rem;
  color: #f8fafc;
  box-sizing: border-box;
  transition: border-color 0.15s, background-color 0.15s;
}

.form-control:focus-visible {
  outline: 3px solid #3b82f6;
  outline-offset: 2px;
}

.error-msg {
  display: none;
  color: #fca5a5;
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

:is(.form-control:user-invalid, .form-control.user-invalid-fallback) {
  border-color: #ef4444;
  background-color: rgba(127, 29, 29, 0.25);
}

:is(.form-control:user-invalid, .form-control.user-invalid-fallback) + .error-msg {
  display: block;
}

:is(.form-control:user-valid, .form-control.user-valid-fallback) {
  border-color: #10b981;
}

/* Responsive Tables (@container query + sticky headers + stacked mobile cards) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
}

.pf-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  --label-2: "Scanner automatique";
  --label-3: "Cabinet traditionnel";
  --label-4: "Praetorian Forge";
}

.pf-compare-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.pf-compare-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background-color: #0b1120;
}

@container (width < 680px) {
  .pf-compare-table,
  .pf-compare-table thead,
  .pf-compare-table tbody,
  .pf-compare-table tr,
  .pf-compare-table th,
  .pf-compare-table td {
    display: block;
  }
  .pf-compare-table thead {
    display: none;
  }
  .pf-compare-table tr {
    margin-block-end: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 0.85rem;
    padding: 0.75rem;
    background-color: #0b1120;
  }
  .pf-compare-table tbody th {
    position: static;
    margin-block-end: 0.4rem;
    color: #ffffff;
  }
  .pf-compare-table td {
    padding-block: 0.3rem;
  }
  .pf-compare-table td:nth-child(2)::before {
    content: var(--label-2) " : ";
    font-weight: 700;
    color: #94a3b8;
  }
  .pf-compare-table td:nth-child(3)::before {
    content: var(--label-3) " : ";
    font-weight: 700;
    color: #94a3b8;
  }
  .pf-compare-table td:nth-child(4)::before {
    content: var(--label-4) " : ";
    font-weight: 700;
    color: #60a5fa;
  }

  .bench-table, .bench-table thead, .bench-table tbody, .bench-table tr, .bench-table th, .bench-table td {
    display: block;
  }
  .bench-table thead {
    display: none;
  }
  .bench-table tr {
    margin-block-end: 0.9rem;
    border: 1px solid #334155;
    border-radius: 0.75rem;
    padding: 0.6rem;
  }
  .bench-table td:nth-child(2)::before { content: "Cyber : "; font-weight: 700; color: #94a3b8; }
  .bench-table td:nth-child(3)::before { content: "Performance : "; font-weight: 700; color: #94a3b8; }
  .bench-table td:nth-child(4)::before { content: "Accessibilité : "; font-weight: 700; color: #94a3b8; }
  .bench-table td:nth-child(5)::before { content: "SEO : "; font-weight: 700; color: #94a3b8; }
  .bench-table td:nth-child(6)::before { content: "TTFB / DMARC : "; font-weight: 700; color: #94a3b8; }
}
