/* ============================================================
   nicolaspettican.com — cyberpunk dharma
   Palette: void #0b0714 · panel #150d26 · line #2d2048
            magenta #ff2d95 (engineering) · cyan #29e0ff (interactive)
            gold #f0b23e (dharma) · bone #d3cde2 · dim #948aad
   Type: Chakra Petch (display) · Space Grotesk (body) · IBM Plex Mono (utility)
   ============================================================ */

:root {
  --void: #0b0714;
  --panel: #150d26;
  --line: #2d2048;
  --magenta: #ff2d95;
  --cyan: #29e0ff;
  --gold: #f0b23e;
  --bone: #d3cde2;
  --dim: #948aad;
  --display: "Chakra Petch", sans-serif;
  --body: "Space Grotesk", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --tibetan: "Noto Serif Tibetan", serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--void);
  scrollbar-color: var(--line) var(--void);
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--bone);
  background:
    radial-gradient(
      120% 60% at 70% -10%,
      rgba(255, 45, 149, 0.09),
      transparent 60%
    ),
    radial-gradient(
      90% 50% at 10% 0%,
      rgba(41, 224, 255, 0.06),
      transparent 55%
    ),
    var(--void);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* CRT scanlines, faint and static */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(5, 2, 12, 0.22) 0 1px,
    transparent 1px 3px
  );
}

.wrap {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 22px;
}

main {
  flex: 1;
  padding-bottom: 4rem;
}

/* ---------- links ---------- */

a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(41, 224, 255, 0.3);
  transition:
    color 0.15s,
    border-color 0.15s,
    text-shadow 0.15s;
}

a:hover {
  color: #7deeff;
  border-bottom-color: var(--cyan);
  text-shadow: 0 0 10px rgba(41, 224, 255, 0.45);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 1px;
}

::selection {
  background: var(--magenta);
  color: var(--void);
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: rgba(11, 7, 20, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.mast {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--bone);
  border-bottom: none;
}

.mast:hover {
  color: var(--bone);
  text-shadow: none;
}

/* two names, one person: masthead glitch-swaps between them */
.mast-name {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  text-shadow:
    1px 0 rgba(255, 45, 149, 0.5),
    -1px 0 rgba(41, 224, 255, 0.4);
}

/* the typed name; text-shadow (chromatic aberration) inherits from .mast-name */
.mast-name .typed:empty::before {
  content: "\200b";
} /* keep line-height when empty */

.cursor {
  color: var(--gold);
  animation: blink 1.2s steps(2) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.site-nav {
  display: flex;
  gap: 1.15rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--dim);
  border-bottom: none;
}

.site-nav a::before {
  content: "/";
  color: var(--line);
  margin-right: 2px;
}

.site-nav a:hover {
  color: var(--bone);
  text-shadow:
    1px 0 var(--magenta),
    -1px 0 var(--cyan);
}

.site-nav a[aria-current="page"] {
  color: var(--gold);
}

/* mobile nav toggle — hidden on desktop, checkbox-driven (no JS) */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.nav-burger {
  display: none;
}

@media (max-width: 767px) {
  .nav-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 34px;
    margin: -4px 0;
    cursor: pointer;
  }
  .nav-burger span {
    display: block;
    width: 24px;
    height: 2px;
    margin-left: auto;
    background: var(--bone);
    transition:
      transform 0.2s,
      opacity 0.2s;
  }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: 0.5rem;
  }
  .site-nav a {
    padding: 0.65rem 0.2rem;
    border-top: 1px solid var(--line);
    font-size: 0.95rem;
  }
  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-toggle:focus-visible ~ .nav-burger {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
  }
}

/* ---------- headings ---------- */

h1 {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.12;
  margin: 2.4rem 0 0.8rem;
  color: var(--bone);
  text-shadow:
    2px 0 rgba(255, 45, 149, 0.5),
    -2px 0 rgba(41, 224, 255, 0.4);
}

/* section prompt: Tibetan head-mark + mono label */
h2.sec {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.1rem;
  text-transform: lowercase;
  letter-spacing: 0.2em;
  color: var(--magenta);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
  margin: 3rem 0 1.3rem;
}

h2.sec .yig {
  font-family: var(--tibetan);
  color: var(--gold);
  letter-spacing: 0;
  margin-right: 0.6em;
  font-size: 1rem;
}

h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: 0.03em;
  color: var(--bone);
  margin: 1.9rem 0 0.15rem;
}

h3 a {
  color: inherit;
  border-bottom-color: var(--line);
}

/* ---------- hero (home) ---------- */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 3.2rem 0 1rem;
}

.hero-sys {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--dim);
  margin: 0 0 0.4rem;
}

.hero-sys .yig {
  font-family: var(--tibetan);
  color: var(--gold);
  font-size: 0.95rem;
}

.hero h1 {
  margin: 0;
}

.hero h1 .ordained {
  display: block;
  font-size: 0.44em;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: none;
  margin-top: 0.5rem;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--dim);
  margin: 1.1rem 0 0;
}

.hero-tag b {
  color: var(--cyan);
  font-weight: 500;
}
.hero-tag .sep {
  color: var(--magenta);
}

/* hero illustration: hand-drawn laptop ⇄ Tibetan pecha, drawn + typed by hero.js */
.hero-anim {
  position: relative;
  flex: 0 0 auto;
  width: clamp(225px, 35vw, 340px);
  aspect-ratio: 3 / 2;
  container-type: inline-size;
}

.hero-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-svg .ln {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(240, 178, 62, 0.45));
}

/* HTML text overlaid on the drawn frame; positioned in viewBox proportions */
.screen {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  overflow: visible;
  white-space: pre-wrap;
  transition: opacity 0.25s;
}

.screen.on {
  opacity: 1;
}

.screen-laptop {
  left: 26%;
  top: 23%;
  width: 44%;
  font-family: var(--mono);
  font-size: 2.8cqw;
  line-height: 1.4;
  color: var(--cyan);
}

.screen-pecha {
  left: 15%;
  top: 35%;
  width: 70%;
  text-align: center;
  line-height: 1.5;
}

.screen-pecha .line-bo {
  display: block;
  font-family: var(--tibetan);
  font-size: 3.3cqw;
  color: var(--gold);
}

.screen-pecha .line-en {
  display: block;
  margin-top: 0.35em;
  font-family: var(--body);
  font-style: italic;
  font-size: 3.3cqw;
  color: var(--bone);
}

.screen .typing::after {
  content: "▍";
  color: currentColor;
  animation: blink 1.1s steps(2) infinite;
}

/* ---------- status panels ---------- */

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.6rem 0;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 45%),
    var(--panel);
  padding: 1.1rem 1.15rem 1.2rem;
}

/* corner brackets */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-color: var(--accent, var(--magenta));
  border-style: solid;
}

.panel::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}
.panel::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.panel-tag {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent, var(--magenta));
  margin: 0 0 0.55rem;
}

.panel-tag::before {
  content: "▸ ";
}

.panel p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--bone);
}

.p-build {
  --accent: var(--magenta);
}
.p-study {
  --accent: var(--cyan);
}
.p-practise {
  --accent: var(--gold);
}

/* ---------- experience log (home) ---------- */

.xp {
  list-style: none;
  margin: 0;
  padding: 0;
}

.xp li {
  display: grid;
  grid-template-columns: 7.2em 1fr;
  gap: 0.35rem 1.2rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--line);
}

.xp-when {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  padding-top: 0.2em;
}

.xp-org {
  font-family: var(--display);
  font-weight: 700;
  color: var(--bone);
}

.xp-org small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--dim);
  margin-left: 0.5em;
}

.xp-role {
  grid-column: 2;
  font-size: 0.92rem;
  color: var(--dim);
  margin: 0;
}

.more-line {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--dim);
  margin-top: 1.4rem;
}

/* ---------- contact row ---------- */

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding: 0;
  margin: 1.4rem 0;
  list-style: none;
}

.contact-row a {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.83rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--bone);
  background: var(--panel);
}

.contact-row a:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 14px rgba(41, 224, 255, 0.2);
  text-shadow: none;
}

/* ---------- portrait (about) ---------- */

/* framed like the HUD panels: line border, gold corner brackets, caption
   bezel. the global CRT scanlines fall across the photo for free. */
.portrait {
  float: right;
  width: clamp(200px, 36%, 300px);
  margin: 0.5rem 0 1.4rem 1.9rem;
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 0 24px rgba(255, 45, 149, 0.1);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(0.92) contrast(1.05);
}

/* corner brackets (dharma gold) — matches .panel */
.portrait::before,
.portrait::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-color: var(--gold);
  border-style: solid;
  z-index: 1;
}

.portrait::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}
.portrait::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.portrait figcaption {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--dim);
  border-top: 1px solid var(--line);
  padding: 0.5rem 0.75rem 0.55rem;
}

.portrait figcaption .yig {
  font-family: var(--tibetan);
  color: var(--gold);
  letter-spacing: 0;
  margin-right: 0.5em;
}

@media (max-width: 600px) {
  .portrait {
    float: none;
    width: min(80%, 300px);
    margin: 0.5rem auto 1.6rem;
  }
}

/* ---------- prose pages (about, now) ---------- */

.prose {
  max-width: 68ch;
}

.prose p {
  margin: 1.1rem 0;
}

.prose em {
  color: var(--gold);
  font-style: italic;
}

.lede {
  font-size: 1.12rem;
  color: var(--bone);
}

/* ---------- cv ---------- */

.cv-dl {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.job {
  max-width: 68ch;
}

.job .meta {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  margin: 0.1rem 0 0.6rem;
}

.job .meta .at {
  color: var(--gold);
}

.job p {
  margin: 0.6rem 0;
  font-size: 0.97rem;
}

.stack {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  margin: 0.6rem 0 0;
}

.stack::before {
  content: "stack:";
  color: var(--magenta);
  margin-right: 0.6em;
}

/* ---------- work grid ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin: 1.4rem 0 2.6rem;
}

.holo {
  position: relative;
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0;
  overflow: hidden;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}

.holo:hover {
  border-color: var(--magenta);
  box-shadow: 0 0 22px rgba(255, 45, 149, 0.22);
  transform: translateY(-3px);
}

.holo img {
  display: block;
  width: 100%;
  max-height: 220px;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.05);
  transition: filter 0.2s;
}

.holo:hover img {
  filter: saturate(1.1) contrast(1.08);
}

.holo-bezel {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--line);
  display: block;
}

.holo-title {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--bone);
}

.holo-title::after {
  content: " ↗";
  color: var(--magenta);
  font-size: 0.85em;
}

.holo-desc {
  display: block;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--dim);
  margin-top: 0.25rem;
}

/* ---------- contact page ---------- */

.email-big {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  letter-spacing: 0.02em;
  color: var(--gold);
  border-bottom: 2px solid rgba(240, 178, 62, 0.4);
}

.email-big:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
  text-shadow: 0 0 14px rgba(240, 178, 62, 0.5);
}

.link-table {
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  max-width: 46ch;
}

.link-table li {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.92rem;
}

.link-table .k {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--dim);
  padding-top: 0.15em;
}

/* ---------- footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2rem;
  text-align: center;
}

.foot-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.3rem;
  margin: 0 0 1.1rem;
  padding: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.foot-links a {
  color: var(--dim);
  border-bottom: none;
}
.foot-links a:hover {
  color: var(--cyan);
}

.mantra {
  font-family: var(--tibetan);
  font-size: 1.15rem;
  color: rgba(240, 178, 62, 0.55);
  margin: 0 0 0.5rem;
}

.colophon {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--dim);
  margin: 0;
}

/* ---------- 404 ---------- */

.err {
  text-align: center;
  padding: 5rem 0 3rem;
}

.err .code {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 8rem);
  line-height: 1;
  color: var(--bone);
  text-shadow:
    3px 0 rgba(255, 45, 149, 0.55),
    -3px 0 rgba(41, 224, 255, 0.45);
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 767px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding-top: 2rem;
  }
  .hero-anim {
    width: clamp(50%, 78vw, 90%);
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .work-grid {
    grid-template-columns: 1fr;
  }
  .xp li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .xp-role {
    grid-column: 1;
  }
  .link-table li {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* ---------- print (cv) ---------- */

@media print {
  body {
    background: #fff;
    color: #111;
  }
  body::after,
  .site-head,
  .site-foot {
    display: none;
  }
  a {
    color: #111;
    border-bottom: none;
  }
  h1,
  h3,
  .xp-org {
    color: #000;
    text-shadow: none;
  }
  h2.sec {
    color: #000;
  }
  .job .meta,
  .stack,
  .xp-when,
  .xp-role {
    color: #444;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .cursor,
  .screen .typing::after {
    animation: none;
  }
  .screen {
    transition: none;
  }
  .holo,
  .holo img,
  a {
    transition: none;
  }
  .holo:hover {
    transform: none;
  }
}
