/* ------------------------------------------------------------------
   Muneeb Almoliky — portfolio
   Hand-written CSS. No framework, no reset beyond the few lines below.
   Palette: warm paper, near-black ink, one oxide-red accent.
   ------------------------------------------------------------------ */

:root {
  --paper:  #f4f0e6;
  --ink:    #1b1712;
  --soft:   #5c554a;             /* secondary text */
  --hair:   rgba(27, 23, 18, .18); /* hairline rules */
  --hair-soft: rgba(27, 23, 18, .08);
  --accent: #a03d22;             /* oxide red */
  --status: #2b7a4b;             /* available green */
  --serif:  "Newsreader", Georgia, "Times New Roman", serif;
  --mono:   "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 34em;
}

/* Dark: same paper-and-ink idea, lights off. Follows the system unless
   the masthead toggle has set an explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:  #191511;
    --ink:    #e9e2d2;
    --soft:   #a49a89;
    --hair:   rgba(233, 226, 210, .2);
    --hair-soft: rgba(233, 226, 210, .1);
    --accent: #c96f4e;
    --status: #48b870;
  }
}

:root[data-theme="dark"] {
  --paper:  #191511;
  --ink:    #e9e2d2;
  --soft:   #a49a89;
  --hair:   rgba(233, 226, 210, .2);
  --hair-soft: rgba(233, 226, 210, .1);
  --accent: #c96f4e;
  --status: #48b870;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  transition: background-color .25s ease, color .25s ease;
}

::selection { background: var(--accent); color: var(--paper); }

main, .masthead, .colophon {
  max-width: 68rem;
  margin-inline: auto;
}

/* ---- type utilities ---------------------------------------------- */

.mono, .mono-label { font-family: var(--mono); }

.mono-label {
  font-size: .6875rem;           /* 11px */
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft);
}

sup { font-size: .65em; color: var(--accent); }

/* ---- links -------------------------------------------------------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hair);
  text-underline-offset: .2em;
  transition: color .15s ease, text-decoration-color .15s ease;
}

a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.arrow {
  display: inline-block;
  font-size: .55em;
  vertical-align: .55em;
  margin-left: .35em;
  color: var(--accent);
  transition: transform .2s ease;
}

h2 a:hover .arrow { transform: translate(2px, -2px); }

/* ---- masthead / colophon ------------------------------------------ */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--hair);
  padding: 1.1rem 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.masthead-name {
  grid-column: 1;
  text-decoration: none;
  justify-self: start;
  white-space: nowrap;
}

.masthead-time,
.masthead-nav {
  grid-column: 2;
  justify-self: center;
}

.masthead-nav {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

.masthead.is-scrolled .masthead-time { display: none; }
.masthead.is-scrolled .masthead-nav { display: flex; }

.masthead-nav a {
  text-decoration: none;
  color: var(--soft);
  font-size: .6875rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .15s ease;
  white-space: nowrap;
}

.masthead-nav a span:first-child {
  color: var(--accent);
  margin-right: .35em;
  opacity: .75;
  transition: opacity .15s ease;
}

.masthead-nav a:hover { color: var(--ink); }
.masthead-nav a:hover span:first-child { opacity: 1; }

.masthead-nav a[aria-current="true"] {
  color: var(--ink);
}

.masthead-nav a[aria-current="true"] span:first-child {
  opacity: 1;
}

.masthead-nav a[aria-current="true"] .nav-text {
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
}

.masthead-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-self: end;
  white-space: nowrap;
}

/* Anchors land clear of the sticky masthead. */
.section, .intro { scroll-margin-top: 3.75rem; }

.colophon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--hair);
  margin-top: 6rem;
}

.masthead > :first-child { color: var(--ink); }

.term-trigger-btn {
  background: none;
  border: 1px solid transparent;
  padding: .15rem .45rem;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .06em;
  color: var(--ink);
  transition: all .15s ease;
  white-space: nowrap;
}

.term-trigger-btn:hover {
  border-color: var(--hair);
  color: var(--accent);
  background: rgba(160, 61, 34, 0.06);
}

.nav-sep {
  color: var(--hair);
  font-family: var(--mono);
  font-size: .6875rem;
  user-select: none;
}

.theme-toggle {
  background: none;
  border: 0;
  padding: .25rem .35rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: color .15s ease, transform .2s ease;
  line-height: 1;
  border-radius: 3px;
}

.theme-toggle:hover {
  color: var(--accent);
  transform: scale(1.15);
}

.theme-icon {
  font-size: .95rem;
  line-height: 1;
  display: inline-block;
  user-select: none;
}

.masthead-status::before {
  content: "";
  display: inline-block;
  width: .5em; height: .5em;
  background: var(--status);
  border-radius: 50%;
  margin-right: .55em;
  animation: pulse 2.5s infinite ease-in-out;
}

/* ---- intro --------------------------------------------------------- */

.intro { padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3rem, 7vw, 5rem); }

h1 {
  font-weight: 300;
  font-size: clamp(2.3rem, 9.6vw, 5.75rem);
  line-height: 1.04;
  letter-spacing: -.025em;
}

.h1-line {
  white-space: nowrap;
}

h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-cmd-line,
.hero-cmd-line a,
.typing-line,
.typing-text {
  color: var(--accent);
  font-style: normal;
}

.hero-cmd-prompt {
  font-family: var(--mono);
  font-size: .82em;
  font-style: normal;
  font-weight: 400;
  opacity: .75;
  vertical-align: .03em;
  display: inline-block;
  user-select: none;
}

.typing-line {
  display: inline-flex;
  align-items: baseline;
  min-height: 1.04em;
  cursor: pointer;
  text-decoration: none;
  color: var(--accent);
}

.typing-cursor {
  display: inline-block;
  width: clamp(3px, .05em, 5px);
  height: .82em;
  background-color: var(--accent);
  margin-left: .08em;
  vertical-align: -0.02em;
  transform: none !important;
  border-radius: 1px;
  animation: terminal-blink .85s step-end infinite;
}

@keyframes terminal-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.is-typed .typing-cursor {
  animation: terminal-blink 1.4s step-end infinite;
  opacity: .5;
}

@media (prefers-reduced-motion: reduce) {
  .typing-cursor { display: none; }
}

.intro-cols {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(14rem, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  align-items: start;
}

.intro-lede {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.5;
  max-width: var(--measure);
}

.intro-lede + .intro-lede {
  margin-top: 1.15rem;
}

.intro-index { display: flex; flex-direction: column; }

.intro-index a {
  font-size: .8125rem;
  padding: .65rem 0;
  border-top: 1px solid var(--hair);
  text-decoration: none;
  color: var(--ink);
  transition: color .15s ease, padding-left .18s ease;
}

.intro-index a:last-child { border-bottom: 1px solid var(--hair); }

.intro-index span {
  color: var(--accent);
  margin-right: .75em;
}

.intro-index a:hover {
  color: var(--accent);
  padding-left: .25rem;
}

/* ---- sections ------------------------------------------------------ */

.section { border-top: 1px solid var(--ink); padding: 1rem 0 3.5rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.section-head .mono-label:first-child { color: var(--ink); }

/* ---- projects ------------------------------------------------------ */

.project {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.75rem 0;
}

.project + .project { border-top: 1px solid var(--hair); }

.project-no {
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--accent);
  line-height: 1.2;
}

.project h2 {
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin-bottom: .7rem;
}

.project h2 a { text-decoration: none; }

.project p { max-width: var(--measure); }

.project-meta {
  margin-top: .8rem;
  font-size: .75rem;
  color: var(--soft);
}

.project-links {
  margin-top: .45rem;
  font-size: .75rem;
}

.project-links a { color: var(--accent); }

.also {
  border-top: 1px solid var(--hair);
  padding-top: 1.75rem;
  color: var(--soft);
  font-style: italic;
  max-width: 44em;
}

.also a { color: var(--ink); font-style: normal; }

/* One line per repo: name, then what it is. Deliberately not a project
   entry — these are for skimming, not reading. */
.index-list {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  max-width: 52em;
}

.index-list li {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1rem;
  padding: .55rem 0;
  border-top: 1px solid var(--hair-soft);
  font-size: .8125rem;
}

.index-list a { color: var(--accent); text-decoration: none; }
.index-list a:hover { text-decoration: underline; }
.index-list span { color: var(--soft); }

/* ---- below the stack ------------------------------------------------ */

.below-text {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  max-width: 40em;
}

.below-note {
  margin-top: 2rem;
  color: var(--soft);
  font-style: italic;
  max-width: 44em;
}

/* ---- working set --------------------------------------------------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
}

.tool-col h3 { margin-bottom: 1rem; color: var(--accent); }

.tool-col ul { list-style: none; padding: 0; }

.tool-col li {
  padding: .5rem 0;
  border-top: 1px solid var(--hair-soft);
  font-size: 1.0625rem;
}

/* ---- contact ------------------------------------------------------- */

.contact-line {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 300;
  line-height: 1.45;
  max-width: 30em;
}

/* ---- the terminal moment --------------------------------------------
   The clock is the one place on the page already set in mono, so it is
   the one place a block cursor belongs. */

#local-time::after {
  content: "▋";
  margin-left: .15em;
}

/* ---- reading position ------------------------------------------------ */

.intro-index a[aria-current="true"] {
  color: var(--accent);
  padding-left: .5rem;
}

/* ---- motion ----------------------------------------------------------
   The page sets itself like a printed sheet: each rule draws left to
   right, then the type settles onto it. Everything here is opt-out —
   ask for reduced motion and you get the finished page, immediately.

   The reveal list below is mirrored in index.html (REVEAL); keep them
   in step. Hidden states live under .js so the page is readable with
   scripting off, and .js is set in <head> so nothing flashes first.
   --------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {

  html { scroll-behavior: smooth; }

  .masthead-status::before { animation: pulse 2.6s ease-in-out infinite; }
  #local-time::after { animation: caret 1.2s step-end infinite; }

  .intro-index a { transition: color .2s ease, padding-left .2s ease; }

  .project-no { transition: transform .3s cubic-bezier(.22,.61,.36,1); }
  .project:hover .project-no { transform: translateX(3px); }

  /* Rules draw. */
  .js .section { position: relative; border-top-color: transparent; }

  .js .section::before {
    content: "";
    position: absolute;
    top: -1px; left: 0;
    width: 100%; height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .75s cubic-bezier(.22,.61,.36,1);
  }

  .js .section.is-in::before { transform: scaleX(1); }

  /* Type settles. */
  /* :where() keeps this at .js — one class — so .js .is-in below always
     outranks it. Without that, any selector here carrying an element
     (.intro-index a) would win and the element would never appear. */
  .js :where(
    .h1-line, .intro-lede, .intro-index a, .section-head, .project,
    .also, .index-list, .below-text, .below-note, .tool-col, .contact-line
  ) {
    opacity: 0;
    transform: translateY(8px);
  }

  .js .is-in {
    opacity: 1;
    transform: none;
    transition:
      opacity .6s ease var(--d, 0ms),
      transform .6s cubic-bezier(.22,.61,.36,1) var(--d, 0ms);
  }

  /* The two headline lines land one after the other. */
  .js em.h1-line { --d: 130ms; }

  /* The index writes itself down the column. */
  .js .intro-index a:nth-child(2) { --d: 60ms; }
  .js .intro-index a:nth-child(3) { --d: 120ms; }
  .js .intro-index a:nth-child(4) { --d: 180ms; }
  .js .intro-index a:nth-child(5) { --d: 240ms; }

  /* Stack columns arrive left to right. */
  .js .tool-col:nth-child(2) { --d: 90ms; }
  .js .tool-col:nth-child(3) { --d: 180ms; }
}

@keyframes caret { 0%, 100% { opacity: 1 } 50% { opacity: 0 } }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }

/* ---- editorial index drawer (mobile) ------------------------------- */

.mobile-index-btn,
.mobile-nav-sep,
.mobile-nav-overlay {
  display: none;
}

@media (max-width: 720px) {
  .mobile-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(27, 23, 18, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-height: 92vh;
    overflow-y: auto;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    transform: translateY(-100%);
    transition: transform .32s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-overlay.is-open .mobile-nav-drawer {
    transform: translateY(0);
  }

  .drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.25rem;
    padding-inline: clamp(1.25rem, 4vw, 3rem);
    border-bottom: 1px solid var(--hair);
  }

  .drawer-title {
    color: var(--soft);
  }

  .drawer-close {
    background: none;
    border: none;
    padding: .25rem;
    color: var(--ink);
    font-family: var(--mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .15s ease;
  }

  .drawer-close:hover,
  .drawer-close:active {
    color: var(--accent);
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    padding: .5rem clamp(1.25rem, 4vw, 3rem) 1.25rem;
  }

  .drawer-link {
    display: flex;
    align-items: baseline;
    padding: .95rem 0;
    border-bottom: 1px solid var(--hair-soft);
    text-decoration: none;
    color: var(--ink);
    transition: color .15s ease;
  }

  .drawer-link:last-child {
    border-bottom: none;
  }

  .drawer-num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.55rem;
    line-height: 1;
    color: var(--accent);
    min-width: 2.25rem;
    flex-shrink: 0;
  }

  .drawer-label {
    font-family: var(--serif);
    font-size: 1.2rem;
    line-height: 1.25;
    color: var(--ink);
    flex-grow: 1;
    transition: color .15s ease;
  }

  .drawer-arrow {
    font-family: var(--mono);
    font-size: .875rem;
    color: var(--soft);
    flex-shrink: 0;
    margin-left: auto;
    transition: transform .2s ease, color .2s ease;
  }

  .drawer-link:hover .drawer-label,
  .drawer-link:active .drawer-label {
    color: var(--accent);
  }

  .drawer-link:hover .drawer-arrow,
  .drawer-link:active .drawer-arrow {
    color: var(--accent);
    transform: translate(3px, -3px);
  }

  .drawer-link[aria-current="true"] .drawer-label {
    color: var(--accent);
    font-weight: 500;
  }

  .drawer-link[aria-current="true"] .drawer-arrow {
    color: var(--accent);
  }

  .drawer-foot {
    background: var(--hair-soft);
    border-top: 1px solid var(--hair);
    padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: .45rem;
    font-size: .6875rem;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .drawer-foot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--soft);
  }

  .accent-dot {
    color: var(--status);
    font-size: .75em;
    margin-inline: .2em;
  }

  .drawer-foot-contact a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--hair);
    padding-bottom: 1px;
    transition: border-color .15s ease, color .15s ease;
  }

  .drawer-foot-contact a:hover {
    color: var(--accent);
    border-color: var(--accent);
  }
}

/* ---- interactive fullscreen terminal overlay ----------------------- */

.terminal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 13, 11, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2.5rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.terminal-shell-window {
  width: 100%;
  max-width: 860px;
  height: 620px;
  max-height: 88vh;
  background: #0f0d0b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform .25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .terminal-shell-window {
  background: #090807;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
}

.terminal-overlay.is-open .terminal-shell-window {
  transform: translateY(0) scale(1);
}

.terminal-overlay.is-maximized {
  padding: 0 !important;
  background: #0f0d0b !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.terminal-shell-window.is-maximized {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

.terminal-shell-window.is-maximized .win-icon-max {
  display: none;
}

.terminal-shell-window.is-maximized .win-icon-restore {
  display: block;
}

.win-icon-restore {
  display: none;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.1rem;
  background: #171411;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  gap: 1rem;
}

.shell-controls {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}

.shell-ctrl {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform .1s ease, filter .15s ease;
}

.shell-ctrl:hover {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.shell-close { background: #e05f54; }
.shell-min { background: #e4a148; }
.shell-max { background: #61b865; }

.shell-title-bar {
  font-size: .6875rem;
  letter-spacing: .06em;
  color: #9c9588;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  flex-grow: 1;
  cursor: pointer;
}

.shell-title-user { color: var(--accent); }
.shell-title-badge { color: #696257; }

.shell-actions {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}

.shell-shortcut-hint {
  font-size: .625rem;
  color: #696257;
  letter-spacing: .04em;
  margin-right: .25rem;
}

.shell-shortcut-hint kbd {
  background: rgba(255, 255, 255, 0.08);
  padding: .1rem .35rem;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #c4bea0;
  font-family: inherit;
}

.shell-win-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 3px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9c9588;
  cursor: pointer;
  padding: 0;
  transition: all .15s ease;
}

.shell-win-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.shell-win-close:hover {
  background: #e05f54;
  border-color: #e05f54;
  color: #fff;
}

.shell-body {
  flex: 1;
  padding: 1.25rem 1.25rem 1rem;
  font-size: .8125rem;
  line-height: 1.6;
  overflow-y: auto;
  color: #dcd6c8;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.shell-body::-webkit-scrollbar {
  width: 5px;
}

.shell-body::-webkit-scrollbar-track {
  background: transparent;
}

.shell-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

.shell-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

.shell-welcome-block {
  margin-bottom: 1rem;
}

.shell-ascii {
  color: var(--accent);
  font-size: .75rem;
  line-height: 1.25;
  margin: 0 0 .6rem;
  overflow-x: auto;
  user-select: none;
}

.shell-welcome-msg {
  color: #948e82;
  font-size: .8125rem;
  margin: 0;
}

.sh-kw {
  color: #fff;
  font-weight: 500;
}

.sh-user {
  color: var(--accent);
  font-weight: 500;
}

.sh-cwd {
  color: #56a5e1;
}

.shell-history {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.sh-line {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
}

.sh-cmd {
  color: #fff;
}

.sh-output {
  padding-left: .85rem;
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  color: #c4beaf;
  word-break: break-word;
  margin-top: .15rem;
}

.sh-output pre {
  margin: 0;
  font-family: inherit;
  white-space: pre-wrap;
  line-height: 1.55;
}

.sh-output a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sh-output strong {
  color: #fff;
}

.sh-output .sh-dir {
  color: #56a5e1;
  font-weight: 600;
}

.sh-output .sh-exec {
  color: #61b865;
}

.sh-output .sh-muted {
  color: #6e675b;
}

.shell-prompt-form {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: .85rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shell-prompt-label {
  display: inline-flex;
  align-items: baseline;
  user-select: none;
  white-space: nowrap;
}

.shell-input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--mono);
  font-size: .8125rem;
  flex: 1;
  padding: 0;
  min-width: 80px;
  caret-color: var(--accent);
}

.shell-input::placeholder {
  color: #4f493f;
  font-style: italic;
}

.terminal-min-dock {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  display: none;
  align-items: center;
  gap: .55rem;
  background: #171411;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: .45rem .85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: all .18s ease;
  user-select: none;
}

.terminal-min-dock.is-visible {
  display: flex;
}

.terminal-min-dock:hover {
  border-color: var(--accent);
  background: #201b16;
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.7);
}

.term-dock-icon {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 600;
  font-size: .8125rem;
}

.term-dock-label {
  color: #e9e2d2;
  font-size: .75rem;
  font-family: var(--mono);
}

.term-dock-dot {
  width: 6px;
  height: 6px;
  background: #61b865;
  border-radius: 50%;
  animation: pulse 2s infinite ease-in-out;
}

.term-dock-badge {
  color: #8c8577;
  font-size: .6875rem;
  margin-left: .15rem;
}

.terminal-min-dock:hover .term-dock-badge {
  color: var(--accent);
}

.shell-footer {
  padding: .65rem 1rem;
  background: #14120f;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
}

.shell-pills-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
}

.shell-pill-label {
  font-size: .625rem;
  color: #6e675b;
  margin-right: .2rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.shell-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  color: #b0aa9d;
  font-family: var(--mono);
  font-size: .6875rem;
  padding: .18rem .5rem;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.shell-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.shell-pill-exit:hover {
  background: #e05f54;
  border-color: #e05f54;
}

/* ---- small screens -------------------------------------------------- */

@media (max-width: 960px) {
  .masthead-time,
  .masthead-status { display: none; }
  .masthead-nav { gap: .85rem; }
}

@media (max-width: 720px) {
  .masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-inline: calc(-1 * clamp(1.25rem, 4vw, 3rem));
    padding-inline: clamp(1.25rem, 4vw, 3rem);
    padding-block: 0;
    height: 3.25rem;
  }

  .masthead-status,
  .masthead-time,
  .masthead-nav { display: none !important; }

  .masthead-right {
    display: flex;
    align-items: center;
    gap: .35rem;
  }

  .mobile-index-btn {
    display: inline-block;
    background: none;
    border: none;
    padding: .2rem .1rem;
    font-family: var(--mono);
    font-size: .6875rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    transition: color .15s ease;
  }

  .mobile-index-btn:hover,
  .mobile-index-btn:active {
    color: var(--accent);
  }

  .mobile-nav-sep {
    display: inline-block;
    color: var(--hair);
    font-family: var(--mono);
    font-size: .6875rem;
    margin: 0 .15rem;
    user-select: none;
  }

  .intro-cols { grid-template-columns: 1fr; }
  .intro-index { display: none; }

  .project { grid-template-columns: 1fr; gap: .25rem; }
  .project-no { font-size: 1.15rem; }

  .tools-grid { grid-template-columns: 1fr; gap: 1.5rem; }

  .index-list li { grid-template-columns: 1fr; gap: .15rem; }

  .terminal-overlay {
    padding: 0;
  }

  .terminal-shell-window {
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
  }

  .shell-shortcut-hint {
    display: none;
  }

  .shell-ascii {
    display: none;
  }

  .shell-pills-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
  }

  .shell-pills-bar::-webkit-scrollbar {
    height: 3px;
  }

  .shell-pills-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 280px) {
  body {
    padding: 0 .65rem;
  }

  .masthead {
    margin-inline: -.65rem;
    padding-inline: .65rem;
  }

  .masthead-right {
    gap: .25rem;
  }

  .mobile-nav-sep,
  .nav-sep {
    display: none;
  }
}



