/* ============================================================
   Jahnavi GKR — shared stylesheet
   Contemplative minimalism. Everything breathes.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #FAF8F5;
  --bg-warm: #F4F0E8;
  --bg-deep: #1C1B19;        /* fond sombre éventuel */
  --ink: #1A1A1A;
  --ink-soft: rgba(26, 26, 26, 0.62);
  --ink-mute: rgba(26, 26, 26, 0.40);
  --ink-faint: rgba(26, 26, 26, 0.22);
  --hair: rgba(26, 26, 26, 0.10);
  --hair-soft: rgba(26, 26, 26, 0.06);

  /* Accent (aged gold by default, swappable via tweaks) */
  --accent: #A89968;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, var(--bg));

  /* Type stacks */
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Rhythm */
  --measure: 64ch;
  --gutter: clamp(20px, 4vw, 56px);
  --page-pad: clamp(24px, 5vw, 72px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.6, 0.1, 1);
  --dur-slow: 900ms;
  --dur-med: 600ms;
  --dur-fast: 280ms;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 350;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* ============================================================
   Type
   ============================================================ */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: 0.005em; }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); font-weight: 400; letter-spacing: 0.02em; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; line-height: 1.08; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(48px, 7vw, 104px); }
h2 { font-size: clamp(34px, 4.4vw, 64px); }
h3 { font-size: clamp(24px, 2.4vw, 34px); }
h4 { font-size: clamp(18px, 1.6vw, 22px); }
p  { margin: 0 0 1em; text-wrap: pretty; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(20px, 1.8vw, 26px);
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-soft);
  font-weight: 400;
}
.body-soft { color: var(--ink-soft); }

/* ============================================================
   Page chrome — header & footer
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--page-pad);
  background: linear-gradient(to bottom, color-mix(in oklab, var(--bg) 92%, transparent), transparent);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.site-header .logotype {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-header nav {
  display: flex;
  gap: clamp(14px, 1.8vw, 36px);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.site-header nav a {
  position: relative;
  padding: 4px 0;
  transition: color var(--dur-fast) var(--ease);
}
.site-header nav a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right var(--dur-med) var(--ease);
}
.site-header nav a:hover { color: var(--ink); }
.site-header nav a:hover::after { right: 0; }
.site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a[aria-current="page"]::after { right: 0; background: var(--accent); }

.site-header.is-inverted { color: #F4F0E8; }
.site-header.is-inverted .site-header nav a,
.site-header.is-inverted nav { color: rgba(244, 240, 232, 0.7); }

.site-footer {
  border-top: 1px solid var(--hair);
  padding: clamp(60px, 8vw, 120px) var(--page-pad) 48px;
  margin-top: clamp(80px, 12vw, 160px);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.site-footer h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  margin-bottom: 24px;
}
.site-footer .newsletter form {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--ink);
  max-width: 380px;
}
.site-footer .newsletter input {
  flex: 1;
  border: 0;
  background: none;
  padding: 10px 0;
  font: inherit;
  color: var(--ink);
  outline: none;
}
.site-footer .newsletter input::placeholder { color: var(--ink-mute); }
.site-footer .newsletter button {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 0 10px 16px;
  transition: color var(--dur-fast) var(--ease);
}
.site-footer .newsletter button:hover { color: var(--accent); }
.site-footer .newsletter button[disabled] { opacity: 0.55; cursor: default; }
.site-footer .newsletter-status {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  min-height: 1.5em;
  max-width: 380px;
}
.site-footer .newsletter-status:empty { margin-top: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.site-footer .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 18px; }
.site-footer a { color: var(--ink-soft); transition: color var(--dur-fast) var(--ease); }
.site-footer a:hover { color: var(--ink); }
.site-footer .colophon {
  margin-top: clamp(60px, 8vw, 100px);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  border-top: 1px solid var(--hair-soft);
  padding-top: 28px;
}

@media (max-width: 800px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .site-header nav { display: none; }
}

/* ============================================================
   Work placeholders — subtle diagonal stripes + caption
   ============================================================ */
.artwork {
  position: relative;
  background: #EFEAE0;
  background-image:
    repeating-linear-gradient(
      135deg,
      transparent 0 14px,
      rgba(26, 26, 26, 0.035) 14px 15px
    );
  overflow: hidden;
  isolation: isolate;
}
.artwork::after {
  /* Légère ombre interne pour donner du grain */
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 110%, rgba(26,26,26,0.08), transparent 60%);
  pointer-events: none;
}
.artwork .artwork-meta {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.45);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.artwork .artwork-title-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 56px 0;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(18px, 1.4vw, 22px);
  color: var(--ink-soft);
  pointer-events: none;
}

/* Real image — fills the placeholder, keeps the declared ratio.
   If the file is missing, onerror removes the <img> and the coloured
   placeholder underneath stays visible. */
.artwork > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.artwork:has(> img) { background-image: none; }
.artwork:has(> img)::after,
.artwork:has(> img) .artwork-title-overlay,
.artwork:has(> img) .artwork-meta { display: none; }

/* Variantes de teintes pour donner du caractère aux placeholders */
.artwork.tone-warm    { background-color: #ECE3D2; }
.artwork.tone-rose    { background-color: #ECDDD6; }
.artwork.tone-sage    { background-color: #DCDDD0; }
.artwork.tone-blue    { background-color: #D6DCE0; }
.artwork.tone-shadow  { background-color: #C8C2B6; }
.artwork.tone-dusk    { background-color: #D9CFC5; }
.artwork.tone-ash     { background-color: #DEDAD2; }
.artwork.tone-ochre   { background-color: #E3D3B0; }
.artwork.tone-bone    { background-color: #EDE7DA; }

/* Ratios */
.ratio-portrait    { aspect-ratio: 4 / 5; }
.ratio-tall        { aspect-ratio: 3 / 4.5; }
.ratio-landscape   { aspect-ratio: 5 / 4; }
.ratio-square      { aspect-ratio: 1 / 1; }
.ratio-wide        { aspect-ratio: 16 / 10; }

/* ============================================================
   Page intro / sections
   ============================================================ */
.page-intro {
  padding: clamp(140px, 18vh, 220px) var(--page-pad) clamp(40px, 6vw, 80px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 120px);
  align-items: end;
  border-bottom: 1px solid var(--hair);
}
.page-intro h1 { font-size: clamp(56px, 8vw, 130px); line-height: 0.96; }
.page-intro .lede { max-width: 42ch; }
@media (max-width: 800px) {
  .page-intro { grid-template-columns: 1fr; }
}

/* Reveal on scroll (intersection-driven) */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Utilities */
.hr { border: 0; border-top: 1px solid var(--hair); margin: 0; }
.link-arrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-faint);
  padding-bottom: 6px;
  transition: gap var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.link-arrow:hover { gap: 20px; border-color: var(--accent); }
.link-arrow::after { content: '→'; font-family: var(--sans); font-size: 14px; }

.btn-quiet {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-faint);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-quiet:hover { color: var(--ink); border-color: var(--ink); }

/* ============================================================
   Custom cursor — discreet dot + thin ring (premium feel)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  body, body * { cursor: none; }
  input, textarea, [contenteditable="true"] { cursor: text; }

  .jgkr-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    will-change: transform;
    transition: opacity 220ms var(--ease);
  }
  .jgkr-cursor.is-ready { opacity: 1; }

  .jgkr-cursor__dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink);
    transition:
      background-color 280ms var(--ease),
      opacity 220ms var(--ease);
  }
  .jgkr-cursor__ring {
    width: 30px;
    height: 30px;
    border: 1px solid var(--ink-faint);
    border-radius: 50%;
    transition:
      width 320ms var(--ease),
      height 320ms var(--ease),
      border-color 280ms var(--ease),
      opacity 220ms var(--ease);
  }

  /* Hover sur éléments interactifs — le cercle s'ouvre légèrement */
  body:has(a:hover, button:hover, [role="button"]:hover, label:hover, .artwork:hover, summary:hover)
    .jgkr-cursor__ring {
    width: 46px;
    height: 46px;
    border-color: var(--accent);
  }
  body:has(a:hover, button:hover, [role="button"]:hover, label:hover, .artwork:hover, summary:hover)
    .jgkr-cursor__dot {
    background: var(--accent);
  }

  /* Clic — contraction brève */
  body.cursor-down .jgkr-cursor__ring { width: 22px; height: 22px; }

  /* Au-dessus d'un champ texte, on laisse l'I-beam natif visible seul */
  body:has(input:hover, textarea:hover, [contenteditable="true"]:hover) .jgkr-cursor {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body { cursor: auto; }
  .jgkr-cursor { display: none !important; }
}
