/* Baron Creation — carte de visite. Aucune dependance externe. */

/* ---------- Polices auto-hebergees (OFL), sous-ensemble latin ---------- */
@font-face {
  font-family: 'Instrument Serif';
  src: url('../fonts/instrument-serif-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter var';
  src: url('../fonts/inter-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Jetons ---------- */
:root {
  --paper:        #e6dfd1;   /* le bureau */
  --paper-deep:   #d6cdba;   /* son ombre aux bords */
  --card:         #fbf9f4;   /* la carte */
  --card-edge:    #eae4d7;   /* sa tranche */
  --ink:          #1c1915;
  --ink-soft:     #6a6153;
  --ink-faint:    #9a9081;
  --rule:         rgba(28, 25, 21, 0.14);

  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Inter var', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --measure: 38rem;
  --pad: clamp(1.25rem, 5vw, 2.5rem);
}

/* Le grain du papier : bruit SVG, aucun fichier a charger. */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Le papier tient en deux couches fixes : la lumiere, puis le grain.
   Deux elements plutot que background-attachment: fixed, que iOS ignore. */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* La lumiere du bureau : elle vient du haut, l'ombre s'accumule en bas. */
body::before {
  background-image:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 253, 247, 0.85), rgba(255, 253, 247, 0) 62%),
    radial-gradient(100% 100% at 50% 120%, rgba(120, 104, 78, 0.16), rgba(120, 104, 78, 0) 60%);
}

/* Le grain du papier. */
body::after {
  background-image: var(--grain);
  opacity: 0.42;
  mix-blend-mode: multiply;
}

body > * { position: relative; z-index: 1; }

a { color: inherit; }

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

/* Le focus doit rester visible : liens de contact et App Store s'atteignent au clavier. */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

.nowrap { white-space: nowrap; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Micro-capitales : la voix secondaire de la carte ---------- */
.caps {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- La scene ---------- */
.stage {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: clamp(1.5rem, 6vw, 4rem) var(--pad);
  perspective: 1600px;
}

/* ---------- La carte ---------- */
.drop {
  width: min(38rem, 100%);
  animation: drop 760ms cubic-bezier(0.16, 0.9, 0.3, 1.04) both;
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-18px) scale(1.012); }
  to   { opacity: 1; transform: none; }
}

.card {
  --rx: 0deg;
  --ry: 0deg;
  position: relative;
  aspect-ratio: 85 / 55;
  min-height: fit-content;
  display: flex;
  flex-direction: column;
  padding: clamp(1.75rem, 5vw, 3rem);
  border-radius: 5px;
  background-color: var(--card);
  background-image: var(--grain);
  background-blend-mode: multiply;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) rotate(-1.2deg);
  transform-style: preserve-3d;
  transition: transform 240ms cubic-bezier(0.22, 0.75, 0.3, 1);
  /* tranche du papier, ombre de contact, ombre portee */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 var(--card-edge),
    0 1px 1px rgba(58, 48, 33, 0.16),
    0 10px 22px -8px rgba(58, 48, 33, 0.22),
    0 34px 60px -26px rgba(58, 48, 33, 0.30);
}

/* Le satine du papier, qui suit le curseur. */
.card__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: var(--sheen, 0);
  transition: opacity 420ms ease;
  background: radial-gradient(
    58% 74% at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.9),
    rgba(255, 255, 255, 0) 62%
  );
}

.card__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 8.5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.005em;
  /* Gaufrage : le nom parait imprime en creux dans le papier. */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
}

.card__legal {
  margin: 0.85rem 0 0;
}

.card__rule {
  height: 1px;
  margin: clamp(1.1rem, 3vw, 1.6rem) 0;
  border: 0;
  background: linear-gradient(90deg, var(--rule), rgba(28, 25, 21, 0.04) 72%, transparent);
}

.card__craft {
  margin: 0;
  max-width: 27rem;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.card__contact {
  margin: auto 0 0;
  padding-top: clamp(1.25rem, 4vw, 1.9rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem 1.75rem;
  font-size: 0.9375rem;
}

.card__reach {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.card__contact a {
  color: var(--ink);
  text-decoration-color: var(--ink-faint);
  text-underline-offset: 3px;
  transition: text-decoration-color 200ms ease;
}
.card__contact a:hover { text-decoration-color: var(--ink); }

.card__contact address {
  font-style: normal;
  text-align: right;
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---------- Invite a defiler ---------- */
.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  animation: fade-up 700ms 500ms ease-out both;
}
.scroll-hint svg { color: var(--ink-faint); }
.scroll-hint:hover .caps { color: var(--ink-soft); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Sections posees sur le papier ---------- */
.sheet {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 6rem) var(--pad);
}

.sheet__title {
  margin: 0 0 2.5rem;
}

.app {
  display: flex;
  align-items: flex-start;
  gap: clamp(1.25rem, 4vw, 2rem);
}

/* L'icone : une vignette posee sur le papier, legerement de travers. */
.app__icon {
  flex: none;
  width: clamp(4.5rem, 14vw, 5.5rem);
  height: auto;
  border-radius: 22.5%;
  transform: rotate(1.6deg);
  box-shadow:
    0 1px 2px rgba(58, 48, 33, 0.2),
    0 10px 24px -10px rgba(58, 48, 33, 0.35);
}

.app__body { min-width: 0; }

.app__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.app__pitch {
  margin: 0.6rem 0 1.25rem;
  color: var(--ink-soft);
}

.app__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

/* Le bouton App Store : de l'encre pleine sur le papier. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--card);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(58, 48, 33, 0.25);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(58, 48, 33, 0.35);
}
.btn:active { transform: none; }

.link-quiet {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  text-underline-offset: 3px;
  text-decoration-color: rgba(106, 97, 83, 0.4);
}
.link-quiet:hover { color: var(--ink); }

/* ---------- Pied de page ---------- */
.foot {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(2.5rem, 8vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
}
.foot nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink-soft); }

/* ---------- Pages legales : le verso du meme document ---------- */
.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 9vw, 5.5rem) var(--pad) clamp(2rem, 6vw, 3rem);
}

.doc__back {
  display: inline-block;
  margin-bottom: clamp(2rem, 6vw, 3rem);
  text-decoration: none;
}
.doc__back:hover .caps { color: var(--ink-soft); }

.doc h1 {
  margin: 0 0 2.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 7vw, 3rem);
  line-height: 1.05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.doc h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.doc p, .doc li { color: var(--ink-soft); }
.doc p { margin: 0 0 1rem; }
.doc ul { margin: 0 0 1rem; padding-left: 1.15rem; }
.doc li { margin-bottom: 0.4rem; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: rgba(28, 25, 21, 0.06);
}

/* Le bloc d'identite de l'editeur, cale comme un tampon sur la page. */
.doc__block {
  margin: 0 0 1rem;
  padding: 1rem 1.5rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
  line-height: 1.7;
  text-wrap: pretty;
}
.doc__block strong { display: block; }

.doc__updated {
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
}

/* ---------- Ecrans etroits ---------- */
@media (max-width: 34rem) {
  .card { aspect-ratio: auto; }
  .card__contact { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .card__contact address { text-align: left; }
  .app { flex-direction: column; }
}

/* ---------- Mouvement reduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .drop, .scroll-hint { animation: none; }
  .card { transition: none; }
  .card__sheen { display: none; }
  .btn { transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Impression : une carte de visite doit s'imprimer ---------- */
@media print {
  body { background: #fff; }
  body::before, body::after, .card__sheen, .scroll-hint { display: none; }
  .card { transform: none; box-shadow: none; border: 1px solid #ccc; }
  .drop { animation: none; }
}
