@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

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

:root {
  --bg: #0a0a0a;
  --text: #f0f0f0;
  --muted: rgba(240, 240, 240, 0.62);
  --faint: rgba(240, 240, 240, 0.34);
  --line: rgba(240, 240, 240, 0.14);
  --panel: rgba(240, 240, 240, 0.045);
}

[data-theme="light"] {
  --bg: #ffffff;
  --text: #111111;
  --muted: rgba(17, 17, 17, 0.64);
  --faint: rgba(17, 17, 17, 0.34);
  --line: rgba(17, 17, 17, 0.14);
  --panel: rgba(17, 17, 17, 0.045);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.4s, color 0.4s;
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

#stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.top-nav {
  position: fixed;
  top: 1.35rem;
  left: 1.2rem;
  z-index: 20;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
}

.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 20;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
  padding: 0.3rem;
  opacity: 0.8;
  line-height: 1;
}

.theme-toggle:hover { opacity: 1; }

.corner-controls {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
}

.corner-controls .theme-toggle {
  position: static;
  top: auto;
  right: auto;
}

.language-switch {
  display: flex;
  gap: 0.25rem;
  color: var(--muted);
}

.language-switch a,
.language-switch span {
  opacity: 0.62;
  color: inherit;
  text-decoration: none;
}

.language-switch a:hover,
.language-switch a.is-active { opacity: 1; }

.language-switch a:hover span { text-decoration: underline; }

.scroll-nav {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: 'Courier New', Courier, monospace;
}

.scroll-nav button {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  color: var(--text);
  opacity: 0.62;
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  padding: 0.25rem 0.35rem;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s, transform 0.2s;
}

#scrollUp { top: 1rem; }
#scrollDown { bottom: 1rem; }
.scroll-nav button.is-visible { display: block; }
.scroll-nav button:hover { opacity: 1; transform: translateX(-50%) translateY(-1px); }

a { color: inherit; text-decoration: none; }

.top-nav a,
.bracket-link {
  opacity: 0.62;
  transition: opacity 0.2s, color 0.4s;
}

.top-nav a:hover,
.bracket-link:hover { opacity: 1; }

.top-nav a:hover span,
.bracket-link:hover span { text-decoration: underline; }

main {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2.4rem));
  margin: 0 auto;
  padding: 8rem 0 5rem;
}

.project-header {
  margin-bottom: 0.45rem;
}

.logo-link {
  display: inline-block;
  margin-bottom: 0.9rem;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.logo-cosmo { font-weight: 700; }
.logo-bot { font-weight: 300; }

h1 {
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
}

.project-cycle {
  display: flex;
  gap: 0.45rem;
  margin-left: auto;
}

.cycle-separator {
  color: inherit;
  opacity: 0.62;
}

.readme {
  background: color-mix(in srgb, var(--bg) 92%, var(--text));
  border: 1px solid var(--line);
  padding: clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  line-height: 1.62;
}

.readme h1,
.readme h2,
.readme h3 {
  color: var(--text);
  font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: -0.04em;
  margin: 1.8rem 0 0.75rem;
}

.readme h1:first-child,
.readme h2:first-child,
.readme h3:first-child { margin-top: 0; }

.readme h1 { font-size: 2rem; }
.readme h2 { font-size: 1.45rem; }
.readme h3 { font-size: 1.15rem; }

.readme p { margin: 0.75rem 0; }
.readme ul { margin: 0.75rem 0 0.75rem 1.2rem; }
.readme li { margin: 0.25rem 0; }

.readme code {
  color: var(--text);
  background: var(--panel);
  padding: 0.08rem 0.25rem;
}

.readme pre {
  overflow-x: auto;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.readme pre code { background: none; padding: 0; }

.readme a { text-decoration: underline; text-underline-offset: 0.18em; }

.readme hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.cv-document-page {
  background: var(--bg);
  color: var(--text);
  --panel: transparent;
  --document-bg: #000000;
}

html[data-theme="light"] .cv-document-page {
  --bg: #ffffff;
  --text: #111111;
  --muted: #222222;
  --faint: #555555;
  --line: #111111;
  --document-bg: #ffffff;
}

html[data-theme="dark"] .cv-document-page {
  --bg: #000000;
  --text: #f5f5f5;
  --muted: #d0d0d0;
  --faint: #8a8a8a;
  --line: #666666;
  --document-bg: #000000;
}

.cv-document-page > .project-header {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 2.4rem));
  margin: 7rem auto 0;
}

.cv-document-page main {
  background: var(--document-bg);
  border: 1px solid var(--line);
  margin: 1.25rem auto 3rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.cv-document-page .readme {
  background: var(--bg);
  border: 0;
  color: var(--text);
  padding: 0;
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  line-height: 1.58;
}

.cv-document-page .readme h1,
.cv-document-page .readme h2,
.cv-document-page .readme h3 {
  color: var(--text);
  font-family: "Roboto", Arial, Helvetica, sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cv-document-page .readme p,
.cv-document-page .readme li {
  font-family: inherit;
}

.cv-document-page .readme code,
.cv-document-page .readme pre {
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: "Roboto", Arial, Helvetica, sans-serif;
}

.cv-document-page .readme hr {
  border-top-color: var(--line);
}

.document-contact {
  position: relative;
  z-index: 1;
  padding: 4rem 0 0;
  text-align: center;
}

.document-contact h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

.document-contact-list {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  color: var(--muted);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.84rem;
}

.readme-media {
  display: block;
  width: min(100%, 920px);
  max-height: 70vh;
  object-fit: contain;
  margin: 1.25rem auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

video.readme-media {
  aspect-ratio: 16 / 9;
}

.page-footer {
  position: relative;
  z-index: 1;
  padding: 3.5rem 0 5rem;
  text-align: center;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.84rem;
}

@media (max-width: 760px) {
  main { padding-top: 7rem; }
  .cv-document-page > .project-header {
    margin-top: 6rem;
  }
  .cv-document-page main {
    margin-top: 1rem;
    padding: 1.25rem;
  }
}
