/* tkbtk.com shared styles — linked from the top page, every app page and every changelog page.
   Page-specific rules stay inline in each page's <style>. */

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle canvas dot-grid, like a design-tool artboard */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

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

img, svg{ display: block; max-width: 100%; }

ul{ margin: 0; padding: 0; list-style: none; }

h1,h2,h3,h4,p{ margin: 0; }

:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* =========== menu bar (site nav) =========== */
.menubar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22,23,27,0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.menubar-inner{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menubar-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.dots{ display:flex; gap:6px; }

.dot{ width:11px; height:11px; border-radius:50%; }

.dot.red{ background:#ff5f57; }

.dot.yellow{ background:#febc2e; }

.dot.green{ background:#28c840; }

.menubar-nav{
  display: flex;
  align-items: center;
  gap: 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
}

.menubar-nav a{ transition: color .15s ease; }

.menubar-nav a:hover{ color: var(--text); }

.menubar-nav .pill{
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text);
}

.menubar-nav .pill:hover{ border-color: var(--text-dim); }

/* =========== hero =========== */
.hero{
  padding: 96px 0 76px;
}

.eyebrow{
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before{
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(111,208,140,0.15);
}

.headline .accent{ color: var(--amber); }

.hero-meta{
  margin-top: 34px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.hero-meta b{ color: var(--text-dim); font-weight: 500; }

/* =========== section shell =========== */
section{ padding: 72px 0; position: relative; z-index: 1; }

.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}

.section-title{
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}

.section-tag{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

/* =========== macOS window card (signature component) =========== */
.window{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-window);
}

.window-titlebar{
  background: var(--titlebar);
  border-bottom: 1px solid var(--border-soft);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-titlebar .title{
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-right: 54px; /* balance the traffic lights on the left */
}

/* app grid on the homepage */
.app-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 880px){
  .app-grid{ grid-template-columns: 1fr; }
}

.app-card{
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, border-color .22s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: rise .6s ease forwards;
}

.app-card:nth-child(1){ animation-delay: .05s; }

.app-card:nth-child(2){ animation-delay: .15s; }

.app-card:nth-child(3){ animation-delay: .25s; }

@keyframes rise{ to{ opacity:1; transform: translateY(0); } }

.app-card:hover{ transform: translateY(-4px); border-color: var(--border); }

.app-card > .window-titlebar .title{ font-weight: 500; }

.app-card-body{
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.app-icon{
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #14151a;
}

.app-name{ font-family: var(--font-display); font-weight: 700; font-size: 18px; }

.app-desc{ color: var(--text-dim); font-size: 14.5px; flex: 1; }

.app-tags{ display: flex; gap: 8px; flex-wrap: wrap; }

.badge{
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.app-card-foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.link-arrow{
  font-family: var(--font-mono);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap .18s ease;
}

.app-card:hover .link-arrow{ gap: 10px; }

/* =========== buttons =========== */
.btn{
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{ color: #16171b; }

.btn-primary:hover{ filter: brightness(1.08); }

.btn-ghost{
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover{ border-color: var(--text-dim); }

/* =========== features grid =========== */
.feature-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 880px){ .feature-grid{ grid-template-columns: 1fr 1fr; } }

@media (max-width: 560px){ .feature-grid{ grid-template-columns: 1fr; } }

.feature{
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
}

.feature-icon{
  width: 30px; height: 30px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #14151a;
}

.feature h3{
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature p{ color: var(--text-dim); font-size: 14px; }

/* =========== release notes (real chronology → numbered/dated) =========== */
.changelog{ display: flex; flex-direction: column; }

.release{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px solid var(--border-soft);
}

.release:first-child{ border-top: none; padding-top: 0; }

@media (max-width: 640px){
  .release{ grid-template-columns: 1fr; gap: 10px; }
}

.release-meta{ font-family: var(--font-mono); }

.release-version{
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.release-date{ font-size: 12px; color: var(--text-faint); margin-top: 4px; }

.release-latest{
  display:inline-block;
  margin-top: 8px;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(111,208,140,0.12);
  color: var(--ok);
  border: 1px solid rgba(111,208,140,0.3);
}

.change-list{ display: flex; flex-direction: column; gap: 9px; }

.change{
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.tag{
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  height: fit-content;
  margin-top: 2px;
}

.tag.new{ background: rgba(123,176,255,0.14); color: var(--blue); }

.tag.improved{ background: rgba(240,192,90,0.14); color: var(--warn); }

.tag.fixed{ background: rgba(255,138,128,0.14); color: var(--fix); }

/* link to the full changelog archive (index.html → changelog.html) */
.release-more{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-top: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(123,176,255,0.05);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  transition: border-color .15s, background .15s, color .15s;
}
.release-more:hover{ border-color: rgba(123,176,255,0.4); background: rgba(123,176,255,0.10); color: var(--text); }
.release-more .cmd{ color: var(--blue); font-weight: 700; }
.release-more b{ color: var(--text); font-weight: 600; }

/* =========== terminal / readme block =========== */
.terminal{
  background: #101114;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-window);
}

.terminal-body{
  padding: 22px 24px 28px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #c7cad1;
  overflow-x: auto;
}

.terminal-body .prompt{ color: var(--ok); }

.terminal-body .path{ color: var(--blue); }

.terminal-body .comment{ color: var(--text-faint); }

.terminal-body h4{
  font-family: var(--font-mono);
  color: var(--text);
  font-size: 13.5px;
  margin: 18px 0 8px;
}

.terminal-body h4:first-child{ margin-top: 0; }

.terminal-body pre{ margin: 0; white-space: pre-wrap; }

.terminal-body ul{ margin: 4px 0 0 0; padding-left: 18px; list-style: disc; }

.terminal-body li{ margin: 3px 0; }

/* =========== app hero (individual pages) =========== */
.app-hero{
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 72px;
}

@media (max-width: 860px){
  .app-hero{ grid-template-columns: 1fr; }
}

.app-hero h1{
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.app-hero .tagline{
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 16px;
  max-width: 44ch;
}

.app-hero .cta-row{
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.spec-list{
  margin-top: 22px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.spec-list b{ color: var(--text-dim); font-weight: 500; }

/* screenshot mock panel inside a window */
.screen-mock{
  aspect-ratio: 16/10.5;
  padding: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* two-col overview */
.overview{
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 44px;
}

@media (max-width: 860px){ .overview{ grid-template-columns: 1fr; } }

.overview-text p{ color: var(--text-dim); font-size: 15.5px; margin-bottom: 16px; }

.overview-text p:last-child{ margin-bottom: 0; }

.spec-card{
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  padding: 20px 22px;
}

.spec-card h4{
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.spec-row{
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 9px 0;
  border-top: 1px solid var(--border-soft);
}

.spec-row:first-of-type{ border-top: none; }

.spec-row span:first-child{ color: var(--text-faint); }

.spec-row span:last-child{ font-family: var(--font-mono); color: var(--text); }

/* =========== footer =========== */
footer{
  border-top: 1px solid var(--border-soft);
  padding: 40px 0 50px;
  margin-top: 40px;
}

.footer-inner{
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-faint);
}

.footer-inner a:hover{ color: var(--text-dim); }

.footer-links{ display: flex; gap: 20px; }

/* back link on app pages */
.back-link{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.back-link:hover{ color: var(--text); }

/* reveal-on-scroll (used for feature cards etc.) */
.reveal{
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.in{ opacity: 1; transform: translateY(0); }

.window{ box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 64px -28px rgba(0,0,0,.8); }

@supports not (backdrop-filter: blur(14px)){ .menubar{ background: rgba(22,23,27,.97); } }
