/* ==========================================================================
   Killian Rigot — site vitrine
   Palette : cyan / vert canard / turquoise
   ========================================================================== */

:root {
  /* Brand */
  --cyan: #22d3ee;
  --turquoise: #2ec4b6;
  --teal: #0f6e73;        /* vert canard */
  --teal-deep: #0a4a4f;
  --teal-light: #3fb8af;

  /* Surfaces (dark first) */
  --bg: #061a1d;
  --bg-alt: #0a2326;
  --surface: #0e2d31;
  --surface-2: #133a3f;
  --border: rgba(46, 196, 182, 0.16);

  /* Text */
  --text: #e6f6f5;
  --text-muted: #9bbfbd;
  --on-primary: #032326;

  --grad: linear-gradient(120deg, var(--cyan) 0%, var(--turquoise) 50%, var(--teal-light) 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --container: 1160px;
  --gutter: 16px;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Sora", var(--font-body);
}

@media (prefers-color-scheme: light) {
  :root {
    --cyan: #0891b2;
    --turquoise: #0f9e93;
    --teal: #0f6e73;
    --teal-light: #13827a;
    --bg: #f5fbfb;
    --bg-alt: #e9f5f4;
    --surface: #ffffff;
    --surface-2: #eef8f7;
    --border: rgba(15, 110, 115, 0.16);
    --text: #0b2a2d;
    --text-muted: #4b6b6d;
    --on-primary: #ffffff;
    --shadow: 0 20px 50px -24px rgba(10, 74, 79, 0.35);
  }
}

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 768px) { :root { --gutter: 32px; } }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--cyan); color: var(--on-primary); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

.eyebrow {
  display: inline-block;
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--turquoise); margin-bottom: .8rem;
}
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 .95rem/1 var(--font-body); cursor: pointer; text-decoration: none;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary { background: var(--grad); color: var(--on-primary); box-shadow: 0 10px 30px -10px rgba(34, 211, 238, .55); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--turquoise); }
.btn-sm { padding: .6rem 1.1rem; font-size: .875rem; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-family: var(--font-head); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad); color: var(--on-primary); font-size: .9rem; font-weight: 700;
}
.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) { color: var(--text-muted); font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--text); text-decoration: none; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem var(--gutter) 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: all .25s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 1rem; }
}

/* Hero ------------------------------------------------------------------ */
.hero { position: relative; padding: clamp(4rem, 12vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem); overflow: hidden; }
.hero-glow {
  position: absolute; inset: -30% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background:
    radial-gradient(circle at 30% 30%, rgba(34, 211, 238, .28), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(15, 110, 115, .45), transparent 60%);
  filter: blur(40px); pointer-events: none;
}
.hero-inner { position: relative; max-width: 900px; margin-left: 0; }
@media (min-width: 1224px) { .hero-inner { margin-left: calc((100vw - var(--container)) / 2); } }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-muted); max-width: 640px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 2rem 0 3rem; }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 720px; }
.hero-facts li { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.hero-facts strong { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--cyan); }
.hero-facts span { font-size: .875rem; color: var(--text-muted); }
@media (max-width: 600px) { .hero-facts { grid-template-columns: 1fr; } }

/* Sections -------------------------------------------------------------- */
.section { padding: clamp(4rem, 9vw, 7rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head p:last-child { color: var(--text-muted); }

/* Apps showroom --------------------------------------------------------- */
.app {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  margin-bottom: clamp(3.5rem, 8vw, 6rem);
}
.app:last-child { margin-bottom: 0; }
.app-reverse .app-visual { order: 2; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .app-reverse .app-visual { order: 0; }
}
.app-kicker { font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
.app h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.app-content > p:not(.app-kicker) { color: var(--text-muted); }
.app-points { margin: 1.25rem 0; display: grid; gap: .55rem; }
.app-points li { position: relative; padding-left: 1.6rem; }
.app-points li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: .7rem; height: .7rem; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
.link-arrow { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--accent); margin-top: 1.25rem; }
.link-arrow::after { content: "→"; transition: transform .2s; }
.link-arrow:hover { text-decoration: none; }
.link-arrow:hover::after { transform: translateX(4px); }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.tags li {
  font-size: .8rem; font-weight: 500; padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
.tags-lg li { font-size: .875rem; padding: .4rem .9rem; }

/* CSS-only app mockups */
.app-visual { position: relative; }
.app-visual::before {
  content: ""; position: absolute; inset: 10% 5%; border-radius: 50%;
  background: var(--accent); opacity: .22; filter: blur(60px);
}
.mock {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.mock img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; transition: transform .6s ease; }
.app:hover .mock img { transform: scale(1.02); }
a.app-visual:hover { text-decoration: none; }
.mock-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.mock-bar i:first-child { background: var(--accent); }
.mock-bar span { margin-left: 10px; font-size: .72rem; color: var(--text-muted); font-family: ui-monospace, monospace; }
/* Services -------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.card {
  padding: 1.75rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: var(--turquoise); }
.card p { color: var(--text-muted); margin: 0; }
.card-icon {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 1.25rem; border-radius: 12px;
  background: color-mix(in srgb, var(--turquoise) 14%, transparent);
}
.card-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--turquoise); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Steps ----------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; counter-reset: s; }
.steps li { position: relative; padding: 1.75rem; border-left: 2px solid var(--border); }
.steps p { color: var(--text-muted); margin: 0; }
.step-n {
  display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 1rem; border-radius: 50%;
  font-family: var(--font-head); font-weight: 700; color: var(--on-primary); background: var(--grad);
}

/* Timeline -------------------------------------------------------------- */
.timeline { position: relative; display: grid; gap: 1.25rem; max-width: 860px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline > li { position: relative; padding: 1.5rem 1.5rem 1.5rem 2.75rem; }
.timeline > li::before {
  content: ""; position: absolute; left: 0; top: 1.85rem; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-alt); border: 3px solid var(--turquoise);
}
.timeline > li:first-child::before { background: var(--grad); border-color: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.tl-date { margin: 0 0 .25rem; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--turquoise); }
.timeline h3 { margin-bottom: .6rem; }
.timeline h3 span { font-weight: 500; color: var(--text-muted); }
.timeline ul { display: grid; gap: .4rem; }
.timeline ul li { position: relative; padding-left: 1.1rem; color: var(--text-muted); }
.timeline ul li::before { content: "–"; position: absolute; left: 0; color: var(--turquoise); }

/* About ----------------------------------------------------------------- */
.about { display: grid; grid-template-columns: 320px 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.about-photo {
  aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center; overflow: hidden;
  background: var(--grad); box-shadow: var(--shadow);
  font: 700 5rem/1 var(--font-head); color: var(--on-primary);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-text p:not(.eyebrow) { color: var(--text-muted); }
.about-text .tags { margin-top: 1.5rem; }
.about-meta { display: grid; gap: .45rem; margin-top: 1.25rem; color: var(--text-muted); font-size: .95rem; }
.about-meta strong { display: inline-block; min-width: 7.5rem; color: var(--text); font-weight: 600; }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about-photo { max-width: 240px; }
}

/* Contact --------------------------------------------------------------- */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }
.contact-intro > p { color: var(--text-muted); }
.contact-links { display: grid; gap: .5rem; margin-top: 1.5rem; }
.contact-links a { font-weight: 600; }

.form { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.field { display: grid; gap: .4rem; }
.field label { font-size: .875rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--turquoise); box-shadow: 0 0 0 3px color-mix(in srgb, var(--turquoise) 25%, transparent);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #f87171; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-size: .925rem; min-height: 1.4em; }
.form-status.ok { color: var(--turquoise); }
.form-status.err { color: #f87171; }

/* Footer ---------------------------------------------------------------- */
.site-footer { padding: 2rem 0; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--text-muted); }

/* Legal page ------------------------------------------------------------ */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal p { color: var(--text-muted); }

/* Reveal on scroll ------------------------------------------------------ */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
