/* ==========================================================================
   tomi.md — TUI theme
   --------------------------------------------------------------------------
   Palette derived from the Data36 design system, inverted for a terminal:
     brand green        #41905C  -> dimmed accent, borders, secondary text
     brand green hover  #20D181  -> primary terminal green
     brand navy         #1D2448  -> the base the dark neutrals are mixed from
     semantic amber/red #E8A13B / #D9534F  carried over unchanged
   Design-system ethos kept: hairline borders, small radii, no gradients,
   no glass, no heavy effects. Monospace throughout, because it's a terminal.
   ========================================================================== */

:root {
  --bg:          #0B0F1A;
  --bg-panel:    #111726;
  --bg-elev:     #161D2F;
  --bg-hover:    #1A2236;

  --border:      #222B42;
  --border-br:   #2E3A57;

  --fg:          #DDE3EE;
  --fg-dim:      #8A93A8;
  --fg-faint:    #5D6980;

  --green:       #20D181;
  --green-dk:    #41905C;
  --green-glow:  rgba(32, 209, 129, 0.14);
  --amber:       #E8A13B;
  --red:         #D9534F;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
          Menlo, Consolas, "Liberation Mono", monospace;

  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;

  --statusbar-h: 34px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-bottom: calc(var(--statusbar-h) + 8px);
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--green); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: currentColor; }

::selection { background: var(--green); color: #04120B; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border-br);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--fg-dim);
  white-space: nowrap;
}

.prompt { color: var(--green); font-weight: 700; user-select: none; }
.hl { color: var(--green); }

/* ── layout ────────────────────────────────────────────────────────────── */
.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 20px 60px;
}

/* ── hero ──────────────────────────────────────────────────────────────── */
.hero { margin-bottom: 38px; }

.hero__ascii {
  margin: 0 0 22px;
  font-size: clamp(6px, 1.62vw, 14px);
  line-height: 1.25;
  color: var(--green);
  overflow: hidden;
  white-space: pre;
}

.hero__h1 {
  display: none;
  margin: 0 0 18px;
  font-size: 26px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.5px;
}

.hero__lines p { margin: 0 0 4px; }
.hero__lines .out {
  color: var(--fg-dim);
  padding-left: 16px;
  max-width: 78ch;
}
.hero__lines .line { color: var(--fg); }
.hero__lines .line + .line,
.hero__lines .out + .line { margin-top: 16px; }

/* ── toolbar ───────────────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 6px; }

.tab {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 6px 12px;
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.tab:hover { color: var(--fg); border-color: var(--border-br); }
.tab[aria-selected="true"] {
  color: var(--green);
  border-color: var(--green-dk);
  background: var(--green-glow);
}
.tab__n { color: var(--fg-faint); margin-left: 6px; }
.tab[aria-selected="true"] .tab__n { color: var(--green-dk); }
.tab__key { color: var(--fg-faint); margin-right: 2px; }
.tab[aria-selected="true"] .tab__key { color: var(--green-dk); }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  max-width: 400px;
  padding: 5px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.search:focus-within { border-color: var(--green-dk); }
.search__prompt { color: var(--green); font-size: 12.5px; flex: none; user-select: none; }
.search__input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
}
.search__input::placeholder { color: var(--fg-faint); }
.search__input::-webkit-search-cancel-button { filter: invert(0.6); }
.search__kbd { flex: none; }
.search:focus-within .search__kbd { opacity: 0; }

/* ── listing ───────────────────────────────────────────────────────────── */
.listing {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  overflow: hidden;
}

.listing__head,
.row {
  display: grid;
  grid-template-columns: 78px 58px 62px 104px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 9px 16px;
}

.listing__head {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--fg-faint);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.rows { margin: 0; padding: 0; list-style: none; outline: none; }

.row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
}
.rows li:last-child .row { border-bottom: 0; }
.row:hover { background: var(--bg-hover); }
.row.is-active {
  background: var(--green-glow);
  box-shadow: inset 3px 0 0 var(--green);
}

.col-mode  { color: var(--fg-faint); font-size: 12px; }
.col-size  { color: var(--amber); font-size: 12px; }
.col-lines { color: var(--fg-faint); font-size: 12px; }
.col-date  { color: var(--fg-faint); font-size: 12px; }

.col-name { min-width: 0; }
.name {
  color: var(--fg);
  font-weight: 500;
  word-break: break-word;
}
.row.is-active .name,
.row:hover .name { color: var(--green); }

.desc {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-dim);
}

.tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 10.5px;
  padding: 1px 6px;
  border: 1px solid var(--border-br);
  border-radius: var(--r-sm);
  color: var(--fg-faint);
}

.col-act { display: flex; gap: 6px; align-items: center; flex: none; }

.btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 11px;
  border: 1px solid var(--border-br);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--fg-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.btn:hover {
  color: var(--green);
  border-color: var(--green-dk);
  background: var(--green-glow);
}
.btn--primary { color: var(--green); border-color: var(--green-dk); }
.btn--primary:hover { background: var(--green); color: #04120B; border-color: var(--green); }

.empty { padding: 22px 16px; margin: 0; color: var(--fg-dim); }
.linkish {
  background: none; border: 0; padding: 0;
  font-family: var(--mono); font-size: inherit;
  color: var(--green); cursor: pointer;
  border-bottom: 1px solid currentColor;
}

/* ── footer ────────────────────────────────────────────────────────────── */
.foot {
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}
.foot p { margin: 0 0 4px; }
.foot .out { color: var(--fg-dim); padding-left: 16px; max-width: 78ch; }
.foot__cmd { margin-top: 22px; }

.foot__by {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--fg-faint);
}
.foot__motto { color: var(--green-dk); }

/* ── privacy policy (collapsible) ──────────────────────────────────────── */
.policy {
  margin: 6px 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  max-width: 84ch;
}

.policy__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.policy__summary::-webkit-details-marker { display: none; }
.policy__summary:hover .policy__label { color: var(--green); }

.policy__chev {
  flex: none;
  color: var(--green);
  transition: transform .15s;
}
.policy[open] .policy__chev { transform: rotate(90deg); }

.policy__label { color: var(--fg); font-weight: 500; }
.policy__tldr { font-size: 11.5px; color: var(--green-dk); }

.policy__body {
  padding: 4px 18px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--fg-dim);
}
.policy__updated {
  margin: 14px 0 18px;
  font-size: 11.5px;
  color: var(--fg-faint);
}
.policy__body h2 {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.3px;
}
.policy__body h2::before { content: "## "; color: var(--fg-faint); font-weight: 400; }
.policy__body p { margin: 0 0 10px; line-height: 1.7; }
.policy__body strong { color: var(--fg); font-weight: 700; }
.policy__body ul { margin: 0 0 12px; padding-left: 0; list-style: none; }
.policy__body li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 4px;
  line-height: 1.65;
}
.policy__body li::before {
  content: "-";
  position: absolute;
  left: 4px;
  color: var(--green-dk);
}

/* ── status bar ────────────────────────────────────────────────────────── */
.statusbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--statusbar-h);
  padding: 0 14px;
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--fg-faint);
}
.statusbar__mode {
  flex: none;
  padding: 2px 9px;
  border-radius: var(--r-sm);
  background: var(--green);
  color: #04120B;
  font-weight: 700;
  letter-spacing: 0.6px;
}
.statusbar__count { flex: none; color: var(--fg-dim); }
.statusbar__keys {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

/* ── responsive ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .listing__head, .row { grid-template-columns: 62px 1fr auto; }
  .col-mode, .col-lines, .col-date { display: none; }
}

@media (max-width: 640px) {
  .hero__ascii { display: none; }
  .hero__h1 { display: block; }
  .statusbar__keys { display: none; }
  .wrap { padding: 24px 14px 50px; }
  .listing__head, .row { grid-template-columns: 1fr auto; gap: 10px; }
  .col-size { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Honour an explicit light-theme preference minimally — this page is
   deliberately a dark terminal, so we only soften the pure black. */
@media print {
  body { background: #fff; color: #000; }
  .statusbar, .toolbar { display: none; }
}

/* ==========================================================================
   tomi.md — portfolio / CV additions
   ========================================================================== */

/* ── hero extras ───────────────────────────────────────────────────────── */
.hero__ascii { font-size: clamp(11px, 3.6vw, 22px); }

.name-strong { color: var(--green); font-weight: 700; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-left: 16px;
}
.hero__actions .btn { padding: 6px 14px; font-size: 12.5px; text-decoration: none; }
.hero__actions a.btn { border-bottom: 1px solid var(--border-br); }
.hero__actions a.btn:hover { border-bottom-color: var(--green-dk); }
.hero__actions .btn--primary { border-bottom-color: var(--green-dk); }

/* ── stat strip ────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  margin: 0 0 46px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--bg-panel);
}
.stat__n { font-size: 20px; font-weight: 700; color: var(--green); line-height: 1.2; }
.stat__l { font-size: 11.5px; color: var(--fg-faint); }

/* ── sections ──────────────────────────────────────────────────────────── */
.section { margin-bottom: 46px; }
.section__cmd { margin: 0 0 16px; color: var(--fg); }

.sub {
  margin: 20px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--green);
}
.sub:first-child { margin-top: 0; }

.out--tight { padding-left: 0; margin: 0 0 4px; color: var(--fg-dim); }
.muted { color: var(--fg-faint); }

/* ── project rows (4 columns, not 6) ───────────────────────────────────── */
.listing__head, .row {
  grid-template-columns: 92px 76px 1fr auto;
}

.col-status { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.col-year { color: var(--fg-faint); font-size: 12px; }

.dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex: none;
  background: var(--fg-faint);
}
.dot--active { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.dot--live { background: var(--green-dk); }
.dot--archived { background: var(--fg-faint); }
.dot__l { color: var(--fg-faint); font-size: 11px; }

.host {
  margin-left: 8px;
  font-size: 11.5px;
  color: var(--fg-faint);
}
.btn--ghost { background: none; border-color: transparent; cursor: default; }
.btn--ghost:hover { color: var(--fg-dim); border-color: transparent; background: none; }

.empty { padding: 22px 16px; margin: 0; color: var(--fg-dim); }
.empty__sub { display: block; margin-top: 6px; font-size: 12.5px; color: var(--fg-faint); }

/* ── timeline ──────────────────────────────────────────────────────────── */
.timeline {
  margin: 0;
  padding: 0 0 0 2px;
  list-style: none;
  border-left: 1px solid var(--border);
}
.tl {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  padding: 0 0 26px 22px;
  position: relative;
}
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: "";
  position: absolute;
  left: -4px; top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green-dk);
}
.tl:first-child::before { background: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }

.tl__year { font-size: 12.5px; color: var(--green); padding-top: 1px; }
.tl__role { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--fg); }
.tl__at { font-weight: 400; color: var(--fg-dim); }
.tl__desc { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--fg-dim); max-width: 78ch; }

/* ── skills ────────────────────────────────────────────────────────────── */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.skillset__h {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--green);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-size: 12px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-panel);
  color: var(--fg-dim);
}

/* ── two-column block ──────────────────────────────────────────────────── */
.twocol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.langs { margin: 0; padding: 0; list-style: none; }
.langs li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.langs li:last-child { border-bottom: 0; }
.lang__n { color: var(--fg-dim); }
.lang__lvl { color: var(--fg-faint); font-size: 12px; }

/* ── responsive overrides ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .listing__head, .row { grid-template-columns: 20px 1fr auto; }
  .col-year { display: none; }
  .dot__l { display: none; }
}

@media (max-width: 640px) {
  .hero__ascii { display: block; }
  .hero__h1 { display: none; }
  .listing__head, .row { grid-template-columns: 20px 1fr auto; gap: 10px; }
  .tl { grid-template-columns: 1fr; gap: 4px; padding-left: 18px; }
  .tl__year { padding-top: 0; }
  .hero__actions { padding-left: 0; }
}
