/* ───────────────────────────────────────────────────────────
   kikohimself.com — Amber CRT (V8)
   Production styles. Responsive desktop + mobile.
   Designed mobile-first; min-width: 720px upgrades to desktop.
   ─────────────────────────────────────────────────────────── */

:root {
  --bg:    #0F0A04;          /* deep near-black */
  --ink:   #FFB454;          /* primary amber */
  --dim:   #A8783C;          /* muted amber (accessibility-tuned) */
  --hot:   #FFD58A;           /* bright text */
  --cream: #FFE9C2;           /* highest emphasis */
  --rule:  rgba(255, 180, 84, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.65;
  text-shadow: none;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  /* iOS safe-area for notch */
  padding-top: env(safe-area-inset-top);
}

a {
  color: var(--hot);
  text-decoration: underline;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: background-color 0.08s, color 0.08s;
}
a:hover, a:focus-visible {
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  outline: none;
}

button,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none !important; opacity: 0.7; }
}

/* ───────────────────────────────────────────────────────────
   Connection bar (top)
   ─────────────────────────────────────────────────────────── */
.connbar {
  position: relative;
  z-index: 3;
  background: #000;
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.connbar-row {
  display: flex;
  align-items: stretch;
}
.connbar-row-sub {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid rgba(255,180,84,0.13);
  color: var(--dim);
}
.connbar-tag {
  padding: 8px 14px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  text-shadow: none;
}
.connbar-cell {
  padding: 8px 14px;
  color: var(--dim);
}
.connbar-spacer { margin-left: auto; }
.connbar-host {
  margin-left: auto;
  color: var(--ink);
  font-weight: 700;
}

/* Hide non-essential cells on small screens; sub-row shows them */
.connbar-hide-sm { display: none; }

@media (min-width: 720px) {
  .connbar { font-size: 11px; letter-spacing: 0.2em; }
  .connbar-tag { padding: 8px 18px; }
  .connbar-cell { padding: 8px 18px; }
  .connbar-hide-sm { display: block; }
  .connbar-row-sub { display: none; }   /* desktop has it all on one line */
  .connbar-host { margin-left: 0; }     /* connbar-spacer takes margin-left:auto on desktop */
}

/* ───────────────────────────────────────────────────────────
   Main screen content
   ─────────────────────────────────────────────────────────── */
.screen {
  position: relative;
  z-index: 3;
  max-width: 960px;
  margin: 0;
  padding: 24px 18px 32px;
}
@media (min-width: 720px) {
  .screen {
    padding: 36px 28px 48px;
    font-size: 14px;
  }
}
@media (min-width: 1200px) {
  .screen {
    padding-left: 34px;
  }
}

/* MOTD */
.motd {
  margin: 0 0 12px;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
  white-space: pre-wrap;
  line-height: 1.5;
}
@media (min-width: 720px) {
  .motd { font-size: 11px; white-space: pre; }
}

/* Prompt line */
.prompt {
  margin: 18px 0 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.prompt::-webkit-scrollbar { display: none; }
@media (min-width: 720px) {
  .prompt { font-size: 13px; margin: 22px 0 8px; }
}
.p-host { color: var(--hot); font-weight: 700; }
.p-sep  { color: var(--dim); }
.p-cwd  { color: var(--cream); }
.p-cmd  { color: var(--ink); }

/* ASCII banners — show desktop OR mobile, never both */
.banner {
  margin: 6px 0 4px;
  white-space: pre;
  font-weight: 700;
  color: var(--hot);
  letter-spacing: 0;
  overflow-x: auto;
}
.banner-desktop { display: none; font-size: 22px; line-height: 1.1; }
.banner-mobile  { display: block; font-size: 16px; line-height: 1.0; }

@media (min-width: 720px) {
  .banner-desktop { display: block; }
  .banner-mobile  { display: none; }
}

/* Name */
.name {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0.02em;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--cream);
  margin: 14px 0 4px;
  text-wrap: balance;
}
@media (min-width: 720px) {
  .name { font-size: 28px; line-height: 1.15; }
}

.cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--hot);
  vertical-align: -0.12em;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { to { opacity: 0.15; } }

.subtitle {
  font-size: 9.5px;
  color: var(--dim);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 18px;
  line-height: 1.5;
}
.sub-sep { display: inline; }
@media (min-width: 720px) {
  .subtitle { font-size: 11px; margin-bottom: 24px; }
}

.description {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  max-width: 700px;
}
@media (min-width: 720px) {
  .description { font-size: 14px; margin-bottom: 28px; }
}
.description .quote { color: var(--dim); }

/* whoami / kiko.conf — show only one */
.kconf {
  margin: 0 0 24px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre;
  overflow-x: auto;
}
.kconf-desktop { display: none; font-size: 13px; }
.kconf-mobile  { display: block; }
@media (min-width: 720px) {
  .kconf-desktop { display: block; margin-bottom: 32px; }
  .kconf-mobile  { display: none; }
}

/* ───────────────────────────────────────────────────────────
   Generic card — used by sections & netstat
   ─────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--ink);
  background: rgba(0,0,0,0.4);
  margin-bottom: 24px;
}
@media (min-width: 720px) {
  .card { margin-bottom: 36px; }
}

/* Card header (column labels) — hidden on mobile, shown desktop */
.card-head {
  display: none;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
@media (min-width: 720px) {
  .card-head { display: grid; }
}
.sections-head { grid-template-columns: 160px 1fr; }
.netstat-head  {
  grid-template-columns: minmax(110px, 0.85fr) 70px minmax(150px, 1.15fr) minmax(180px, 1.4fr) 70px;
}

/* ─── Sections rows ─── */
.section-row {
  padding: 14px 14px 16px;
  border-top: 1px solid var(--rule);
  font-size: 12.5px;
}
.section-row:first-of-type { border-top: none; }
@media (min-width: 720px) {
  .section-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    padding: 18px;
    align-items: start;
    font-size: 13px;
  }
}

.section-meta { margin-bottom: 4px; }
@media (min-width: 720px) {
  .section-meta { margin-bottom: 0; }
}
.section-label { color: var(--hot); font-weight: 700; font-size: 12px; display: inline; }
.section-file  { color: var(--dim); font-size: 10px; margin-left: 8px; display: inline; }
@media (min-width: 720px) {
  .section-label { font-size: 13px; display: block; }
  .section-file  { font-size: 11px; margin-left: 0; margin-top: 4px; display: block; }
}
.section-body { color: var(--ink); line-height: 1.7; }
@media (min-width: 720px) { .section-body { line-height: 1.75; } }

/* ─── Netstat rows ─── */
.net-row {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 14px;
  row-gap: 7px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  font-size: 12.5px;
}
.net-row:first-of-type { border-top: none; }
.net-row:hover, .net-row:focus-visible {
  background: rgba(255,180,84,0.08);
  outline: none;
}
.net-row:hover a, .net-row:focus-visible a { /* nested links don't apply but keep colors */ }

/* mobile layout — stacked w/ inline meta */
.net-id {
  color: var(--dim);
  font-size: 10px;
  margin-right: 0;
  text-transform: lowercase;
}
.net-proto {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  color: var(--bg);
  background: var(--ink);
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 700;
  text-shadow: none;
  margin-right: 0;
}
.net-svc {
  grid-column: 1;
  grid-row: 2;
  color: var(--hot);
  font-weight: 700;
  margin-right: 0;
}
.net-state  {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.14em;
  float: none;
}
.net-handle {
  grid-column: 1 / 3;
  grid-row: 3;
  color: var(--ink);
  padding-left: 0;
  margin-top: 0;
}

/* desktop grid layout */
@media (min-width: 720px) {
  .net-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.85fr) 70px minmax(150px, 1.15fr) minmax(180px, 1.4fr) 70px;
    align-items: center;
    column-gap: 18px;
    row-gap: 0;
    padding: 14px 18px;
    font-size: 13px;
  }
  .net-id, .net-svc, .net-proto { margin-right: 0; }
  .net-id,
  .net-proto,
  .net-svc,
  .net-handle,
  .net-state {
    grid-row: auto;
    grid-column: auto;
    justify-self: stretch;
  }
  .net-proto { padding: 2px 8px; font-size: 10px; text-align: center; justify-self: start; }
  .net-state { color: var(--cream); font-size: 11px; letter-spacing: 0.16em; float: none; justify-self: end; }
  .net-handle { display: inline; padding-left: 0; margin-top: 0; }
}

/* ───────────────────────────────────────────────────────────
   Mail card
   ─────────────────────────────────────────────────────────── */
.mailcard {
  border: 2px solid var(--ink);
  background: rgba(0,0,0,0.5);
  padding: 16px 16px 18px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .mailcard {
    padding: 22px 26px;
    margin-bottom: 24px;
  }
}
.mailcard-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}
@media (min-width: 720px) {
  .mailcard-head { font-size: 10px; margin-bottom: 12px; }
}
.mailcard-to { font-size: 11px; color: var(--dim); margin-bottom: 4px; }
@media (min-width: 720px) { .mailcard-to { font-size: 12px; } }

.mailcard-addr {
  display: inline-block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
  word-break: break-word;
}
.mailcard-addr:hover, .mailcard-addr:focus-visible {
  background: var(--ink);
  color: var(--bg);
  border-bottom-color: var(--ink);
}
@media (min-width: 720px) {
  .mailcard-addr { font-size: 22px; padding-bottom: 4px; }
}

.mailcard-note {
  font-size: 11px;
  color: var(--dim);
  font-style: italic;
  margin: 12px 0 0;
}
@media (min-width: 720px) { .mailcard-note { font-size: 12px; margin-top: 14px; } }

/* ───────────────────────────────────────────────────────────
   Interactive shell
   ─────────────────────────────────────────────────────────── */
.shellcard {
  border: 1px solid var(--rule);
  background: rgba(0,0,0,0.42);
  margin: 0 0 28px;
}
.shell-output {
  min-height: 130px;
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 12px;
}
.shell-output p {
  margin: 0;
  line-height: 1.65;
  white-space: pre;
}
.shell-output p + p,
.shell-block + .shell-block {
  margin-top: 8px;
}
.shell-muted {
  color: var(--dim);
}
.shell-command {
  color: var(--cream);
}
.shell-inline-command {
  color: var(--cream);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 0 1px 1px;
  cursor: pointer;
}
.shell-inline-command:hover,
.shell-inline-command:focus-visible {
  background: var(--ink);
  color: var(--bg);
  outline: none;
  text-shadow: none;
}
.shell-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}
.shell-prompt {
  color: var(--hot);
  font-weight: 700;
}
.shell-form input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--cream);
  caret-color: var(--hot);
  outline: none;
}
.shell-form input::placeholder {
  color: rgba(168,120,60,0.8);
}
.shell-form button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--hot);
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
}
.shell-form button:hover,
.shell-form button:focus-visible {
  background: var(--ink);
  color: var(--bg);
  outline: none;
  text-shadow: none;
}
@media (min-width: 720px) {
  .shell-output {
    min-height: 150px;
    padding: 16px 18px;
    font-size: 13px;
  }
  .shell-form {
    padding: 12px 18px;
  }
}

/* ───────────────────────────────────────────────────────────
   Baud-rate footer
   ─────────────────────────────────────────────────────────── */
.baudbar {
  position: relative;
  z-index: 3;
  background: var(--ink);
  color: var(--bg);
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  text-shadow: none;
}
@media (min-width: 720px) {
  .baudbar { padding: 8px 18px; font-size: 11px; letter-spacing: 0.22em; }
}
/* Hide middle items on very narrow screens */
.baud-mid { display: none; }
@media (min-width: 480px) { .baud-mid { display: inline; } }
