/* ============================================================
   guangxinzhao.com — sodium-amber CRT
   colors stolen from a Stuttgart streetlamp at 02:13
   ============================================================ */

:root {
  --bg:        #0d0b08;
  --bg-rule:  #1a1611;
  --bg-soft:  #14110c;
  --fg:        #d4cabb;
  --fg-mute:  #968b7e;
  --fg-dim:   #5b544b;
  --amber:    #ffaa00;
  --amber-hot:#ffd166;
  --rust:     #ff6b35;
  --bone:     #efe4d2;
  --shadow:   0 0 0 transparent;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --tracking-tight: -0.04em;
  --tracking-wide:   0.18em;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --col:    min(72ch, 100%);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "calt" 1, "ss01" 1, "ss02" 1, "zero" 1;
  text-rendering: geometricPrecision;
  min-height: 100vh;
  overflow-x: hidden;
  /* faint vignette */
  background-image:
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 60%, rgba(0,0,0,0.5) 100%),
    var(--bg);
}

/* CRT scanlines overlay (very low opacity, opt-in motion) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 2px,
      rgba(255, 170, 0, 0.012) 2px,
      rgba(255, 170, 0, 0.012) 3px
    );
  z-index: 100;
  mix-blend-mode: lighten;
}

/* phosphor flicker — removed, was too distracting */

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

/* webkit scrollbar — styled like a CRT slider */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); border-left: 1px solid var(--bg-rule); }
::-webkit-scrollbar-thumb {
  background: var(--bg-rule);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--fg-dim); }

/* ============================================================
   top chrome — terminal title bar
   ============================================================ */
.titlebar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 28px;
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0 var(--gutter);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--bg-rule);
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--fg-mute);
  z-index: 50;
  backdrop-filter: blur(6px);
}
.titlebar__tty {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--fg-mute);
  font-size: 12px;
  letter-spacing: 0;
  padding-right: 0.65rem;
  border-right: 1px solid var(--bg-rule);
}
.titlebar__tty::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px rgba(255, 170, 0, 0.7);
  animation: ttyblink 2.6s steps(1) infinite;
}
@keyframes ttyblink {
  0%, 92% { opacity: 1; }
  94%, 96% { opacity: 0.35; }
  98%, 100% { opacity: 1; }
}
.titlebar__path { color: var(--fg); }
.titlebar__path .at { color: var(--amber); }
.titlebar__clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.titlebar__clock::before {
  content: '◉ ';
  color: var(--amber);
  text-shadow: 0 0 8px var(--amber);
}

/* ============================================================
   page frame
   ============================================================ */
main {
  padding: 88px var(--gutter) 6rem;
  position: relative;
}

/* page-side line numbers (decorative) */
.linenos {
  position: fixed;
  left: 0;
  top: 28px; bottom: 0;
  width: var(--gutter);
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2rem;
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.08em;
  z-index: 5;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--bg-rule);
}
@media (min-width: 720px) { .linenos { display: flex; } }
.linenos span {
  line-height: 2;
  opacity: 0.6;
  transition: color 0.18s, opacity 0.18s, text-shadow 0.18s;
}
.linenos span.is-active {
  color: var(--amber);
  opacity: 1;
  text-shadow: 0 0 12px rgba(255, 170, 0, 0.65);
}

/* fixed right rail — section index */
.sections {
  position: fixed;
  right: var(--gutter);
  top: 50%; transform: translateY(-50%);
  display: none;
  flex-direction: column; gap: 0.5rem;
  font-size: 12px;
  letter-spacing: 0;
  z-index: 10;
}
@media (min-width: 1080px) { .sections { display: flex; } }
.sections a {
  color: var(--fg-dim);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.6rem;
  transition: color 0.2s;
}
.sections a::before {
  content: ''; display: inline-block;
  width: 18px; height: 1px; background: var(--fg-dim);
  transition: width 0.2s, background 0.2s;
}
.sections a:hover, .sections a.is-active { color: var(--amber); }
.sections a:hover::before, .sections a.is-active::before {
  width: 36px; background: var(--amber);
}

/* ============================================================
   sections
   ============================================================ */
section { padding: 5rem 0; max-width: var(--col); }

.cmd {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-size: 13px;
  color: var(--fg-mute);
  letter-spacing: 0;
  margin-bottom: 1.5rem;
}
.cmd::before {
  content: '$';
  color: var(--amber);
  font-weight: 700;
}
.cmd .num {
  margin-left: auto;
  color: var(--fg-dim);
  font-size: 10px;
}

/* ============================================================
   hero / boot
   ============================================================ */
.hero {
  min-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 0;
}

.boot {
  font-size: 12px;
  color: var(--fg-mute);
  margin-bottom: 2.5rem;
  white-space: pre;
  line-height: 1.85;
}
.boot .ok    { color: #74c476; }
.boot .warn  { color: var(--amber); }
.boot .dim   { color: var(--fg-dim); }
.boot > div { opacity: 0; animation: bootline 0.4s forwards; }
.boot > div:nth-child(1) { animation-delay: 0.10s; }
.boot > div:nth-child(2) { animation-delay: 0.30s; }
.boot > div:nth-child(3) { animation-delay: 0.55s; }
.boot > div:nth-child(4) { animation-delay: 0.85s; }
.boot > div:nth-child(5) { animation-delay: 1.10s; }
@keyframes bootline {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__name {
  font-size: clamp(2.6rem, 9vw, 5.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: var(--tracking-tight);
  color: var(--bone);
  margin: 0.5rem 0 1rem;
  text-shadow: 0 0 30px rgba(255, 170, 0, 0.06);
}
.hero__name .lo { color: var(--fg-mute); font-weight: 300; }

.hero__role {
  color: var(--fg-mute);
  font-size: 14px;
  letter-spacing: 0;
  margin-bottom: 2rem;
}
.hero__role .sep { color: var(--fg-dim); margin: 0 0.55rem; }
.hero__role .acc { color: var(--amber); }

.hero__name .caret {
  width: 0.45em;
  height: 0.85em;
  margin-left: 0.18em;
  vertical-align: -0.05em;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(255, 170, 0, 0.45);
}

.prompt {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-size: 14px;
  color: var(--fg);
  margin-top: 1.5rem;
}
.prompt__sym { color: var(--amber); }
.prompt input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  flex: 1;
  caret-color: var(--amber);
  min-width: 0;
}
.prompt input::placeholder { color: var(--fg-dim); font-style: normal; }
/* hide the standalone block when the input is focused — native caret takes over */
.prompt input:focus ~ .cursor { display: none; }
.cursor {
  display: inline-block;
  width: 0.55em; height: 1.05em;
  background: var(--amber);
  vertical-align: -0.18em;
  animation: blink 1.05s steps(1) infinite;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.35);
}
.cursor.thin { width: 1px; }
@keyframes blink { 50% { opacity: 0; } }

.term-output {
  font-size: 13px;
  color: var(--fg-mute);
  margin-top: 0.75rem;
  white-space: pre-wrap;
  min-height: 1.5em;
}
.term-output .ok  { color: #74c476; }
.term-output .err { color: var(--rust); }
.term-output b { color: var(--fg); font-weight: 500; }

/* ============================================================
   about
   ============================================================ */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}
@media (min-width: 760px) {
  .about { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
.about p { margin-bottom: 1rem; max-width: 56ch; }
.about p .acc { color: var(--amber); }
.about p a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--fg-dim);
  padding-bottom: 1px;
  transition: color 0.18s, border-color 0.18s;
}
.about p a:hover { color: var(--amber); border-color: var(--amber); }

.neofetch {
  font-size: 12.5px;
  color: var(--fg);
  background: var(--bg-soft);
  border: 1px solid var(--bg-rule);
  padding: 1.1rem 1.25rem;
  white-space: pre;
  line-height: 1.7;
  position: relative;
}
.neofetch::before {
  content: 'guangxin@stuttgart';
  display: block;
  color: var(--amber);
  margin-bottom: 0.3rem;
  font-weight: 500;
}
.neofetch::after {
  content: '─────────────────────────────';
  display: block;
  color: var(--fg-dim);
  margin-bottom: 0.6rem;
}
.neofetch .k { color: var(--fg-mute); }
.neofetch .v { color: var(--fg); }
.neofetch .v.acc { color: var(--amber); }

/* ============================================================
   projects
   ============================================================ */
.projects { display: flex; flex-direction: column; gap: 0; }
.proj {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.25rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--bg-rule);
  align-items: baseline;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.proj:first-child { border-top: 1px solid var(--bg-rule); }
.proj:hover { background: var(--bg-soft); }
.proj:hover .proj__name { color: var(--amber); }
.proj:hover .proj__perms { color: var(--fg-mute); }
.proj__perms {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.proj__main { min-width: 0; }
.proj__name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}
.proj__name a { color: inherit; text-decoration: none; }
.proj__name .ext { color: var(--fg-dim); font-weight: 400; }
.proj__desc {
  font-size: 13px;
  color: var(--fg-mute);
  max-width: 60ch;
  margin-bottom: 0.4rem;
}
.proj__tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.05em;
}
.proj__tags span::before { content: '· '; color: var(--bg-rule); }
.proj__tags span:first-child::before { content: ''; }
.proj__arrow {
  color: var(--fg-dim);
  font-size: 14px;
  transition: color 0.2s, transform 0.2s;
}
.proj:hover .proj__arrow { color: var(--amber); transform: translateX(2px); }

@media (max-width: 600px) {
  .proj {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  .proj__perms { grid-column: 1 / -1; order: -1; margin-bottom: -0.4rem; }
}

/* ============================================================
   log / timeline
   ============================================================ */
.log { font-size: 13px; }
.log__entry {
  position: relative;
  padding-left: 1.25rem;
  border-left: 1px solid var(--bg-rule);
  padding-bottom: 1.5rem;
}
.log__entry:last-child { padding-bottom: 0; }
.log__entry::before {
  content: '';
  position: absolute;
  left: -4px; top: 0.45rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--fg-dim);
}
.log__entry:first-child::before {
  background: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 12px rgba(255,170,0,0.4);
}
.log__hash {
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.log__meta {
  font-size: 11px;
  color: var(--fg-dim);
  margin-bottom: 0.4rem;
}
.log__msg {
  color: var(--fg);
  font-size: 14px;
  margin-bottom: 0.2rem;
}
.log__sub {
  color: var(--fg-mute);
  font-size: 12.5px;
}

/* ============================================================
   contact
   ============================================================ */
.contact { font-size: 14px; }
.contact ul { list-style: none; }
.contact li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.25rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--bg-rule);
}
.contact li:last-child { border-bottom: 0; }
.contact .k {
  color: var(--fg-dim);
  font-size: 13px;
  letter-spacing: 0;
  padding-top: 2px;
}
.contact a {
  color: var(--fg);
  text-decoration: none;
  display: inline-flex; gap: 0.4rem;
  transition: color 0.18s;
}
.contact a::after {
  content: '↗';
  color: var(--fg-dim);
  font-size: 11px;
  transform: translateY(-2px);
  transition: color 0.2s, transform 0.2s;
}
.contact a:hover { color: var(--amber); }
.contact a:hover::after { color: var(--amber); transform: translate(2px, -3px); }

/* ============================================================
   footer
   ============================================================ */
footer {
  padding: 2.5rem var(--gutter) 4rem;
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--bg-rule);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem;
  background: var(--bg-soft);
}
footer .sep { color: var(--bg-rule); }
footer code {
  color: var(--amber);
  font-family: inherit;
}
footer .right { margin-left: auto; }
footer kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--bg-rule);
  border-radius: 2px;
  font: inherit;
  font-size: 10px;
  color: var(--fg-mute);
  background: var(--bg);
  margin: 0 1px;
}

/* ============================================================
   ascii rule
   ============================================================ */
.rule {
  color: var(--fg-dim);
  font-size: 12px;
  margin: 0.5rem 0 1.5rem;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
}
