/* AKIKI.AI / D.AI.SY: light theme with a code-repository look. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --border: #d8dee4;
  --border-muted: #eaeef2;
  --hairline: 1px;
  --fg: #1f2328;
  --fg-muted: #59636e;
  --link: #11727a;
  --not: #7e57c2;
  --tab-line: #ec8e4a;
  --check: #1f8a5c;
  --topic-bg: #e3f4f2;
  --topic-fg: #0f6a70;
  --gutter: 16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (min-resolution: 2dppx) { :root { --hairline: 0.5px; } }
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1012px) { :root { --gutter: 32px; } }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }

.icon { width: 16px; height: 16px; fill: currentColor; flex: none; vertical-align: text-bottom; }

.spin { animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The tulip sways on its stem instead of turning. */
.sway { animation: sway 6s ease-in-out infinite; transform-origin: 50% 96%; }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spin, .sway, .logo-word .cursor { animation: none; }
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */

.appheader { background: var(--bg-subtle); border-bottom: var(--hairline) solid var(--border); }

.appheader-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-top: 16px;
  padding-bottom: 8px;
}

.brand { display: block; line-height: 0; }

.crumbs { font-size: 16px; }

/* The AKIKI logo word, drawn by its own colour font (fonts/akiki-pixel.woff2): typing "akiki" becomes the logo. */
@font-face {
  font-family: "AKIKI Pixel";
  src: url("fonts/akiki-pixel.woff2?v=3") format("woff2");
  font-display: block;
}
.logo-word {
  font-family: "AKIKI Pixel", var(--mono);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  font-variant-ligatures: common-ligatures;
  color: #2f4d5c;
}
.logo-word .cursor { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.crumbs .sep { margin: 0 4px; color: var(--fg-muted); }
.crumbs strong { font-weight: 600; }

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 48px;
  border-bottom: 1px solid transparent;
  color: var(--fg);
  white-space: nowrap;
}
.tabs a:hover { text-decoration: none; border-bottom-color: var(--border); }
.tabs a .icon { color: var(--fg-muted); }
.tabs a[aria-current] { border-bottom-color: var(--tab-line); font-weight: 600; }

.label {
  display: inline-block;
  padding: 0 7px;
  border: var(--hairline) solid var(--border);
  border-radius: 2em;
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

/* Two-column layout */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0 48px;
}
.main-col { display: flex; flex-direction: column; gap: 16px; }

/* On phones the README (and its headline) comes first. */
@media (max-width: 1011px) {
  .readme { order: -1; }
}

@media (min-width: 1012px) {
  .layout { grid-template-columns: minmax(0, 1fr) 296px; }
}

/* Boxes */

.box { border: var(--hairline) solid var(--border); border-radius: 6px; background: var(--bg); }

.box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: var(--hairline) solid var(--border);
  border-radius: 6px 6px 0 0;
}
.box-header .icon { color: var(--fg-muted); }
.box-header strong { font-weight: 600; }

.commit-msg { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-meta { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--fg-muted); white-space: nowrap; }

/* File list */

.file-list { margin: 0; padding: 0; list-style: none; }
.file-list li + li { border-top: var(--hairline) solid var(--border-muted); }

.file-list a {
  display: grid;
  grid-template-columns: 16px minmax(0, 170px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 16px;
  color: var(--fg);
}
.file-list a:hover { background: var(--bg-subtle); text-decoration: none; }
.file-list a:hover .name { color: var(--link); text-decoration: underline; }
.file-list li:last-child a { border-radius: 0 0 6px 6px; }

.file-list .flower { --center: #f2b632; }
.file-list .leaf { color: #3aa56f; }
.file-list .blur { filter: blur(4px); user-select: none; }
.file-list .msg { color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list .when { color: var(--fg-muted); white-space: nowrap; }

@media (max-width: 543px) {
  .commit-msg { display: none; }
  .file-list a {
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-areas: "icon name" ". msg";
    row-gap: 0;
  }
  .file-list .icon { grid-area: icon; }
  .file-list .name { grid-area: name; }
  .file-list .msg { grid-area: msg; white-space: normal; }
  .file-list .when { display: none; }
}

/* README */

.markdown { padding: 24px 32px 32px; font-size: 16px; line-height: 1.6; }
@media (max-width: 543px) { .markdown { padding: 20px 16px; } }

.markdown > :first-child { margin-top: 0; }
.markdown h2 {
  margin: 32px 0 16px;
  padding-bottom: 0.3em;
  border-bottom: var(--hairline) solid var(--border-muted);
  font-size: 1.5em;
  font-weight: 600;
  line-height: 1.25;
  scroll-margin-top: 16px;
}
.markdown p, .markdown ul, .markdown ol { margin: 0 0 16px; }
.markdown ul { padding-left: 1.5em; }
.markdown li + li { margin-top: 0.5em; }
.markdown hr { height: 1px; margin: 24px 0; border: 0; background: var(--border-muted); }

.hero { text-align: center; scroll-margin-top: 16px; }
.hero-logo { width: clamp(128px, 30vw, 152px); height: auto; }
.hero h1 {
  margin: 12px 0 20px;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
/* The motto in the logo's own pixel font; "AI" takes the logo's colours. */
.hero h1.pixel-title {
  font-family: "AKIKI Pixel", var(--mono);
  font-size: clamp(22px, 6.4vw, 54px);
  font-weight: 400;
  font-synthesis: none;
  line-height: 1.3;
  letter-spacing: 0;
  font-variant-ligatures: common-ligatures;
  color: #2f4d5c;
}

.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; }
.badge {
  display: inline-flex;
  border-radius: 3px;
  overflow: hidden;
  color: #fff;
  font: 11px/20px Verdana, "DejaVu Sans", Geneva, sans-serif;
  white-space: nowrap;
}
.badge span { padding: 0 6px; }
.badge span:first-child { background: #555; }
.b-orange { background: #b85a1e; }
.b-teal { background: #11727a; }
.b-blue { background: #3f6fb5; }
.b-purple { background: #7e57c2; }


/* Principles */

.markdown .principles { padding-left: 0; list-style: none; }
.principles li { position: relative; padding-left: 28px; }
.principles .icon { position: absolute; left: 0; top: 5px; color: var(--check); }

/* Modules */

.modules { display: grid; gap: 16px; margin: 0 0 16px; }
.module {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
  border: var(--hairline) solid var(--border);
  border-radius: 6px;
  scroll-margin-top: 16px;
}
.module:target { border-color: var(--tab-line); box-shadow: 0 0 0 1px var(--tab-line); }
.module img { flex: none; width: 120px; height: 120px; }
.module h3 { margin: 0 4px 0 0; font-size: 1.25em; font-weight: 600; line-height: 1.25; }
.module-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
/* Model names in the logo's pixel font. */
.module h3.pixel-name {
  font-family: "AKIKI Pixel", var(--mono);
  font-size: 30px;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  line-height: 1;
  color: #2f4d5c;
  margin-right: 8px;
}
.chip {
  padding: 0 8px;
  border: var(--hairline) solid var(--border);
  border-radius: 2em;
  background: var(--bg-subtle);
  color: var(--fg-muted);
  font: 12px/20px var(--mono);
  white-space: nowrap;
}
.markdown .module-role { margin: 2px 0 8px; color: var(--fg-muted); font-style: italic; }
.markdown .module p:last-child { margin-bottom: 0; }

@media (max-width: 543px) {
  .module { flex-direction: column; text-align: center; gap: 12px; }
  .module-head { justify-content: center; }
  .markdown .module p:not(.module-role) { text-align: left; }
}

/* Sidebar */

.side { padding-bottom: 24px; }
.side + .side { padding-top: 24px; border-top: var(--hairline) solid var(--border-muted); }
.side h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.side p { margin: 0 0 12px; }
.side-motto { font-size: 16px; font-style: italic; }

.topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.topics li {
  padding: 0 10px;
  border-radius: 2em;
  background: var(--topic-bg);
  color: var(--topic-fg);
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
}

.release { display: flex; align-items: center; gap: 8px; }
.release .icon { color: var(--fg-muted); }
.muted { color: var(--fg-muted); }

.lang-bar { display: flex; height: 4px; margin-bottom: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.lang-bar span { flex: 1; background: var(--c); }

.lang-list { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.lang-list li { display: flex; align-items: center; gap: 6px; }
.lang-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* Footer */

.footer { border-top: var(--hairline) solid var(--border-muted); }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-top: 32px;
  padding-bottom: 32px;
  color: var(--fg-muted);
  font-size: 12px;
}
.footer-inner img { opacity: 0.7; }
.footer-motto { margin-left: auto; font-style: italic; }
