/* ═══════════════════════════════════════════════════════════════════
   base.css — réplique de la production origami-corp.com
   Source : index.DjkKS0fz.css, servie par https://origami-corp.com le 2026-08-25.
   Repris tel quel : tokens, grille bento, plaques, cartouches, canvas de
   grille, rail sol-track, char-reveal, id-sketch, footer, reduced-motion.
   Deux dérogations, toutes deux décidées par Tomy :
     1. .card-services passe de la plaque noire au Liquid Glass (voir app.css) ;
     2. les vues sont empilées en absolu pour permettre un morph spatial
        mesurable sans reload — la géométrie de l'accueil reste identique.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --bg: #fbfbfd;
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-muted: #86868b;
  --text-tertiary: #aeaeb2;
  --accent: #0071e3;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, .04);
  --card-border-hover: rgba(0, 0, 0, .07);
  --card-shadow: 0 0 0 .5px rgba(0,0,0,.04), 0 2px 4px rgba(0,0,0,.02), 0 12px 32px rgba(0,0,0,.06), 0 24px 48px rgba(0,0,0,.03);
  --card-shadow-hover: 0 0 0 .5px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.05), 0 16px 48px rgba(0,0,0,.1), 0 32px 64px rgba(0,0,0,.05);
  --tint-blue: rgba(0, 113, 227, .03);
  --tint-amber: rgba(255, 159, 10, .025);
  --radius-card: 16px;
  --ease-apple: cubic-bezier(.25, .1, .25, 1);
  --ease-out-soft: cubic-bezier(.23, 1, .32, 1);
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *:before, *:after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: clip;
}
::selection { background: rgba(0,113,227,.15); color: var(--text) }

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

/* ─── Fond blueprint (production) ─── */
.page-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none }
.grid-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, black 40%, transparent 100%);
}
.page-bg:after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 18% 0%, var(--tint-blue), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% 8%, var(--tint-amber), transparent 70%);
}

/* ─── Vues empilées : la vue cachée garde sa mise en page, donc reste
       mesurable. C'est ce qui permet un FLIP sans reload et sans saut. ─── */
#stage { position: relative; z-index: 1; min-height: 100dvh }
.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.view[data-state="hidden"] { visibility: hidden; pointer-events: none }

.wrap {
  position: relative; z-index: 1;
  max-width: 1500px; margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 48px);
}

/* ─── Bento production ─── */
.bento {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  padding-top: clamp(72px, 11vh, 104px); padding-bottom: 24px;
}
@media (min-width: 640px) {
  .bento { grid-template-columns: repeat(2, 1fr) }
  .card-identity, .card-conseil, .card-services { grid-column: span 2 }
}
@media (min-width: 960px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, clamp(220px, 18vw, 276px));
    gap: clamp(16px, 1.4vw, 24px);
  }
  .card-identity { grid-column: 1 / 3; grid-row: 1 / 3 }
  .card-conseil  { grid-column: 3 / 5; grid-row: 1 }
  .card-services { grid-column: 3 / 5; grid-row: 2 }
}

.card {
  position: relative; overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  box-shadow: var(--card-shadow);
  padding: 24px; min-height: 168px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
  transition: transform .3s var(--ease-apple), box-shadow .3s var(--ease-apple), border-color .3s var(--ease-apple);
}
@media (hover: hover) {
  .card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); border-color: var(--card-border-hover) }
}
.card-title { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -.01em; color: var(--text) }
.card-desc  { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--text-muted) }

/* ─── Rail d'icônes Microsoft (production) ─── */
.sol-strip {
  position: relative; z-index: 2; overflow: hidden;
  margin-top: 8px; padding: 6px 0 20px; margin-bottom: -12px;
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}
.sol-track {
  display: flex; align-items: center; gap: 14px; width: max-content;
  animation: sol-slide 20s linear infinite;
}
@keyframes sol-slide { from { transform: translate3d(0,0,0) } to { transform: translate3d(-33.333%,0,0) } }
.sol-icon {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 3%, transparent);
  box-shadow: 0 0 8px color-mix(in srgb, var(--c) 12%, transparent) inset, 0 16px 12px -8px rgba(0,0,0,.15);
}
.sol-icon img { width: 26px; height: 26px; object-fit: contain }
.sol-icon.bounce { animation: sol-bounce .8s ease }
@keyframes sol-bounce { 0%, to { transform: translateY(0) scale(1) } 50% { transform: translateY(-5px) scale(1.15) } }

.card-copy { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 6px }
.ascii-bg { position: absolute; inset: 0; z-index: 1; pointer-events: none }

.tw-char { display: inline-block }
.tw-cursor { display: inline-block; width: 3px; height: .85em; margin-left: 2px; border-radius: 2px; background: currentColor; vertical-align: text-bottom; opacity: .4; animation: cursor-pulse 1.1s step-end infinite }
@keyframes cursor-pulse { 0%, to { opacity: .4 } 50% { opacity: 0 } }

/* ─── PL.01 Identity ─── */
.card-identity { justify-content: center; min-height: 400px; gap: 0 }
.card-identity:after {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius-card);
  opacity: .45; transition: opacity .6s var(--ease-apple); pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px),
    linear-gradient(rgba(0,0,0,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.02) 1px, transparent 1px);
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 20%, transparent 75%);
}
@media (hover: hover) { .card-identity:hover:after { opacity: 1 } }

.id-figure {
  position: relative; z-index: 2; width: clamp(170px, 46%, 230px); aspect-ratio: 1;
  margin: 6px auto 0; display: flex; align-items: center; justify-content: center;
}
.construction { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(0,0,0,.14); stroke-width: 1 }
.construction circle { stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw-circle 1.1s var(--ease-apple) .95s forwards }
.construction .c-dash {
  stroke-dasharray: 3 6; stroke-dashoffset: 0; opacity: 0;
  transform-box: fill-box; transform-origin: center;
  animation: line-in .6s ease 1.7s forwards, compass-rot 90s linear 1.7s infinite;
}
@keyframes compass-rot { to { transform: rotate(-360deg) } }
.construction .c-axis { stroke: rgba(0,0,0,.07); stroke-dasharray: 5 7; opacity: 0; animation: line-in .6s ease 1.85s forwards }
.id-spin {
  position: relative; width: 88%; display: flex; align-items: center; justify-content: center;
  animation: id-rot 36s linear 2.4s infinite; will-change: transform;
}
@keyframes id-rot { to { transform: rotate(360deg) } }
@keyframes draw-circle { to { stroke-dashoffset: 0 } }
.construction line { opacity: 0; animation: line-in .4s ease 1.9s forwards }
@keyframes line-in { to { opacity: 1 } }
.id-sketch { position: relative; width: 100%; height: auto; clip-path: inset(0 100% 0 0); animation: sketch-in .9s var(--ease-apple) 1.05s forwards }
@keyframes sketch-in { to { clip-path: inset(0 0 0 0) } }
.id-cote { position: relative; z-index: 2; display: block; width: 150px; height: 12px; margin: 4px auto 0; overflow: visible; stroke: #c2c2c6; stroke-width: 1 }
.id-cote text { fill: #aeaeb2; stroke: none; font-family: var(--font-mono); font-size: 8px; letter-spacing: .5px }

.id-title {
  position: relative; z-index: 2; margin: 10px 0 0; text-align: center;
  font-size: clamp(1.75rem, 6vw, 2.75rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.05;
}
.id-title .word { display: inline-block; white-space: nowrap }
.id-title .char { display: inline-block }
.id-sub { position: relative; z-index: 2; margin: 10px auto 0; text-align: center; font-size: .9375rem; line-height: 1.5; color: var(--text-secondary); max-width: 34ch; text-wrap: balance }
.id-place { position: relative; z-index: 2; margin: 4px 0 0; text-align: center; font-size: .8125rem; color: var(--text-tertiary) }

/* ─── Cartouches ─── */
.plate { position: absolute; inset: 10px; pointer-events: none; z-index: 3 }
.plate:before, .plate:after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--plate-mark, rgba(0,0,0,.18)); border-style: solid;
}
.plate:before { top: 0; left: 0; border-width: 1px 0 0 1px }
.plate:after  { bottom: 0; right: 0; border-width: 0 1px 1px 0 }
.plate-label {
  position: absolute; top: 13px; right: 16px; z-index: 3; pointer-events: none;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .6px;
  text-transform: uppercase; color: #aeaeb2;
}
.card-conseil:after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 56px; height: 56px; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(0,0,0,.05) 0, rgba(0,0,0,.05) 1px, transparent 1px, transparent 7px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  border-radius: 0 0 var(--radius-card) 0;
}

/* ─── EN/FR + footer ─── */
.lang-selector {
  position: absolute; top: 20px; right: clamp(20px, 5vw, 48px); z-index: 5;
  display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; letter-spacing: .5px;
}
.lang-selector a { color: var(--text-muted); text-decoration: none; padding: 4px 6px; border-radius: 4px; opacity: .6; transition: color .3s, opacity .3s }
@media (hover: hover) { .lang-selector a:hover { opacity: 1 } }
.lang-selector a.active { opacity: 1; color: var(--accent) }
.lang-separator { color: var(--text-muted); opacity: .3; font-weight: 300 }

.footer { padding: 40px 0 48px; text-align: center; display: flex; flex-direction: column; gap: 4px }
.footer p { margin: 0; font-size: .8125rem; color: var(--text-muted) }
.footer .footer-note { color: var(--text-tertiary) }

/* ─── Entrées production ─── */
@keyframes char-in { 0% { opacity: 0; filter: blur(10px); transform: translateY(15px) } to { opacity: 1; filter: blur(0); transform: translateY(0) } }
.id-title .char { opacity: 0; animation: char-in .5s var(--ease-apple) both; animation-delay: calc(.75s + var(--i) * 35ms) }
@keyframes fade-up { 0% { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }
.reveal { opacity: 0; animation: fade-up .5s var(--ease-apple) both; animation-delay: var(--d, .6s) }
@keyframes card-in { 0% { opacity: 0; transform: translate(var(--dx,0), var(--dy,24px)) scale(.97) } to { opacity: 1; transform: translate(0) scale(1) } }
.card { opacity: 0; animation: card-in .7s var(--ease-out-soft) both; animation-delay: calc(.55s + var(--i, 0) * .06s) }

/* Une fois le voyage commencé, l'animation d'entrée ne doit plus reprendre
   la main sur le transform piloté par les springs. */
.card.motion-owned { animation: none !important; opacity: 1 }

@media (prefers-reduced-motion: reduce) {
  .id-title .char, .reveal, .card, .tw-cursor, .id-sketch,
  .construction circle, .construction line {
    animation: none; opacity: 1; filter: none; transform: none; transition: none;
  }
  .construction circle { stroke-dashoffset: 0 }
  .id-sketch { clip-path: none }
  .id-spin, .construction .c-dash, .construction .c-axis, .sol-track, .sol-icon {
    animation: none; opacity: 1; transform: none;
  }
  .tw-char { display: inline-block }
  .card:hover, .card-identity:hover { transform: none }
  .card-identity:after { transition: none }
}
