/* Amaete Chem Lab: the home page and the periodic table. Loaded after style.css. */
body.site { overflow-x: hidden; }
.wrap { width: min(1280px, 100% - 40px); margin: 0 auto; }
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 850; letter-spacing: -.02em; text-decoration: none; font-size: 17px; }
.logo svg { width: 28px; height: 28px; }
.nav nav { display: flex; gap: 4px; margin-left: auto; }
.nav nav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: 14.5px; color: var(--ink2); }
.nav nav a:hover, .nav nav a[aria-current] { background: var(--panel); color: var(--ink); }

/* hero */
.hero { position: relative; display: grid; grid-template-columns: 1.02fr 1fr; gap: 40px; align-items: center; padding: 56px 0 40px; }
.hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.0; letter-spacing: -.035em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #d13a64, #e2552b 35%, #f2b134 55%, #3aa35a 70%, #1f78d1 85%, #6a52b3); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: ph 8s ease-in-out infinite alternate; }
@keyframes ph { to { background-position: 100% 0; } }
.hero p.lead { font-size: 19px; line-height: 1.55; color: var(--ink2); margin: 0 0 26px; max-width: 34em; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.cta .btn { padding: 15px 22px; font-size: 16px; }
.stats { display: flex; gap: 26px; margin-top: 32px; flex-wrap: wrap; }
.stats div b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats div span { font-size: 13px; color: var(--mute); }
.stage3d { position: relative; aspect-ratio: 1.05; border-radius: 28px; overflow: hidden; background: #e7e3da; box-shadow: var(--shadow); }
[data-theme="dark"] .stage3d { background: #15181d; }
.stage3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage3d .live { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 90%, transparent); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }
.stage3d .live i { width: 8px; height: 8px; border-radius: 50%; background: #e2552b; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.stage3d .caption { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: var(--shadow); font-size: 14px; line-height: 1.4; min-height: 64px; transition: opacity .3s; }
.stage3d .caption b { display: block; font-size: 15px; margin-bottom: 2px; }

/* sections */
section.block { padding: 56px 0; }
.sh { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.sh h2 { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.03em; margin: 0; line-height: 1.05; }
.sh p { margin: 0; color: var(--ink2); max-width: 36em; font-size: 16.5px; line-height: 1.5; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how div { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.how svg { width: 54px; height: 54px; display: block; margin-bottom: 12px; }
.how h3 { margin: 0 0 6px; font-size: 19px; } .how p { margin: 0; color: var(--ink2); line-height: 1.5; }
.lvlrow { margin-bottom: 34px; }
.lvlrow h3 { display: flex; align-items: baseline; gap: 10px; font-size: 20px; margin: 0 0 14px; }
.lvlrow h3 small { font-size: 14px; color: var(--mute); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 16px; }
.cards[style*="--n:2"] .xcard .art, .cards[style*="--n:3"] .xcard .art { aspect-ratio: 1.9; }
.xcard { position: relative; display: flex; flex-direction: column; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.xcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.xcard .art { aspect-ratio: 1.45; background: color-mix(in srgb, var(--hue) 11%, var(--panel2)); display: grid; place-items: center; }
.xcard .art svg { width: 64%; height: 82%; overflow: visible; }
.xcard .art .liq { animation: slosh 4.5s ease-in-out infinite; transform-origin: center; }
.xcard:hover .art .bub { animation-duration: 1.2s; }
.xcard .art .bub { animation: rise 2.6s linear infinite; }
@keyframes rise { from { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } to { transform: translateY(-46px); opacity: 0; } }
@keyframes slosh { 50% { transform: skewY(-2deg); } }
.xcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.xcard h4 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.xcard p { margin: 0; color: var(--ink2); font-size: 14px; line-height: 1.45; flex: 1; }
.xcard .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--mute); font-weight: 600; margin-top: 6px; }
.xcard .done { color: var(--ok); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.banner { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 28px; border-radius: 26px; text-decoration: none; overflow: hidden; min-height: 220px; }
.banner.free { background: #12302c; color: #eaf7f4; }
.banner.table { background: #2a2040; color: #f1ecfb; }
.banner h3 { font-size: 30px; letter-spacing: -.02em; margin: 0 0 8px; } .banner p { margin: 0 0 16px; opacity: .85; line-height: 1.5; max-width: 26em; }
.banner .go { display: inline-flex; padding: 11px 18px; border-radius: 999px; background: #fff; color: #111; font-weight: 750; }
.mini { display: grid; grid-template-columns: repeat(4, 46px); gap: 5px; }
.mini span { height: 46px; border-radius: 8px; background: var(--c); color: #1b1b1b; display: grid; place-items: center; font-weight: 800; font-size: 17px; animation: pop 6s ease-in-out infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes pop { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-6px) scale(1.06); } }
.bottles { display: flex; gap: 10px; align-items: end; }
.bottles i { width: 26px; border-radius: 6px 6px 10px 10px; background: linear-gradient(to top, var(--c) 0 var(--f), rgba(255,255,255,.12) var(--f)); border: 2px solid rgba(255,255,255,.4); height: 80px; animation: fill 5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * .5s); }
@keyframes fill { to { --f: 30%; filter: hue-rotate(40deg); } }
.life { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.life div { scroll-snap-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.life b { display: block; margin-bottom: 6px; } .life p { margin: 0; color: var(--ink2); line-height: 1.5; font-size: 14.5px; }
.life div i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--hue); margin-right: 8px; }
.foot { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 30px; }
.foot .wrap { display: flex; gap: 18px; flex-wrap: wrap; color: var(--mute); font-size: 14px; } .foot span { font-weight: 800; color: var(--ink); margin-right: auto; }
.foot a { text-decoration: none; } .foot a:hover { color: var(--ink); }

/* periodic table */
.pt { padding-bottom: 40px; }
.pt-head { padding: 34px 0 18px; } .pt-head h1 { margin: 0 0 4px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.03em; } .pt-head p { margin: 0; color: var(--ink2); }
.pt-layout { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.atom-card { position: sticky; top: 76px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; scroll-margin-top: 70px; }
.atom-view { aspect-ratio: 1.15; background: radial-gradient(circle at 50% 45%, color-mix(in srgb, #2aa6ff 14%, var(--panel2)), var(--panel2)); }
.atom-view canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.atom-info { padding: 16px 18px 18px; }
.ai-top { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.ai-sym { width: 64px; height: 64px; border-radius: 14px; background: var(--c); color: #1b1b1b; display: grid; place-items: center; position: relative; flex: none; }
.ai-sym b { font-size: 28px; } .ai-sym small { position: absolute; left: 6px; top: 4px; font-size: 11px; font-weight: 700; }
.ai-top h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; } .ai-top p { margin: 2px 0 0; color: var(--mute); }
.ai-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 12px; }
.ai-facts div { background: var(--panel2); border-radius: 10px; padding: 7px 9px; } .ai-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); } .ai-facts dd { margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.ai-note { margin: 0 0 10px; line-height: 1.5; } .ai-small { margin: 0; font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.pt-scroll { overflow-x: auto; padding-bottom: 8px; }
.pt-grid { display: grid; grid-template-columns: repeat(18, minmax(44px, 1fr)); grid-template-rows: repeat(7, auto) 14px repeat(2, auto); gap: 4px; min-width: 820px; }
.el { position: relative; aspect-ratio: .86; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--c) 72%, var(--panel)); color: #17191c; padding: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s; }
[data-theme="dark"] .el { background: color-mix(in srgb, var(--c) 62%, #000); color: #fff; }
.el small { position: absolute; left: 4px; top: 2px; font-size: 9.5px; font-weight: 700; opacity: .75; }
.el b { font-size: 17px; line-height: 1; } .el span { font-size: 8.5px; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.el:hover, .el.on { transform: scale(1.12); z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.el.on { outline: 3px solid var(--ink); }
.el.ph { background: var(--panel2); color: var(--mute); font-size: 10px; font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 16px; font-size: 13px; color: var(--ink2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

@media (max-width: 1100px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 30px; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; } .cta, .stats { justify-content: center; }
  .stage3d { aspect-ratio: .95; }
  .how { grid-template-columns: 1fr; } .cards { grid-template-columns: repeat(2, 1fr); } .duo { grid-template-columns: 1fr; }
  .sh { justify-content: center; text-align: center; } .sh h2 { width: 100%; } .lvlrow h3 { justify-content: center; }
  .pt-layout { grid-template-columns: 1fr; } .atom-card { position: relative; top: 0; } .pt-head { text-align: center; }
  .nav nav a:not([aria-current]):nth-child(1) { display: none; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .nav nav a { padding: 7px 9px; font-size: 13.5px; } .logo { font-size: 15px; } .logo span.long { display: none; }
  .hero h1 { font-size: 40px; } .hero p.lead { font-size: 16.5px; }
  .stats { gap: 14px; flex-wrap: nowrap; } .stats div b { font-size: 24px; } .stats div span { font-size: 11.5px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; } .xcard .body { padding: 10px 12px 12px; } .xcard h4 { font-size: 15px; } .xcard p { display: none; }
  .banner { grid-template-columns: 1fr; text-align: center; justify-items: center; } .banner h3 { font-size: 25px; }
  section.block { padding: 38px 0; }
}
@media (prefers-reduced-motion: reduce) { .hero h1 em, .xcard .art *, .mini span, .bottles i, .stage3d .live i { animation: none !important; } }
.nav nav a, .logo { white-space: nowrap; }
@media (max-width: 560px) { .pt-grid { min-width: 700px; gap: 3px; } .el b { font-size: 15px; } .el span { display: none; } .pt-scroll::after { content: "Scroll sideways for the rest of the table →"; display: block; font-size: 12px; color: var(--mute); margin-top: 6px; } }
.xcard p.nick { flex: none; font-style: italic; font-size: 13px; color: color-mix(in srgb, var(--hue) 70%, var(--ink)); }
@media (max-width: 700px) { .xcard p.nick { display: block; font-size: 12px; } }

