@import url("https://fonts.googleapis.com/css2?family=Intel+One+Mono:ital,wght@0,300..700;1,300..700&display=swap");

:root {
  --bg: #000000;
  --fg: #a8ff60;
  --fg-strong: #c2ff91;
  --muted: #72ad57;
  --faint: #416337;
  --border: #6fae55;
  --focus: #d8ffb7;
  --max-width: 1180px;
  --page-pad: clamp(18px, 3.2vw, 48px);
  --mono: "Intel One Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="paper"] {
  --bg: #ffffff;
  --fg: #111111;
  --fg-strong: #000000;
  --muted: #4f4f4f;
  --faint: #8a8a8a;
  --border: #3f3f3f;
  --focus: #000000;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: clamp(15px, 1.08vw, 17px);
  line-height: 1.58;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-underline-offset: 0.22em; }
a:hover { color: var(--fg-strong); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.site-shell {
  width: min(100%, var(--max-width));
  min-height: 100svh;
  margin: 0 auto;
  padding: var(--page-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: clamp(18px, 3vh, 34px);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.utility-row {
  display: none;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}
.brand-link { text-decoration: none; min-width: 0; }
.header-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.utility-links { display: flex; gap: 18px; }
.theme-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.theme-toggle::before { content: "[ "; }
.theme-toggle::after { content: " ]"; }

.logo {
  margin: 0;
  color: var(--fg-strong);
  font-family: var(--mono);
  font-size: clamp(7px, 1.05vw, 14px);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  overflow: hidden;
  user-select: text;
}

.logo-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.rule { overflow: hidden; white-space: nowrap; color: var(--border); line-height: 1; min-width: 0; }
.rule::before { content: "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────"; }

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.78rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.primary-nav a { text-decoration: none; }
.primary-nav a::before { content: "["; color: var(--faint); margin-right: 3px; }
.primary-nav a::after { content: "]"; color: var(--faint); margin-left: 3px; }
.primary-nav a[aria-current="page"] { color: var(--fg-strong); }
.primary-nav a[aria-current="page"]::before { content: "[>"; }

main { align-self: center; min-width: 0; }
.home-main {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
}

.kicker, .section-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 20px;
  color: var(--fg-strong);
  font-size: clamp(1.5rem, 3vw, 2.55rem);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.018em;
}
h2 { color: var(--fg-strong); font-size: 1rem; letter-spacing: 0.065em; text-transform: uppercase; font-weight: 600; }
p { max-width: 74ch; }
.lead { font-size: clamp(1rem, 1.28vw, 1.15rem); font-weight: 400; }
.philosophy { margin: 0 0 24px; color: var(--fg-strong); font-size: clamp(1.02rem, 1.55vw, 1.28rem); font-weight: 500; line-height: 1.4; white-space: nowrap; }

.menu-list { margin: 0; padding: 0; list-style: none; }
.menu-list li { margin: 0 0 11px; }
.menu-list a { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.menu-index { color: var(--muted); }
.menu-dots { flex: 1; overflow: hidden; color: var(--faint); white-space: nowrap; }
.menu-dots::before { content: "................................................................................................"; }
.menu-arrow { color: var(--fg-strong); }

.page-main { display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr); gap: clamp(30px, 7vw, 96px); align-items: start; }
.page-body { max-width: 760px; }
.placeholder { color: var(--muted); border-left: 1px solid var(--border); padding-left: 18px; }
.more { margin-top: 34px; color: var(--fg-strong); letter-spacing: 0.1em; text-transform: uppercase; }

.catalog { display: grid; gap: 28px; }
.catalog-entry { padding-top: 18px; border-top: 1px solid var(--border); }
.catalog-entry:first-child { border-top: 0; padding-top: 0; }
.catalog-meta { color: var(--muted); font-size: 0.82rem; }
.open-link { display: inline-block; margin-top: 8px; text-decoration: none; }
.open-link::before { content: "[ "; color: var(--faint); }
.open-link::after { content: " ]"; color: var(--faint); }

.prompt-panel { align-self: end; }
.prompt-history { min-height: 1.55em; margin-bottom: 6px; color: var(--muted); font-size: 0.85rem; }
.prompt-row {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 1.55em;
  cursor: text;
}
.prompt-label, .prompt-display { color: var(--fg-strong); white-space: pre; }
.block-cursor {
  display: inline-block;
  width: 0.68em;
  height: 1.05em;
  margin-left: -5px;
  background: var(--fg-strong);
  vertical-align: -0.16em;
  animation: terminal-cursor 1s steps(1, end) infinite;
}
.prompt-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  opacity: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font: inherit;
  cursor: text;
}
.prompt-input:focus { outline: none; }
@keyframes terminal-cursor { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

.site-footer { color: var(--faint); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-row { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

.mobile-menu-button { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .home-main, .page-main { grid-template-columns: 1fr; }
  .utility-row { display: flex; justify-content: flex-end; }
  .brand-row { align-items: flex-start; }
  .header-utilities { flex-direction: column; align-items: flex-end; gap: 8px; }
  .primary-nav { display: none; }
  .primary-nav[data-open="true"] { display: block; }
  .primary-nav ul { display: grid; gap: 12px; padding: 16px 0 4px; }
  .mobile-menu-button {
    display: inline-block;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
  }
  .logo { font-size: clamp(5px, 1.85vw, 10px); }
  .philosophy { white-space: normal; }
  main { align-self: start; }
}

@media (max-height: 720px) and (min-width: 821px) {
  .site-shell { gap: 14px; padding-block: 18px; }
  .logo { font-size: clamp(6px, 0.8vw, 11px); }
  .logo-subtitle { margin-top: 5px; }
  .lead { font-size: 0.95rem; }
  .philosophy { margin-top: 18px; }
}

@media (prefers-reduced-motion: no-preference) {
  a, button { transition: color 160ms ease, opacity 160ms ease; }
}

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

/* Landing and interior navigation refinements */
.main-menu-label { margin-bottom: 14px; }
.interior-header .brand-row { align-items: center; }
.interior-wordmark {
  display: inline-block;
  color: var(--fg-strong);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
  font-weight: 650;
  letter-spacing: 0.12em;
}
.interior-menu { align-self: start; min-width: 280px; }
.interior-menu ol { list-style: none; margin: 12px 0 0; padding: 0; }
.interior-menu li { margin: 0 0 8px; }
.interior-menu a {
  position: relative;
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  text-decoration: none;
  padding: 2px 0;
}
.compact-index { color: var(--muted); }
.compact-arrow { color: var(--fg-strong); }
.active-marker { color: var(--fg-strong); margin-left: 3px; }
.interior-menu a[aria-current="page"] { color: var(--fg-strong); }

@media (max-width: 820px) {
  .interior-menu { min-width: 0; }
  .interior-header .utility-row { display: none; }
}

/* Contextual links use the same treatment as utility links. */
.inline-link,
.utility-links a {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--border);
  text-underline-offset: 0.22em;
}
.inline-link:hover,
.utility-links a:hover {
  color: var(--fg-strong);
  text-decoration-color: currentColor;
}

/* Narrow-screen resilience */
body,
.site-shell,
.site-header,
.brand-row,
.home-main,
.page-main,
.page-body,
.home-main > *,
.page-main > * {
  min-width: 0;
}

p,
h1,
h2,
h3,
a,
span {
  overflow-wrap: anywhere;
}

.menu-list a {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, max-content) minmax(0, 1fr) auto;
  width: 100%;
}

.menu-list a > :nth-child(2) {
  min-width: 0;
}

@media (max-width: 620px) {
  :root {
    --page-pad: clamp(12px, 4vw, 20px);
  }

  body {
    min-width: 0;
    font-size: clamp(14px, 4vw, 16px);
  }

  .site-shell {
    width: 100%;
    min-height: 100svh;
    overflow-x: hidden;
    gap: 18px;
  }

  .brand-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .brand-link {
    width: 100%;
    overflow: hidden;
  }

  .header-utilities {
    order: -1;
    width: 100%;
    padding-top: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 14px;
    white-space: normal;
    font-size: 0.72rem;
  }

  .utility-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 14px;
  }

  .theme-toggle {
    max-width: 100%;
    white-space: normal;
    text-align: right;
  }

  .logo {
    max-width: 100%;
    font-size: clamp(4.5px, 1.72vw, 7px);
  }

  .logo-subtitle {
    font-size: 0.68rem;
    letter-spacing: 0.07em;
  }

  .home-main,
  .page-main {
    gap: 24px;
  }

  .home-main section,
  .page-body {
    width: 100%;
  }

  h1 {
    font-size: clamp(1.35rem, 8vw, 1.9rem);
  }

  .lead {
    max-width: 100%;
    font-size: clamp(0.95rem, 4.2vw, 1.06rem);
    line-height: 1.52;
    hyphens: auto;
  }

  .philosophy {
    max-width: 100%;
    font-size: clamp(0.92rem, 4vw, 1.06rem);
  }

  .menu-list a {
    grid-template-columns: 2.1rem minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
  }

  .menu-dots {
    display: none;
  }

  .menu-arrow {
    justify-self: end;
  }

  .interior-menu {
    width: 100%;
  }

  .interior-menu a {
    grid-template-columns: 2rem minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .footer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  .header-utilities {
    justify-content: flex-start;
    align-items: flex-start;
  }

  .utility-links {
    width: 100%;
    justify-content: space-between;
  }

  .theme-toggle {
    width: 100%;
    text-align: left;
  }

  .logo {
    font-size: 4.5px;
  }
}


/* Concise primary-page copy */
.page-copy {
  color: var(--fg);
  border-left: 1px solid var(--border);
  padding-left: 18px;
  font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  line-height: 1.48;
}
.page-copy p {
  margin-bottom: 0.9em;
}
.page-copy p:last-child {
  margin-bottom: 0;
}
.concise-copy h1 {
  margin-bottom: 16px;
}
.concise-copy .more {
  margin-top: 22px;
}

@media (max-height: 780px) and (min-width: 821px) {
  .concise-copy h1 { margin-bottom: 12px; }
  .page-copy {
    font-size: 0.9rem;
    line-height: 1.4;
  }
  .page-copy p { margin-bottom: 0.7em; }
  .concise-copy .more { margin-top: 16px; }
}

/* Founder profile */
.founder-page { max-width: 820px; }
.founder-profile {
  display: grid;
  grid-template-columns: clamp(150px, 18vw, 210px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}
.founder-portrait {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: grayscale(1);
  border: 1px solid var(--border);
}
.founder-copy {
  min-width: 0;
  font-size: clamp(0.78rem, 0.94vw, 0.9rem);
  line-height: 1.46;
}
.founder-copy p { margin-bottom: 0.8em; }
.founder-role {
  color: var(--fg-strong);
  font-weight: 600;
  letter-spacing: 0.035em;
}
.founder-link { margin-top: 1.1em; }

@media (max-width: 680px) {
  .founder-profile { grid-template-columns: 1fr; }
  .founder-portrait { width: min(220px, 65vw); }
  .founder-copy { font-size: 0.9rem; }
}

@media (max-height: 760px) and (min-width: 821px) {
  .founder-copy { font-size: 0.76rem; line-height: 1.38; }
  .founder-copy p { margin-bottom: 0.62em; }
  .founder-page h1 { margin-bottom: 14px; }
  .founder-page .more { margin-top: 18px; }
}

/* Conceptual Systems content */
.catalog-intro { margin-top: 10px; max-width: 72ch; }
.catalog-subtitle { margin: 4px 0 10px; color: var(--fg-strong); font-style: italic; }
.catalog-abstract { margin: 0 0 10px; color: var(--muted); }
.coming-soon { margin-top: 8px; letter-spacing: 0.08em; }
