/* All Things Digital · the AI catalog (ai/)
   Sits on top of site.css: same paper, ink and vermilion, same type and parts
   (nav, buttons, stamp, FAQ, contact). Each tool brings its own colours in
   --tint, --soft and --acc, like the chapters on the main page. */

/* the current page in the nav */
.nav__links a[aria-current="page"] { display: flex; align-items: center; gap: 7px; }
.nav__links a[aria-current="page"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* HERO: THE AI / shelf of tools / CATALOG */
.ahero { position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; padding: calc(var(--nav-h) + 22px) var(--pad) 26px; overflow: hidden; isolation: isolate; }
.ahero__stage { position: relative; z-index: 3; align-self: center; display: grid; padding: 2.4vh 0; }
/* hidden until the type is fitted; shown anyway after 3 s */
html[data-motion="full"]:not(.is-ready) .ahero__stage { opacity: 0; animation: stageSafety 0s 3s forwards; }
@keyframes stageSafety { to { opacity: 1; } }
.ahero__line { display: flex; justify-content: space-between; white-space: nowrap; font-family: var(--display); font-weight: 800; font-size: var(--fs, 14vw); line-height: .8; text-transform: uppercase; pointer-events: none; }
.ahero__line .k { will-change: transform; }

.shelf { --t: clamp(46px, 5.2vw, 86px); position: relative; display: flex; justify-content: space-between; align-items: center; padding: calc(var(--t) * .42) 0 calc(var(--t) * .5); }
.tool { position: relative; z-index: 1; display: block; width: var(--t); height: var(--t); border-radius: 26%; }
.tool__card { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 26%; background: #fff; box-shadow: 0 0 0 1px rgba(22, 19, 15, .06), 0 18px 26px -16px rgba(22, 19, 15, .5); transform-origin: 50% 90%; will-change: transform; }
.tool__card img { width: 58%; height: 58%; object-fit: contain; }
.tool--app .tool__card img { width: 100%; height: 100%; border-radius: 26%; }
.tool__name { position: absolute; left: 50%; top: 100%; padding: 6px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font: 500 10.5px/1 var(--mono); letter-spacing: .04em; white-space: nowrap; opacity: 0; translate: -50% 2px; transition: opacity .25s, translate .35s var(--ease); pointer-events: none; }
.tool:hover .tool__name, .tool:focus-visible .tool__name { opacity: 1; translate: -50% 12px; }
.tool:focus-visible { outline-offset: 6px; border-radius: 26%; }

/* the intro row: lead, buttons, stamp (the main hero is a single column now) */
.ahero .hero__foot { grid-template-columns: minmax(0, 1.25fr) auto auto; align-items: end; justify-items: stretch; gap: 28px 40px; }

/* the spinning stamp. The hover uses rotate/scale, not transform: GSAP owns its transform in the intro */
.stamp { position: relative; display: grid; place-items: center; width: 148px; height: 148px; border-radius: 50%; background: var(--thanaka); transition: rotate .5s var(--ease), scale .5s var(--ease); }
.stamp:hover { rotate: -8deg; scale: 1.05; }
.stamp svg { position: absolute; inset: 0; animation: spin 22s linear infinite; }
.stamp text { font: 600 10.6px var(--my); letter-spacing: .04em; fill: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
[data-motion="reduced"] .stamp svg { animation: none; }

/* the stamp's middle: a bank card, struck through */
.stamp .stamp__card { position: relative; inset: auto; width: 54px; height: auto; animation: none; fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.stamp__card .stamp__slash { stroke: var(--accent); stroke-width: 3.6; }

/* CATALOG */
.catalog { padding: 16vh var(--pad) 12vh; }
.catalog__head { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px 20px; }
.catalog__head .label { grid-column: 1 / -1; }
.catalog__head .big-title { grid-column: 1 / span 8; }
.catalog__my { grid-column: 9 / span 4; align-self: end; font-size: clamp(20px, 2vw, 30px); font-weight: 700; color: var(--accent); text-align: right; }
.catalog__note { grid-column: 1 / span 6; max-width: 36em; color: var(--ink-2); }
.catalog__note b { color: var(--ink); }
.catalog__note span { display: block; margin-top: 6px; font-size: 14.5px; }

.group__head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 22px; margin-top: 12vh; padding: 22px 0 26px; border-top: 2px solid var(--ink); }
.group:first-of-type .group__head { margin-top: 9vh; }
.group__n { grid-row: span 2; align-self: start; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 80; font-size: 24px; line-height: 1; }
.group__title { font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 76; font-size: clamp(34px, 4.2vw, 68px); line-height: .9; letter-spacing: -.01em; text-transform: uppercase; }
.group__my { font-size: clamp(16px, 1.5vw, 22px); font-weight: 700; color: var(--accent); text-align: right; }
.group__note { grid-column: 2 / -1; max-width: 40em; color: var(--ink-2); }

/* one tool: a coloured plate with its logo, then what it is and what it's for */
.item { display: grid; grid-template-columns: repeat(12, 1fr); align-items: center; gap: 0 20px; padding: 7vh 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.group__head + .item { padding-top: 2vh; border-top: 0; }
.item__plate { position: relative; grid-column: 1 / span 5; aspect-ratio: 1 / .9; border-radius: 22px; background: var(--tint); overflow: hidden; container-type: inline-size; isolation: isolate; }
.item__word { position: absolute; left: 0; top: 50%; z-index: 0; margin-top: -.78em; padding-left: 5cqw; font-weight: 800; font-size: 30cqw; line-height: 1.55; white-space: nowrap; color: var(--soft); pointer-events: none; will-change: transform; }
.item__logo { position: absolute; z-index: 2; left: 50%; top: 50%; width: 36cqw; height: 36cqw; margin: -18cqw 0 0 -18cqw; display: grid; place-items: center; border-radius: 24%; background: #fff; box-shadow: 0 0 0 1px rgba(22, 19, 15, .06), 0 34px 44px -24px rgba(22, 19, 15, .55); rotate: -5deg; will-change: transform; }
.item__logo img { width: 56%; height: 56%; object-fit: contain; transition: transform .7s var(--ease); }
.item__logo--app img { width: 100%; height: 100%; border-radius: 24%; }
.item__plate:hover .item__logo img { transform: scale(1.08) rotate(6deg); }
.item__logo--app:hover img, .item__plate:hover .item__logo--app img { transform: none; }
.prompt { position: absolute; z-index: 3; display: flex; align-items: baseline; gap: .6em; max-width: 64%; padding: .75em 1.1em; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 0 0 1px rgba(22, 19, 15, .05), 0 18px 30px -18px rgba(22, 19, 15, .45); font-size: clamp(11.5px, 2.7cqw, 15px); font-weight: 500; line-height: 1.35; will-change: transform; }
.prompt i { font-style: normal; font-family: var(--mono); font-weight: 600; color: var(--acc); }
.prompt:lang(my) { line-height: 1.6; padding-block: .5em; }
.prompt--a { right: 5cqw; top: 8cqw; border-bottom-right-radius: 4px; }
.prompt--b { left: 5cqw; bottom: 8cqw; border-bottom-left-radius: 4px; }

.item__body { grid-column: 7 / span 6; }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.item__n i { font-style: normal; color: var(--ink-3); }
.item__kind { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px; background: var(--tint); }
.item__kind::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); }
.item__name { margin: 18px 0 6px; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 76; font-size: clamp(44px, 5.2vw, 88px); line-height: .88; letter-spacing: -.01em; text-transform: uppercase; }
.item__my { font-size: 16px; color: var(--ink-2); }
.item__desc { margin-top: 20px; max-width: 32em; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.45; }
.item__desc-my { margin-top: 6px; max-width: 40em; font-size: 15px; color: var(--ink-2); }
.item__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font: 500 11.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.item__label span { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.uses { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 26px; margin-top: 14px; }
.uses li { position: relative; padding-left: 22px; }
.uses li::before { content: ""; position: absolute; left: 0; top: .42em; width: 10px; height: 10px; border-radius: 3px; background: var(--acc); }
.uses b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.uses span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.item__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.item__for { flex: 1 1 100%; margin-bottom: 6px; font-size: 14px; color: var(--ink-2); }
.item__for span { margin-right: 10px; font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pick { display: inline-flex; align-items: center; gap: 9px; padding: 14px 20px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ink); font-weight: 600; font-size: 15px; line-height: 1; white-space: nowrap; transition: background .3s, color .3s, box-shadow .3s, transform .3s var(--ease); }
.pick:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper); }
.pick svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; transition: transform .45s var(--ease); }
.pick[aria-pressed="true"] { background: var(--accent); color: #fff7ef; box-shadow: none; }
.pick[aria-pressed="true"] svg { transform: rotate(45deg); }

.catalog__more { margin-top: 10vh; padding-top: 24px; border-top: 2px solid var(--ink); font-size: clamp(18px, 1.6vw, 24px); font-weight: 500; }
.catalog__more a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 4px; }
.catalog__more span { display: block; margin-top: 4px; font-size: 15px; color: var(--ink-2); }

/* HOW TO BUY */
.how { padding: 16vh 0 14vh; background: var(--paper-2); }
.hsteps { position: relative; margin: 0 var(--pad); }
.hsteps__line { position: absolute; left: 0; top: -1px; width: 100%; height: 3px; background: var(--accent); transform-origin: 0 50%; }
.hsteps__list { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.hsteps li { padding: 34px 32px 6px 0; }
.hsteps li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.hsteps b { display: block; font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 60; font-size: clamp(64px, 7vw, 120px); line-height: .85; color: var(--accent); }
.hsteps h3 { margin-top: 20px; font-family: var(--display); font-weight: 800; font-variation-settings: "wdth" 80; font-size: clamp(22px, 2vw, 30px); line-height: 1; text-transform: uppercase; }
.hsteps p { margin-top: 10px; max-width: 26em; color: var(--ink-2); }
.hsteps p:lang(my) { margin-top: 4px; font-size: 14px; }

.faq { padding-top: 16vh; }

/* the list bar, and the "copied" note above it */
.list { position: fixed; z-index: 130; left: 50%; bottom: 18px; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 24px); padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6); translate: -50% 0; transform: translateY(160%); opacity: 0; pointer-events: none; transition: transform .6s var(--ease), opacity .3s; }
.list.is-on { transform: none; opacity: 1; pointer-events: auto; }
.list__logos { display: flex; flex: none; }
.list__logos span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: #fff; box-shadow: 0 0 0 2px var(--ink); }
.list__logos span + span { margin-left: -9px; }
.list__logos img { width: 60%; height: 60%; object-fit: contain; }
.list__logos .is-app img { width: 100%; height: 100%; border-radius: 11px; }
.list__txt { min-width: 0; }
.list__txt b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.list__txt span { display: block; max-width: 22em; overflow: hidden; font-size: 12.5px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; color: rgba(242, 237, 227, .65); }
.list__send { flex: none; padding: 13px 18px; }
.list__send:hover { background: var(--paper); color: var(--ink); }
.list__clear { flex: none; width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--paper); transition: background .25s; }
.list__clear:hover { background: rgba(242, 237, 227, .14); }
.ghost { position: fixed; z-index: 160; display: grid; place-items: center; border-radius: 24%; background: #fff; box-shadow: 0 20px 30px -14px rgba(0, 0, 0, .5); pointer-events: none; }
.ghost img { width: 58%; height: 58%; object-fit: contain; }
.ghost.is-app img { width: 100%; height: 100%; border-radius: 24%; }

.note { position: fixed; z-index: 140; left: 50%; bottom: 18px; max-width: calc(100% - 24px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.5; translate: -50% 0; transform: translateY(20px); opacity: 0; pointer-events: none; transition: opacity .3s, transform .45s var(--ease), bottom .45s var(--ease); }
.note.is-on { transform: none; opacity: 1; }
.note.is-ok { background: #1f7a45; }
.has-list .note { bottom: 84px; }

[data-motion="reduced"] .list, [data-motion="reduced"] .note { transition: none; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .item__plate { grid-column: 1 / span 5; }
  .item__body { grid-column: 6 / span 7; }
}
@media (max-width: 900px) {
  /* phones: the hero is as tall as its content, so no empty band under the nav */
  .ahero { min-height: 0; padding-top: calc(var(--nav-h) + 20px); }
  .ahero__stage { padding: 5vh 0 3vh; }
  .ahero .hero__foot { grid-row: auto; grid-template-columns: 1fr auto; }
  .ahero .hero__lead { grid-column: 1 / -1; }
  .stamp { width: 112px; height: 112px; }
  .stamp text { font-size: 10px; }
  .stamp .stamp__card { width: 42px; }
  .shelf { --t: min(12.2vw, 62px); display: grid; grid-template-columns: repeat(6, var(--t)); justify-content: space-between; row-gap: 14px; padding: 18px 0 22px; }
  .tool__name { display: none; }
  .catalog { padding-top: 12vh; }
  .catalog__head { grid-template-columns: 1fr; }
  .catalog__head > * { grid-column: 1 !important; }
  .catalog__my { text-align: left; }
  .group__head { grid-template-columns: auto 1fr; gap: 6px 16px; }
  .group__n { grid-row: span 1; width: 44px; height: 44px; font-size: 20px; }
  .group__my { grid-column: 1 / -1; text-align: left; }
  .group__note { grid-column: 1 / -1; }
  .item { grid-template-columns: 1fr; gap: 26px; padding: 5vh 0 7vh; }
  .item__plate, .item__body { grid-column: 1; }
  .item__plate { aspect-ratio: 1 / .8; }
  .uses { grid-template-columns: 1fr; gap: 12px; }
  .hsteps__list { grid-template-columns: 1fr; }
  .hsteps li, .hsteps li + li { padding: 26px 0 22px; border-left: 0; }
  .hsteps li + li { border-top: 1px solid var(--line); }
  .list { left: 12px; right: 12px; max-width: none; translate: none; padding-left: 12px; gap: 10px; }
  .list__txt { flex: 1; }
  .note { bottom: 12px; }
  .has-list .note { bottom: 78px; }
}
@media (max-width: 560px) {
  /* the stamp shares the row, so the Telegram button (also in the nav) steps aside */
  .ahero .hero__ctas .btn--line { display: none; }
  .item__foot .btn, .pick { flex: 1 1 auto; justify-content: center; }
  .list__logos span:nth-child(n+3) { display: none; }
  .list__send { padding: 12px 14px; font-size: 14px; }
}
