/* ============================================================
   Q HUB site — content sections: spaces, campus rail, steps, system, pains, AI, compare, day, FAQ
   ============================================================ */

/* ---------- spaces ---------- */
#spaces { background: var(--bg); }
.filters { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: var(--r-pill); background: var(--bg-soft); border: 1px solid var(--line); margin-bottom: var(--s-6); }
.filters button { min-height: 44px; padding: 0 1.15rem; border-radius: var(--r-pill); font-family: var(--f-head); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2); transition: background-color var(--t-med) ease, color var(--t-med) ease, box-shadow var(--t-med) ease; }
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .filters button[aria-pressed="true"] { background: var(--teal); color: #0f1a22; }

.space-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.6rem); }
.space { --mx: 50%; --my: 0%; position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.6s var(--ease-out), box-shadow 0.6s var(--ease-out), border-color 0.4s ease, opacity 0.45s ease; }
.space:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--teal-line); }
.space.gone { display: none; }
.space-media { position: relative; aspect-ratio: 4 / 3.5; overflow: hidden; background: var(--bg-soft); }
.space-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.4s var(--ease-out); }
.space:hover .space-media img { transform: scale(1.12); }
.space-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 25, 38, 0) 45%, rgba(20, 25, 38, 0.72) 100%); }
.space-hint { position: absolute; z-index: 1; inset-inline-start: 14px; bottom: 12px; color: #fff; font-size: var(--fs-xs); font-weight: 500; display: inline-flex; align-items: center; gap: 0.45rem; }
.space-hint::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal-hi); box-shadow: 0 0 0 4px rgba(143, 220, 232, 0.25); }
.space-hot { position: absolute; z-index: 1; inset-inline-end: 12px; top: 12px; padding: 0.3rem 0.75rem; border-radius: var(--r-pill); background: var(--amber); color: #2b1d05; font-family: var(--f-head); font-size: 0.75rem; font-weight: 600; }
.space-body { display: flex; flex-direction: column; gap: var(--s-4); padding: 1.25rem 1.3rem 1.3rem; flex: 1; }
.space h3 { font-family: var(--f-head); font-size: var(--fs-h3); font-weight: 600; line-height: 1.4; }
.space-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem; }
.space-price small { color: var(--mut); font-size: var(--fs-xs); }
.space-price strong { font-family: var(--f-num); font-size: clamp(1.7rem, 1.2vw + 1.2rem, 2.2rem); font-weight: 600; line-height: 1; color: var(--ink); direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.space-price .ask { font-family: var(--f-head); font-size: 1.15rem; color: var(--teal-ink); }
.space ul { display: grid; gap: 0.45rem; padding-top: var(--s-4); border-top: 1px dashed var(--line-2); }
.space li { position: relative; padding-inline-start: 1.6rem; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6; }
.space li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.42em; width: 16px; height: 16px; border-radius: 50%; background: var(--teal-soft) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a8898' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><path d='M6 12.5l4 4 8-9'/></svg>") center / 10px no-repeat; }
.space .btn { margin-top: auto; width: 100%; }
.space .btn-g:hover { background: var(--teal); color: #0f1a22; border-color: var(--teal); }

.incl { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-5); margin-top: var(--s-6); padding: 1.1rem 1.4rem; border-radius: var(--r-lg); background: var(--bg-soft); border: 1px solid var(--line); }
.incl b { font-family: var(--f-head); font-weight: 600; font-size: var(--fs-sm); color: var(--teal-ink); }
.incl ul { display: flex; flex-wrap: wrap; gap: 8px; }
.incl li { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 40px; padding: 0 0.9rem; border-radius: var(--r-pill); background: var(--bg-elev); border: 1px solid var(--line); font-size: var(--fs-sm); color: var(--ink-2); }
.incl svg { width: 17px; height: 17px; fill: none; stroke: var(--teal-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- campus rail (pinned horizontal scroll on desktop, swipe on touch) ---------- */
#campus { padding-bottom: clamp(3rem, 6vw, 5rem); overflow: clip; }
.rail-pin { position: relative; }
.rail { display: flex; gap: clamp(0.9rem, 1.6vw, 1.5rem); padding-inline: var(--gut); width: max-content; will-change: transform; }
.rail.native { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.rail.native::-webkit-scrollbar { display: none; }
.shot { position: relative; flex: none; width: clamp(240px, 26vw, 380px); aspect-ratio: 9 / 13; border-radius: var(--r-lg); overflow: hidden; background: var(--bg-soft); scroll-snap-align: center; cursor: zoom-in; }
.shot:nth-child(even) { margin-top: clamp(1.5rem, 4vw, 4rem); }
.shot.wide { width: clamp(320px, 40vw, 560px); aspect-ratio: 4 / 4.6; cursor: default; }
.shot img, .shot video { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out), filter 0.6s ease; }
.shot:hover img { transform: scale(1.06); }
.shot figcaption, .shot .cap { position: absolute; inset-inline: 0; bottom: 0; padding: 2.4rem 1.1rem 1rem; background: linear-gradient(180deg, transparent, rgba(8, 11, 18, 0.85)); color: #fff; font-family: var(--f-head); font-size: var(--fs-sm); font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.shot figcaption i, .shot .cap i { font-family: var(--f-num); font-style: normal; font-size: var(--fs-xs); color: var(--teal-hi); direction: ltr; }
.rail-meta { display: flex; align-items: center; justify-content: space-between; margin-top: var(--s-6); color: var(--mut); font-size: var(--fs-sm); }
.rail-count { display: inline-flex; align-items: center; gap: 0.7rem; direction: ltr; }
.rail-count b { color: var(--ink); font-size: 1.15rem; }
.rail-count i { width: 54px; height: 1px; background: var(--line-2); }

/* ---------- steps ---------- */
#how { background: var(--bg-soft); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); counter-reset: step; }
.step { position: relative; padding: 1.5rem 1.4rem 1.6rem; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm); counter-increment: step; overflow: hidden; transition: transform 0.5s var(--ease-out), border-color 0.4s ease; }
.step:hover { transform: translateY(-6px); border-color: var(--teal-line); }
.step::before { content: "0" counter(step); display: block; font-family: var(--f-num); font-size: 2.6rem; font-weight: 600; line-height: 1; color: transparent; -webkit-text-stroke: 1.2px var(--teal); margin-bottom: 1.4rem; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.step::after { content: ""; position: absolute; inset-inline-end: -26px; top: -26px; width: 96px; height: 96px; border-radius: 50%; background: var(--teal-soft); transition: transform 0.7s var(--ease-out); }
.step:hover::after { transform: scale(1.5); }
.step h3 { font-family: var(--f-head); font-size: var(--fs-h3); font-weight: 600; margin-bottom: 0.4rem; position: relative; }
.step p { color: var(--mut); font-size: var(--fs-sm); position: relative; }

/* ---------- system ---------- */
#system { background: radial-gradient(90% 60% at 50% 0%, #1f2740 0%, var(--bg) 70%); }
.sys { display: grid; gap: var(--s-5); }
.sys-tabs { display: flex; gap: 6px; padding: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.sys-tabs::-webkit-scrollbar { display: none; }
.sys-tabs button { position: relative; flex: 1 0 auto; min-height: 46px; padding: 0 1.1rem; border-radius: var(--r-pill); font-family: var(--f-head); font-size: var(--fs-sm); font-weight: 500; color: var(--mut); overflow: hidden; transition: color var(--t-med) ease, background-color var(--t-med) ease; }
.sys-tabs button:hover { color: var(--ink); }
.sys-tabs button[aria-selected="true"] { color: #0f1a22; background: var(--teal); font-weight: 600; }
.sys-tabs button[aria-selected="true"]::after { content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.35); transform: scaleX(var(--prog, 0)); transform-origin: left; }
[dir="rtl"] .sys-tabs button[aria-selected="true"]::after { transform-origin: right; }
.sys-tabs button > span { position: relative; z-index: 1; }
.sys-view { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.2rem, 3vw, 2.6rem); align-items: center; }
.browser { border-radius: var(--r-md); overflow: hidden; background: #0c0f17; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); }
.browser .tb { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #171c2a; direction: ltr; }
.browser .tb span { width: 10px; height: 10px; border-radius: 50%; background: #39415a; }
.browser .tb em { margin-inline-start: 12px; font-style: normal; font-family: var(--f-num); font-size: 0.75rem; color: #8d98ad; background: #0f131d; padding: 3px 12px; border-radius: 8px; }
.browser .scr { position: relative; aspect-ratio: 1600 / 1005; background: #0f131d; }
.browser .scr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transform: scale(1.03); transition: opacity 0.6s ease, transform 0.9s var(--ease-out); }
.browser .scr img.on { opacity: 1; transform: none; }
.sys-info { display: grid; gap: var(--s-4); align-content: center; justify-items: start; min-height: 15rem; }
.sys-info h3 { font-family: var(--f-head); font-size: clamp(1.3rem, 1vw + 1rem, 1.75rem); font-weight: 600; line-height: 1.4; }
.sys-info p { color: var(--ink-2); }
.sys-info ul { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-info li { padding: 0.35rem 0.85rem; border-radius: var(--r-pill); border: 1px solid var(--teal-line); background: var(--teal-soft); color: var(--teal-ink); font-size: var(--fs-xs); font-weight: 500; }
.sys-info > * { animation: rise 0.6s var(--ease-out) both; }
.sys-info > *:nth-child(2) { animation-delay: 0.07s; } .sys-info > *:nth-child(3) { animation-delay: 0.14s; } .sys-info > *:nth-child(4) { animation-delay: 0.21s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

/* ---------- pain → solution ---------- */
.pain-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); }
.pain { display: grid; gap: var(--s-4); padding: 1.3rem; border-radius: var(--r-lg); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out); }
.pain:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.pain > div { display: grid; gap: 0.35rem; padding: 0.9rem 1rem; border-radius: var(--r-md); }
.pain small { font-family: var(--f-head); font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.pain small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pain p { font-size: var(--fs-sm); line-height: 1.75; }
.pain .bad { background: var(--bad-soft); } .pain .bad small { color: var(--bad); } .pain .bad p { color: var(--ink-2); text-decoration: line-through; text-decoration-color: transparent; transition: text-decoration-color 0.5s ease; }
.pain:hover .bad p { text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.pain .good { background: var(--ok-soft); } .pain .good small { color: var(--ok); } .pain .good p { color: var(--ink); font-weight: 500; }

/* ---------- AI ---------- */
#ai { background: radial-gradient(70% 90% at 0% 50%, rgba(108, 188, 201, 0.16), transparent 60%), var(--bg); }
[dir="ltr"] #ai { background: radial-gradient(70% 90% at 100% 50%, rgba(108, 188, 201, 0.16), transparent 60%), var(--bg); }
.ai-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.ai-copy { display: grid; gap: var(--s-4); justify-items: start; }
.agents { display: grid; gap: 10px; }
.agent { display: flex; align-items: center; gap: 1rem; padding: 0.7rem; padding-inline-end: 1.2rem; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); transition: transform 0.5s var(--ease-out), background-color 0.4s ease, border-color 0.4s ease; }
.agent:hover { transform: translateX(-10px); background: rgba(108, 188, 201, 0.1); border-color: var(--teal-line); }
[dir="ltr"] .agent:hover { transform: translateX(10px); }
.agent-face { position: relative; width: 64px; height: 64px; border-radius: 20px; overflow: hidden; flex: none; background: var(--bg-elev); }
.agent-face img, .agent-face video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.agent-face video { opacity: 0; transition: opacity 0.4s ease; }
.agent:hover .agent-face video.ready { opacity: 1; }
.agent b { display: block; font-family: var(--f-head); font-size: 1.05rem; font-weight: 600; }
.agent span { color: var(--mut); font-size: var(--fs-sm); line-height: 1.6; }
.agent-live { margin-inline-start: auto; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(88, 211, 154, 0.6); animation: live 2.4s ease-out infinite; flex: none; }
@keyframes live { to { box-shadow: 0 0 0 12px rgba(88, 211, 154, 0); } }

/* ---------- compare ---------- */
.cmp { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-elev); box-shadow: var(--shadow-md); overflow: hidden; max-width: 60rem; margin-inline: auto; }
.cmp table { width: 100%; border-collapse: collapse; }
.cmp th, .cmp td { padding: 1rem 1.2rem; text-align: center; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.cmp th { font-family: var(--f-head); font-weight: 600; color: var(--mut); background: var(--bg-soft); }
.cmp th:first-child, .cmp td:first-child { text-align: start; color: var(--ink); font-weight: 500; }
.cmp th:last-child { color: #0f1a22; background: var(--teal); }
.cmp td:last-child { background: var(--teal-soft); }
.cmp tr:last-child td { border-bottom: 0; }
.cmp tbody tr { transition: background-color var(--t-med) ease; }
.cmp tbody tr:hover { background: var(--bg-soft); }
.cmp svg { width: 22px; height: 22px; margin-inline: auto; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cmp .yes { stroke: var(--ok); stroke-dasharray: 26; stroke-dashoffset: 26; }
.cmp .no { stroke: var(--mut); opacity: 0.55; }
.cmp.in .yes { animation: draw 0.6s var(--ease-out) forwards; animation-delay: calc(0.3s + var(--i, 0) * 70ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- day ---------- */
#day { background: var(--bg-soft); }
.day-wrap { position: relative; }
.day-line { position: absolute; inset-inline: 0; top: 27px; height: 2px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.day-line b { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--teal-hi)); transform: scaleX(var(--p, 0)); }
[dir="rtl"] .day-line b { transform-origin: right; } [dir="ltr"] .day-line b { transform-origin: left; }
.day { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(0.6rem, 1.4vw, 1.2rem); position: relative; }
.dy { display: grid; gap: 0.5rem; justify-items: start; }
.dy-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--teal-ink); box-shadow: var(--shadow-sm); transition: transform 0.5s var(--ease-spring), background-color 0.4s ease, color 0.4s ease; }
.dy.on .dy-ic { background: var(--teal); color: #0f1a22; transform: scale(1.08); border-color: var(--teal); }
.dy-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dy time { font-family: var(--f-num); font-size: var(--fs-xs); font-weight: 600; color: var(--teal-ink); margin-top: 0.5rem; direction: ltr; }
.dy b { font-family: var(--f-head); font-size: 1rem; font-weight: 600; line-height: 1.5; }
.dy span { color: var(--mut); font-size: var(--fs-xs); line-height: 1.7; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.faq-grid .sec-head { position: sticky; top: 120px; margin-bottom: 0; }
.faq { display: grid; gap: 10px; }
.fq { border-radius: var(--r-md); border: 1px solid var(--line); background: var(--bg-elev); transition: border-color var(--t-med) ease, box-shadow var(--t-med) ease; }
.fq.open { border-color: var(--teal-line); box-shadow: var(--shadow-sm); }
.fq button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.3rem; text-align: start; font-family: var(--f-head); font-size: 1.02rem; font-weight: 600; line-height: 1.6; min-height: 56px; }
.fq button i { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--teal-soft); transition: transform 0.5s var(--ease-spring), background-color var(--t-med) ease; }
.fq button i::before, .fq button i::after { content: ""; position: absolute; left: 9px; right: 9px; top: 14px; height: 2px; border-radius: 2px; background: var(--teal-ink); transition: transform 0.45s var(--ease-out); }
.fq button i::after { transform: rotate(90deg); }
.fq.open button i { transform: rotate(180deg); background: var(--teal); }
.fq.open button i::before, .fq.open button i::after { background: #0f1a22; }
.fq.open button i::after { transform: rotate(0deg); }
.fq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease-out); }
.fq.open .fq-a { grid-template-rows: 1fr; }
.fq-a > div { overflow: hidden; }
.fq-a p { padding: 0 1.3rem 1.2rem; color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .space-grid, .pain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sys-view, .ai-grid, .faq-grid { grid-template-columns: 1fr; }
  .faq-grid .sec-head { position: static; }
  .sys-info { min-height: 0; }
  .day { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2rem; }
  .day-line { display: none; }
}
@media (max-width: 620px) {
  .space-grid, .pain-grid, .steps { grid-template-columns: 1fr; }
  .day { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp th, .cmp td { padding: 0.8rem 0.6rem; font-size: var(--fs-xs); }
  .filters { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: var(--r-md); }
  .filters button { flex: none; }
  .shot { width: 72vw; } .shot.wide { width: 84vw; }
  .shot:nth-child(even) { margin-top: 0; }
  .agent:hover { transform: none; }
}

/* link from each space card to its SEO landing page */
.space-more { display: inline-flex; align-items: center; min-height: 40px; margin-top: 0.35rem; font-family: var(--f-head); font-size: var(--fs-sm); font-weight: 600; color: var(--teal-ink); }
.space-more:hover { text-decoration: underline; text-underline-offset: 4px; }
