/* ============================================================
   emilpasini.com — private monograph
   serif display · mono labels · spotlight dark
   ============================================================ */

:root {
  --bg:        #08080a;
  --bg-soft:   #0e0e11;
  --ink:       #ece8e0;
  --ink-dim:   #8d8a83;
  --ink-faint: #4d4b46;
  --line:      rgba(236, 232, 224, 0.09);
  --gold:      #b8965a;
  --heart:     #6bbf8a;
  --accent:    var(--gold);

  --serif: ui-serif, "New York", "Hoefler Text", "Iowan Old Style", Garamond, Georgia, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  --mono:  "SF Mono", "JetBrains Mono", "Menlo", ui-monospace, monospace;

  --pad:  clamp(1.4rem, 6vw, 7rem);
  --maxw: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* ---------- ambient layers ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.spotlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 30%),
              rgba(184,150,90,0.10), transparent 70%);
  transition: background 0.18s ease-out;
}
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--heart), var(--gold));
  z-index: 60;
}

main, .nav, .footer { position: relative; z-index: 3; }

/* ---------- entrance ---------- */
.enter {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4rem; background: var(--bg);
  animation: enterOut 0.9s cubic-bezier(.7,0,.2,1) 1.9s forwards;
}
.enter__name {
  font-family: var(--serif); font-size: clamp(1.5rem, 5vw, 2.6rem);
  letter-spacing: 0.4em; padding-left: 0.4em;
  opacity: 0; animation: fadeUp 1s ease 0.2s forwards;
}
.enter__line {
  width: 0; height: 1px; background: var(--accent);
  animation: lineGrow 1.1s ease 0.5s forwards;
}
.enter__sub { opacity: 0; color: var(--ink-faint); animation: fadeUp 1s ease 0.8s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes lineGrow { to { width: min(220px, 50vw); } }
@keyframes enterOut { to { opacity: 0; transform: translateY(-30px); visibility: hidden; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem var(--pad);
  z-index: 50;
  opacity: 0; animation: fadeUp 0.8s ease 2.4s forwards;
}
.nav__brand { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.2em; display: flex; align-items: center; gap: 0.5rem; }
.mark { color: var(--accent); }
.nav__center { display: flex; gap: 2.2rem; }
.nav__center a { color: var(--ink-dim); transition: color 0.3s; }
.nav__center a:hover { color: var(--ink); }
.nav__cta {
  padding: 0.5rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-dim); transition: border-color 0.3s, color 0.3s;
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 var(--pad);
  max-width: var(--maxw); margin: 0 auto;
}
.hero__kicker { color: var(--accent); margin-bottom: 1.6rem; }
.hero__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(3.4rem, 13vw, 9rem);
  line-height: 0.92; letter-spacing: -0.02em;
}
.hero__sub {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  color: var(--ink-dim); margin-top: 1.8rem; max-width: 28ch;
}
.hero__meta { display: flex; gap: 1.8rem; flex-wrap: wrap; margin-top: 2.8rem; color: var(--ink-faint); }
.hero__pulse { color: var(--heart); }
.hero__pulse::first-letter { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.hero__scroll { margin-top: 4rem; color: var(--ink-faint); animation: float 2.6s ease-in-out infinite; align-self: flex-start; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ---------- thesis ---------- */
.thesis {
  position: relative; overflow: hidden;
  min-height: 92vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem var(--pad); text-align: center;
  border-block: 1px solid var(--line);
}
.thesis__art { position: absolute; inset: 0; z-index: 0; display: flex; justify-content: center; }
.thesis__art img {
  height: 100%; width: auto; object-fit: contain; opacity: 0.22;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 78%);
          mask-image: radial-gradient(60% 60% at 50% 50%, #000 30%, transparent 78%);
}
.thesis blockquote { position: relative; z-index: 1; }
.thesis p {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 6.5vw, 4.6rem);
  line-height: 1.05; letter-spacing: -0.02em;
}
.thesis em { font-style: italic; color: var(--accent); }
.thesis cite { display: block; margin-top: 2rem; color: var(--ink-faint); font-style: normal; }

/* ---------- generic section ---------- */
.section { padding: clamp(5rem, 14vh, 10rem) var(--pad); max-width: var(--maxw); margin: 0 auto; }
.section__head { margin-bottom: 3.5rem; }
.label { display: block; margin-bottom: 1.2rem; color: var(--accent); }
.section__head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05; letter-spacing: -0.02em;
}

/* ---------- the arc ---------- */
.arc__layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.arc__art img { width: 100%; height: auto; display: block; border-radius: 14px; border: 1px solid var(--line); }
.movements { list-style: none; display: grid; gap: 2.4rem; }
.movement { padding-left: 1.4rem; border-left: 1px solid var(--line); transition: border-color 0.4s; }
.movement:hover { border-color: var(--accent); }
.movement__no { display: block; margin-bottom: 0.7rem; color: var(--accent); }
.movement p { color: var(--ink-dim); max-width: 50ch; }

/* ---------- the field (full-bleed) ---------- */
.field { position: relative; overflow: hidden; padding: clamp(6rem, 20vh, 13rem) var(--pad); border-block: 1px solid var(--line); }
.field__art { position: absolute; inset: 0; z-index: 0; }
.field__art img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.32;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 42%, #000 58%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 42%, #000 58%, transparent);
}
.field__copy { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; text-align: center; }
.field__copy h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 3.4rem); line-height: 1.06; letter-spacing: -0.02em;
  margin: 1.2rem 0 1.5rem;
}
.field__copy p { color: var(--ink-dim); max-width: 50ch; margin: 0 auto; }

/* ---------- principles ---------- */
.principles { list-style: none; display: grid; }
.principles li {
  display: flex; gap: 1.4rem; align-items: baseline;
  padding: 1.5rem 0; border-top: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  transition: color 0.3s, padding-left 0.3s;
}
.principles li:last-child { border-bottom: 1px solid var(--line); }
.principles li:hover { color: var(--accent); padding-left: 0.6rem; }
.principles .mono { color: var(--ink-faint); }

/* ---------- contact ---------- */
.contact__note { color: var(--ink-dim); margin-top: 1.2rem; font-family: var(--serif); font-style: italic; }
.contact__form { display: grid; gap: 1.4rem; max-width: 540px; }
.field-row { display: grid; gap: 0.5rem; }
.field-row label { color: var(--ink-faint); }
.field-row input, .field-row textarea {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1rem; color: var(--ink); font-family: var(--sans); font-size: 1rem;
  resize: vertical; transition: border-color 0.3s;
}
.field-row input:focus, .field-row textarea:focus { outline: none; border-color: var(--accent); }
.field-row input::placeholder, .field-row textarea::placeholder { color: var(--ink-faint); }
.btn {
  justify-self: start; padding: 0.85rem 1.6rem; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 0.92rem; font-weight: 500;
  transition: transform 0.2s, background 0.3s;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); }
.contact__direct { display: inline-block; margin-top: 2rem; color: var(--ink-dim); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.contact__direct:hover { color: var(--accent); }

/* ---------- footer ---------- */
.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  padding: 2.5rem var(--pad); border-top: 1px solid var(--line);
}
.footer__tag { color: var(--ink-faint); }
.footer a:hover { color: var(--accent); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .arc__layout { grid-template-columns: 1fr; }
  .arc__art { max-width: 360px; }
}
@media (max-width: 680px) {
  .nav__center { display: none; }
  .hero__sub { max-width: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .enter { display: none; }
  .nav { opacity: 1; animation: none; }
  .hero__scroll, .hero__pulse::first-letter, .spotlight { animation: none; }
  .enter__name, .enter__sub { opacity: 1; animation: none; }
}

/* ============ RENDITION: TERMINAL / PHOSPHOR ============ */
:root {
  --bg:        #000300;
  --bg-soft:   #03070400;
  --ink:       #c9f5dd;
  --ink-dim:   #5f9f78;
  --ink-faint: #2e5f44;
  --line:      rgba(57, 255, 156, 0.16);
  --gold:      #39ff9c;
  --heart:     #39ff9c;
  --accent:    #39ff9c;
}
/* everything monospace */
.hero__title, .section__head h2, .thesis p, .field__copy h2,
.principles li, .contact__note, .enter__name {
  font-family: var(--mono) !important;
  font-weight: 400; letter-spacing: 0.01em;
}
.hero__title { font-size: clamp(2.6rem, 10vw, 6.5rem); }
.thesis p { font-size: clamp(1.6rem, 5vw, 3.4rem); line-height: 1.2; }
.hero__title, .section__head h2, .thesis em, .label, .mark { text-shadow: 0 0 16px rgba(57,255,156,0.35); }
.spotlight { background: radial-gradient(440px circle at var(--mx,50%) var(--my,30%), rgba(57,255,156,0.12), transparent 70%); }
.thesis em { font-style: normal; }
/* phosphor-tint the engravings */
.thesis__art img, .arc__art img, .field__art img {
  filter: sepia(1) hue-rotate(78deg) saturate(2.4) brightness(0.95);
}
/* CRT scanlines */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.22) 2px 3px);
  opacity: 0.55;
}

/* ============ TERMINAL BOOT INTRO ============ */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: #000300;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(1.4rem, 8vw, 9rem);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.boot--out { opacity: 0; transform: translateY(-24px); pointer-events: none; }
.boot__screen {
  font-family: var(--mono); color: #39ff9c;
  font-size: clamp(0.78rem, 2.3vw, 1.15rem); line-height: 1.95; letter-spacing: 0.04em;
  text-shadow: 0 0 12px rgba(57,255,156,0.45);
  white-space: pre-wrap; margin: 0;
}
.boot__caret {
  display: inline-block; width: 0.6em; height: 1.05em; margin-left: 2px;
  background: #39ff9c; box-shadow: 0 0 12px rgba(57,255,156,0.6);
  animation: caretBlink 1s steps(1) infinite; vertical-align: -0.18em;
}
@keyframes caretBlink { 50% { opacity: 0; } }
.boot__skip { position: absolute; bottom: 2rem; left: 0; right: 0; text-align: center; color: #2e5f44; }
.boot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0) 0 2px, rgba(0,0,0,0.28) 2px 3px);
  animation: bootFlicker 0.13s steps(2) infinite;
}
@keyframes bootFlicker { 50% { opacity: 0.65; } }
@media (prefers-reduced-motion: reduce) { .boot { display: none; } }
