/* ==========================================================================
   Tishka AI shared chrome, for the legacy article pages.
   The header and footer come from _chrome/head.html and _chrome/foot.html.
   This file styles them for the pages that still carry the old article
   stylesheet (/resource/site.css); the new pages get the same look from
   /assets/site.css. Values follow that design system: 72px bar, General Sans
   wordmark, IBM Plex Mono buttons, #181818 canvas, signal green #5de27e.
   Written in px on purpose: the article pages keep the browser's 16px root.
   ========================================================================== */

@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/general-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/general-sans-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/general-sans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('/assets/fonts/general-sans-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Tokens live on the chrome itself so they can never leak into the article. */
.site-head,
.site-foot,
.mobile-menu {
  --tk-black: #181818;
  --tk-warm-50: #f5f0ec;
  --tk-warm-100: #eae3dd;
  --tk-warm-200: #d8cfc9;
  --tk-warm-300: #c9bab0;
  --tk-warm-500: #a8978c;
  --tk-line: #3a3936;
  --tk-line-soft: #282726;
  --tk-green: #5de27e;
  --tk-green-hover: #84e99c;
  --tk-font: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --tk-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --tk-r: 8px;
  --tk-ease-out: cubic-bezier(.215, .61, .355, 1);
  --tk-ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  font-family: var(--tk-font);
}

.site-head *,
.site-head *::before,
.site-head *::after,
.site-foot *,
.site-foot *::before,
.site-foot *::after,
.mobile-menu *,
.mobile-menu *::before,
.mobile-menu *::after { box-sizing: border-box; }

.mobile-menu p,
.site-foot p { margin: 0; }
.mobile-menu ul,
.mobile-menu ol,
.site-foot ul,
.site-foot ol { margin: 0; padding: 0; list-style: none; }
.mobile-menu button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.site-head a,
.site-foot a,
.mobile-menu a { color: inherit; text-decoration: none; }

.shell {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: 24px;
}
@media (min-width: 1024px) { .shell { padding-inline: 48px; } }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 22px; height: 22px; flex: none; }

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 10000;
  padding: 10px 16px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--tk-green);
  color: var(--tk-black);
  border-radius: var(--tk-r);
  font-family: var(--tk-mono);
  font-size: 14px;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform .2s var(--tk-ease-out);
}
.skip:focus { transform: none; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-head {
  position: sticky;
  top: 0;
  inset-inline: 0;
  z-index: 90;
  background: rgba(24, 24, 24, .92);
  border-bottom: 1px solid var(--tk-line-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: tk-header-in .9s var(--tk-ease-out) both;
  transition: transform .42s var(--tk-ease-out);
}
.site-head.is-hidden { transform: translateY(-100%); }

.head-in {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-head .wordmark {
  display: inline-flex;
  align-items: baseline;
  padding-block: 9px;
  margin-block: -9px;
  gap: 5px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1;
  color: var(--tk-warm-50);
}
.site-head .wordmark span {
  font-family: var(--tk-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  transform: translateY(-12px);
  color: var(--tk-green);
}
.site-head .nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  height: auto;
  margin-left: 20px;
  margin-right: auto;
}
.site-head .nav a {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 400;
  color: var(--tk-warm-300);
  transition: color .2s var(--tk-ease-out), background .2s var(--tk-ease-out);
}
.site-head .nav a:hover { color: var(--tk-warm-50); background: rgba(234, 227, 221, .07); }
.site-head .nav a[aria-current="page"],
.mobile-nav a[aria-current="page"] { color: var(--tk-warm-50); }
.site-head .nav a[aria-current="page"]:hover { background: transparent; }
.head-actions { display: flex; align-items: center; gap: 24px; }
.head-login {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--tk-warm-500);
  transition: color .2s var(--tk-ease-out);
}
.head-login:hover { color: var(--tk-warm-50); }

/* Buttons: mono 13px, 42px in the bar, 8px radius. */
.site-head .btn,
.mobile-menu .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--tk-r);
  border: 1px solid transparent;
  font-family: var(--tk-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  transition: translate .35s var(--tk-ease-spring),
              background-color .35s var(--tk-ease-spring),
              border-color .35s var(--tk-ease-spring),
              color .35s var(--tk-ease-spring);
}
.site-head .btn:hover,
.mobile-menu .btn:hover { translate: 0 -2px; }
.site-head .btn-ghost {
  background: transparent;
  color: var(--tk-warm-100);
  border-color: rgba(234, 227, 221, .38);
}
.site-head .btn-ghost:hover {
  background: rgba(234, 227, 221, .07);
  border-color: rgba(234, 227, 221, .62);
  color: var(--tk-warm-50);
}
.mobile-menu .btn-primary { background: var(--tk-green); color: var(--tk-black); }
.mobile-menu .btn-primary:hover { background: var(--tk-green-hover); }
.mobile-menu .btn-wide { width: 100%; height: 48px; padding: 0 16px; }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tk-line);
  border-radius: var(--tk-r);
  color: var(--tk-warm-100);
}

/* ── Mobile menu ────────────────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  padding: 22px 24px 30px;
  border: 0;
  background: var(--tk-black);
  color: var(--tk-warm-100);
  z-index: 500;
  display: none;
  flex-direction: column;
}
.mobile-menu[open] { display: flex; }
.mobile-menu::backdrop { background: rgba(0, 0, 0, .6); }
.mobile-top { display: flex; align-items: center; justify-content: space-between; }
.mobile-top .wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1;
  color: var(--tk-warm-50);
}
.mobile-top .wordmark span {
  font-family: var(--tk-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  transform: translateY(-12px);
  color: var(--tk-green);
}
.mobile-menu .menu-toggle { display: inline-flex; }
.mobile-nav {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--tk-line);
}
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--tk-line);
  font-size: clamp(26px, 9vw, 34px);
  font-weight: 700;
  letter-spacing: -.04em;
}
.mobile-nav a span {
  font-family: var(--tk-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--tk-warm-500);
  letter-spacing: .04em;
}
.mobile-foot { margin-top: auto; padding-top: 30px; display: grid; gap: 14px; }
.mobile-foot p,
.mobile-foot .mono {
  font-family: var(--tk-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--tk-warm-500);
  text-align: center;
  letter-spacing: .06em;
}

body.menu-open { overflow: hidden; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-foot {
  border-top: 1px solid var(--tk-line-soft);
  padding: 80px 0 24px;
  font-size: 16px;
  color: var(--tk-warm-500);
}
.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.foot-brand p {
  margin-top: 20px;
  max-width: 34ch;
  font-size: 18px;
  line-height: 1.45;
  color: var(--tk-warm-300);
}
.site-foot .wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: 1;
  color: var(--tk-warm-50);
}
.site-foot .wordmark span {
  font-family: var(--tk-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  transform: translateY(-12px);
  color: var(--tk-green);
}
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 28px;
}
.foot-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--tk-warm-200);
  transition: color .16s var(--tk-ease-out);
}
.foot-legal a:hover,
.foot-legal a[aria-current="page"] { color: var(--tk-green); }
.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--tk-line-soft);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--tk-warm-500);
}
.foot-bottom .mono {
  font-family: var(--tk-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.foot-bottom a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color .2s;
}
.foot-bottom a:hover { color: var(--tk-green); }

@keyframes tk-header-in {
  from { opacity: 0; translate: 0 -12px; }
  to { opacity: 1; translate: 0 0; }
}

@media (max-width: 920px) {
  .site-head .nav,
  .head-login { display: none; }
  .menu-toggle { display: inline-flex; }
  .head-actions .btn { display: none; }
  .head-in { height: 64px; }
}

@media (max-width: 1023px) {
  .mobile-menu { padding-inline: clamp(24px, 4vw, 48px); }
}

@media (max-width: 400px) {
  .mobile-menu .btn { height: auto; min-height: 48px; padding: 12px 14px; white-space: normal; line-height: 1.25; }
}

@media (max-width: 640px) {
  .site-foot { padding: 56px 0 20px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-head { animation: none; }
  .site-head .btn,
  .mobile-menu .btn,
  .skip { transition: none; }
}

@media print {
  .site-head, .mobile-menu, .skip { display: none !important; }
}
