/* ============ Pedro Cid — site styles ============ */
:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --accent: #c9bd9b;
  --accent-d: #6a624c;
  --muted: #7a715b;
  --ink: #e8e1cd;
  --ink-d: #b9b09a;
  --serif: 'Cormorant Garamond', 'EB Garamond', Garamond, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
  --maxw: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }

.mono { font-family: var(--mono); font-weight: 400; letter-spacing: 0.02em; font-size: 12px; }
.mono.small { font-size: 11px; line-height: 1.7; }
.dim { color: var(--muted); }
.display { font-family: var(--serif); font-weight: 500; }

/* ============ Page chrome ============ */
.page { position: relative; min-height: 100vh; }

/* Subtle vignette */
.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,0.55) 100%);
}

/* Film grain via SVG noise */
.grain::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.7 0 0 0 0 0.65 0 0 0 0 0.5 0 0 0 0.5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  opacity: 0.06; mix-blend-mode: overlay;
}

.starfield { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0.7; }

.earth-bg {
  position: fixed;
  left: 28%; top: 62%;
  transform: translate(-50%, -50%);
  width: 95vh; height: 95vh;
  max-width: 1100px; max-height: 1100px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
  animation: earthDrift 360s linear infinite;
}
@keyframes earthDrift {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============ Top bar ============ */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 22px 36px;
  font-size: 11px;
  color: var(--ink-d);
  background: linear-gradient(to bottom, rgba(5,5,5,0.85), transparent);
  backdrop-filter: blur(2px);
}
.top .brand { letter-spacing: 0.3em; }
.topnav { display: flex; gap: 22px; justify-self: center; }
.topnav a { color: var(--ink-d); }
.topnav a:hover { color: var(--accent); }
.status { justify-self: end; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.status .pulse {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201,189,155,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(201,189,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,189,155,0); }
}

/* ============ Hero ============ */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 0 36px;
  z-index: 2;
  overflow: hidden;
}
.hero-grid {
  position: relative; width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; align-items: center;
  padding-top: 60px;
}

.hero-statue {
  position: absolute; left: -120px; top: 50%; transform: translateY(-50%);
  width: 60%; max-width: 720px; pointer-events: none; z-index: 1;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.hero-statue img {
  width: 100%; height: auto; display: block;
  filter: brightness(0.95) contrast(1.05);
  animation: heroStatueIn 2s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes heroStatueIn {
  from { opacity: 0; transform: translateX(-30px) scale(1.04); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.statue-vignette { display: none; }

.hero-text {
  grid-column: 2; position: relative; z-index: 3;
  padding: 0 0 0 40px;
}
.kicker {
  color: var(--accent);
  margin-bottom: 28px;
  letter-spacing: 0.12em;
  min-height: 18px;
}
.kicker .caret { animation: blink 1s steps(1) infinite; opacity: 0; }
@keyframes blink { 50% { opacity: 1; } }

h1.display {
  font-size: clamp(56px, 8vw, 120px);
  line-height: 0.92; letter-spacing: -0.015em;
  margin: 0 0 28px 0;
  font-weight: 400;
  color: var(--ink);
  font-style: italic;
}
.name-line { display: inline-block; }
.caret-h1 {
  display: inline-block; color: var(--accent);
  font-style: normal; font-weight: 300;
  margin-left: 8px;
  animation: blink 0.9s steps(1) infinite;
}

.hero-sub {
  color: var(--ink-d);
  font-size: 13px; line-height: 1.7;
  max-width: 480px;
  margin: 0 0 36px 0;
  min-height: 44px;
}
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.18em; text-transform: uppercase;
}
.hero-meta .dot { opacity: 0.5; }
.hero-meta a { color: var(--ink-d); border-bottom: 1px solid transparent; padding-bottom: 1px; transition: all .25s; }
.hero-meta a:hover { color: var(--accent); border-color: var(--accent); }

.hero-geom-wrap {
  position: absolute; right: -80px; top: 50%; transform: translateY(-50%);
  width: 540px; height: 540px; z-index: 0;
  opacity: 0.92;
  transition: transform 0.4s cubic-bezier(.2,.7,.2,1);
}
.hero-geom { width: 100%; height: 100%; display: block; }

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 9px; letter-spacing: 0.4em; color: var(--muted);
  text-transform: uppercase;
  animation: floatY 3s ease-in-out infinite;
}
@keyframes floatY { 50% { transform: translate(-50%, 6px); } }

/* ============ Geometry animation primitives ============ */
.draw {
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
}
.drawn .draw {
  animation: drawIn var(--dur, 1.6s) cubic-bezier(.6,0,.2,1) var(--delay, 0s) forwards;
}
@keyframes drawIn { to { stroke-dashoffset: 0; } }

.fade-in { opacity: 0; }
.drawn .fade-in {
  animation: fadeIn 0.8s ease var(--delay, 0s) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }

.pop { opacity: 0; transform: scale(0.6); transform-origin: center; transform-box: fill-box; }
.drawn .pop { animation: popIn 0.6s cubic-bezier(.3,1.5,.4,1) var(--delay, 0s) forwards; }
@keyframes popIn { to { opacity: 1; transform: scale(1); } }

.orbit-slow { animation: rotate 60s linear infinite; }
.orbit-rev  { animation: rotate 32s linear infinite reverse; }
@keyframes rotate { to { transform: rotate(360deg); } }

/* OrbitMark */
.orbit-mark { width: 56px; height: 56px; flex: none; opacity: 0.85; }

/* ============ Sections ============ */
.section {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto;
  padding: 140px 36px 80px;
  border-top: 1px solid rgba(201,189,155,0.08);
}
.section.now, .section.work { border-top: 1px solid rgba(201,189,155,0.06); }

.section-head {
  display: flex; align-items: center; gap: 22px;
  margin-bottom: 56px;
  opacity: 0; transform: translateY(20px);
  transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1);
}
.seen .section-head { opacity: 1; transform: translateY(0); }
.section-num { color: var(--accent); letter-spacing: 0.3em; font-size: 11px; min-width: 50px; }
.section-title {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: clamp(36px, 5vw, 64px); margin: 0; line-height: 1; letter-spacing: -0.01em;
  color: var(--ink);
}
.section-meta { margin-left: auto; color: var(--muted); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }

/* ============ About ============ */
.about-body {
  display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: start;
  opacity: 0; transform: translateY(30px);
  transition: opacity 1.2s ease 0.2s, transform 1.2s cubic-bezier(.2,.7,.2,1) 0.2s;
}
.seen .about-body { opacity: 1; transform: translateY(0); }

.about-img {
  position: relative; aspect-ratio: 3 / 4; max-width: 380px;
  background: #000; padding: 18px;
}
.about-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: contrast(1.05) brightness(0.95);
}
.frame-mark { position: absolute; width: 18px; height: 18px; border: 1px solid var(--accent); opacity: 0.8; }
.frame-mark.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.frame-mark.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.frame-mark.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.frame-mark.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.about-text { padding-top: 6px; }
.lede {
  font-size: clamp(20px, 1.8vw, 26px); line-height: 1.5;
  font-weight: 400; color: var(--ink);
  margin: 0 0 28px 0; max-width: 60ch;
}
.dropcap {
  float: left; font-size: 4em; line-height: 0.85; margin: 4px 12px 0 0;
  color: var(--accent); font-style: italic; font-weight: 500;
}
.about-text .mono { color: var(--ink-d); margin: 0 0 28px 0; max-width: 60ch; }
.about-text em { font-style: italic; color: var(--accent); }

.kvs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; max-width: 60ch; }
.kvs li {
  display: grid; grid-template-columns: 110px 1fr; gap: 18px;
  padding-bottom: 8px; border-bottom: 1px dotted rgba(201,189,155,0.15);
  color: var(--ink-d);
}
.kvs li .dim { color: var(--muted); text-transform: uppercase; letter-spacing: 0.18em; font-size: 10px; align-self: center; }

/* ============ Now ============ */
.now-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
}
.now-card {
  position: relative;
  border: 1px solid rgba(201,189,155,0.12);
  padding: 28px 28px 32px;
  background: linear-gradient(180deg, rgba(201,189,155,0.02), transparent);
  display: flex; flex-direction: column; gap: 16px;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.7,.2,1), border-color .4s, background .4s;
}
.seen .now-card { opacity: 1; transform: translateY(0); }
.now-card:hover { border-color: rgba(201,189,155,0.35); background: linear-gradient(180deg, rgba(201,189,155,0.05), transparent); }
.now-mark { width: 56px; height: 56px; }
.now-t { color: var(--accent); letter-spacing: 0.18em; text-transform: uppercase; font-size: 11px; }
.now-b { font-size: 18px; line-height: 1.5; color: var(--ink); max-width: 36ch; }

/* ============ Work ============ */
.work-wrap {
  position: relative;
  display: grid; grid-template-columns: 1fr; gap: 0;
  opacity: 0; transition: opacity 1.2s ease 0.3s;
}
.seen .work-wrap { opacity: 1; }
.constellation {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  z-index: 0;
}

.projects { display: flex; flex-direction: column; position: relative; z-index: 2; }
.project {
  display: grid; grid-template-columns: 70px 1fr 40px; gap: 32px; align-items: start;
  padding: 36px 0;
  border-top: 1px solid rgba(201,189,155,0.1);
  cursor: pointer; transition: all .35s;
  position: relative;
}
.project:last-child { border-bottom: 1px solid rgba(201,189,155,0.1); }
.project::before {
  content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(201,189,155,0.06), transparent 60%);
  transition: width .5s ease;
  pointer-events: none;
}
.project.on::before { width: 100%; }
.project.on { padding-left: 16px; }

.proj-num { color: var(--muted); font-size: 11px; padding-top: 12px; letter-spacing: 0.2em; }
.project.on .proj-num { color: var(--accent); }

.proj-row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.proj-title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px); margin: 0; line-height: 1; color: var(--ink);
  transition: color .3s;
}
.project.on .proj-title { color: var(--accent); }
.proj-year { color: var(--muted); font-size: 11px; letter-spacing: 0.2em; }
.proj-kind { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; margin: 8px 0 14px; }
.proj-blurb { font-size: 16px; line-height: 1.6; color: var(--ink-d); margin: 0 0 14px; max-width: 60ch; }
.proj-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted);
  padding: 4px 10px; border: 1px solid rgba(201,189,155,0.15);
}
.project.on .tag { color: var(--ink-d); border-color: rgba(201,189,155,0.4); }

.proj-arrow {
  font-family: var(--serif); font-size: 28px; color: var(--muted);
  align-self: center; transform: translateX(0); transition: all .35s;
}
.project.on .proj-arrow { color: var(--accent); transform: translateX(8px); }

/* ============ Footer ============ */
.footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 100px 36px 60px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: end;
  border-top: 1px solid rgba(201,189,155,0.1);
  position: relative; z-index: 2;
}
.footer-row { display: flex; align-items: center; gap: 18px; }
.footer-text { color: var(--ink-d); }
.footer-text .dim { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; margin-top: 6px; }
.footer-links { display: flex; gap: 22px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* ============ Vibe variants ============ */
[data-vibe="scholar"] {
  --bg: #0d0a06;
}
[data-vibe="scholar"] body { background: #0d0a06; }
[data-vibe="scholar"] .hero-statue img { filter: sepia(0.3) brightness(1) contrast(1.05); }

[data-vibe="cybermyst"] {
  --bg: #06080f;
}
[data-vibe="cybermyst"] body { background: #06080f; }
[data-vibe="cybermyst"] .hero-statue img { filter: hue-rotate(200deg) brightness(0.9) contrast(1.1) saturate(0.6); }
[data-vibe="cybermyst"] .section-title,
[data-vibe="cybermyst"] .proj-title { font-style: normal; }

/* ============ Responsive ============ */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 100px; }
  .hero-statue { position: relative; left: -36px; top: auto; transform: none; width: 80%; margin-bottom: -40px; }
  .hero-text { grid-column: 1; padding: 0; }
  .hero-geom-wrap { display: none; }
  .about-body { grid-template-columns: 1fr; gap: 32px; }
  .now-grid { grid-template-columns: 1fr; }
  .top { padding: 16px 20px; grid-template-columns: 1fr 1fr; }
  .topnav { display: none; }
  .section { padding: 80px 20px 60px; }
  .footer { padding: 60px 20px 40px; }
  .project { grid-template-columns: 40px 1fr 30px; gap: 16px; }
}
