/* foundth.is: one look for every public page (home, work, notes, loop).
   Layout idea: each page opens with one heading line and one sentence, then goes straight to its content.
   Sections share one header row: a short title on the left, the way onward on the right. */
:root{
  --ink:#0E0F12;
  --bone:#ECE7DA;
  --dim:#8F8A7C;
  --line:#23262F;
  --indigo:#6A66F5;
  --panel:#15162A;
  --sans:"Bai Jamjuree","Noto Sans Thai",ui-sans-serif,system-ui,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,monospace;
  --gut:clamp(16px,4vw,32px);
  color-scheme:dark;
}
html{background:var(--ink)}
body{margin:0;background:var(--ink);color:var(--bone);font-family:var(--sans);font-size:17px;line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:inherit}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}
.nw{white-space:nowrap}

/* one language at a time */
html[data-lang="th"] [lang="en"]:not(html),
html[data-lang="en"] [lang="th"]:not(html){display:none!important}

/* the switcher lives in the top bar, left of the page menu */
.lang{display:inline-flex;flex:none;border:1px solid var(--line);border-radius:2px;overflow:hidden;font-family:var(--mono);font-size:12.5px;line-height:1}
.ft-head .lang{margin-left:auto}
body > .lang{margin:12px var(--gut) 0 auto;width:max-content;display:flex}
.lang button{background:transparent;border:0;padding:8px 11px;color:#82858E}
.lang button[aria-pressed="true"]{color:var(--bone);background:var(--panel)}

/* page frame */
.page{max-width:980px;margin:0 auto;padding:clamp(28px,6vw,56px) var(--gut) 40px;display:grid;gap:clamp(40px,8vw,72px)}
.page-head{display:grid;gap:12px}
.page-head h1{font-weight:600;font-size:clamp(28px,6vw,46px);line-height:1.2;margin:0;max-width:22ch;text-wrap:balance}
.page-head .lede{margin:0;color:var(--dim);font-size:clamp(17px,2.2vw,19px);max-width:56ch}

/* a section: title on the left, the way onward on the right */
.sec{display:grid;gap:16px}
.sec-h{display:flex;justify-content:space-between;align-items:baseline;gap:12px;border-top:1px solid var(--line);padding-top:14px}
.sec-h h2{margin:0;font-size:20px;font-weight:600}
.sec-h .more{font-family:var(--mono);font-size:13px;color:var(--dim);text-decoration:none;white-space:nowrap}
.sec-h .more:hover{color:var(--indigo)}
.sec-h:has(> .more:only-child){justify-content:flex-end}
.sec.rest{margin-top:8px}
.sec .note{margin:0;color:var(--dim);max-width:60ch}

/* the one card, used for work and for notes */
.cards{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(260px,1fr))}
.card{display:grid;align-content:start;gap:6px;padding:18px;border:1px solid var(--line);border-radius:4px;text-decoration:none;color:var(--bone);background:transparent;transition:border-color .2s}
.card:hover{border-color:var(--acc,var(--indigo))}
.card .art{height:120px;margin:-6px -6px 8px;display:flex;align-items:center;justify-content:center}
.card .art svg{width:100%;height:100%}
.card .k{font-family:var(--mono);font-size:12px;letter-spacing:.04em;color:var(--acc,var(--indigo))}
.card h3{margin:0;font-size:20px;font-weight:600;line-height:1.3}
.card p{margin:0;color:var(--dim);font-size:16px}
.card .go{margin-top:6px;font-family:var(--mono);font-size:12.5px;color:var(--dim)}
.card.quiet{opacity:.8}
.cards.five{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.card.mini{padding:14px;gap:4px}
.card.mini .art{height:76px;margin:-4px -4px 6px}
.card.mini h3{font-size:16px}
.card.mini p{font-size:14px;line-height:1.45}
.cards.games{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));margin-top:4px}
.card.game .art{height:44px}
.card.game h3{font-size:15px}
.card.quiet h3{font-size:18px}
.cards.skeleton .card{min-height:120px;border-style:dashed}

/* footer: the same on every page */
.site-foot{max-width:980px;margin:0 auto;padding:20px var(--gut) 36px;display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:10px 24px;border-top:1px solid var(--line);font-family:var(--mono);font-size:13px;color:var(--dim)}
.site-foot nav{display:flex;gap:18px}
.site-foot a{text-decoration:none;color:var(--dim)}
.site-foot a:hover{color:var(--bone)}

@media (prefers-reduced-motion:reduce){.card{transition:none}}
