/*
Theme Name: Approx Cosmos
Theme URI: https://approx.vc/
Author: Built for Approx.VC
Author URI: https://approx.vc/
Description: A two-screen scrolling theme for a venture fund. Screen one is an About statement; screen two is a portfolio catalogue with linked company logos and descriptions. Near-black canvas, white type, a live deep-space starfield behind everything. Portfolio companies are managed as a custom post type; About copy and section headings are edited in the Customizer.
Version: 1.6.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: approx-cosmos
*/

/* ---------------------------------------------------------------------------
   Design tokens
   Palette: deep space is never pure black — the void carries a faint blue.
   --------------------------------------------------------------------------- */
:root {
  --void:        #05060a;   /* near-black base, faintly blue */
  --void-2:      #090b13;   /* raised surfaces */
  --ink:         #ffffff;   /* primary type (per brief) */
  --muted:       rgba(255,255,255,0.60);
  --faint:       rgba(255,255,255,0.13); /* hairlines */
  --fainter:     rgba(255,255,255,0.05); /* logo plate */
  --nebula:      #6b5cff;   /* violet bloom, background only */
  --nebula-2:    #14315e;   /* cold blue bloom */
  --ion:         #8fe3ff;   /* cold star-glow, links/hover, used sparingly */

  --measure: 68ch;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --maxw: 1200px;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ---------------------------------------------------------------------------
   Reset / base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.075rem);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------------------
   Scroll behaviour — two full screens, gentle snapping
   --------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
  scroll-padding-top: 0;
}

/* ---------------------------------------------------------------------------
   Deep-space background — fixed behind all content (z-index below 0)
   Nebula is pure CSS so it renders with no JS; the canvas adds live stars.
   --------------------------------------------------------------------------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 900px at 78% 18%, rgba(107,92,255,0.16), transparent 60%),
    radial-gradient(1000px 800px at 12% 82%, rgba(20,49,94,0.42), transparent 62%),
    radial-gradient(700px 700px at 50% 50%, rgba(143,227,255,0.05), transparent 60%),
    var(--void);
  background-size: cover;
  background-position: center;
}
.starfield::after { /* subtle vignette so type always holds */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
#stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------------------------------------------------------------------------
   Shared layout
   --------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.screen {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  scroll-snap-align: start;
  padding-block: clamp(6rem, 14vh, 10rem);
}

/* ---------------------------------------------------------------------------
   Fixed masthead — quiet wordmark + two anchors
   --------------------------------------------------------------------------- */
.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(1rem, 2.4vh, 1.6rem) var(--gutter);
  mix-blend-mode: normal;
}
.masthead__brand {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}
.masthead__brand .dot { color: var(--ion); }
.masthead__nav { display: flex; gap: clamp(1rem, 3vw, 2.2rem); }
.masthead__nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.masthead__nav a:hover,
.masthead__nav a:focus-visible { color: var(--ink); border-color: var(--faint); }

/* ---------------------------------------------------------------------------
   Screen 1 — About
   --------------------------------------------------------------------------- */
/* About shares the same .wrap container as the portfolio, so their
   left/right edges align. Only the inner text measures are tuned below. */
.about__inner .eyebrow { margin-bottom: clamp(1.5rem, 4vh, 2.5rem); }
.about__statement {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.6rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  max-width: none;
  margin: 0 0 clamp(1.6rem, 4vh, 2.6rem);
  text-wrap: balance;
}
.about__body {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.22rem);
  line-height: 1.62;
  color: var(--muted);
  max-width: 62ch;
}
.about__body p { margin: 0 0 1em; }
.about__body p:last-child { margin-bottom: 0; }

.scrollcue {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: clamp(2.4rem, 6vh, 4rem);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s ease;
}
.scrollcue:hover, .scrollcue:focus-visible { color: var(--ink); }
.scrollcue .arrow { display: inline-block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

/* ---------------------------------------------------------------------------
   Screen 2 — Portfolio catalogue
   --------------------------------------------------------------------------- */
.screen--portfolio { align-items: flex-start; }
.section-head { margin-bottom: clamp(2.5rem, 7vh, 4.5rem); }
.section-head .eyebrow { margin-bottom: 0.9rem; }
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
}

/* theme filter bar */
.pf-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 5vh, 3rem);
}
.pf-filter__btn {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}
.pf-filter__btn:hover,
.pf-filter__btn:focus-visible { color: var(--ink); border-color: rgba(255,255,255,0.32); }
.pf-filter__btn.is-active { color: var(--void); background: var(--ink); border-color: var(--ink); }

.pf-row.is-hidden { display: none; }

.pf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: clamp(1.5rem, 3vw, 3rem);
  row-gap: clamp(2rem, 4vh, 3.25rem);
}

/* each company is a vertical card: logo on top, text beneath */
.pf-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 1.75rem;
  border-top: 1px solid var(--faint);
}

/* logo cell — no frame; the logo sits directly on the void */
.pf-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 84px;
  margin-bottom: 1.4rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.pf-logo:hover, .pf-logo:focus-visible {
  transform: translateY(-3px);
  opacity: 0.88;
}
.pf-logo img { max-height: 72px; max-width: 100%; width: auto; object-fit: contain; }
/* text fallback when a company has no logo image yet */
.pf-logo__word {
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--ink);
}

.pf-info { min-width: 0; }
.pf-stage {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ion);
  margin: 0 0 0.7rem;
}
.pf-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 1.15rem + 0.6vw, 1.7rem);
  line-height: 1.1;
  margin: 0 0 0.6rem;
}
.pf-name a { transition: color 0.25s ease; }
.pf-name a:hover, .pf-name a:focus-visible { color: var(--ion); }
.pf-desc { color: var(--muted); }
.pf-desc p { margin: 0 0 0.7em; }
.pf-desc p:last-child { margin-bottom: 0; }
.pf-themes {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}
.pf-themes li {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--faint);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}
.pf-visit {
  display: inline-block;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--faint);
  padding-bottom: 2px;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.pf-visit:hover, .pf-visit:focus-visible { color: var(--ion); border-color: rgba(143,227,255,0.5); }

/* empty state (shown to admins before any company is added) */
.pf-empty {
  border: 1px dashed var(--faint);
  border-radius: 14px;
  padding: 2.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
}
.pf-empty a { color: var(--ion); }

/* ---------------------------------------------------------------------------
   Screen 3 — Collective (bios with links)
   --------------------------------------------------------------------------- */
.screen--collective { align-items: flex-start; }
.collective__body {
  font-family: var(--sans);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.22rem);
  line-height: 1.66;
  color: var(--muted);
  max-width: 72ch;
}
.collective__body p { margin: 0 0 1.1em; }
.collective__body p:last-child { margin-bottom: 0; }
.collective__body a {
  color: var(--ink);
  border-bottom: 1px solid var(--faint);
  transition: color 0.25s ease, border-color 0.25s ease;
}
.collective__body a:hover,
.collective__body a:focus-visible { color: var(--ion); border-color: rgba(143,227,255,0.5); }
.collective__body strong { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-foot {
  padding: 2.5rem var(--gutter) 3rem;
  border-top: 1px solid var(--faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Accessibility
   --------------------------------------------------------------------------- */
:focus-visible { outline: 2px solid var(--ion); outline-offset: 3px; border-radius: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--void);
  padding: 0.6rem 1rem; z-index: 100; font-family: var(--mono); font-size: 0.8rem;
}
.skip-link:focus { left: 0; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Responsive — grid steps 3 -> 2 -> 1
   --------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .pf-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .pf-list { grid-template-columns: 1fr; }
  .pf-logo { height: 96px; }
  .pf-logo img { max-height: 84px; }
  .masthead__brand { font-size: 0.72rem; }
}

/* ---------------------------------------------------------------------------
   Reduced motion — hold the stars still, drop the bob
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scrollcue .arrow { animation: none; }
  * { transition-duration: 0.001ms !important; }
}
