/* ============================================================
   CoART Creative Labs — style.css
   Single source of truth for layout and visual system
   ============================================================ */

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  --ink:       #15130F;
  --ink-2:     #141413;
  --paper:     #F4F0E8;
  --stone:     #6E6A62;
  --accent:    #B5481E;
  --line:      rgba(10, 10, 10, 0.1);
  --line-dark: rgba(244, 240, 232, 0.14);
  --muted:     rgba(244, 240, 232, 0.55);
  --nav-h:     4.5rem;    /* desktop nav height */
  --nav-h-sm:  3.5rem;    /* mobile nav height  */
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--ink);
  color: var(--paper);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#main { flex: 1 0 auto; }

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Nav ─────────────────────────────────────────────────── */

/*  The header is fixed at top:0 on EVERY page.
    It never shifts. Its height is --nav-h (desktop) / --nav-h-sm (mobile).
    The background bar starts hidden on HOME (slides in on scroll)
    and is immediately visible on INNER pages via data-page="inner".       */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
}

.nav-bar {
  position: relative;
  height: var(--nav-h-sm);
  z-index: 1;
}
@media (min-width: 768px) {
  .nav-bar { height: var(--nav-h); }
}

/* Sliding background bar */
.nav-bar-bg {
  position: absolute;
  inset: 0;
  background: #15130F;
  border-bottom: 1px solid var(--line-dark);
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
  z-index: -1;
}

/* Home: bar slides in on scroll (JS adds .scrolled) */
.site-nav.scrolled .nav-bar-bg { transform: translateY(0); }

/* Inner pages: bar always visible, no animation */
[data-page="inner"] .nav-bar-bg {
  transform: translateY(0) !important;
  transition: none !important;
}

/* Nav underline hover effect */
.nav-link { position: relative; padding-bottom: 2px; }
.nav-link::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--paper); }

/* Letter-wave hover on nav links */
.nav-link {
  white-space: nowrap;
}
.nav-link .ltr {
  display: inline-block;
  transition: transform .2s ease, color .2s ease;
}
.nav-link:hover .ltr {
  animation: letterWave .35s ease forwards;
}
@keyframes letterWave {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-4px); color: var(--accent); }
  100% { transform: translateY(0); color: var(--accent); }
}

/* Mobile menu */
#mobile-menu { display: none; }
#mobile-menu.open { display: block; }

/* ── Full-screen pages (About, Contact) ──────────────────── */
/*  body becomes a flex column that fills the viewport.
    The header is fixed so it sits on top of everything.
    main { flex:1 } grows to fill remaining space.
    To make content visually centered IN THE VISIBLE AREA
    (i.e. below the nav, above the footer) we give main
    padding-top equal to the nav height.                      */

body.fullscreen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.fullscreen #main {
  flex: 1;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h-sm);
  padding-bottom: 0;
}

@media (min-width: 768px) {
  body.fullscreen #main {
    padding-top: var(--nav-h);
  }
}

/* ── Scroll progress bar ─────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 60;
  transition: width .1s linear;
}

/* ── Scroll indicator (hero) ─────────────────────────────── */
.scroll-line {
  width: 1px; height: 44px;
  background: var(--line-dark);
  position: relative; overflow: hidden;
}
.scroll-line span {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 40%;
  background: var(--accent);
  animation: scrollDrop 2.2s ease-in-out infinite;
}
@keyframes scrollDrop {
  0%   { transform: translateY(-100%); }
  50%  { transform: translateY(140%); }
  100% { transform: translateY(-100%); }
}

/* ── Status dot ──────────────────────────────────────────── */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(181,72,30,.4); }
  50%       { opacity: .6; box-shadow: 0 0 0 4px rgba(181,72,30,0); }
}

/* ── Image hover ─────────────────────────────────────────── */
.media-frame { overflow: hidden; }
.media-frame img {
  transition: transform .8s cubic-bezier(.22,1,.36,1), filter .8s ease;
}
.media-frame:hover img { transform: scale(1.04); }

/* ── Hero animation targets ──────────────────────────────── */
.line-mask { display: block; overflow: hidden; }
.line-inner { display: inline-block; will-change: transform; }

.title-letter {
  display: inline-block;
  will-change: transform, filter, opacity;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

/* ── Language switch (EN / FR) ───────────────────────────── */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(244,240,232,0.25);
  border-radius: 3px;
  overflow: hidden;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.lang-switch a {
  padding: 8px 12px;
  color: rgba(244,240,232,0.45);
  transition: color .2s ease, background-color .2s ease;
}
.lang-switch a:not(:last-child) {
  border-right: 1px solid rgba(244,240,232,0.15);
}
.lang-switch a:hover { color: var(--paper); }
.lang-switch a[aria-current="true"] {
  color: var(--accent);
  pointer-events: none;
}

/* ── Ecosystem / people cards ────────────────────────────── */
.person-card {
  border: 1px solid var(--line-dark);
  transition: border-color .35s ease, transform .35s ease;
}
.person-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

/* ── Tag pill ────────────────────────────────────────────── */
.tag {
  display: inline-block;
  border: 1px solid var(--line-dark);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nav-bar-bg { transition: none !important; }
  .nav-link .ltr { animation: none !important; }
  .scroll-line span { animation: none; transform: translateY(60%); }
  .status-dot { animation: none; }
  .line-inner { transform: none !important; }
  .title-letter { opacity: 1 !important; transform: none !important; filter: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Piola credit (footer) ──────────────────────────────── */
.piola-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 14px;
  margin-left: 2px;
  border-left: 1px solid rgba(244, 240, 232, 0.12);
  font-family: 'Piola Bungee', system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: inherit;
  text-decoration: none;
  opacity: .7;
  transition: opacity .2s ease;
}
.piola-credit:hover { opacity: 1; }
.piola-credit svg { width: 22px; height: auto; flex: none; color: #c6ff3d; display: block; }
