/* jaack.me — editorial Forma.
   Shared with other sites: token names, the type scale, the 4px spacing scale,
   theme.js (light 07:00–18:59, Auto/Chiaro/Scuro) and the layout principles.
   This site's own skin: warm paper, oxblood instead of Forma's gold, serif headlines,
   a 66ch essay measure, and dated writing rows. Work titles stay in the system sans. */

nav.site-nav.jk-top {
  width: min(calc(100% - 16px), 1120px);
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 6px 8px 6px 14px;
  z-index: 40;
}
nav.site-nav .nav-row { display: contents; }
nav.site-nav .jk-mark { margin-right: 4px; }
nav.site-nav .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav.site-nav.jk-top .nav-links a.jk-sw {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  background: transparent;
  color: var(--jk-ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
nav.site-nav .nav-links a.jk-sw:hover,
nav.site-nav .nav-links a.jk-sw[aria-current="page"] {
  color: var(--jk-ink);
  background: var(--jk-tint-hi);
}
nav.site-nav .lang-switch { display: flex; gap: 0; margin-left: 4px; }
nav.site-nav .lang-toggle {
  min-width: 40px;
  min-height: 40px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  border-radius: var(--jk-r-pill);
  color: var(--jk-ink-2);
  font-family: var(--jk-font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
nav.site-nav .lang-toggle[aria-pressed="true"] {
  color: var(--jk-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
nav.site-nav .jk-mark {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  min-width: 0;
}
.jk-thsw button { min-height: 40px; }
@media (min-width: 641px) {
  .jk-thsw button { min-width: 40px; }
}
.author > .toright > .bio { color: var(--jk-ink-2); }
.footer-main .footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.wrapper-normal.jk-page,
.wrapper-large.jk-page,
.wrapper-xwide.jk-page {
  width: min(1120px, 100%);
  max-width: 1120px;
  height: auto;
  margin: 0 auto;
  padding: calc(var(--jk-topbar-h) + 12px) clamp(16px, 3vw, 28px) 0;
}
.wrapper-xwide.jk-page { max-width: 1240px; }

@media (max-width: 760px) {
  :root { --jk-topbar-h: 112px; }
  nav.site-nav.jk-top {
    width: calc(100% - 8px);
    top: 8px;
    gap: 2px 6px;
    padding: 4px 6px 4px 10px;
  }
  nav.site-nav .jk-mark { order: 1; margin-right: 0; flex: 1 1 auto; }
  nav.site-nav [data-jk-theme-switch] { order: 2; margin-left: auto; flex: 0 0 auto; }
  nav.site-nav .nav-row {
    display: flex;
    order: 3;
    flex: 1 0 100%;
    align-items: center;
    min-width: 0;
    gap: 4px;
  }
  nav.site-nav .nav-links {
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  nav.site-nav .lang-switch { order: 1; flex: none; margin-left: 0; }
  nav.site-nav .nav-links a.jk-sw { padding: 6px 8px; }
}

h1,
.header-home .hero-title,
.page > .page-title,
.post > .title,
.project-page .page-title,
.contact-section h2,
.section-heading h2,
.app-gallery h2,
.wrapper-xwide .post > .title {
  font-family: var(--jk-serif);
  font-weight: 560;
  font-size: var(--jk-fs-title);
  letter-spacing: -0.02em;
  line-height: 1.12;
  font-style: normal;
}
.project-feature h3,
.feature-lead h3,
.app-entry h3,
.app-gallery h3 {
  font-family: var(--jk-font);
  font-weight: 650;
}
h2 { font-size: clamp(22px, 2vw, 28px); font-weight: 650; letter-spacing: -0.02em; }
h3 { font-size: 18px; font-weight: 650; }
p, li { line-height: 1.55; }
.page-intro, .section-intro, .hero-sub { color: var(--jk-t2); font-size: var(--jk-fs-lede); }
.work-meta, .post > .date, figcaption, .jk-note { color: var(--jk-t2); font-size: var(--jk-fs-sm); }

.header-home { padding: 8px 0 20px; }
.header-home .hero-title { margin: 0 0 12px; }
.header-home .hero-bottom { gap: 16px; }
.home-section { margin: 0 0 28px; }
.page, .post, .home, .writing, .projects { margin-top: 8px; }
.page > .page-title { margin: 0 0 12px; text-align: left; }
.contact-section { padding-top: 16px; }
.contact-section h2 { margin: 0 0 8px; }
.footer-main { margin-top: 28px; padding: 16px 0 28px; }

.home > .list > .item > .url,
.writing > .list > .item > .url,
.projects > .list > .item > .url { padding: 8px 0; }
.writing-entry, .reading-pick, .work-entry { padding: 10px 0; }
.project-feature .feature-copy { padding: 12px 0 16px; }
.feature-lead h3, .project-feature h3 { font-size: clamp(22px, 2vw, 28px); }
.app-gallery { padding: 16px 0; gap: 20px; }
.app-gallery h2 { margin: 8px 0; }

a, a:link { color: var(--jk-ink); }
a:hover, a:focus, a:active { color: var(--jk-accent-text); }
a.text-link, .contact-links a { color: var(--jk-accent-text); }

.lost-container { padding: 24px 0 48px; }
.lost-container .page-title,
.lost-container h1 {
  font-size: var(--jk-fs-big);
  letter-spacing: var(--jk-track-big);
  line-height: 0.9;
  margin: 0;
}
.lost-note { color: var(--jk-t2); margin-top: 12px; }

img, pre { border-radius: 0; }
.app-preview img, .project-screen img { border-radius: 24px; }
pre, code, tt {
  background: var(--jk-surface-2);
  color: var(--jk-ink);
  border-color: var(--jk-hair);
}
blockquote {
  border-left: 1px solid var(--jk-hair);
  color: var(--jk-t2);
  font-style: normal;
  font-weight: 450;
}

/* Syntax colours that assume a light page stay readable when the theme is dark. */
html[data-theme="dark"] .highlight { color: var(--jk-ink); }
html[data-theme="dark"] .highlight .n,
html[data-theme="dark"] .highlight .na,
html[data-theme="dark"] .highlight .nf,
html[data-theme="dark"] .highlight .nc,
html[data-theme="dark"] .highlight .nx,
html[data-theme="dark"] .highlight .s,
html[data-theme="dark"] .highlight .s1,
html[data-theme="dark"] .highlight .s2 { color: var(--jk-ink-2); }
html[data-theme="dark"] .highlight .c,
html[data-theme="dark"] .highlight .c1,
html[data-theme="dark"] .highlight .cm,
html[data-theme="dark"] .highlight .cp { color: var(--jk-t2); }

.skip-link:focus { z-index: 50; }

/* Old posts embed Instagram HTML with forced white cards. Keep them readable, don't restyle the embed internals. */
.instagram-media { max-width: 100% !important; }

/* Editorial skin. Packaged gold stays in the shared files and is not this site's accent. */
:root { --jk-serif: Iowan Old Style, Palatino, "Palatino Linotype", Georgia, serif; }
html[data-theme="light"] {
  --jk-bg: #f3eee6;
  --jk-surface: #fffdf8;
  --jk-surface-2: #e7dfd2;
  --jk-ink: #1c1612;
  --jk-ink-2: #5a4e45;
  --jk-t2: rgba(28, 22, 18, .72);
  --jk-t3: rgba(28, 22, 18, .64);
  --jk-hair: rgba(28, 22, 18, .14);
  --jk-accent: #8c3a48;
  --jk-accent-text: #6e2432;
  --jk-on-accent: #fffdf8;
  --jk-accent-wash: rgba(140, 58, 72, .12);
  --jk-bg-1: rgba(196, 122, 118, .22);
  --jk-bg-1b: rgba(196, 122, 118, .08);
  --jk-bg-2: rgba(214, 176, 130, .20);
  --jk-bg-2b: rgba(214, 176, 130, .08);
  --jk-bg-3: rgba(150, 158, 120, .16);
  --jk-bg-3b: rgba(150, 158, 120, .06);
}
html[data-theme="dark"] {
  --jk-bg: #161311;
  --jk-surface: #1e1916;
  --jk-surface-2: #261f1b;
  --jk-ink: #f6f0e8;
  --jk-ink-2: #d4c6ba;
  --jk-t2: rgba(246, 240, 232, .72);
  --jk-t3: rgba(246, 240, 232, .58);
  --jk-hair: rgba(246, 240, 232, .14);
  --jk-accent: #e7a8b4;
  --jk-accent-text: #f0c0c8;
  --jk-on-accent: #1c1214;
  --jk-accent-wash: rgba(231, 168, 180, .14);
  --jk-bg-1: rgba(180, 90, 100, .16);
  --jk-bg-1b: rgba(180, 90, 100, .06);
  --jk-bg-2: rgba(196, 150, 110, .12);
  --jk-bg-2b: rgba(196, 150, 110, .05);
  --jk-bg-3: rgba(140, 150, 110, .10);
  --jk-bg-3b: rgba(140, 150, 110, .04);
}
.hero-label {
  font-family: var(--jk-font);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-label span { color: var(--jk-accent-text); }
.post { max-width: 66ch; }
.post > .title {
  max-width: 22ch;
  padding-bottom: 12px;
  box-shadow: inset 0 -2px 0 var(--jk-accent);
}
.post > .date {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-top: 10px;
  font-family: var(--jk-font);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--jk-accent-text);
}
.post > .date p { margin: 0; color: var(--jk-t2); letter-spacing: 0; text-transform: none; font-size: 13px; }
.post-body { font-size: var(--jk-fs-lede); line-height: 1.65; }
.writing-entry { padding: 12px 0; gap: 16px; }
.writing-entry time {
  color: var(--jk-accent-text);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.writing-entry h3 { font-family: var(--jk-serif); font-weight: 560; }
