/* alexanderrivera.dev — terminal theme
   Shared by index.html, project.html and contact.html.
   Colours live in the two blocks below; change them there. */

:root {
  --bg: #0e0e11;
  --fg: #d8d6de;
  --muted: #86838f;
  --line: #2a2831;
  --accent: #e45bd0;      /* helmet-visor magenta from the profile art */
  --accent-2: #8f7bff;    /* violet */
  --field: #15151a;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #faf8fc;
  --fg: #1d1b22;
  --muted: #6b6775;
  --line: #dcd7e4;
  --accent: #b0149b;
  --accent-2: #4b34c9;
  --field: #ffffff;
  color-scheme: light;
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--bg); background: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

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

/* ---- header ---- */

.banner {
  display: block;
  container-type: inline-size;
  overflow: hidden;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.banner:hover { background: none; color: var(--accent); }
.banner pre {
  font-family: inherit;
  /* 128 columns of 0.6em-wide glyphs fill the column exactly */
  font-size: calc(100cqw / 76.8);
  line-height: 1;
  white-space: pre;
  user-select: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.site-nav .name { color: var(--fg); font-weight: 700; text-decoration: none; margin-right: auto; }
.site-nav .name:hover { color: var(--bg); }
.site-nav a[aria-current="page"] { color: var(--fg); text-decoration: none; }
.site-nav a[aria-current="page"]::before { content: "> "; color: var(--accent); }
.site-nav a[aria-current="page"]:hover { color: var(--bg); }

.theme-toggle {
  font: inherit;
  line-height: 1;
  background: none;
  border: 1px solid var(--line);
  color: var(--fg);
  padding: 0.3rem 0.45rem;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }

.crumbs { color: var(--muted); font-size: 0.87rem; padding-top: 1rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--bg); }

/* ---- content ---- */

main { padding-top: 2rem; }

h1 { font-size: 1.6rem; line-height: 1.3; margin-bottom: 0.75rem; }
h2 { font-size: 1.15rem; margin: 2.75rem 0 0.75rem; }
h2::before { content: "## "; color: var(--accent); }
h3 { font-size: 1rem; }

p { margin-bottom: 1rem; }
.lede { color: var(--muted); }
.cursor::after { content: "_"; color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor::after { animation: none; } }

.intro { display: flex; gap: 1.25rem; align-items: flex-start; }
.intro img {
  width: 104px; height: 104px; flex: none;
  object-fit: cover; object-position: center 12%;
  border: 1px solid var(--line);
}

.more { display: inline-block; margin-top: 0.5rem; }

/* link lists: home page sections */
.entries { list-style: none; }
.entries li {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding: 0.4rem 0;
  border-bottom: 1px dashed var(--line);
}
.entries .meta { color: var(--muted); font-size: 0.87rem; text-align: right; flex: none; }
.empty { color: var(--muted); }
.empty::before { content: "// "; }

/* projects page */
.project { padding: 1.4rem 0; border-bottom: 1px dashed var(--line); }
.project:first-of-type { padding-top: 0.5rem; }
.project h2 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.project p { margin-bottom: 0.6rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem; color: var(--muted); font-size: 0.87rem; margin-bottom: 0.6rem; }
.tags li::before { content: "["; }
.tags li::after { content: "]"; }
.project .links { display: flex; gap: 1.25rem; }

/* contact form */
.form { max-width: 34rem; }
.form label { display: block; color: var(--muted); margin: 1rem 0 0.3rem; }
.form label::before { content: "$ "; color: var(--accent); }
.form input, .form textarea {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.6rem 0.75rem;
}
.form textarea { min-height: 10rem; resize: vertical; display: block; }
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: none; }
.form button {
  font: inherit; font-weight: 700;
  margin-top: 1.25rem;
  padding: 0.6rem 1.25rem;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
}
.form button:hover { background: transparent; color: var(--accent); }

/* ---- footer ---- */

footer {
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.87rem;
}
footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-bottom: 0.6rem; }
footer p { margin: 0; }

@media (max-width: 30rem) {
  body { font-size: 14px; }
  .intro { flex-direction: column; }
  .entries li { flex-direction: column; gap: 0; }
  .entries .meta { text-align: left; }
}
