:root {
  --bg: #090b0a;
  --fg: #e6ece8;
  --dim: #8a978f;
  --accent: #5cf08a;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="amber"]  { --accent: #ffb000; }
[data-theme="violet"] { --accent: #b69cff; }
[data-theme="white"]  { --accent: #f2f2f2; }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  overflow: hidden;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ---------- controls ---------- */

.controls {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.lang { display: flex; align-items: center; gap: 0.4rem; color: var(--dim); }

.lang button {
  background: none;
  border: 0;
  padding: 0.25rem 0.2rem;
  font: inherit;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s;
}
.lang button:hover { color: var(--fg); }
.lang button[aria-pressed="true"] { color: var(--accent); }

.themes { display: flex; gap: 0.55rem; }

.themes button {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.themes button:hover { opacity: 1; }
.themes button[aria-pressed="true"] {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--fg);
}
.themes [data-set="green"]  { background: #5cf08a; }
.themes [data-set="amber"]  { background: #ffb000; }
.themes [data-set="violet"] { background: #b69cff; }
.themes [data-set="white"]  { background: #f2f2f2; }

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

main {
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 4rem 1.25rem 2rem;
  pointer-events: none; /* clicks pass through to the background */
}

.card {
  text-align: center;
  padding: 3rem 2.5rem;
  background: radial-gradient(closest-side, rgba(9, 11, 10, 0.92) 45%, rgba(9, 11, 10, 0) 100%);
}

h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(1.3rem, 4.6vw, 2.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.bracket {
  color: var(--accent);
  font-family: "Noto Sans Symbols 2", "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", var(--mono);
  margin: 0 0.25em;
}

.subtitle {
  margin: 1rem 0 0;
  color: var(--dim);
  font-size: clamp(0.8rem, 2.3vw, 1.05rem);
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 0.3em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.06s steps(1, end) infinite;
}

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

.links {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: auto;
}

.links a {
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}

.links a .prompt { color: var(--accent); margin-right: 0.35em; }

.links a:hover {
  color: var(--bg);
  background: var(--accent);
}
.links a:hover .prompt { color: var(--bg); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: 8;
  transform: translate(-50%, 8px);
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.9rem;
  border-radius: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- status + terminal hint ---------- */

.status,
.hint {
  position: fixed;
  bottom: 0.9rem;
  z-index: 3;
  font: inherit;
  font-size: 0.78rem;
  color: var(--dim);
}
.status { left: 1.25rem; }

.hint {
  right: 1.25rem;
  background: none;
  border: 0;
  padding: 0.25rem 0;
  cursor: pointer;
  transition: color 0.2s;
}
.hint:hover { color: var(--accent); }
.hint-short { display: none; font-size: 0.95rem; color: var(--accent); }

@media (pointer: coarse) {
  .hint-long { display: none; }
  .hint-short { display: inline; padding: 0.4rem 0.6rem; border: 1px solid var(--dim); border-radius: 4px; }
}

/* ---------- terminal ---------- */

#terminal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  height: min(46vh, 380px);
  padding: 0.9rem 1.25rem 1rem;
  background: rgba(9, 11, 10, 0.94);
  border-top: 1px solid var(--accent);
  font-size: 0.9rem;
  color: var(--accent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
#terminal[hidden] { display: none; }

#term-out {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  line-height: 1.5;
}
#term-out div { white-space: pre-wrap; word-break: break-word; }
#term-out .cmd-echo { color: var(--fg); }
#term-out .cmd-echo b { color: var(--accent); font-weight: 400; }

.term-line {
  display: flex;
  gap: 0.6ch;
  align-items: center;
  padding-top: 0.4rem;
}
.term-prompt { color: var(--accent); white-space: nowrap; }

#term-in {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: 0;
  padding: 0;
  font: inherit;
  font-size: 16px; /* stops iOS from zooming on focus */
  color: var(--fg);
  caret-color: var(--accent);
}

/* ---------- photo overlay ---------- */

#photo {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(9, 11, 10, 0.9);
  cursor: pointer;
}
#photo[hidden] { display: none; }
#photo figure { margin: 0; text-align: center; }
#photo img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  border: 1px solid var(--accent);
  padding: 6px;
  background: var(--bg);
}
#photo figcaption { margin-top: 0.7rem; font-size: 0.8rem; color: var(--dim); }

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