/* about.css — "about me" headline + story, and one centered open code snippet (no box) whose 4 values get one quick highlight sweep */

.glow--1 { top: -260px; left: -180px; }

/* Light theme band ends in yellow, so it flows straight into Projects (which starts yellow) */
.about { padding: 24px 0 120px; --band: linear-gradient(var(--ivory), var(--honey) 65%, var(--yellow)); }

/* ---------- Top row: headline left, paragraph right, centered with each other ---------- */
.about__intro {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 56px;
}

.about__headline {
  font-size: clamp(40px, 4.8vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--yellow);
}

.about__copy {
  border-left: 3px solid var(--yellow);
  padding-left: 28px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- The code (open, centered, no box) ---------- */
.about__code {
  position: relative;
  max-width: 860px;
  margin: 72px auto 0;
  container-type: inline-size;   /* lets the values array wrap when the code area is narrow */
}

/* Very soft yellow glow behind the code */
.about__code::before {
  content: '';
  position: absolute;
  inset: -10% 0;
  z-index: -1;
  background: radial-gradient(closest-side, var(--yellow-a20), transparent);
  filter: blur(40px);
  opacity: 0.6;
  pointer-events: none;
}

.code__file {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font: 500 13px var(--font-mono);
  color: var(--muted);
}
.code__dot { width: 8px; height: 8px; border-radius: 50%; }
.code__dot--red    { background: var(--dot-red); }
.code__dot--yellow { background: var(--dot-yellow); }
.code__dot--green  { background: var(--dot-green); margin-right: 8px; }

/* Line numbers come from a CSS counter on every numbered line, drawn in the left gutter */
.code__body {
  --gutter: calc(2ch + 33px);    /* numbers (2 digits) + 14px + 1px rule + 18px */
  position: relative;
  padding-left: var(--gutter);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.9;
  color: var(--code-text);
  white-space: normal;           /* the spaces BETWEEN lines in the HTML are ignored… */
  counter-reset: line;
}
.code__body code { display: block; }

/* the thin rule between numbers and code */
.code__body::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(2ch + 14px);
  width: 1px;
  background: var(--about-line);
}

.code__line {
  display: block;
  min-height: 1.9em;             /* empty lines keep their height while the code types, so nothing jumps */
  white-space: pre;              /* …but spaces INSIDE a line are kept (indentation) */
  counter-increment: line;
}

.code__line::before {
  content: counter(line);
  position: absolute;
  left: 0;                       /* no "top": it stays on its own line */
  width: 2ch;
  text-align: right;
  color: var(--code-num);
}

.code__kw  { color: var(--code-kw); }
.code__key { color: var(--code-key); }
.code__str { color: var(--code-str); }
/* Values: one quick sweep (.is-sweep, 0.3s each, left to right), then all 4 stay softly highlighted (.is-on) */
.code__val {
  padding: 1px 0;
  border-radius: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}
.code__val.is-on    { background: var(--code-val-bg); color: var(--code-val-text); }
.code__val.is-sweep { background: var(--code-sweep-bg); color: var(--code-val-text); }

.code__cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  margin-left: 2px;
  vertical-align: -0.2em;
  background: var(--about-accent);
  animation: code-blink 1s steps(1) infinite;
}
@keyframes code-blink { 50% { opacity: 0; } }

/* ---------- Narrow code area: one value per line (each gets its own number) ---------- */
@container (max-width: 820px) {
  .code__item,
  .code__close {
    display: block;
    min-height: 1.9em;
    counter-increment: line;
  }
  .code__item { padding-left: 4ch; }
  .code__close { padding-left: 2ch; }
  .code__item::before,
  .code__close::before {
    content: counter(line);
    position: absolute;
    left: 0;
    width: 2ch;
    text-align: right;
    color: var(--code-num);
  }
  .code__sp { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .about__intro { grid-template-columns: 1fr; gap: 28px; }   /* headline, then paragraph */
}

@media (max-width: 760px) {
  .code__body { font-size: 13px; }
}

@media (max-width: 560px) {
  .about__headline { letter-spacing: -2px; }
  .about__copy { font-size: 16px; padding-left: 20px; }}

@media (prefers-reduced-motion: reduce) {
  .code__val { transition: none; }
}
