/* byte.glass — CRT / phosphor-green theme.
   Monochrome green on near-black. Restrained CRT flourishes. */

:root {
  --bg: #050a07;
  --bg-raised: #0a130d;
  --bg-inset: #030705;
  --fg: #b6e4c2;          /* body: soft phosphor */
  --fg-dim: #6a8f77;      /* meta, footer */
  --fg-bright: #d7ffe3;   /* headings */
  --accent: #00ff66;      /* brand accent — matches blob app icon */
  --accent-dim: #18b551;
  --rule: #143a22;
  --glow: rgba(0, 255, 102, 0.18);
  --measure: 68ch;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font: 15px/1.65 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(0, 255, 102, 0.06), transparent 70%),
    var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

header, main, footer { position: relative; z-index: 2; }

/* --- Layout ---------------------------------------------------------- */

header {
  max-width: var(--measure);
  margin: 2.5rem auto 0;
  padding: 0 1.25rem;
}

main {
  max-width: var(--measure);
  margin: 2rem auto;
  padding: 0 1.25rem;
  flex: 1;
}

footer {
  max-width: var(--measure);
  margin: 3rem auto 2rem;
  padding: 1.25rem;
  color: var(--fg-dim);
  border-top: 1px dashed var(--rule);
  font-size: 0.85em;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

footer .sig {
  color: var(--accent);
  letter-spacing: 0.15em;
}

footer a { color: var(--fg-dim); }
footer a:hover { color: var(--accent); }

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

.brand {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px var(--glow);
}
.brand:hover { color: var(--fg-bright); }
.brand .prompt { color: var(--accent-dim); margin-right: 0.35ch; }

/* --- Typography ------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  color: var(--fg-bright);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-shadow: 0 0 14px var(--glow);
}

h1 {
  font-size: 2rem;
  margin: 0.75rem 0 0.5rem;
  color: var(--accent);
}
h1::before {
  content: "# ";
  color: var(--accent-dim);
}

h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--rule);
  clear: both;
}
h2::before {
  content: "## ";
  color: var(--accent-dim);
}

h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}
h3::before {
  content: "### ";
  color: var(--accent-dim);
}

p { margin: 0.75rem 0; }

strong { color: var(--fg-bright); font-weight: 600; }
em { color: var(--fg-bright); font-style: normal; text-decoration: underline dotted var(--accent-dim); text-underline-offset: 3px; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-dim);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.1s;
}
a:hover { color: var(--fg-bright); text-decoration-color: var(--fg-bright); }

hr {
  border: 0;
  border-top: 1px dashed var(--rule);
  margin: 2.25rem 0;
  clear: both;
}

ul, ol {
  padding-left: 1.5rem;
}
li { margin: 0.25rem 0; }
ul li::marker { color: var(--accent-dim); }

blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 2px solid var(--accent);
  color: var(--fg-bright);
  background: linear-gradient(to right, rgba(0, 255, 102, 0.04), transparent 50%);
}
blockquote p { margin: 0.25rem 0; }

code {
  font: inherit;
  background: var(--bg-inset);
  padding: 0.05em 0.35em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--fg-bright);
  font-size: 0.95em;
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1rem;
  overflow-x: auto;
}
pre code {
  background: transparent;
  border: 0;
  padding: 0;
}

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

/* --- Tables --------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.93em;
  overflow-x: auto;
  display: block;
}
thead { border-bottom: 1px solid var(--accent-dim); }
th, td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px dashed var(--rule);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--fg-bright);
  font-weight: 600;
  text-shadow: 0 0 8px var(--glow);
}
td:first-child, th:first-child { white-space: nowrap; color: var(--fg-bright); }
td code, th code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 1em;
  color: var(--fg);
  word-break: break-all;
}

/* --- blob page hero (icon + title + tagline, centered) -------------- */

.hero {
  text-align: center;
  margin: 2.5rem 0 3.5rem;
}
.hero-icon {
  width: 128px;
  height: 128px;
  border-radius: 22%;
  border: 1px solid var(--rule);
  box-shadow: 0 0 44px rgba(0, 255, 102, 0.22);
  display: block;
  margin: 0 auto;
}
.hero h1 {
  font-size: 2.6rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--accent);
  text-shadow: 0 0 28px var(--glow);
  letter-spacing: -0.015em;
}
.hero h1::before { content: none; }
.hero .tagline {
  color: var(--fg-bright);
  font-size: 1.1rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}

@media (max-width: 480px) {
  .hero { margin: 1.5rem 0 2.5rem; }
  .hero-icon { width: 100px; height: 100px; }
  .hero h1 { font-size: 2rem; margin-top: 1.25rem; }
  .hero .tagline { font-size: 1rem; }
}

/* --- Screenshots (markdown images → thumbnails, click to zoom) ------ */

.screenshot {
  float: right;
  width: 150px;
  margin: 0.5rem 0 1rem 1.5rem;
  padding: 0;
}
.screenshot-trigger {
  display: block;
  line-height: 0;
  border: 0;
  text-decoration: none;
}
.screenshot img {
  width: 150px;
  height: 240px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
  cursor: zoom-in;
}
.screenshot-trigger:hover img,
.screenshot-trigger:focus-visible img {
  box-shadow: 0 0 32px rgba(0, 255, 102, 0.32);
  transform: translateY(-1px);
}

@media (max-width: 620px) {
  .screenshot {
    float: none;
    width: auto;
    max-width: 100%;
    margin: 1.25rem 0;
    text-align: center;
  }
  .screenshot img {
    width: auto;
    height: auto;
    max-width: 220px;
    max-height: none;
    aspect-ratio: auto;
    object-fit: initial;
    margin: 0 auto;
  }
}

/* --- Lightbox ------------------------------------------------------- */

.lightbox {
  padding: 0;
  background: transparent;
  border: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  margin: 0;
  color: var(--fg);
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(3, 7, 5, 0.94);
  backdrop-filter: blur(4px);
}
.lightbox:not([open]) { display: none; }
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  inset: 0;
}
.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  width: auto;
  height: auto;
  display: block;
  border: 1px solid var(--accent-dim);
  border-radius: 6px;
  box-shadow: 0 0 48px rgba(0, 255, 102, 0.25);
}
.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: var(--bg-raised);
  color: var(--fg-bright);
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font: 400 1.5rem/1 ui-monospace, Menlo, monospace;
  cursor: pointer;
  padding: 0;
}
.lightbox-close:hover,
.lightbox-close:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.3);
}

/* --- App Store link ------------------------------------------------- */

.actions {
  text-align: center;
  margin: 1.5rem 0;
}
.app-store-link {
  display: inline-block;
  text-decoration: none;
  transition: filter 0.15s;
  border: 0;
}
.app-store-link img {
  display: inline-block;
  max-width: 160px;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(0, 255, 102, 0.25));
}
.app-store-link:hover img {
  filter: drop-shadow(0 0 16px rgba(0, 255, 102, 0.5));
}

/* --- Project cards (home page) -------------------------------------- */

.project {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-top: 1px dashed var(--rule);
  margin: 0;
}
.project:first-of-type { border-top: 0; padding-top: 0.5rem; }

.project-icon-link {
  display: block;
  text-decoration: none;
  border: 0;
  flex-shrink: 0;
}
.project-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 22%;
  border: 1px solid var(--rule);
  background: var(--bg-raised);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.08);
}
img.project-icon { padding: 0; }
.project-icon--glyph {
  font: 700 2rem/1 ui-monospace, Menlo, monospace;
  color: var(--accent);
  text-shadow: 0 0 14px var(--glow);
}
.project-icon-link:hover .project-icon,
.project-icon-link:focus-visible .project-icon {
  box-shadow: 0 0 28px rgba(0, 255, 102, 0.28);
}
.project-body { flex: 1; min-width: 0; }
.project-body h3 {
  margin: 0 0 0.5rem;
  padding-top: 0;
  border-top: 0;
}
.project-body h3::before { content: none; }
.project-body p:last-child { margin-bottom: 0; }

.soon-tag {
  display: inline-block;
  font-size: 0.68em;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent-dim);
  padding: 0.15em 0.55em;
  border-radius: 2px;
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-shadow: none;
  text-transform: uppercase;
}

.project--soon { opacity: 0.75; }

@media (max-width: 480px) {
  .project { gap: 0.9rem; }
  .project-icon { width: 56px; height: 56px; }
  .project-icon--glyph { font-size: 1.6rem; }
}

/* --- Small screens -------------------------------------------------- */

@media (max-width: 480px) {
  body { font-size: 14px; }
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.15rem; }
}

/* --- Accessibility preferences -------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .scanlines { display: none; }
}
