/* ===========================================================
   christian di maio — minimal, cozy, terminal soul.
   one column, lots of air, pure css.
   =========================================================== */

:root {
  --bg:      #1a1a1f;   /* warm dark, not black */
  --bg2:     #15151a;
  --text:    #cdc9c2;   /* warm light, easy on the eyes */
  --soft:    #9a958d;   /* secondary text */
  --muted:   #5f5b54;   /* dim meta */
  --accent:  #fab387;   /* peach */
  --mauve:   #cba6f7;
  --green:   #a6e3a1;
  --blue:    #89b4fa;
  --line:    #2a2a30;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body.warm {
  --bg:     #1c1813;
  --bg2:    #17130e;
  --text:   #e3d7c6;
  --accent: #f6b26b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: clamp(48px, 12vh, 120px) 24px 100px;
}

/* ---------- the prompt ---------- */
.prompt {
  font-size: 15px;
  margin-bottom: 34px;
  cursor: text;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 .55ch;
}
.ps1 { color: var(--soft); white-space: nowrap; }
.ps1 .at, .ps1 .d { color: var(--muted); }
.ps1 .pwd { color: var(--blue); }
.ps1 .g { color: var(--accent); margin-left: .15ch; }
.line { color: var(--text); }
#typed { white-space: pre; }
.cur {
  display: inline-block;
  width: .55ch; height: 1.05em;
  background: var(--accent);
  transform: translateY(.18em);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 0%,50%{opacity:1} 50.01%,100%{opacity:0} }
#real {
  position: absolute;
  left: -9999px;
  opacity: 0;
  width: 1px;
}

.log {
  margin: -22px 0 34px;
  color: var(--soft);
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.log:empty { display: none; }
.log .e { color: var(--muted); }
.log .err { color: #f38ba8; }
.log div { margin-bottom: 2px; }

/* ---------- type / rhythm ---------- */
section { margin-bottom: 56px; }
.lede { margin-bottom: 64px; }
.lede p { color: var(--text); font-size: 16px; }

h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: .5px;
}
h2::before { content: "# "; color: var(--muted); }

h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--soft);
  margin: 26px 0 12px;
  letter-spacing: .3px;
}
h3::before { content: "› "; color: var(--muted); }

.cv { list-style: none; }
.cv li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4px 16px;
  margin-bottom: 13px;
  color: var(--soft);
}
.cv .when { color: var(--muted); font-size: 13px; padding-top: 1px; }

p { color: var(--soft); margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }
.lede p:last-child, section p:last-child { margin-bottom: 0; }

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* projects */
.row { margin-bottom: 22px; }
.row a { color: var(--text); font-weight: 500; }
.row a:hover { color: var(--accent); }

/* publications */
.pubs { list-style: none; }
.pubs li {
  margin-bottom: 14px;
  padding-left: 56px;
  text-indent: -56px;
  color: var(--soft);
}
.pubs .yr { color: var(--muted); display: inline-block; width: 44px; text-indent: 0; }
.pubs a { color: var(--text); border-bottom: none; }
.pubs a:hover { color: var(--accent); }

/* photography */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.gallery a {
  width: calc(33.33% - 7px);
  display: block;
  border: none;
  border-radius: 4px;
  overflow: hidden;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .5s ease, filter .25s ease;
}
.gallery a:hover img { transform: scale(1.05); filter: brightness(1.06) saturate(1.05); }
.ph {
  width: calc(33.33% - 7px);
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

/* contact */
#contact a { color: var(--text); }
#contact a:hover { color: var(--accent); }

footer { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); }
.warm-btn {
  font-family: var(--mono);
  font-size: 13px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  padding: 0;
}
.warm-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- the red button (do not click) ---------- */
.redzone { margin-top: 40px; text-align: center; }
.red-button {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .4px;
  color: #ffdadb;
  background: #5e1820;
  border: 1px solid #f38ba8;
  padding: 11px 20px;
  border-radius: 9px;
  cursor: pointer;
  transition: transform .15s, background .15s;
  animation: redpulse 2.4s ease-in-out infinite;
}
.red-button:hover { background: #842732; transform: translateY(-1px); }
.red-button:active { transform: translateY(0) scale(.97); }
@keyframes redpulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(243,139,168,.4); }
  50%     { box-shadow: 0 0 24px 2px rgba(243,139,168,.22); }
}

/* ---------- reboot overlay ---------- */
.boom {
  position: fixed; inset: 0; z-index: 999;
  background: #07070b;
  display: none;
  align-items: center; justify-content: center;
  padding: 28px;
}
.boom.on { display: flex; animation: shake .5s ease; }
.boom-text {
  font-family: var(--mono);
  font-size: clamp(11px, 1.7vw, 15px);
  line-height: 1.55;
  color: #7f8396;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  max-width: 780px;
}
.boom-text .dim   { color: #5f6377; }
.boom-text .panic { color: #f38ba8; font-weight: 700; text-shadow: 0 0 14px rgba(243,139,168,.5); }
.boom-text .msg   { color: #e3d7c6; font-size: 1.12em; }
.boom-text .yell  { color: #f9e2af; font-weight: 700; font-size: 1.18em; text-shadow: 0 0 16px rgba(249,226,175,.55); }
.boom-text .reboot{ color: #a6e3a1; }
.boom-text .cur { display:inline-block; width:.6ch; height:1.05em; background:#a6e3a1; transform:translateY(.18em); animation: blink 1.1s steps(1) infinite; }
.boom.off { animation: crtoff .45s ease forwards; }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(5px, -4px); }
  60% { transform: translate(-4px, -2px); }
  80% { transform: translate(4px, 3px); }
}
@keyframes crtoff {
  60% { transform: scaleY(.012); filter: brightness(2.2); opacity: 1; }
  100% { transform: scale(.001); filter: brightness(4); opacity: 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 480px) {
  main { padding: 56px 20px 80px; }
  .gallery .ph, .gallery a { width: calc(50% - 5px); }
  .pubs li { padding-left: 44px; text-indent: -44px; }
  .cv li { grid-template-columns: 66px 1fr; gap: 2px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cur { animation: none; }
}

::selection { background: var(--accent); color: var(--bg); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
