/* paimos.com - phase 1 - monochrome editorial-terminal */

:root {
  color-scheme: dark light;
  --bg: #0A0A0A;
  --bg-alt: #121110;
  --fg: #EDEAE0;
  --fg-muted: #8A8780;
  --fg-dim: #5A5852;
  --rule: #26241F;
  --noise-opacity: 0.035;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F3EFE4;
    --bg-alt: #EAE5D6;
    --fg: #17140F;
    --fg-muted: #6B6862;
    --fg-dim: #9C9890;
    --rule: #D5CFBD;
    --noise-opacity: 0.055;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-feature-settings: "ss01", "ss02", "cv11";
}

/* fine grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

::selection { background: var(--fg); color: var(--bg); }

a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: opacity .15s ease; }
a:hover { opacity: 0.65; }

.mono {
  font-family: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-feature-settings: "zero", "ss02";
  letter-spacing: -0.005em;
}

/* ─── meta strip (top) ─────────────────────────────────────────── */
.meta {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  backdrop-filter: saturate(180%);
}
.meta .sep { color: var(--fg-dim); }
.meta .dot { width: 6px; height: 6px; border-radius: 50%; background: #7ABA5E; display: inline-block; margin-right: 0.45rem; box-shadow: 0 0 0 2px color-mix(in srgb, #7ABA5E 25%, transparent); animation: pulse 2.2s ease-in-out infinite; }
.meta .right { margin-left: auto; }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ─── layout ───────────────────────────────────────────────────── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.75rem; }

/* ─── hero ─────────────────────────────────────────────────────── */
.hero {
  padding: 6rem 0 5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}

.hero .mark-wrap {
  width: 100%;
  max-width: 860px;
  opacity: 0;
  animation: markRise 0.9s cubic-bezier(.2,.7,.1,1) 0.05s forwards;
}
.hero svg.mark {
  display: block;
  width: 100%;
  height: auto;
  color: var(--fg);
  overflow: visible;
}

/* stem emergence: both stems start overlapping the P, slide to target
   x while fading in from 0 to their target opacity. easeOutQuint. */
.hero svg.mark .stem {
  opacity: 0;
  animation-duration: 1.1s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-fill-mode: forwards;
  animation-delay: 0.35s;
}
.hero svg.mark .stem-1 { animation-name: stem1In; }
.hero svg.mark .stem-2 { animation-name: stem2In; animation-delay: 0.22s; }

@keyframes stem1In {
  from { x: 63; opacity: 0; }
  to   { x: 0;  opacity: 0.4; }
}
@keyframes stem2In {
  from { x: 63; opacity: 0; }
  to   { x: 34; opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .hero svg.mark .stem-1 { animation: none; opacity: 0.4; }
  .hero svg.mark .stem-2 { animation: none; opacity: 0.7; }
}

.hero .claim {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}
.hero h1 {
  font-family: "Geist", sans-serif;
  font-weight: 300;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  max-width: 34ch;
  color: var(--fg);
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(.2,.7,.1,1) 0.35s forwards;
}
.hero h1 em {
  font-style: normal;
  color: inherit;
  font-weight: inherit;
}
.hero .tail {
  color: inherit;
  font-weight: inherit;
}
.hero .tail-sep {
  color: var(--fg-dim);
  margin: 0 0.1em 0 0.05em;
}

/* ─── rotator (hero word cycle) ────────────────────────────────── */
.rotator {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--fg);
  white-space: nowrap;
  transition: width 1.2s cubic-bezier(.2,.7,.1,1);
  /* width set by JS from per-word measurements */
}
/* zero-width space establishes inline baseline for an otherwise abs-only box */
.rotator::before {
  content: "\200B";
  display: inline;
}
.rotator .word {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  pointer-events: none;
  font: inherit;
  line-height: inherit;
}
.rotator .word .ltr {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  /* transitions set by JS per phase */
}
.hero .serial {
  font-size: 11px;
  color: var(--fg-dim);
  text-align: right;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(.2,.7,.1,1) 0.55s forwards;
}

@keyframes markRise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── sections ─────────────────────────────────────────────────── */
section { padding: 4.5rem 0; border-bottom: 1px solid var(--rule); }

.section-head {
  display: grid;
  grid-template-columns: 14ch 1fr;
  gap: 2rem;
  margin-bottom: 2.25rem;
}
.section-head .label {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.4rem;
}
.section-head h2 {
  font-family: "Geist", sans-serif;
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 32ch;
}

.prose {
  display: grid;
  grid-template-columns: 14ch 1fr;
  gap: 2rem;
  margin-top: 1rem;
}
.prose > :first-child { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.35rem; }
.prose p { max-width: 62ch; color: var(--fg); font-size: 17px; line-height: 1.62; }
.prose p + p { margin-top: 1rem; }
.prose strong { font-weight: 500; }

/* ─── audiences split ──────────────────────────────────────────── */
.audiences {
  display: grid;
  grid-template-columns: 14ch 1fr 1fr;
  gap: 2rem;
  margin-top: 1rem;
}
.audiences > .label { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.35rem; }
.audience {
  border-left: 1px solid var(--rule);
  padding: 0.25rem 0 0.25rem 1.5rem;
}
.audience h3 {
  font-family: "Geist Mono", monospace;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 0.9rem;
}
.audience h3 .num { color: var(--fg-dim); margin-right: 0.55rem; }
.audience p { font-size: 15px; line-height: 1.6; color: var(--fg); max-width: 36ch; }
.audience p + p { margin-top: 0.75rem; color: var(--fg-muted); font-size: 14px; }

/* ─── badges / specs ───────────────────────────────────────────── */
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(182px, 1fr));
  gap: 0.55rem;
  margin-top: 1rem;
}

.badge {
  display: block;
  padding: 0.75rem 0.9rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  color: inherit;
  text-decoration: none;
  position: relative;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.25s cubic-bezier(.2,.7,.1,1), box-shadow 0.3s ease;
  overflow: hidden;
  isolation: isolate;
}

/* left rail (hairline) appears on hover */
.badge::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.4s cubic-bezier(.2,.7,.1,1);
  z-index: 1;
}
.badge:hover::before { transform: scaleY(1); }

/* diagonal corner tick (top-right) */
.badge::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--fg-dim);
  border-right: 1px solid var(--fg-dim);
  opacity: 0;
  transform: translate(4px, -4px);
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.badge:hover::after {
  opacity: 1;
  transform: translate(0, 0);
  border-color: var(--fg);
}

.badge-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.badge svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--fg-muted);
  transition: color 0.3s ease, transform 0.45s cubic-bezier(.2,.7,.1,1);
}

.badge:hover svg {
  color: var(--fg);
  transform: rotate(-6deg) scale(1.12);
}

.badge-label {
  font-family: "Geist", sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.002em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* underline rule - short at rest, shimmering full-width on hover */
.badge-rule {
  display: block;
  height: 1px;
  width: 18px;
  margin-top: 0.55rem;
  background: linear-gradient(90deg, var(--fg) 0%, transparent 100%);
  transition: width 0.55s cubic-bezier(.2,.7,.1,1), background 0.4s ease;
  position: relative;
}

.badge:hover .badge-rule {
  width: calc(100% - 0.15rem);
  background: linear-gradient(90deg,
    var(--fg) 0%,
    var(--fg-muted) 35%,
    var(--fg) 50%,
    var(--fg-muted) 65%,
    var(--fg) 100%);
  background-size: 220% 100%;
  animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

/* auto-height reveal using grid 0fr → 1fr */
.badge-desc-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(.2,.7,.1,1);
}

.badge-desc-wrap > .badge-desc {
  overflow: hidden;
  min-height: 0;
  display: block;
  font-family: "Geist", sans-serif;
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: 0.003em;
  color: var(--fg-muted);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.35s ease, transform 0.35s ease, padding-top 0.35s ease;
  padding-top: 0;
}

.badge:hover .badge-desc-wrap { grid-template-rows: 1fr; }
.badge:hover .badge-desc {
  opacity: 1;
  transform: translateY(0);
  padding-top: 0.5rem;
  transition-delay: 0.08s;
}

.badge:hover {
  border-color: var(--fg-muted);
  background: color-mix(in srgb, var(--bg-alt), var(--fg) 3.5%);
  transform: translateY(-1px);
  box-shadow: 0 2px 0 -1px color-mix(in srgb, var(--fg) 10%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .badge, .badge *, .badge::before, .badge::after { transition: none !important; animation: none !important; }
  .badge:hover .badge-desc-wrap { grid-template-rows: 1fr; }
  .badge:hover .badge-desc { opacity: 1; transform: none; padding-top: 0.5rem; }
}

/* ─── status block ─────────────────────────────────────────────── */
.status {
  display: grid;
  grid-template-columns: 14ch 1fr;
  gap: 2rem;
}
.status .label { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.35rem; }
.status-body {
  border: 1px solid var(--rule);
  padding: 1.5rem 1.75rem;
  background: var(--bg-alt);
  position: relative;
}
.status-body::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 10px; height: 10px;
  border-top: 1px solid var(--fg);
  border-left: 1px solid var(--fg);
}
.status-body::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-bottom: 1px solid var(--fg);
  border-right: 1px solid var(--fg);
}
.status-phase { font-family: "Geist Mono", monospace; font-size: 12px; color: var(--fg-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 0.75rem; }
.status-phase .tag { display: inline-block; padding: 2px 7px; border: 1px solid var(--rule); margin-right: 0.5rem; color: var(--fg); }
.status h3 { font-family: "Geist", sans-serif; font-weight: 400; font-size: 19px; line-height: 1.4; color: var(--fg); max-width: 50ch; letter-spacing: -0.01em; }
.status-blurb { margin-top: 1rem; font-size: 14px; line-height: 1.6; color: var(--fg-muted); max-width: 54ch; }
.status-blurb a { color: var(--fg); text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ─── ascii block ──────────────────────────────────────────────── */
.ascii {
  font-family: "Geist Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--fg-muted);
  white-space: pre;
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--bg-alt);
  margin: 1.5rem 0;
}

/* ─── footer ───────────────────────────────────────────────────── */
footer {
  padding: 6rem 0 8rem;
  color: var(--fg-muted);
  font-size: 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
}
footer .footer-mark {
  display: block;
  line-height: 0;
  color: var(--fg-muted);
  transition: color 0.3s ease;
  text-decoration: none;
}
footer .footer-mark:hover { color: var(--fg); opacity: 1; }
footer .footer-mark svg {
  display: block;
  width: 78px;
  height: auto;
  overflow: visible;
}
footer .footer-links {
  display: flex;
  gap: 0.85rem;
  justify-self: center;
  align-items: baseline;
  font-size: 13px;
}
footer .footer-links a {
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.002em;
  transition: color 0.2s ease;
}
footer .footer-links a:hover { color: var(--fg); opacity: 1; }
footer .footer-links .sep { color: var(--fg-dim); user-select: none; }
footer .license {
  font-family: "Geist Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-dim);
  text-align: right;
}
footer .license a { color: var(--fg-muted); text-decoration-thickness: 1px; }
footer .license a:hover { color: var(--fg); }

/* ─── about page specifics ─────────────────────────────────────── */
.about-main { padding: 4rem 0 2rem; }
.about-main h1 {
  font-family: "Geist", sans-serif;
  font-weight: 300;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 2.5rem;
}
.about-main h1 em { font-style: normal; color: var(--fg-muted); }

.decoder {
  display: grid;
  grid-template-columns: 14ch 1fr;
  gap: 2rem;
  margin: 2.5rem 0;
}
.decoder .label { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.35rem; }
.decoder .glyph-line {
  font-family: "Geist Mono", monospace;
  font-size: clamp(18px, 2.4vw, 28px);
  letter-spacing: 0.15em;
  color: var(--fg);
  line-height: 1.4;
}
.decoder .glyph-line .hidden { color: var(--fg-dim); }

.breakdown {
  display: grid;
  grid-template-columns: 14ch 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
.breakdown .label { color: var(--fg-dim); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; padding-top: 0.35rem; }
.breakdown dl { display: grid; grid-template-columns: 12ch 1fr; gap: 0.75rem 1.5rem; font-size: 15px; }
.breakdown dt { font-family: "Geist Mono", monospace; font-size: 13px; color: var(--fg-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.breakdown dd { color: var(--fg); }
.breakdown dd em { font-style: normal; color: var(--fg-muted); font-size: 13px; display: block; margin-top: 0.15rem; }

.back-link { display: inline-flex; align-items: center; gap: 0.6rem; font-family: "Geist Mono", monospace; font-size: 13px; color: var(--fg-muted); text-decoration: none; margin-top: 2.5rem; }
.back-link:hover { color: var(--fg); }
.back-link::before { content: "←"; }

/* ─── responsive ───────────────────────────────────────────────── */
@media (max-width: 780px) {
  .meta { font-size: 11px; gap: 0.7rem; padding: 0.7rem 1rem; flex-wrap: wrap; }
  .meta .right { margin-left: 0; width: 100%; }
  .wrap { padding: 0 1.25rem; }
  .hero { padding: 3.5rem 0 3rem; gap: 2rem; }
  .hero .claim { grid-template-columns: 1fr; gap: 1rem; }
  .hero .serial { text-align: left; }
  .section-head, .prose, .status, .audiences, .decoder, .breakdown { grid-template-columns: 1fr; gap: 0.75rem; }
  .section-head .label, .prose > :first-child, .status .label, .audiences > .label, .decoder .label, .breakdown .label { padding-top: 0; }
  .audiences { grid-template-columns: 1fr; }
  .audience { border-left: none; border-top: 1px solid var(--rule); padding: 1rem 0 0; }
  footer { grid-template-columns: 1fr; gap: 1rem; text-align: center; }
  footer .license { text-align: center; }
  section { padding: 3rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero .mark-wrap, .hero h1, .hero .serial { opacity: 1 !important; animation: none !important; transform: none !important; }
  .meta .dot { animation: none; }
}
