/* ==========================================================================
   Emanuele Palma — Pixels and People
   Palette: Cyan Circuit.  Everything themeable lives in :root.
   ========================================================================== */

:root {
  /* Colour */
  --plum:    #6E026F;
  --azure:   #007DCC;
  --amber:   #FFB900;
  --cream:   #F1E6C9;
  --mint:    #ABDADC;
  --night:   #0F1626;
  --night-2: #16203A;
  --night-3: #0A0F1B;
  --line:    #243252;
  --line-2:  #1B2740;
  --paper:   #FFFDF3;
  --paper-line: #DED2B3;
  --text-muted:  #A6B8D3;
  --text-dim:    #7F93B5;
  --text-faint:  #55688C;
  --ink:         #0F1626;
  --ink-muted:   #4F5560;
  --ink-faint:   #9A8B64;

  /* Type — swap these three lines to re-skin the whole site.
     Alternatives (remember to update the <link> in each page's <head>):
       Poster:       'Anton'   / 'Work Sans'       / 'IBM Plex Mono'
       Contemporary: 'Bricolage Grotesque' / 'Instrument Sans' / 'DM Mono'
       Geometric:    'Syne'    / 'Manrope'         / 'Space Mono'          */
  --display: 'Archivo', sans-serif;
  --body:    'Space Grotesk', sans-serif;
  --mono:    'JetBrains Mono', monospace;

  /* Rhythm */
  --wrap:    1240px;
  --gutter:  clamp(20px, 5vw, 40px);
  --sec-y:   110px;
}

/* --------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--azure); }
h1, h2, h3, p { margin: 0; }
button, input, textarea { font: inherit; }

/* ---------------------------------------------------------- primitives -- */
.wrap { max-width: var(--wrap); margin: 0 auto; }
.sec { padding: var(--sec-y) var(--gutter); position: relative; overflow: hidden; }
.sec--tight  { padding-top: 40px; padding-bottom: 90px; }
.sec--night  { background: var(--night); }
.sec--plum   { background: var(--plum); }
.sec--azure  { background: var(--azure); }
.sec--cream  { background: var(--cream); }
.sec--paper  { background: var(--paper); padding-top: 70px; padding-bottom: 100px; }
.pagehead    { padding-top: 96px; padding-bottom: 80px; }

.stack { display: flex; flex-direction: column; gap: clamp(28px, 4vw, 56px); }
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}
.split--center { align-items: center; }
.split--start  { align-items: start; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.eyebrow--amber { color: var(--amber); }
.eyebrow--azure { color: var(--azure); }
.eyebrow--cream { color: var(--cream); }

.h1 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(46px, 8vw, 104px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  max-width: 1000px;
  text-wrap: balance;
}
.h1--sub  { font-size: clamp(37px, 6.5vw, 84px); line-height: 0.94; max-width: 900px; }
.h1--dark { color: var(--ink); }
.h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(25px, 4.3vw, 56px);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.h2--dark { color: var(--ink); }
.h3 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(22px, 3.4vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.lede { font-size: 24px; line-height: 1.5; color: #D6E2EF; max-width: 720px; text-wrap: pretty; }
.lede--dark  { font-size: 21px; color: var(--ink-muted); max-width: 640px; }
.lede--cream { font-size: 21px; color: var(--cream); max-width: 560px; }
.body { font-size: 19px; line-height: 1.55; color: var(--text-muted); max-width: 620px; text-wrap: pretty; }
.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.label--amber { color: var(--amber); margin-bottom: 0; }
.note  { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 18px 30px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn--solid { background: var(--cream); color: var(--ink); }
.btn--solid:hover { background: var(--amber); color: var(--ink); }
.btn--ghost { background: var(--night); border-color: var(--night); color: var(--cream); }
.btn--ghost:hover { background: var(--azure); border-color: var(--azure); color: var(--cream); }
.btn--amber { background: var(--amber); color: var(--ink); }
.btn--amber:hover { background: var(--cream); }

.link-u {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 700;
  color: var(--plum); border-bottom: 2px solid var(--plum); padding-bottom: 4px;
}
.link-u:hover { color: var(--azure); border-bottom-color: var(--azure); }

.linkbar { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.linkbar a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 6px 12px; border: 1px solid var(--plum); color: var(--cream);
}
.tag--amber { background: var(--amber); color: var(--ink); border-color: var(--amber); }
.tag--azure { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.tag--azure-solid { background: var(--azure); color: var(--cream); border-color: var(--azure); }
.tag--plum-solid  { background: var(--plum);  color: var(--cream); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  border: 1px solid var(--plum); color: var(--cream); padding: 9px 14px;
}
.chips a:hover { background: var(--plum); color: var(--cream); }

.panel { background: var(--night-2); border: 1px solid #2B3B5E; padding: 40px; display: flex; flex-direction: column; gap: 18px; }
.panel--dark { background: var(--night); border: none; gap: 20px; }
.field {
  background: var(--night); border: 1px solid var(--plum); color: var(--cream);
  font-family: var(--mono); font-size: 15px; padding: 18px 20px; outline: none;
}
.panel--dark .field { background: var(--night-2); font-size: 14px; padding: 16px 18px; resize: vertical; }
.field:focus { border-color: var(--azure); }

/* placeholder art */
.ph-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; position: relative; }
.blob { position: absolute; border-radius: 50%; display: block; }
.blob--plum  { background: var(--plum); }
.blob--azure { background: var(--azure); }
.blob--amber { background: var(--amber); }
.blob--hero-a { right: -160px; top: -140px; width: min(52vw, 520px); aspect-ratio: 1; animation: drift-a 14s ease-in-out infinite; }
.blob--hero-b { right: 140px; bottom: -240px; width: min(44vw, 440px); aspect-ratio: 1; animation: drift-b 18s ease-in-out infinite; }
.blob--head   { right: -120px; bottom: -200px; width: 420px; height: 420px; animation: drift-b 16s ease-in-out infinite; }
.blob--head-l { right: -140px; top: -160px; width: 420px; height: 420px; animation: drift-a 16s ease-in-out infinite; }
.blob--card   { right: -30px; top: -30px; width: 120px; height: 120px; }
.blob--proj   { left: -40px; top: -40px; width: 180px; height: 180px; }

.scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(15,22,38,0.24) 0 3px, rgba(0,0,0,0) 3px 8px);
}
.scanbeam {
  position: absolute; left: 0; right: 0; height: 180px; pointer-events: none;
  background: linear-gradient(180deg, rgba(241,230,201,0) 0%, rgba(241,230,201,0.10) 50%, rgba(241,230,201,0) 100%);
  animation: scan 7s linear infinite;
}

/* ------------------------------------------------------------ the mark -- */
.mark { display: inline-flex; align-items: center; }
.mark__dot { width: 26px; height: 26px; border-radius: 50%; display: block; }
.mark__dot + .mark__dot { margin-left: -9px; }
.mark__dot--plum  { background: var(--plum); }
.mark__dot--azure { background: var(--azure); }
.mark__dot--amber { background: var(--amber); }
.mark--xs .mark__dot { width: 10px; height: 10px; }
.mark--xs .mark__dot + .mark__dot { margin-left: -4px; }

/* --------------------------------------------------------------- header -- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,22,38,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; }
.brand:hover { color: inherit; }
.brand .mark { animation: pulse 5s ease-in-out infinite; }
.brand__name {
  font-family: var(--display); font-weight: 900; font-size: 17px;
  letter-spacing: -0.02em; text-transform: uppercase; color: var(--cream);
}
.nav { display: flex; align-items: center; gap: 2px 4px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; white-space: nowrap;
  padding: 9px 14px; color: var(--text-dim);
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--cream); }
.nav a.is-active { color: var(--cream); border-bottom-color: var(--amber); }
.nav__cta {
  margin-left: 10px; padding: 10px 20px !important;
  background: var(--plum); color: var(--cream) !important; font-weight: 700;
}
.nav__cta:hover { background: var(--azure); }

/* ----------------------------------------------------------------- hero -- */
.hero { padding-top: 120px; padding-bottom: 110px; }
.hero__inner { position: relative; display: flex; flex-direction: column; gap: 40px; }
.hero .eyebrow { font-size: 13px; letter-spacing: 0.24em; margin-bottom: 0; }
.flicker { animation: flicker 5s linear infinite; }
.caret { animation: blink 1.1s step-end infinite; }

/* -------------------------------------------------------------- marquee -- */
.marquee {
  background: var(--azure); overflow: hidden; padding: 16px 0;
  border-top: 3px solid var(--night); border-bottom: 3px solid var(--night);
}
.marquee__track { display: flex; width: max-content; animation: marquee 26s linear infinite; }
.marquee__group {
  display: flex; gap: clamp(28px, 4vw, 56px); padding-right: 56px;
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--cream); white-space: nowrap;
}

/* ------------------------------------------------------------ now rows -- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 30px 0; border-top: 1px solid var(--line); }
.row--last { border-bottom: 1px solid var(--line); }
.row__key { font-family: var(--mono); font-size: 13px; color: var(--amber); flex: 0 0 90px; }
.row__body { display: flex; flex-direction: column; gap: 8px; }
.row__title { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; color: var(--cream); }
.row__text { font-size: 17px; line-height: 1.55; color: var(--text-muted); }

/* ---------------------------------------------------------------- cards -- */
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 28px; }
.card { display: flex; flex-direction: column; background: var(--paper); color: inherit; transition: transform 200ms cubic-bezier(.2,.7,.2,1); }
.card:hover { transform: translateY(-6px); color: inherit; }
.card__media {
  aspect-ratio: 4/3; position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 20px;
  background: repeating-linear-gradient(135deg, #E8DFC4 0 12px, #F5EED9 12px 24px);
  color: var(--ink-faint);
}
.card__body { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.card__meta  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--azure); }
.card__title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; color: var(--ink); }
.card__text  { font-size: 16px; line-height: 1.5; color: var(--ink-muted); }

/* -------------------------------------------------------------- projects -- */
.projects { display: flex; flex-direction: column; }
.proj {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(28px, 4vw, 56px); padding: 56px 0;
  border-top: 1px solid var(--line); align-items: center;
}
.proj:last-child { border-bottom: 1px solid var(--line); }
.proj--flip .proj__media { order: 2; }
.proj--flip .proj__body  { order: 1; }
.proj__media {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 24px;
  background: repeating-linear-gradient(135deg, var(--night-2) 0 12px, #1C2947 12px 24px);
  color: #5D719A;
}
.proj__media--wide   { aspect-ratio: 16/10; }
.proj__media--tall   { aspect-ratio: 4/5; }
.proj__media--square { aspect-ratio: 1; }
.proj--flip .blob--proj { left: auto; right: -40px; top: auto; bottom: -40px; }
.proj__body { display: flex; flex-direction: column; gap: 16px; }
.proj__links { display: flex; gap: 24px; padding-top: 8px; }
.proj__links a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 3px; }

/* --------------------------------------------------------------- mosaic -- */
.mosaic {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  grid-auto-rows: minmax(150px, 200px); gap: 20px;
}
.tile {
  display: flex; align-items: flex-end; padding: 18px; color: var(--ink-faint);
  background: repeating-linear-gradient(135deg, #E8DFC4 0 12px, #F5EED9 12px 24px);
}
.tile--big  { grid-column: span 2; grid-row: span 2; padding: 22px; }
.tile--plum { background: var(--plum); color: var(--cream); }
.tile--mint { background: var(--mint); color: var(--ink); }

/* --------------------------------------------------------- publications -- */
.pub { display: flex; flex-wrap: wrap; gap: 16px 32px; padding: 32px 0; border-top: 1px solid var(--line); align-items: baseline; }
.pub--last { border-bottom: 1px solid var(--line); }
.pub__year  { font-family: var(--mono); font-size: 15px; color: var(--amber); flex: 0 0 70px; }
.pub__body  { display: flex; flex-direction: column; gap: 8px; flex: 1 1 320px; }
.pub__title { font-family: var(--display); font-weight: 800; font-size: 27px; line-height: 1.2; letter-spacing: -0.02em; color: var(--cream); }
.pub__authors { font-size: 16px; color: var(--text-dim); }
.pub__authors em { color: var(--text-muted); }
.pub__meta { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 0 1 150px; }
.pub__meta a { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }

.talk { background: var(--cream); padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.talk .eyebrow { margin-bottom: 0; }
.talk__title { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.12; letter-spacing: -0.02em; color: var(--ink); }
.talk__text  { font-size: 15px; line-height: 1.5; color: var(--ink-muted); }
.talk__link  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--plum); margin-top: auto; }

/* ---------------------------------------------------------------- notes -- */
.note-item {
  display: flex; flex-wrap: wrap; gap: 12px 32px; padding: 34px 0;
  border-top: 1px solid var(--paper-line); align-items: center; color: inherit;
  transition: background 160ms ease;
}
.note-item--last { border-bottom: 1px solid var(--paper-line); }
.note-item:hover { background: var(--cream); color: inherit; }
.note-item__date  { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); flex: 0 0 110px; }
.note-item__body  { display: flex; flex-direction: column; gap: 8px; }
.note-item__title { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.14; letter-spacing: -0.025em; color: var(--ink); }
.note-item__text  { font-size: 17px; line-height: 1.5; color: var(--ink-muted); max-width: 700px; }
.note-item__arrow { font-family: var(--mono); font-size: 20px; color: var(--azure); margin-left: auto; }

/* ---------------------------------------------------------------- about -- */
.portrait {
  aspect-ratio: 1; max-width: 420px; border-radius: 50%; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #5D719A;
  background: repeating-linear-gradient(135deg, var(--night-2) 0 12px, #1C2947 12px 24px);
}
.portrait .scanlines { background: repeating-linear-gradient(180deg, rgba(241,230,201,0.05) 0 3px, rgba(0,0,0,0) 3px 8px); }
.prose { display: flex; flex-direction: column; gap: 20px; font-size: 20px; line-height: 1.62; color: #C3D3E4; max-width: 720px; }
.prose p { text-wrap: pretty; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.fact { padding: 26px 32px 26px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.fact:nth-child(even) { padding-right: 0; padding-left: 32px; }
.fact:nth-child(n+3)  { border-bottom: 1px solid var(--line); }
.fact .eyebrow { font-size: 11px; letter-spacing: 0.16em; margin-bottom: 0; }
.fact__title { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--cream); }
.fact__sub   { font-size: 16px; color: var(--text-dim); }

/* -------------------------------------------------------------- contact -- */
.contact-details { display: flex; flex-direction: column; gap: 16px; font-family: var(--mono); font-size: 16px; color: var(--cream); }
.contact-details__mail { font-size: 19px; color: var(--cream); border-bottom: 2px solid var(--cream); padding-bottom: 4px; align-self: flex-start; }
.contact-details__mail:hover { color: var(--night); border-bottom-color: var(--night); }

/* --------------------------------------------------------------- footer -- */
.footer { background: var(--night-3); padding: 64px var(--gutter) 40px; border-top: 1px solid var(--line); }
.footer__inner { display: flex; flex-direction: column; gap: 40px; }
.footer__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 40px; }
.brand--footer { gap: 16px; }
.avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--cream); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.avatar__ep { font-family: var(--display); font-weight: 900; font-size: 19px; line-height: 1; letter-spacing: -0.05em; color: var(--plum); }
.brand__name--lg { display: block; font-size: 18px; }
.brand__tag { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); }
.footer__links { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.footer__links a { color: var(--text-dim); }
.footer__links a:hover { color: var(--amber); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px;
  padding-top: 24px; border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; color: #4A5C7E;
}

/* ------------------------------------------------------------ animation -- */
[data-reveal] { opacity: 0; transform: translateY(28px); }
[data-reveal].is-visible {
  opacity: 1; transform: none;
  transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.2,1);
}

@keyframes flicker { 0%,100% { opacity: 1; } 92% { opacity: 1; } 94% { opacity: 0.45; } 96% { opacity: 1; } 97% { opacity: 0.7; } 98% { opacity: 1; } }
@keyframes pulse   { 0%,100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
@keyframes drift-a { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-28px, 22px); } }
@keyframes drift-b { 0%,100% { transform: translate(0,0); } 50% { transform: translate(26px, -20px); } }
@keyframes scan    { 0% { top: -180px; } 100% { top: 100%; } }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes blink   { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
