/* ============================================================
   WINDOWS.CSS: the sections below the film are his desktop.
   Each epoch is a window styled as the program that fits its
   content (editor, table, git log, file explorer, test report,
   terminal). Colours come from the journey variables, so the
   windows follow the dark-to-stone scroll like everything else.

   A window is one build block: its direct children (title bar,
   rows, status bar) are the "parts" the helper cursors reveal
   one by one (see build.js).
   ============================================================ */

/* ---------- a smaller chapter heading above a window ---------- */
.chapter.win-chapter .ch-head { margin-bottom: 44px; gap: 24px; }
.chapter.win-chapter .ch-num { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.chapter.win-chapter .ch-title { font-size: clamp(1.5rem, 3vw, 2.4rem); max-width: 24ch; }
.chapter.win-chapter .ch-narrative { margin-top: 12px; font-size: 0.98rem; }

/* ---------- the window frame ---------- */
.win {
  position: relative;
  display: flex; flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;                       /* the corners clip the title bar and the status bar */
  background: var(--panel);
  contain: layout paint;                  /* a window is drawn on its own: nothing outside it is repainted with it */
  font-family: var(--mono);
}
.win-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--txt) 7%, var(--panel));
  border-bottom: 1px solid var(--line);
  user-select: none;
}
.win-dots { display: inline-flex; gap: 6px; }
.win-dots i { width: 9px; height: 9px; border-radius: 50%; background: color-mix(in srgb, var(--txt) 22%, transparent); }
.win-dots i:first-child { background: var(--accent); }
.win-tab {
  font-size: 0.72rem; letter-spacing: 0.04em; color: var(--txt);
  padding: 3px 10px; border-radius: 5px;
  background: color-mix(in srgb, var(--txt) 10%, transparent);
}
.win-path { margin-left: auto; font-size: 0.66rem; letter-spacing: 0.06em; color: var(--muted); }
.win-status {
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 6px 14px;
  font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--txt) 5%, var(--panel));
}
.win-status b { color: var(--accent); font-weight: 500; }

/* ---------- the text editor: about.md ---------- */
.about-win { counter-reset: ln; }
.ed-row {
  position: relative;
  display: block;
  padding: 3px 18px 3px 62px;
  font-family: var(--sans); font-size: 1rem; line-height: 1.85;
  color: var(--muted);
}
.ed-row::before {                          /* the line number in the gutter */
  counter-increment: ln;
  content: counter(ln);
  position: absolute; left: 0; top: 3px; width: 44px;
  text-align: right;
  font-family: var(--mono); font-size: 0.72rem; line-height: 2.6;
  color: color-mix(in srgb, var(--txt) 34%, transparent);
}
.ed-row.blank { padding-top: 0; padding-bottom: 0; min-height: 0.9em; }
.ed-row.blank::before { line-height: 0.9; }
.ed-row.h { font-family: var(--mono); font-weight: 700; color: var(--txt); font-size: 1.05rem; }
.ed-row.h i { color: var(--accent); font-style: normal; margin-right: 8px; }   /* the markdown # */
.ed-row.li { padding-left: 80px; }
.ed-row.li::after { content: '-'; position: absolute; left: 62px; top: 3px; color: var(--accent); font-family: var(--mono); }
.ed-row .caret {                           /* the blinking caret at the end of the last line */
  display: inline-block; width: 8px; height: 1.05em; margin-left: 4px;
  vertical-align: text-bottom; background: var(--accent);
  animation: blink 1s steps(1) infinite;
}
.ed-row.first { margin-top: 14px; }
.ed-row.last { margin-bottom: 14px; }

/* ---------- the table: stats.csv ---------- */
.csv-row {
  display: grid; grid-template-columns: 76px 1fr;
  gap: 16px; align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.csv-row.head { font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 9px 16px; }
.csv-row b { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.csv-row span { font-family: var(--sans); font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.csv-row.head span { font-family: var(--mono); font-size: 0.64rem; }

/* about: the editor beside the table */
.about-split { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .about-split { grid-template-columns: 1fr; gap: 22px; } }
@media (max-width: 560px) {
  .ed-row { padding-left: 46px; font-size: 0.94rem; }
  .ed-row::before { width: 32px; }
  .ed-row.li { padding-left: 62px; }
  .ed-row.li::after { left: 46px; }
  .win-path { display: none; }
}

/* a window that is still being built keeps its frame hidden with the rest (see build.css) */


/* ============================================================
   THE OTHER FIVE WINDOWS
   ============================================================ */
.win .caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 4px; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }
.win-chapter .ch-body > .win { max-width: 980px; }

/* ---------- skills: model.summary() ---------- */
.sum-row { display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.sum-row.head { padding: 9px 18px; font-size: 0.64rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sum-name b { display: block; font-size: 0.82rem; font-weight: 700; color: var(--accent); letter-spacing: 0.02em; }
.sum-name i { display: block; margin-top: 3px; font-style: normal; font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }
.sum-win .chips { gap: 8px; }
.sum-win .chip { font-size: 0.7rem; padding: 5px 12px; }
.win-ticker { overflow: hidden; white-space: nowrap; padding: 9px 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--txt) 4%, transparent); }
.win-ticker .marquee-track { font-size: 0.7rem; letter-spacing: 0.22em; }
@media (max-width: 760px) { .sum-row { grid-template-columns: 1fr; gap: 10px; } .sum-row.head span:last-child { display: none; } }

/* ---------- journey: git log --graph ---------- */
.log-row { display: grid; grid-template-columns: 46px 1fr; padding: 0 18px 0 0; }
.log-rail { position: relative; }
.log-rail::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 2px; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.log-row.first .log-rail::before { top: 26px; }
.log-row.last .log-rail::before { bottom: calc(100% - 26px); }
.log-rail i { position: absolute; left: 16px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 3px solid var(--panel); box-sizing: content-box; margin: -3px 0 0 -3px; }
.log-main { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
.log-row.last .log-main { border-bottom: 0; }
.log-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; font-size: 0.74rem; letter-spacing: 0.04em; }
.log-line b { color: var(--accent); font-weight: 700; }
.log-head { font-style: normal; font-size: 0.62rem; letter-spacing: 0.1em; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: var(--deep); }
.log-tag { color: var(--muted); }
.log-date { margin-left: auto; color: var(--muted); font-size: 0.68rem; }
.log-main h3 { margin-top: 8px; font-family: var(--sans); font-size: 1.12rem; font-weight: 700; color: var(--txt); line-height: 1.3; }
.log-main h4 { margin-top: 3px; font-family: var(--sans); font-size: 0.86rem; font-weight: 400; color: var(--accent); }
.log-main p { margin-top: 8px; font-family: var(--sans); font-size: 0.92rem; line-height: 1.7; color: var(--muted); }
.log-main .pts { margin-top: 8px; }
@media (max-width: 560px) { .log-row { grid-template-columns: 32px 1fr; } .log-rail::before { left: 14px; } .log-rail i { left: 8px; } .log-date { margin-left: 0; } }

/* ---------- projects: file explorer ---------- */
.xp { display: grid; grid-template-columns: 270px 1fr; min-height: 420px; }
.xp-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--txt) 3%, transparent); }
.xp-file { display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer; padding: 13px 16px; font: inherit; color: var(--muted); background: none; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.xp-file:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--txt); }
.xp-file.on { background: var(--accent-soft); border-left-color: var(--accent); color: var(--txt); }
.xp-name { font-size: 0.7rem; letter-spacing: 0.06em; color: var(--accent); }
.xp-title { font-family: var(--sans); font-size: 0.86rem; line-height: 1.35; }
.xp-view { padding: 22px 26px 24px; min-width: 0; }
.xp-pane[hidden] { display: none; }
.xp-pane { animation: kidIn 0.35s ease-out; }
.xp-key { display: inline-block; font-size: 0.7rem; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.xp-pane h3 { margin-top: 12px; font-family: var(--sans); font-size: 1.3rem; font-weight: 700; line-height: 1.25; color: var(--txt); }
.xp-pane > p { margin-top: 8px; font-family: var(--sans); font-size: 0.95rem; line-height: 1.7; color: var(--muted); }
.xp-pane .pts { margin: 12px 0 18px; }
.xp-pane .proj-tags { margin-bottom: 16px; }
@media (max-width: 760px) {
  .xp { grid-template-columns: 1fr; }
  .xp-list { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; }
  .xp-file { flex: 0 0 auto; border-bottom: 0; border-left: 0; border-bottom: 3px solid transparent; }
  .xp-file.on { border-bottom-color: var(--accent); }
  .xp-title { display: none; }
  .xp-view { padding: 18px 16px 20px; }
}

/* ---------- certifications: a test report ---------- */
.t-head { padding: 12px 18px; font-size: 0.74rem; letter-spacing: 0.06em; color: var(--muted); border-bottom: 1px solid var(--line); }
.t-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: baseline; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.t-name { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--txt); line-height: 1.4; }
.t-res { font-size: 0.7rem; letter-spacing: 0.14em; color: var(--accent); }
.t-res::before { content: '\2713\00a0'; }
.t-row p { grid-column: 1 / -1; font-family: var(--sans); font-size: 0.88rem; line-height: 1.6; color: var(--muted); }

/* ---------- contact: a terminal with its buttons in one landscape row ---------- */
.win-chapter .ch-body > .sh-win { max-width: 980px; }
.sh-row { padding: 9px 22px; font-size: 0.92rem; line-height: 1.6; color: var(--muted); }
.sh-row.first { padding-top: 22px; }
.sh-p { display: inline-block; min-width: 3.2em; color: var(--accent); }
.sh-buttons { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 14px; align-items: stretch; padding: 10px 22px 26px; }
.sh-btn {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 16px 14px;
  font-family: var(--mono); font-size: 0.9rem; letter-spacing: 0.04em; text-decoration: none;
  color: var(--txt);
  border: 1px solid var(--line); border-radius: 8px;
  transition: transform 0.2s, border-color 0.2s, color 0.2s;
}
.sh-btn:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }
.sh-btn.solid { flex: 2 1 0; font-weight: 700; color: var(--deep); background: var(--accent); border-color: var(--accent); }
.sh-btn.solid:hover { color: var(--deep); }
@media (max-width: 560px) {
  .sh-buttons { flex-wrap: wrap; }
  .sh-btn { flex: 1 1 28%; padding: 14px 8px; font-size: 0.8rem; }
  .sh-btn.solid { flex: 1 1 100%; }
}
#contact .ch-body { margin: 8px auto 0; width: 100%; max-width: 940px; }

/* small accent text needs more contrast once the page turns light: mix the accent toward the text colour */
.win { --acc-text: color-mix(in srgb, var(--accent) 60%, var(--txt)); }
.win-status b, .t-res, .xp-name, .xp-key, .sum-name b, .log-line b, .log-main h4, .csv-row b, .sh-p, .ed-row.h i, .ed-row.li::after, .win-ticker em { color: var(--acc-text); }

/* the personal hook: a markdown quote line at the top of about.md */
.ed-row.q { font-style: italic; color: var(--txt); padding-left: 80px; }
.ed-row.q::after { content: '>'; position: absolute; left: 62px; top: 3px; font-family: var(--mono); font-style: normal; color: var(--acc-text, var(--accent)); }
@media (max-width: 560px) { .ed-row.q { padding-left: 62px; } .ed-row.q::after { left: 46px; } }
