/* tpgiv.app: an app gallery in the renaissance.systems visual language (brand system
   2026-07-01): Nocturne ground with a fresco grain, Newsreader serif for names, Inter for
   text, blue for the built things, gold for the touch of craft. Values copied from
   renaissance.systems/styles.css. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/newsreader-normal-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 450;
  font-display: swap;
  src: url("/fonts/newsreader-italic-450-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("/fonts/inter-normal-latin.woff2") format("woff2");
}
/* Pixelify Sans (OFL): the Mortimer calculator's own title face, for its tile only. */
@font-face {
  font-family: "Pixelify Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/pixelify-latin.woff2") format("woff2");
}
/* Metric-matched fallbacks (from renaissance.systems) so the font swap does not shift layout. */
@font-face {
  font-family: "Newsreader Fallback";
  font-style: normal;
  src: local("Georgia");
  size-adjust: 100.72%;
  ascent-override: 72.97%;
  descent-override: 26.31%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  font-style: italic;
  src: local("Georgia Italic");
  size-adjust: 92.58%;
  ascent-override: 79.39%;
  descent-override: 28.62%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 106.75%;
  ascent-override: 90.75%;
  descent-override: 22.6%;
  line-gap-override: 0%;
}

:root {
  --nocturne: #04070e;
  --tile: #0b111c;
  --plate: #070b13;
  --raise: #131b29;
  --border-soft: rgba(214, 222, 236, 0.08);
  --border-strong: rgba(214, 222, 236, 0.18);
  --halo: #79a6ff;
  --night-gold: #dcaf55;
  --gold-soft: rgba(212, 165, 55, 0.55);
  --text-primary: #f6f7ff;
  --text-headline: #eef2f8;
  --text-secondary: #c5cbda;
  --text-muted: #8a93a8;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-emphasis: cubic-bezier(0.16, 1, 0.3, 1);
  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: min(1240px, 100% - 48px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--nocturne);
  color-scheme: dark;
  scrollbar-color: var(--raise) var(--nocturne);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--grain) repeat, var(--nocturne);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(67, 127, 254, 0.38); color: #fff; }

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }
a:focus-visible {
  outline: 2px solid var(--halo);
  outline-offset: 4px;
  border-radius: 6px;
}

.wrap { width: var(--wrap); margin-inline: auto; }

/* Header: a wordmark built like REN-AI-SSANCE, with the IV in blue */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 30px;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.3125rem;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--text-headline);
  text-decoration: none;
}
.wordmark span { color: var(--halo); }
.site-head nav a {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 180ms var(--ease-out);
}
.site-head nav a:hover { color: #fff; }

/* GitHub: the small gold-outline glass button from the renaissance.systems hero */
.site-head .gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(212, 165, 55, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(179, 179, 179, 0.03));
  box-shadow:
    0 0 18px rgba(212, 165, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 0 14px rgba(212, 165, 55, 0.07);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    border-color 180ms var(--ease-out),
    background 180ms var(--ease-out),
    box-shadow 220ms var(--ease-out),
    transform 220ms var(--ease-out);
}
.site-head .gh-btn .gh { width: 16px; height: 16px; }
.site-head .gh-btn .arrow { width: 14px; height: 14px; margin-left: 0; color: var(--night-gold); }
.site-head .gh-btn:hover,
.site-head .gh-btn:focus-visible {
  color: #fff;
  border-color: rgba(230, 189, 84, 0.95);
  background: rgba(30, 22, 8, 0.45);
  box-shadow:
    0 0 28px rgba(212, 165, 55, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 18px rgba(212, 165, 55, 0.12);
  transform: translateY(-1px);
}
.site-head .gh-btn:hover .arrow { transform: translate(2px, -2px); }
.site-head .gh-btn:active { transform: translateY(0); }
.site-head .gh-btn:focus-visible { outline: 2px solid var(--halo); outline-offset: 3px; border-radius: 999px; }

main { flex: 1; }

.page-title {
  margin: clamp(40px, 9vh, 104px) 0 0;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--text-headline);
}

/* Bento: each brand's own imagery, with a liquid-glass caption floating over it.
   Glass needs something behind it to bend (liquid-glass skill, rule 1); here that is the
   brand art inside each tile, so the page itself stays flat near-black. */
.bento-grid {
  list-style: none;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.cell { min-width: 0; }
.cell-ren .bento { min-height: 440px; }
.cell-mahj .bento { min-height: 250px; }
.cell-harbor .bento,
.cell-vera .bento,
.cell-kjv .bento,
.cell-explainer .bento,
.cell-colo .bento,
.cell-mort .bento { min-height: 270px; }

@media (min-width: 640px) {
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 264px; }
  .cell-ren { grid-column: 1 / -1; grid-row: span 2; }
  .cell-mahj { grid-column: 1 / -1; }
  .cell .bento { min-height: 0; }
}
@media (min-width: 1100px) {
  .bento-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 252px; }
  .cell-ren { grid-column: 1 / 3; grid-row: 1 / 3; }
  .cell-mahj { grid-column: 3 / 5; grid-row: 1; }
  .cell-harbor { grid-column: 3; grid-row: 2; }
  .cell-vera { grid-column: 4; grid-row: 2; }
  .cell-kjv { grid-column: 1 / 3; grid-row: 3; }
  .cell-explainer { grid-column: 3 / 5; grid-row: 3; }
  .shelf .cell { grid-column: span 2; }
}

/* A second shelf of tiles under its own small serif heading */
.shelf { margin-top: clamp(56px, 7vw, 88px); }
.shelf-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.625rem, 2.4vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--text-headline);
}
.shelf .bento-grid { margin-top: 20px; }

.bento {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--tile);
  box-shadow: 0 18px 34px -18px rgba(0, 0, 0, 0.7);
  color: inherit;
  text-decoration: none;
  transition: border-color 300ms var(--ease-out);
}
/* A soft shade at the top of the photo tiles so the brand mark reads over any art. */
.bento:not(.bento-light)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.62) 0%, rgba(4, 7, 14, 0.18) 26%, rgba(4, 7, 14, 0) 42%);
}
.bento:hover,
.bento:focus-visible { border-color: var(--gold-soft); }
.bento:focus-visible { outline-offset: 3px; border-radius: 26px; }

.art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1400ms var(--ease-emphasis);
}
.cell-ren .art { object-position: 72% 30%; }
.cell-kjv .art { object-position: 50% 46%; }
.cell-colo .art { object-position: 50% 32%; }
.art-dim { filter: brightness(0.5) saturate(0.85); }
.bento:hover .art { transform: scale(1.045); }

/* The brand mark, top left, on the art */
.brand { position: absolute; top: 22px; left: 24px; z-index: 2; }
.wm-ren {
  width: clamp(168px, 38%, 236px);
  height: auto;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7));
}
.lockup-mahj { width: 168px; height: auto; }
.brand-made {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
}
.brand-made img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* codebase-explainer: the page it makes, as a window rising out of the tile */
.cell-explainer .art {
  inset: 70px auto auto 24px;
  width: max(560px, 100%);
  height: auto;
  object-fit: fill;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 0;
  border-bottom: 0;
  border-radius: 12px 0 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  transform-origin: 0 0;
  transition: transform 900ms var(--ease-emphasis);
}
.cell-explainer .bento:hover .art { transform: translate(-3px, -6px); }

/* Mortimer: the calculator's own stone panel, title face and imbued heart */
.bento-stone {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.3)),
    #2a2317 url("/img/art/mortimer-stone.webp") repeat;
  background-size: auto, 240px;
}
.bento-stone::before { display: none; }
.wm-mort {
  display: block;
  max-width: min(330px, 58%);
  font: 700 clamp(1.375rem, 2.2vw, 1.75rem) / 1.08 "Pixelify Sans", ui-monospace, monospace;
  color: #ff981f;
  text-shadow: 0 3px 0 #000;
  text-wrap: balance;
}
.mort-heart {
  position: absolute;
  top: 16px;
  right: 7%;
  width: clamp(104px, 22%, 132px);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(255, 110, 40, 0.22)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
  transition: transform 900ms var(--ease-emphasis);
}
.bento:hover .mort-heart { transform: translateY(-6px) rotate(-3deg); }

/* Mahj Mentor: its own cream ground and its own 3D tiles from mahjmentor.app */
.bento-light { background: #faf7f1; border-color: rgba(0, 0, 0, 0.06); }
.mahj-tiles { position: absolute; inset: 0; }
.mt {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(70, 52, 30, 0.22));
  transition: transform 900ms var(--ease-emphasis);
}
.mt1 { width: 76px; right: 6%; top: 24px; transform: rotate(9deg); }
.mt2 { width: 70px; right: 21%; top: 64px; transform: rotate(-11deg); }
.mt3 { width: 62px; right: 35%; top: 20px; transform: rotate(5deg); }
.mt4 { width: 58px; right: 48%; top: 86px; transform: rotate(-7deg); }
.bento:hover .mt1 { transform: rotate(13deg) translateY(-6px); }
.bento:hover .mt2 { transform: rotate(-15deg) translateY(-4px); }
.bento:hover .mt3 { transform: rotate(1deg) translateY(-7px); }
.bento:hover .mt4 { transform: rotate(-3deg) translateY(-5px); }

/* Liquid glass caption. A dark frost over the tint keeps the text readable over busy art
   (the skill's modal-tier reasoning); glass.js adds the edge refraction in Chromium. */
.caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 12px;
  border-radius: 18px;
}
.cell-ren .caption { right: auto; width: min(380px, calc(100% - 24px)); }
.glass {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(16, 18, 24, 0.34), rgba(10, 12, 18, 0.5));
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}
.glass-light {
  border-color: rgba(255, 255, 255, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(250, 247, 241, 0.58));
  box-shadow:
    0 12px 28px rgba(70, 52, 30, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
}
.cap-desc {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #f1f4f9;
  text-wrap: pretty;
}
.glass-light .cap-desc { color: #2b2a33; }
.cap-host {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: rgba(226, 232, 242, 0.72);
}
.glass-light .cap-host { color: #6d6672; }
.gh { width: 14px; height: 14px; flex: none; fill: currentColor; }
.arrow {
  width: 16px;
  height: 16px;
  flex: none;
  margin-left: auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 260ms var(--ease-out), color 180ms var(--ease-out);
}
.bento:hover .arrow { color: var(--night-gold); transform: translate(2px, -2px); }
.bento-light:hover .arrow { color: #a85566; }

@media (max-width: 639px) {
  .mt3, .mt4 { display: none; }
  .mt1 { right: 5%; }
  .mt2 { right: 27%; top: 74px; }
  .lockup-mahj { width: 150px; }
}

/* Footer */
.site-foot {
  margin-top: clamp(72px, 10vw, 128px);
  padding-block: 28px 40px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Not-found page */
.lost { margin-top: 18px; color: var(--text-secondary); }
.lost a { color: var(--halo); text-underline-offset: 0.24em; }

@media (max-width: 720px) {
  .site-head { padding-block: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; }
}
