/* ==========================================================================
   Espace Jix
   Shared tokens, rail header, buttons, footer, forms primitives.
   ========================================================================== */

:root {
  --felt: #0e3a2c;
  --felt-mid: #12503c;
  --felt-deep: #0a2d22;
  --ink: #07150f;
  --ivory: #f3ebe0;
  --ivory-dim: #c9bfb0;
  --bronze: #c4843a;
  --bronze-bright: #d49a52;
  --bronze-deep: #8f5c22;
  --crimson: #9b1b2e;
  --chip: #e4d2a6;
  --chip-edge: #c9b27a;
  --line: rgba(228, 210, 166, 0.22);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  --display: "Bodoni Moda", "Times New Roman", serif;
  --ui: "Figtree", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --wrap: 1180px;
  --rail-h: 82px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--bronze);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}

.felt {
  background-color: var(--felt);
  background-image:
    radial-gradient(
      circle at 18% 22%,
      rgba(255, 255, 255, 0.035) 0 1px,
      transparent 1.5px
    ),
    radial-gradient(
      circle at 72% 64%,
      rgba(0, 0, 0, 0.18) 0 1px,
      transparent 1.5px
    ),
    linear-gradient(180deg, rgba(20, 82, 62, 0.55), transparent 42%);
  background-size:
    7px 7px,
    9px 9px,
    100% 100%;
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
}

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

/* ---------- buttons (chip pills) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition:
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
  box-shadow:
    0 0 0 2px var(--chip-edge),
    0 0 0 5px rgba(14, 58, 44, 0.9),
    0 0 0 6px var(--bronze);
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 2px solid var(--ivory);
  outline-offset: 4px;
}

.btn--chip {
  background: radial-gradient(
    circle at 30% 28%,
    #f4e7c8,
    var(--bronze) 55%,
    var(--bronze-deep)
  );
  color: var(--ink);
}
.btn--chip:hover {
  box-shadow:
    0 0 0 2px var(--chip),
    0 0 0 5px var(--felt),
    0 0 0 6px var(--bronze-bright),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--ivory);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost:hover {
  background: rgba(243, 235, 224, 0.06);
}

.btn--sm {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}
.btn--block {
  width: 100%;
}
.btn--crimson {
  background: radial-gradient(
    circle at 30% 28%,
    #c94a5a,
    var(--crimson) 58%,
    #6e101e
  );
  color: var(--ivory);
}

/* ---------- felt rail header ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--rail-h);
  background: linear-gradient(
    180deg,
    #1a6048 0%,
    var(--felt-mid) 38%,
    var(--felt) 100%
  );
  border-bottom: 1px solid rgba(196, 132, 58, 0.4);
  box-shadow:
    inset 0 3px 0 rgba(228, 210, 166, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.28);
}
.rail::after {
  content: "";
  position: absolute;
  left: max(20px, calc((100% - var(--wrap)) / 2));
  right: max(20px, calc((100% - var(--wrap)) / 2));
  bottom: 6px;
  height: 3px;
  background-image: radial-gradient(
    circle closest-side,
    var(--chip) 1.15px,
    transparent 1.25px
  );
  background-size: 10px 3px;
  background-repeat: repeat-x;
  background-position: 0 50%;
  opacity: 0.9;
  pointer-events: none;
}
.rail.is-compact {
  --rail-h: 68px;
}

.rail__in {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 1;
  padding-bottom: 10px;
}

.mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ivory);
  flex-shrink: 0;
  min-height: 44px;
}
.mark__logo {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.28));
}
.rail.is-compact .mark__logo {
  width: 42px;
  height: 42px;
}
.ftr__brand .mark__logo {
  width: 52px;
  height: 52px;
}

.rail__menu {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}
.rail__nav {
  display: flex;
  gap: 22px;
}
.rail__nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--ivory-dim);
  padding: 8px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.rail__nav a:hover,
.rail__nav a[aria-current="page"] {
  color: var(--ivory);
}

.rail__act {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.rail__login {
  color: var(--ivory);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.rail__login:hover {
  color: var(--chip);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  padding: 0;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--chip);
  position: absolute;
  left: 13px;
  border-radius: 2px;
}
.nav-toggle span {
  top: 20px;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  left: 0;
}
.nav-toggle span::before {
  top: -6px;
}
.nav-toggle span::after {
  top: 6px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
  .rail__menu {
    display: none;
  }
  .rail.is-open .rail__menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--felt-deep);
    padding: 16px 20px 22px;
    gap: 8px;
    margin: 0;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  }
  .rail.is-open .rail__nav {
    flex-direction: column;
    gap: 0;
  }
  .rail.is-open .rail__nav a {
    min-height: 48px;
    border-bottom: 1px solid var(--line);
  }
  .rail.is-open .rail__act {
    padding-top: 8px;
    justify-content: flex-start;
  }
}

/* ---------- footer ---------- */

.ftr {
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: 56px 0 28px;
  color: var(--ivory-dim);
}
.ftr__top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 36px;
}
.ftr__tag {
  font-family: var(--display);
  font-style: italic;
  color: var(--ivory);
  font-size: 20px;
  margin: 12px 0 8px;
}
.ftr__brand p {
  margin: 0;
  max-width: 32ch;
}
.ftr h3 {
  margin: 0 0 12px;
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 600;
}
.ftr ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ftr li {
  margin: 0 0 8px;
}
.ftr a {
  text-decoration: none;
  color: var(--ivory-dim);
}
.ftr a:hover {
  color: var(--ivory);
}
.ftr__bot {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
}
.ftr__legal {
  max-width: 72ch;
}
.ftr--slim {
  padding-top: 28px;
}
.ftr--slim .ftr__bot {
  border: 0;
  padding-top: 0;
}

@media (max-width: 800px) {
  .ftr__top {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .ftr__top {
    grid-template-columns: 1fr;
  }
  .ftr__bot {
    flex-direction: column;
  }
}

/* ---------- shared links / focus ---------- */

.tlink {
  color: var(--bronze-bright);
  text-underline-offset: 3px;
}
.tlink:hover {
  color: var(--chip);
}

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
