/* Aozora Downloads — Zed.dev architectural hairline grid style, One Dark palette, font IoskeleyMono */
@font-face {
  font-family: 'IoskeleyMono';
  src: url('/fonts/IoskeleyMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IoskeleyMono';
  src: url('/fonts/IoskeleyMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e1015;
  --surface: #13161e;
  --surface-2: #171b24;
  --surface-hover: #1a1f2a;
  --border: #242936;
  --border-strong: #343b4e;
  --text: #e6eaf2;
  --muted: #8c94a8;
  --faint: #636b7f;
  --accent: #3b82f6;
  --accent-bright: #5a9cf8;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-border: rgba(59, 130, 246, 0.35);
  --green: #89ca78;
  --radius: 6px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'IoskeleyMono Nerd Font', 'IoskeleyMono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: none; color: #84b7ff; }
a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* Architectural centered rail */
.rail {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.rail-section {
  position: relative;
  border-bottom: 1px solid var(--border);
}

/* Subtle Zed-style corner crosshairs on section boundaries */
.rail-section::before,
.rail-section::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 7px;
  height: 7px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  z-index: 2;
  pointer-events: none;
}
.rail-section::before { left: -4px; }
.rail-section::after { right: -4px; }

/* Sticky topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(14, 16, 21, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 0 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-weight: 700;
}
.brand:hover { color: var(--text); text-decoration: none; }

.brand-logo {
  display: block;
  width: 32px;
  height: 33px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.brand-sub { font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: 0.06em; }

.topnav { display: flex; align-items: center; gap: 20px; }
.topnav a { color: var(--muted); font-size: 13.5px; transition: color 0.15s ease; }
.topnav a:hover { color: var(--text); text-decoration: none; }

.nav-github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text) !important;
  font-weight: 700;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-github:hover {
  border-color: var(--accent-bright);
  background: var(--surface-2);
}
.nav-github svg { width: 15px; height: 15px; }

/* Hero — 2-column split with 1px center divider */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.03), transparent 55%),
    var(--bg);
}

.hero-copy {
  padding: 48px 36px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-logo {
  display: block;
  width: 64px;
  height: 65px;
  object-fit: contain;
  flex-shrink: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 700;
  color: var(--text);
}

.hero h1 .accent { color: var(--accent-bright); }

.hero-rotator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  height: 36px;
  padding: 0 12px;
  margin: 0 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rotator-prefix {
  color: var(--accent-bright);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.rotator-viewport {
  position: relative;
  height: 24px;
  min-width: 240px;
  overflow: hidden;
  flex: 1;
}

.rotator-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease;
  white-space: nowrap;
}

.rotator-item.is-active {
  transform: translateY(0);
  opacity: 1;
}

.rotator-item.is-leaving {
  transform: translateY(-100%);
  opacity: 0;
}

.rotator-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.rotator-ver {
  font-size: 11.5px;
  color: var(--green);
  flex-shrink: 0;
}

.lede {
  margin: 0 0 28px;
  max-width: 540px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 700;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: #ffffff;
  text-decoration: none;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent-bright);
  color: var(--text);
  text-decoration: none;
}

/* Right hero column: flat Zed-style terminal & app icon matrix */
.hero-visual {
  padding: 40px 32px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.term {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
}

.term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.term-dots { display: flex; align-items: center; gap: 6px; }
.term-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #e06c75; }
.dot-y { background: #e5c07b; }
.dot-g { background: #89ca78; }

.term-title {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.term-body {
  padding: 15px 16px;
  font-size: 12.5px;
  line-height: 1.9;
}

.term-body p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp { color: var(--accent-bright); }
.tc { color: #c678dd; }
.tv { color: var(--green); }
.ok { color: var(--green); }
.term-summary { margin-top: 4px !important; padding-top: 6px; border-top: 1px dashed var(--border); }

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--accent-bright);
  vertical-align: -2px;
  animation: hero-blink 1.1s steps(1) infinite;
}
@keyframes hero-blink { 50% { opacity: 0; } }

.hero-icons {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}

.hero-icon-item {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-icon-item img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.hero-icon-item svg {
  width: 19px;
  height: 19px;
}

.hero-visual-cap {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 12px;
}

/* Toolbar: stats cells + command-palette style search */
.toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  background: var(--surface);
}

.stats-bar {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  border-right: 1px solid var(--border);
}

.stats-bar li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 22px;
  border-right: 1px solid var(--border);
}
.stats-bar li:last-child { border-right: 0; }

.stats-bar strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stats-bar span {
  font-size: 11.5px;
  color: var(--muted);
}

.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: var(--bg);
}

.search-row:focus-within {
  background: #10131a;
}

.search-icon { display: grid; place-items: center; color: var(--faint); flex-shrink: 0; }
.search-icon svg { width: 17px; height: 17px; }

#search {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
#search::placeholder { color: var(--faint); }

.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.count {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Seamless 2-column hairline grid inside rail */
.grid-section {
  overflow: hidden;
  background: var(--bg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: calc(100% + 1px);
  margin-bottom: -1px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.card:hover {
  background: var(--surface);
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.app-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1px solid;
}
.app-icon svg { width: 22px; height: 22px; }

.app-icon .app-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}
.app-icon .app-svg-fallback { place-items: center; }
.app-icon .app-svg-fallback svg { width: 22px; height: 22px; }

.icon-terminal { color: #61afef; background: rgba(97, 175, 239, 0.10); border-color: rgba(97, 175, 239, 0.28); }
.icon-copy { color: #98c379; background: rgba(152, 195, 121, 0.10); border-color: rgba(152, 195, 121, 0.28); }
.icon-grid { color: #c678dd; background: rgba(198, 120, 221, 0.10); border-color: rgba(198, 120, 221, 0.28); }
.icon-globe { color: #56b6c2; background: rgba(86, 182, 194, 0.10); border-color: rgba(86, 182, 194, 0.28); }
.icon-layers { color: #d19a66; background: rgba(209, 154, 102, 0.10); border-color: rgba(209, 154, 102, 0.28); }
.icon-route { color: #e5c07b; background: rgba(229, 192, 123, 0.10); border-color: rgba(229, 192, 123, 0.28); }
.icon-code { color: #e06c75; background: rgba(224, 108, 117, 0.10); border-color: rgba(224, 108, 117, 0.28); }
.icon-note { color: #4ec9b0; background: rgba(78, 201, 176, 0.10); border-color: rgba(78, 201, 176, 0.28); }

.card-title { flex: 1; min-width: 0; }
.card-title h2 {
  margin: 0 0 4px;
  font-size: 16.5px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.lang { margin: 0; color: var(--muted); font-size: 12px; }
.lang .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.version {
  flex-shrink: 0;
  padding: 2px 9px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 700;
}

.desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  flex: 1;
}

.files {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.files li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover .files li { background: var(--bg); }
.files li:hover { border-color: var(--border-strong); }

.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  transition: background 0.15s ease;
}
.dl svg { width: 13px; height: 13px; }
.dl:hover { background: var(--accent-bright); color: #ffffff; text-decoration: none; }

.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta strong { font-size: 12.5px; color: var(--text); }
.file-name {
  font-size: 11.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.size { flex-shrink: 0; color: var(--muted); font-size: 12.5px; }

.card-foot {
  display: flex;
  gap: 18px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
}

.empty {
  margin: 0;
  padding: 36px 28px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

/* Note section */
.note {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 26px 28px;
  background: var(--surface);
}

.note-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius);
  color: var(--accent-bright);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.note-icon svg { width: 19px; height: 19px; }

.note h2 { margin: 0 0 6px; font-size: 14.5px; color: var(--text); }
.note p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; }

/* Footer */
.site-footer {
  border-bottom: 1px solid var(--border);
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  color: var(--faint);
  font-size: 12.5px;
}

.foot-inner a { color: var(--muted); }
.foot-inner a:hover { color: var(--text); }

.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.foot-logo {
  display: block;
  width: 26px;
  height: 27px;
  object-fit: contain;
  flex-shrink: 0;
}
.foot-brand .brand-name { font-size: 13.5px; }
.foot-brand .brand-sub { font-size: 10.5px; }

/* Responsive */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy {
    padding: 36px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .hero-visual { padding: 28px 24px; }
  .toolbar { grid-template-columns: 1fr; }
  .stats-bar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .stats-bar li { flex: 1; padding: 12px 16px; }
}

@media (max-width: 720px) {
  .rail { border-left: 0; border-right: 0; }
  .rail-section::before,
  .rail-section::after { display: none; }
  .topbar-inner { padding: 0 16px; }
  .topnav a:not(.nav-github) { display: none; }
  .hero-copy { padding: 28px 16px; }
  .hero-visual { padding: 22px 16px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 22px 16px; }
  .file-name { display: none; }
  .kbd { display: none; }
  .search-row { padding: 10px 16px; }
  .note { flex-direction: column; padding: 22px 16px; }
  .foot-inner { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .files li, .dl, .btn-primary, .btn-ghost, .nav-github, .rotator-item { transition: none; }
  .cursor { animation: none; }
}
