/* ==========================================================================
   sections.css — styles for the added features only
   --------------------------------------------------------------------------
   Nothing here overrides existing rules: every selector below is new.
     1. Ambient background canvas
     2. Founders — floating portraits
     3. Founder CV view
     4. Published websites — cover cards
   Uses the existing brand tokens (--bg / --fg / --line …) so the palette is
   unchanged.
   ========================================================================== */

/* ---------- 1. Ambient background ----------------------------------------- */
/* One slow particle field behind everything. Fixed, never intercepts input. */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ---------- 2. Founders --------------------------------------------------- */
.founders {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(2.5rem, 8vw, 7rem);
}

/* The whole portrait is the button that opens the CV view. */
.founder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem;
  border-radius: var(--r-lg);
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 0.45s var(--ease);
}
.founder:hover { transform: translateY(-6px); }
.founder:focus-visible { outline: 2px solid var(--fg); outline-offset: 6px; }

/* Portrait: circular, thin ring, gentle idle float. */
.founder__frame {
  position: relative;
  width: clamp(150px, 22vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  animation: founder-float var(--float-dur, 8s) ease-in-out var(--float-delay, 0s)
             infinite alternate;
  transition: border-color 0.4s var(--ease);
  will-change: transform;
}
.founder:hover .founder__frame { border-color: var(--line-strong); }

@keyframes founder-float {
  from { transform: translateY(-7px); }
  to   { transform: translateY(7px); }
}

.founder__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Monogram shown until a real photo file exists at the configured path. */
.founder__frame.is-missing .founder__img { display: none; }
.founder__monogram {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: clamp(2.75rem, 7vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-muted);
}
.founder__frame.is-missing .founder__monogram { display: grid; }

.founder__name {
  display: block;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.founder__role {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.founder__cue {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  transition: color 0.3s var(--ease);
}
.founder:hover .founder__cue { color: var(--fg); }
.founder__cue svg { width: 14px; height: 14px; }

/* ---------- 3. Founder CV view -------------------------------------------- */
.cv {
  position: fixed;
  inset: 0;
  z-index: 140;              /* above the header, below the intro cover */
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.98);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease),
              visibility 0s linear 0.5s;
}
.cv.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease),
              visibility 0s;
}

.cv__inner {
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(4rem, 8vw, 6rem);
}

.cv__back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.cv__back:hover, .cv__back:focus-visible {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--accent-ink);
}
.cv__back svg { width: 15px; height: 15px; }

.cv__head {
  margin-top: clamp(2rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 4rem);
}

.cv__portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}
.cv__portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv__portrait.is-missing img { display: none; }
.cv__portrait .founder__monogram { font-size: clamp(3.5rem, 9vw, 6rem); }
.cv__portrait.is-missing .founder__monogram { display: grid; }

.cv__name {
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.cv__role {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.cv__intro {
  margin-top: 1.5rem;
  max-width: 46ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--fg-muted);
}

.cv__body {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.cv__block {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.cv__block-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 1.1rem;
}
.cv__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cv__tag {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
}
.cv__list { display: grid; gap: 0.6rem; }
.cv__list li { color: var(--fg-muted); font-size: 0.95rem; }

.cv__projects { display: grid; gap: 0.6rem; }
.cv__project {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--fg-muted);
  transition: color 0.3s var(--ease);
}
.cv__project:hover, .cv__project:focus-visible { color: var(--fg); }
.cv__project svg { width: 13px; height: 13px; flex: none; }

/* ---------- 4. Published websites — cover cards --------------------------- */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.cover {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform 0.45s var(--ease), border-color 0.4s var(--ease),
              background-color 0.4s var(--ease);
}
.cover:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  background: var(--bg-soft);
}

.cover__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}
.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease);
}
.cover:hover .cover__img { transform: scale(1.04); }

/* Domain plate shown until a real cover file exists at the configured path. */
.cover__media.is-missing .cover__img { display: none; }
.cover__fallback {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-faint);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
}
.cover__media.is-missing .cover__fallback { display: grid; }

.cover__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: clamp(1.1rem, 2vw, 1.5rem);
}
.cover__name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.cover__domain {
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}
.cover__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.cover__link:hover, .cover__link:focus-visible {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--accent-ink);
}
.cover__link svg { width: 14px; height: 14px; }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 760px) {
  .cv__head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cv__portrait { max-width: 220px; }
  .cv__intro { margin-inline: auto; }
  .cv__tags { justify-content: center; }
  .cv__block { text-align: center; }
  .cv__projects { justify-items: center; }
}

@media (max-width: 560px) {
  .founders { gap: 3rem; }
  .cover__body { flex-direction: column; align-items: flex-start; }
  .cover__link { width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .founder__frame { animation: none !important; }
  .founder, .cover, .cover__img { transition: none !important; }
  .cv { transition: opacity 0.15s linear, visibility 0s !important; transform: none !important; }
}
