/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== TOKENS ===== */
:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #888888;
  --muted-2: #cccccc;
  --max-w: 1600px;
}

/* ===== BASE ===== */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ===== LAYOUT ===== */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

@media (min-width: 768px) {
  .page { padding: 4rem 3rem 2.5rem; }
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(12, 1fr); gap: 2rem; }
  .col-left { grid-column: span 4; }
  .col-spacer { grid-column: span 1; }
  .col-right { grid-column: span 7; }
}

/* ===== NAME ===== */
.name {
  font-family: 'Instrument Serif', ui-serif, Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.name .dim {
  color: var(--muted);
}

/* ===== BIO ===== */
.bio p {
  font-size: 0.88rem;
  color: var(--muted-2);
  max-width: 32rem;
  margin-bottom: 1.1rem;
}

.bio p:last-child {
  margin-bottom: 0;
}

.meta-block {
  color: var(--muted) !important;
}

.meta-block a {
  display: inline-flex;
  margin-top: 0.3rem;
}

.stack {
  font-size: 0.78rem;
  color: var(--muted) !important;
}

/* ===== TERMINAL ===== */
.terminal {
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  background: #141414;
  padding: 1rem 1.1rem;
  font-size: 0.8rem;
  line-height: 1.7;
  max-width: 32rem;
}

.term-line {
  color: var(--text);
}

.prompt {
  color: var(--muted);
  margin-right: 0.35rem;
  user-select: none;
}

.term-out {
  color: var(--muted-2);
  margin: 0.15rem 0 0.9rem;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}

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

/* ===== STATS ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 1.5rem;
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #1a1a1a;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
}

.stat {
  border-left: 1px solid #1f1f1f;
  padding-left: 1.1rem;
  transition: border-color 0.3s ease;
}

.stat:hover {
  border-color: rgba(255, 255, 255, 0.55);
}

.stat-num {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ===== PHOTO ===== */
.photo-wrap {
  width: 100%;
  max-width: 190px;
  aspect-ratio: 3 / 5;
  overflow: hidden;
  background: #111111;
  border-radius: 2px;
}

.photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: grayscale(100%);
  transition: filter 0.35s ease;
}

.photo-wrap:hover .photo {
  filter: grayscale(0%);
}

/* ===== ELSEWHERE / SECTION LABELS ===== */
.elsewhere h3,
.col-right h3 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 1rem;
}

.col-right h3 {
  margin-bottom: 2.5rem;
}

.elsewhere ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.85rem;
}

/* ===== LINKS (dotted underline + arrow) ===== */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  transition: color 0.2s;
}

.arrow-link:hover {
  color: #d4d4d4;
}

.underline-text {
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.arrow-link:hover .underline-text {
  border-color: rgba(255, 255, 255, 1);
}

.arrow-link::after {
  content: "↗";
  font-size: 0.7em;
  opacity: 0.5;
  transform: translate(0, 0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.arrow-link:hover::after {
  opacity: 1;
  transform: translate(2px, -2px);
}

/* ===== RIGHT COLUMN / ENTRIES ===== */
.col-right {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 640px) {
  .col-right { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.item {
  margin-bottom: 3rem;
}

.item:last-child {
  margin-bottom: 0;
}

.item .num {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.item .title {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.item .subtitle {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted-2);
  margin-bottom: 0.4rem;
}

.item .meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
}

/* ===== FOOTER ===== */
.page-footer {
  margin-top: 4rem;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333333; }

/* ===== STAGGERED FADE-IN ===== */
.fade-item {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fade-item {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 639px) {
  .photo-wrap {
    max-width: 150px;
  }
}
