/* =====================================================================
   Julien Bourgois — studio web
   Direction « studio suisse » : papier, encre, un seul accent orange.
   1. Tokens  2. Base  3. Layout  4. Components  5. Sections  6. Motion  7. Responsive
   ===================================================================== */

/* 1. Tokens ----------------------------------------------------------- */
:root {
  --paper: #f4f2ee;
  --paper-2: #ebe8e2;
  --surface: #ffffff;
  --ink: #111111;
  --ink-2: #2a2927;
  --muted: #5c5852;
  --line: rgb(17 17 17 / .12);
  --line-strong: rgb(17 17 17 / .28);
  --accent: #ff4d00;           /* decorative + large type only; text stays ink */
  --on-accent: #111111;
  --scrim: rgb(17 17 17 / .7);
  --shadow: 0 30px 60px -30px rgb(17 17 17 / .35);

  --display: "Inter Tight", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-label: .75rem;
  --fs-sm: .9rem;
  --fs-md: 1rem;
  --fs-lg: clamp(1.1rem, 1.5vw, 1.3rem);
  --fs-h3: clamp(1.5rem, 2.4vw, 2rem);
  --fs-h2: clamp(2.6rem, 7vw, 6.5rem);
  --fs-hero: clamp(3.4rem, 11.5vw, 11.5rem);

  --gutter: clamp(16px, 3.2vw, 48px);
  --section: clamp(88px, 12vw, 176px);
  --radius: 4px;
  --header-h: 64px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-fast: .2s;
  --dur-base: .5s;
  --dur-slow: 1.1s;
  --stagger: 70ms;

  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0f0f0e;
  --paper-2: #171716;
  --surface: #1b1b1a;
  --ink: #f4f2ee;
  --ink-2: #dedad3;
  --muted: #a39f98;
  --line: rgb(244 242 238 / .12);
  --line-strong: rgb(244 242 238 / .3);
  --accent: #ff5a14;
  --scrim: rgb(0 0 0 / .8);
  --shadow: 0 30px 60px -30px rgb(0 0 0 / .9);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f0f0e;
    --paper-2: #171716;
    --surface: #1b1b1a;
    --ink: #f4f2ee;
    --ink-2: #dedad3;
    --muted: #a39f98;
    --line: rgb(244 242 238 / .12);
    --line-strong: rgb(244 242 238 / .3);
    --accent: #ff5a14;
    --scrim: rgb(0 0 0 / .8);
    --shadow: 0 30px 60px -30px rgb(0 0 0 / .9);
    color-scheme: dark;
  }
}

/* 2. Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-md)/1.6 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; overflow-x: clip;
  transition: background-color var(--dur-base), color var(--dur-base);
}
img, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; line-height: .92; letter-spacing: -.045em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 30; padding: 8px 14px; background: var(--ink); color: var(--paper); }
.skip-link:focus { top: 12px; }

/* 3. Layout ----------------------------------------------------------- */
.container { width: min(1440px, 100%); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(12px, 2vw, 24px); }
.section { position: relative; padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--line); }

/* 4. Components ------------------------------------------------------- */
.label {
  font: 500 var(--fs-label)/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.dot { color: var(--accent); }

/* Section heading: label in the left columns, giant title on the right */
.section-head { align-items: end; margin-bottom: clamp(48px, 7vw, 112px); }
.section-head .label { grid-column: 1 / span 3; padding-bottom: .9em; }
.section-head h2 { grid-column: 4 / -1; font-size: var(--fs-h2); }
.section-head h2 span { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font: 500 var(--fs-md)/1 var(--sans); text-decoration: none; white-space: nowrap;
  transform: translate(var(--tx, 0), var(--ty, 0));
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: var(--fs-sm); }
.btn .icon { transition: transform var(--dur-base) var(--ease-out); }
.btn:hover .icon { transform: translateX(3px); }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid transparent; background: none; transition: border-color var(--dur-fast);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon { width: 20px; height: 20px; flex: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 500;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat; padding-bottom: 3px;
  transition: background-size var(--dur-base) var(--ease-out), color var(--dur-fast);
}
.link-arrow:hover { background-size: 0 1px; background-position: 100% 100%; }

.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tags li { font-size: var(--fs-sm); color: var(--muted); }
.tags li::before { content: "— "; color: var(--line-strong); }

/* Segmented control (preview device switch) */
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); }
.segmented button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-size: var(--fs-sm); color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur-base);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--header-h); }
.brand { display: inline-flex; align-items: baseline; gap: 2px; font: 600 1.15rem/1 var(--display); letter-spacing: -.03em; text-decoration: none; white-space: nowrap; }
.header-end { display: flex; align-items: center; gap: clamp(8px, 2vw, 28px); }
.nav { display: flex; gap: clamp(16px, 2.2vw, 32px); }
.nav a { position: relative; font-size: var(--fs-sm); text-decoration: none; color: var(--muted); transition: color var(--dur-fast); }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav a[aria-current="true"]::before { content: ""; position: absolute; left: -10px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: var(--accent); }
.scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
  background: var(--accent); transform-origin: left; transform: scaleX(var(--progress, 0));
}
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }

/* 5. Sections --------------------------------------------------------- */

/* Hero */
.hero { padding-block: clamp(32px, 5vw, 64px) clamp(48px, 6vw, 88px); }
.hero-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.hero-meta strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero h1 { margin-top: clamp(40px, 7vw, 104px); font-size: var(--fs-hero); font-weight: 600; letter-spacing: -.06em; line-height: .86; }
.hero h1 .line { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.hero h1 .line > span { display: inline-block; }
.hero h1 .indent { padding-left: 1.1em; }
.hero-bottom { margin-top: clamp(40px, 6vw, 88px); align-items: start; }
.hero-bottom .label { grid-column: 1 / span 3; padding-top: .4em; }
.hero-text { grid-column: 4 / span 6; }
.lead { font-size: var(--fs-lg); line-height: 1.5; color: var(--ink-2); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 36px; }
.hero-bottom .hero-scroll { grid-column: 11 / -1; justify-self: end; align-self: end; display: grid; justify-items: end; gap: 10px; text-decoration: none; }
.hero-scroll span:last-child { display: block; width: 1px; height: 64px; background: var(--line-strong); position: relative; overflow: hidden; }
.hero-scroll span:last-child::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: translateY(-100%); animation: scroll-cue 2.2s var(--ease-in-out) infinite; }

/* Reel: the four sites in a wide band that slides with scroll */
.reel { overflow: hidden; padding-block: clamp(8px, 2vw, 24px) var(--section); }
.reel-track {
  display: flex; gap: clamp(12px, 2vw, 24px); width: max-content; padding-inline: var(--gutter);
  transform: translateX(calc(var(--reel, 0) * -1px));
}
.reel figure { margin: 0; width: clamp(260px, 38vw, 620px); }
.reel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; background: var(--paper-2); }
.reel figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; }

/* Works */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(56px, 7vw, 112px) clamp(16px, 2.4vw, 32px); }
.project:nth-child(even) { margin-top: clamp(0px, 10vw, 160px); }
.project-shot { position: relative; display: block; overflow: hidden; background: var(--paper-2); text-decoration: none; }
.project-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; transform: scale(1.04) translateY(var(--parallax, 0)); transition: transform 1.4s var(--ease-out); }
.project-shot:hover img { transform: scale(1.08) translateY(var(--parallax, 0)); }
.project-shot-label {
  position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-size: var(--fs-sm); font-weight: 500;
}
.project-head { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: baseline; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.project-num { font: 500 var(--fs-sm)/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.project h3 { font-size: var(--fs-h3); letter-spacing: -.035em; line-height: 1.05; }
.project-meta { font-size: var(--fs-sm); color: var(--muted); text-align: right; }
.project-desc { margin-top: 14px; max-width: 52ch; color: var(--ink-2); }
.project .tags { margin-top: 14px; }
.project-actions { margin-top: 20px; }

/* Offers */
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.offer { display: flex; flex-direction: column; gap: 20px; padding: 32px clamp(16px, 2vw, 32px) 40px 0; }
.offer + .offer { padding-left: clamp(16px, 2vw, 32px); border-left: 1px solid var(--line); }
.offer h3 { font-size: var(--fs-h3); }
.offer p:not(.label) { color: var(--ink-2); max-width: 36ch; }
.offer ul { display: grid; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.offer li { display: flex; gap: 10px; font-size: var(--fs-sm); }
.offer li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: .55em; background: var(--accent); }
.offer-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 12px; }
.offer-price { font: 600 1.4rem/1 var(--display); letter-spacing: -.03em; }
.offer-featured { position: relative; }
.offer-featured::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--accent); }
.offer + .offer.offer-featured::before { left: 0; }

/* Method */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); counter-reset: step; }
.step { padding-top: 20px; border-top: 1px solid var(--line-strong); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; margin-bottom: clamp(40px, 6vw, 96px); font: 600 clamp(3rem, 6vw, 5.5rem)/.8 var(--display); letter-spacing: -.06em; color: var(--accent); }
.step h3 { font-size: 1.4rem; letter-spacing: -.03em; }
.step p { margin-top: 12px; color: var(--ink-2); font-size: .97rem; }

/* FAQ */
.faq-wrap { align-items: start; }
.faq-aside { grid-column: 1 / span 3; position: sticky; top: calc(var(--header-h) + 24px); display: grid; justify-items: start; gap: 16px; }
.faq-aside p { color: var(--ink-2); max-width: 26ch; }
.faq { grid-column: 4 / -1; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 0;
  font: 500 clamp(1.15rem, 2vw, 1.6rem)/1.25 var(--display); letter-spacing: -.02em; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat, linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  transition: transform var(--dur-base) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--muted); }
.faq-answer { padding: 0 0 28px; max-width: 64ch; color: var(--ink-2); }
.faq-answer p + p { margin-top: 10px; }

/* Contact */
.contact { padding-bottom: clamp(48px, 6vw, 96px); }
.contact h2 { font-size: var(--fs-hero); letter-spacing: -.06em; line-height: .86; }
.contact-grid { margin-top: clamp(48px, 7vw, 104px); align-items: end; }
.contact-grid .label { grid-column: 1 / span 3; }
.contact-lead { grid-column: 4 / span 4; color: var(--ink-2); font-size: var(--fs-lg); line-height: 1.5; }
.contact-list { grid-column: 8 / -1; display: grid; }
.contact-link {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 22px 0;
  border-top: 1px solid var(--line-strong); text-decoration: none;
  font: 600 clamp(1.3rem, 2.6vw, 2.2rem)/1.1 var(--display); letter-spacing: -.035em;
  transition: color var(--dur-fast), padding var(--dur-base) var(--ease-out);
}
.contact-list li:last-child .contact-link { border-bottom: 1px solid var(--line-strong); }
.contact-link small { display: block; margin-bottom: 6px; font: 500 var(--fs-label)/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-link .icon { width: 28px; height: 28px; transition: transform var(--dur-base) var(--ease-out); }
.contact-link:hover { color: var(--accent); padding-left: 12px; }
.contact-link:hover .icon { transform: rotate(-45deg); }
.contact-link span { overflow-wrap: anywhere; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-block: 24px 32px; font-size: var(--fs-sm); color: var(--muted); }
.footer-inner a { text-decoration: none; }
.footer-inner a:hover { color: var(--ink); }

/* Live preview dialog */
.preview { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); }
.preview::backdrop { background: var(--scrim); }
.preview[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); overflow: hidden; animation: fade-in .3s var(--ease-out); }
.preview-bar { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px var(--gutter); background: var(--paper); border-bottom: 1px solid var(--line); }
.preview-title { flex: 1; min-width: 0; }
.preview-title strong { display: block; font: 600 1.05rem/1.2 var(--display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-title span { display: block; font-size: var(--fs-label); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-nav { display: flex; gap: 4px; }
.preview-stage { position: relative; display: grid; place-items: center; padding: clamp(0px, 2.4vw, 32px); overflow: hidden; }
.preview-frame { position: relative; width: 100%; height: 100%; overflow: hidden; background: #fff; box-shadow: var(--shadow); animation: rise .5s var(--ease-out); transition: width var(--dur-base) var(--ease-in-out), border-radius var(--dur-base); }
.preview[data-device="mobile"] .preview-frame { width: min(390px, 100%); border-radius: 32px; border: 8px solid #111; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-loading { position: absolute; inset: 0; display: grid; place-items: center; gap: 14px; align-content: center; background: var(--paper); color: var(--muted); font-size: var(--fs-sm); transition: opacity var(--dur-base); }
.preview-loading::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.preview.is-loaded .preview-loading { opacity: 0; pointer-events: none; }

/* Cursor follower ("Voir") — fine pointers only */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 15; pointer-events: none;
  display: grid; place-items: center; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: var(--fs-sm); font-weight: 600;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) scale(0);
  transition: transform .4s var(--ease-out);
}
.cursor.is-active { transform: translate3d(var(--x), var(--y), 0) scale(1); }
.has-cursor .project-shot { cursor: none; }
.has-cursor .project-shot-label { opacity: 0; }

/* 404 */
.error-page { padding-block: clamp(80px, 14vw, 180px); }
.error-page h1 { margin-top: 24px; font-size: clamp(3rem, 10vw, 8rem); letter-spacing: -.06em; }
.error-page .lead { margin-top: 24px; }

/* 6. Motion ----------------------------------------------------------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes scroll-cue { 50% { transform: none; } 100% { transform: translateY(100%); } }

/* Everything starts visible; the head script adds .motion, main.js confirms with .is-ready. */
.motion .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); transition-delay: calc(var(--i, 0) * var(--stagger)); }
.motion .reveal.is-visible { opacity: 1; transform: none; }

.motion .hero h1 .line > span { transform: translateY(105%); transition: transform 1.3s var(--ease-out); transition-delay: calc(var(--i, 0) * 110ms + 150ms); }
.motion .hero.is-visible h1 .line > span { transform: none; }
.motion .hero .dot { display: inline-block; transform: scale(0); transition: transform .8s var(--ease-out) 1s; }
.motion .hero.is-visible .dot { transform: none; }

.motion .project-shot { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--ease-out); }
.motion .project.is-visible .project-shot { clip-path: inset(0); }
.motion .project-head { opacity: 0; transition: opacity 1s var(--ease-out) .3s; }
.motion .project.is-visible .project-head { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-delay: 0s !important; }
  .project-shot img { transform: none !important; }
  .reel-track { transform: none; }
  .cursor { display: none; }
}

/* 7. Responsive ------------------------------------------------------- */
@media (max-width: 1100px) {
  .nav { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
}
@media (max-width: 900px) {
  .section-head .label, .section-head h2, .hero-bottom .label, .hero-text, .hero-scroll,
  .faq-aside, .faq, .contact-grid .label, .contact-lead, .contact-list { grid-column: 1 / -1; }
  .section-head h2 { margin-top: 12px; }
  .hero-text { margin-top: 16px; }
  .hero-bottom .hero-scroll { display: none; }
  .works { grid-template-columns: 1fr; }
  .project:nth-child(even) { margin-top: 0; }
  .offers { grid-template-columns: 1fr; }
  .offer, .offer + .offer { padding: 32px 0; border-left: 0; }
  .offer + .offer { border-top: 1px solid var(--line); }
  .faq-aside { position: static; margin-bottom: 32px; }
  .contact-lead { margin-top: 16px; }
  .contact-list { margin-top: 32px; }
}
@media (max-width: 760px) {
  .preview-device { display: none; }
  .preview-bar { gap: 4px; padding-inline: 16px 8px; }
  .preview-open-label { display: none; }
  .preview-bar .btn { width: 44px; padding: 0; border-color: transparent; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .hero h1 .indent { padding-left: 0; }
  .hero-meta span:nth-child(2) { display: none; }
  .project-head { grid-template-columns: auto 1fr; }
  .project-meta { grid-column: 2; text-align: left; }
  .header-end { gap: 6px; }
}
