/*
  prakash.systems — shared theme engine
  90s DOS terminal, classy + minimalist, grayscale with one rotating accent.
  Accent color is set at runtime via the --accent custom property (see theme.js).
*/

@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0c0c0c;
  --surface: #161616;
  --border: #2b2b2b;
  --text-dim: #7a7a7a;
  --text: #c2c2c2;
  --text-bright: #e9e9e9;

  /* overwritten per-load by theme.js; this is just a safe fallback */
  --accent: #b7d3e0;
  --accent-dim: #b7d3e033;
}

* {
  box-sizing: border-box;
}

/*
  Cross-document View Transitions: opts every same-origin navigation
  on the site into a smooth crossfade between the old and new page,
  instead of the default hard cut on reload. This is what actually
  softens the jump between very different-looking pages (e.g. the
  moon-centric gateway vs. an owner's bio page) — pure progressive
  enhancement, no JS, no SPA/router. Browsers without support just
  navigate normally.
*/
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: ease-in-out;
}

::view-transition-old(root) {
  animation-name: rak2-crt-out;
}

::view-transition-new(root) {
  animation-name: rak2-crt-in;
}

@keyframes rak2-crt-out {
  from { opacity: 1; filter: brightness(1); }
  to   { opacity: 0; filter: brightness(1.7); }
}

@keyframes rak2-crt-in {
  from { opacity: 0; filter: brightness(1.7); }
  to   { opacity: 1; filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', 'Consolas', monospace;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012) 0px,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 3px
    );
}

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

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

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.crt-shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

/* ---------- terminal chrome ---------- */

.term-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.term-titlebar .dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 6px;
  background: var(--border);
}

.term-body {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 32px 40px;
}

.prompt-line {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 18px;
}

.prompt-line .accent {
  color: var(--accent);
}

h1, h2, h3 {
  font-family: 'VT323', 'IBM Plex Mono', monospace;
  color: var(--text-bright);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
}

h1 {
  font-size: 44px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 10px;
}

h2 {
  font-size: 30px;
  color: var(--accent);
  margin-top: 40px;
}

h3 {
  font-size: 22px;
  color: var(--text-bright);
  margin-top: 24px;
}

p {
  color: var(--text);
}

.tagline {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: -6px;
}

/* ---------- nav ---------- */

.term-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  margin: 24px 0 8px;
  font-size: 15px;
}

.term-nav a {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 14px;
  position: relative;
  overflow: hidden;
}

.term-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: var(--accent-dim);
}

.term-nav .sep {
  color: var(--border);
  padding: 6px 0;
}

/* ---------- pixel-typing hover/click animation ----------
   A row of block glyphs "types" left to right using steps(),
   like a cursor stamping pixelated periods across a terminal. */

.px-type {
  position: relative;
  display: inline-block;
}

.px-type::after {
  content: '\2591\2591\2591\2591\2591\2591\2591\2591';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 14px;
  color: var(--accent);
  background: var(--bg);
  letter-spacing: 4px;
  overflow: hidden;
  width: 0;
  white-space: nowrap;
  pointer-events: none;
}

.term-nav a.px-type::after {
  padding: 0 14px;
}

.term-nav a.px-type:hover::after,
.term-nav a.px-type:focus-visible::after {
  animation: px-type-in 480ms steps(8, end) forwards;
}

.term-nav a.px-type.px-click::after {
  animation: px-type-click 260ms steps(8, end);
}

@keyframes px-type-in {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes px-type-click {
  0% { width: 100%; opacity: 1; }
  60% { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* buttons / mailto-style CTAs get the same treatment */

.term-btn {
  display: inline-block;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  padding: 10px 18px;
  font-family: inherit;
  font-size: 15px;
  background: transparent;
  cursor: pointer;
}

.term-btn.px-type::after {
  padding: 0 18px;
}

/* ---------- content blocks ---------- */

.exp-entry {
  border-left: 2px solid var(--border);
  padding-left: 16px;
  margin-bottom: 22px;
}

.exp-entry .role {
  color: var(--text-bright);
  font-weight: 600;
}

.exp-entry .meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 4px;
}

.tag {
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  padding: 3px 8px;
  letter-spacing: 0.03em;
}

ul.term-list {
  margin: 0;
  padding-left: 20px;
}

ul.term-list li {
  margin-bottom: 6px;
}

ul.term-list li::marker {
  color: var(--accent);
}

.term-footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding-top: 16px;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.blink {
  animation: blink-caret 1.1s steps(1) infinite;
  color: var(--accent);
}

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

@media (max-width: 560px) {
  .crt-shell { padding: 28px 14px 64px; }
  .term-body { padding: 22px 18px 28px; }
  h1 { font-size: 34px; }
}
