/* ==========================================================================
   rafaelholguin.com
   palette  : aviation instrument panel — deep ink + amber + cyan + green
   type     : JetBrains Mono (ui) + Instrument Sans (body) + Instrument Serif (editorial)
   layout   : tiling window manager, two-section launcher
   ========================================================================== */

:root {
  /* surfaces */
  --bg-base:     #0a0a0f;
  --bg-screen:   #11111a;
  --bg-bar:      #07070c;
  --bg-launcher: #0d0d16;
  --bg-pane:     #11111a;
  --bg-surface:  #1a1a26;
  --bg-elev:     #242434;

  /* text */
  --fg:        #e8e8f0;
  --fg-muted:  #8b8ba0;
  --fg-dim:    #5a5a70;

  /* lines */
  --line:      #1f1f2e;
  --line-soft: #15151f;

  /* accents */
  --amber:    #fbbf24;
  --amber-d:  #b07a09;
  --cyan:     #67e8f9;
  --cyan-d:   #0e7490;
  --green:    #86efac;
  --green-d:  #15803d;
  --coral:    #fb7185;
  --lav:      #a78bfa;

  /* type */
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans:    'Instrument Sans', system-ui, sans-serif;
  --serif:   'Instrument Serif', Georgia, serif;

  /* layout */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
}

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

html, body {
  background: var(--bg-base);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  padding: 24px;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(251,191,36,0.05) 0%, transparent 40%),
    radial-gradient(circle at 88% 92%, rgba(103,232,249,0.04) 0%, transparent 42%);
  background-attachment: fixed;
}

::selection { background: var(--amber); color: var(--bg-base); }

a { color: var(--cyan); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--amber); }
a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 2px; }

kbd {
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  vertical-align: 1px;
}

.noscript {
  max-width: 520px;
  margin: 8vh auto;
  padding: 32px;
  background: var(--bg-screen);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  font-family: var(--mono);
}
.noscript h1 { font-size: 22px; color: var(--amber); margin-bottom: 12px; }
.noscript p { color: var(--fg-muted); margin-bottom: 8px; }
.noscript a { color: var(--cyan); }

/* ==========================================================================
   screen — the desktop frame
   ========================================================================== */

.screen {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--bg-screen);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 24px 80px -20px rgba(0,0,0,0.7);
  opacity: 0;
  transform: translateY(8px);
  animation: boot 0.5s 0.08s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes boot {
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   top bar — waybar
   ========================================================================== */

.bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  background: var(--bg-bar);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
  user-select: none;
}

.bar-host {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.bar-ws {
  display: flex;
  gap: 3px;
}
.ws {
  padding: 1px 7px;
  border-radius: var(--r-sm);
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.ws-active {
  background: var(--bg-surface);
  color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber-d) inset;
}

.bar-spacer { flex: 1; }

.bar-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.bar-stat svg { color: var(--cyan); flex-shrink: 0; }
.bar-stat:last-child svg { color: var(--amber); }

/* ==========================================================================
   body — the workspace
   ========================================================================== */

.body {
  flex: 1;
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 0;
}

/* ==========================================================================
   launcher — left side
   ========================================================================== */

.launcher {
  background: var(--bg-launcher);
  background-image:
    linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 12px 12px;
  border-right: 1px solid var(--line);
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: var(--mono);
}

.launcher-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.launcher-label {
  color: var(--fg-dim);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.app {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: background 0.12s, color 0.12s, transform 0.12s;
  opacity: 0;
  animation: app-in 0.4s ease-out forwards;
}
.launcher-group:nth-child(1) .app:nth-child(2) { animation-delay: 0.30s; }
.launcher-group:nth-child(1) .app:nth-child(3) { animation-delay: 0.36s; }
.launcher-group:nth-child(1) .app:nth-child(4) { animation-delay: 0.42s; }
.launcher-group:nth-child(1) .app:nth-child(5) { animation-delay: 0.48s; }
.launcher-group:nth-child(2) .app:nth-child(2) { animation-delay: 0.56s; }
.launcher-group:nth-child(2) .app:nth-child(3) { animation-delay: 0.62s; }
.launcher-group:nth-child(2) .app:nth-child(4) { animation-delay: 0.68s; }

@keyframes app-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.app:hover {
  background: var(--bg-surface);
  color: var(--amber);
}
.app:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: -1px;
}
.app-on {
  background: var(--bg-surface);
  color: var(--amber);
  box-shadow: inset 2px 0 0 var(--amber);
}
.app-on .app-key { color: var(--amber); }

.app-key {
  font-size: 10px;
  color: var(--fg-dim);
  font-weight: 400;
  min-width: 14px;
  text-align: center;
  background: var(--bg-elev);
  border-radius: var(--r-sm);
  padding: 1px 0;
  letter-spacing: 0;
}

.app-name {
  flex: 1;
  letter-spacing: 0;
}

.launcher-foot {
  margin-top: auto;
  padding: 12px 10px 6px;
  border-top: 1px solid var(--line-soft);
}
.hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==========================================================================
   pane — content area
   ========================================================================== */

.pane {
  background: var(--bg-pane);
  padding: 14px 32px 40px;
  overflow-y: auto;
  min-width: 0;
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 12px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-muted);
}
.dots { display: inline-flex; gap: 5px; }
.dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg-elev);
}
.titlebar-title { flex: 1; letter-spacing: 0.02em; }
.titlebar-meta { color: var(--fg-dim); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   content — typography for app bodies
   ========================================================================== */

.content {
  max-width: 720px;
  animation: content-in 0.32s ease-out;
}

@keyframes content-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin-bottom: 20px;
  max-width: 620px;
}

.lede {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  color: var(--fg);
  margin-bottom: 16px;
  max-width: 640px;
  font-weight: 400;
}

.bio {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--fg-muted);
  margin-bottom: 28px;
  max-width: 640px;
  line-height: 1.66;
}

.hl {
  color: var(--amber);
  font-weight: 500;
}

.prompt {
  color: var(--green);
  font-family: var(--mono);
  font-size: 13px;
  margin: 24px 0 10px;
  letter-spacing: 0.02em;
}
.prompt::before { content: '> '; color: var(--fg-dim); }

.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 16px;
  font-family: var(--sans);
  font-size: 15px;
}
.bullets li {
  padding: 4px 0;
  position: relative;
  color: var(--fg);
}
.bullets li::before {
  content: '·';
  color: var(--amber);
  font-weight: 700;
  margin-right: 10px;
  margin-left: -14px;
}

.content h2 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--amber);
  margin: 28px 0 12px;
  letter-spacing: 0.02em;
}

.content h3 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--cyan);
  margin: 20px 0 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.content p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.66;
  color: var(--fg);
  margin-bottom: 14px;
  max-width: 640px;
}

.content .muted { color: var(--fg-muted); }

/* key-value rows */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 16px;
  margin: 12px 0 20px;
  font-family: var(--mono);
  font-size: 13px;
}
.kv dt { color: var(--cyan); font-weight: 400; }
.kv dd { color: var(--fg); font-family: var(--sans); font-size: 14px; }

/* file tree */
.tree {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--fg);
  white-space: pre;
  margin: 12px 0 20px;
  overflow-x: auto;
}
.tree .dir { color: var(--lav); }
.tree .comment { color: var(--fg-dim); }

/* checklist (garage) */
.check {
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
  font-family: var(--mono);
  font-size: 13px;
}
.check li { padding: 4px 0; display: flex; gap: 12px; align-items: baseline; }
.check .tag {
  color: var(--fg-dim);
  min-width: 70px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.check .done .tag { color: var(--green); }
.check .wip .tag { color: var(--amber); }
.check .todo .tag { color: var(--fg-dim); }

/* book list (library) */
.shelf {
  list-style: none;
  padding: 0;
  margin: 12px 0 20px;
}
.shelf li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--sans);
  font-size: 15px;
}
.shelf li:last-child { border-bottom: 0; }
.shelf .title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--amber);
  margin-right: 8px;
}
.shelf .author { color: var(--fg-muted); font-size: 14px; }

/* pull quote — editorial moment */
.pull {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--fg);
  border-left: 2px solid var(--amber);
  padding: 6px 0 6px 20px;
  margin: 24px 0;
  max-width: 580px;
}
.pull .by {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 12px;
  color: var(--fg-dim);
  margin-top: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* CTA / download */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin: 8px 0;
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber-d);
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.cta:hover {
  background: var(--amber);
  color: var(--bg-base);
}
.cta::before { content: '↓'; font-weight: 700; }

/* kbd hint at end of about */
.kbd-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==========================================================================
   devlog — timeline for projects/
   ========================================================================== */

.devlog {
  position: relative;
  margin: 8px 0 24px;
  padding-left: 24px;
}
.devlog::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line) 6%, var(--line) 94%, transparent);
}

.entry {
  position: relative;
  padding: 4px 0 20px;
  cursor: pointer;
  transition: transform 0.15s;
}
.entry:hover { transform: translateX(2px); }
.entry::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 11px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--fg-dim);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.entry:hover::before {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.15);
}
.entry-active::before {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(251,191,36,0.2);
}

.entry-shipped::before { border-color: var(--green); }
.entry-shipped:hover::before { border-color: var(--green); box-shadow: 0 0 0 3px rgba(134,239,172,0.18); }

.entry-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.entry-date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  min-width: 76px;
  font-variant-numeric: tabular-nums;
}
.entry-title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.01em;
  flex: 1;
}
.entry-active .entry-title { color: var(--amber); }

.entry-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid;
  flex-shrink: 0;
}
.status-shipped { color: var(--green); border-color: var(--green-d); background: rgba(134,239,172,0.05); }
.status-wip     { color: var(--amber); border-color: var(--amber-d); background: rgba(251,191,36,0.06); }
.status-planned { color: var(--fg-dim); border-color: var(--line); }

.entry-summary {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-top: 6px;
  padding-left: 86px;
}

.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-left: 86px;
}
.tag-chip {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  background: rgba(103,232,249,0.06);
  border: 1px solid rgba(103,232,249,0.15);
  padding: 1px 6px;
  border-radius: var(--r-sm);
  letter-spacing: 0.5px;
}

.entry-detail {
  display: none;
  margin-top: 14px;
  margin-left: 86px;
  padding: 14px 16px 6px;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  animation: detail-in 0.25s ease-out;
}
.entry-active .entry-detail { display: block; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-detail p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg);
  line-height: 1.65;
  margin-bottom: 10px;
}
.entry-detail .label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 12px;
  margin-bottom: 4px;
}
.entry-detail ul {
  list-style: none;
  padding: 0;
  margin: 4px 0 12px;
  font-family: var(--mono);
  font-size: 13px;
}
.entry-detail ul li {
  padding: 2px 0;
  color: var(--fg);
}
.entry-detail ul li::before {
  content: '·';
  color: var(--amber);
  margin-right: 8px;
}
.entry-detail .links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.entry-detail .links a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
}

.devlog-foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 820px) {
  .devlog { padding-left: 20px; }
  .entry-date { min-width: auto; }
  .entry-summary, .entry-tags, .entry-detail { padding-left: 0; margin-left: 0; }
  .entry-head { gap: 8px; }
}

/* ==========================================================================
   terminal app
   ========================================================================== */

.term {
  background: #060609;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--fg);
  min-height: 360px;
  margin: 0 0 16px;
  max-height: 520px;
  overflow-y: auto;
}
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-prompt { color: var(--lav); }
.term-path   { color: var(--cyan); }
.term-ok     { color: var(--green); }
.term-warn   { color: var(--amber); }
.term-err    { color: var(--coral); }
.term-muted  { color: var(--fg-muted); }
.term-input-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.term-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13px;
  padding: 0;
  caret-color: var(--amber);
}
.term-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--amber);
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ==========================================================================
   typewriter — for the tagline first paint
   ========================================================================== */
.tw-caret {
  display: inline-block;
  width: 2px;
  height: 0.95em;
  background: var(--amber);
  margin-left: 4px;
  vertical-align: -3px;
  animation: blink 0.85s step-end infinite;
}

/* ==========================================================================
   mobile — stack the layout
   ========================================================================== */

@media (max-width: 820px) {
  body { padding: 12px; }
  .screen { min-height: calc(100vh - 24px); }

  .bar { gap: 10px; padding: 8px 12px; font-size: 11px; flex-wrap: wrap; }
  .bar-ws, .bar-stat:nth-of-type(2) { display: none; }
  .bar-stat span:not(#bar-clock-text) { display: none; }

  .body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .launcher {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background-image: none;
  }
  .launcher-group {
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
  }
  .launcher-label { display: none; }
  .launcher-foot { display: none; }

  .app {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid var(--line);
  }
  .app-key { display: none; }
  .app-on { box-shadow: inset 0 -2px 0 var(--amber); }

  .pane { padding: 14px 18px 32px; }

  .tagline { font-size: 28px; }
  .lede { font-size: 15px; }
  .kv { grid-template-columns: 100px 1fr; }
  .kbd-hint { display: none; }
}

@media (max-width: 480px) {
  .tagline { font-size: 24px; }
  .pane { padding: 12px 14px 28px; }
}

/* ==========================================================================
   accessibility — reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .led, .tw-caret, .term-cursor { animation: none; }
}
