/* Diwan details page: one section grammar, after the home page's.
   Section heads: title on the left (8 of 12 columns), its line and action on the right (4 columns), sitting on the title's last baseline.
   Head to content: one gap (--hgap). Second title lines in grey (.t2). */
:root{--g12:24px;--hgap:clamp(40px,5vw,64px)}
@media (max-width:1100px){ :root{--g12:20px} }

.sheet:not(.forest) h2.t .t2{color:#858A84}

.shead{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:var(--g12);align-items:end}
.shead h2.t{grid-column:1/9;max-width:none;margin:0}
.shead .sh-r{grid-column:9/13;padding-bottom:calc(var(--h2fs) * .11)}
:is(#connect,#inside,#memory,#together) .shead .sh-r .lead{margin:0;max-width:none;text-wrap:pretty}
@media (max-width:1180px){ .shead h2.t{grid-column:1/8} .shead .sh-r{grid-column:8/13} }
.shead .sh-a{margin-top:24px}
.shead .sh-a>span{display:block}
@media (max-width:900px){
  .shead{grid-template-columns:1fr;row-gap:18px}
  .shead h2.t,.shead .sh-r{grid-column:auto}
  .shead .sh-r{padding-bottom:0}
  :is(#connect,#inside,#memory,#together) .shead .sh-r .lead{max-width:44ch}
}

/* head to content, the same everywhere */
#connect .hubgrid,#together .pair{margin-top:var(--hgap)}
@media (min-width:821px){ #inside .rtrack{margin-top:var(--hgap)} }

/* hero: the headline balances over three lines instead of breaking after "kept and" */
@media (min-width:821px){
  .phero .grid{grid-template-columns:minmax(0,7fr) minmax(0,5fr)}
  .phero h1{max-width:none}
  .phero h1 .l>span{text-wrap:balance}
}

/* Diwan AI titles use the page's headline size and weight */
.aiscope .aih h2{font-size:var(--h2fs);font-weight:400;letter-spacing:-.03em;line-height:1.04}

/* Better together: Moltaqa is not available yet; the photo keeps its title legible */
#together .pair .card.photo::after{background:linear-gradient(180deg,rgba(20,23,22,.5) 0%,rgba(20,23,22,.28) 45%,rgba(20,23,22,.74) 100%)}
#together .pair .card .soon{align-self:flex-start;display:inline-flex;align-items:center;height:26px;padding:0 11px;margin-bottom:18px;border-radius:999px;background:rgba(237,239,234,.16);color:var(--bone);font-size:12.5px;font-weight:500;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}

/* Questions: title on the left, the list on the right */
#questions .wrap{text-align:left}
.qgrid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));column-gap:var(--g12);align-items:start}
.qgrid .qhead{grid-column:1/5;position:sticky;top:120px}
#questions .qgrid .qhead h2.t{margin:0;max-width:none}
.qgrid .qhead .lead{margin-top:18px;max-width:28ch;font-size:clamp(16px,1.25vw,18px)}
.qgrid .qlink{color:var(--ink);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
#questions .qgrid .faq{grid-column:6/13;margin:0;max-width:none;border-top:1px solid var(--line)}
#questions .qgrid .faq summary{padding:22px 0}
@media (max-width:900px){
  .qgrid{grid-template-columns:1fr;row-gap:28px}
  #questions .qgrid .qhead,#questions .qgrid .faq{grid-column:auto}
  .qgrid .qhead{position:static}
}

/* small screens: titles use the width instead of breaking at 14 characters */
@media (max-width:820px){ h2.t{max-width:22ch} .aiscope .aih h2{max-width:none} }

/* the hero and the first section share the paper: one section gap between them, not two */
#connect.sheet{padding-top:clamp(48px,5vw,72px)}

/* Better together follows the questions on the same paper: a hairline, then the head */
#together .shead{border-top:1px solid var(--line);padding-top:var(--hgap)}

/* Diwan Knowledge: the feature's mark above the knowledge graph title, like Diwan Ask AI and Diwan Act AI (Figma "Diwan Knowledge") */
.shead .kmark{grid-column:1/-1;display:block;overflow:hidden;padding:6px 0;margin:-6px 0 28px}
.shead .kmark>span{display:block;width:max-content}
.k-mark{display:inline-flex;align-items:center;gap:10px;height:34px;font-size:40px;line-height:1;font-weight:500;letter-spacing:-.03em;white-space:nowrap}
.k-mark img{display:block;height:38px;width:auto;transform:translateY(-1px)}
.k-mark .kmt{display:block;padding-bottom:.06em;background:linear-gradient(90deg,#4E72FF 0%,#5CBEFF 50%,#5AA9F5 100%);-webkit-background-clip:text;background-clip:text;color:transparent}
@media (max-width:640px){ .k-mark{height:28px;font-size:33px;gap:8px} .k-mark img{height:31px} .shead .kmark{margin-bottom:20px} }

/* the three feature marks (Diwan Ask AI, Diwan Act AI, Diwan Knowledge) sit 12px closer to their titles, and each
   title's two lines get 8px between them; the knowledge head uses the same visible gaps as the Diwan AI heads */
.aiscope .aih .lmk{margin-bottom:22px}
.aiscope #ai-act .aih .lmk{margin-bottom:19px}
.aiscope .aih h2 .l+.l{margin-top:8px}
.shead .kmark{margin-bottom:13px}
#mem-h .l+.l{margin-top:9px}
@media (max-width:640px){
  .aiscope .aih .lmk{margin-bottom:10px}
  .aiscope #ai-act .aih .lmk{margin-bottom:7px}
  .shead .kmark{margin-bottom:-11px}
  #mem-h .l+.l{margin-top:6px}
}

/* Diwan Act, "Your call": the fourth source (documents) lights with its card, and the cell carries the dot ground of Integrations */
/* Your call: sparks are driven by diwan-act.js (random per line); illustration centred in the cell */
.aiscope .ywide .mv{animation:none!important}
.aiscope #ai-act .yc3 .istage{margin:auto -24px}
.aiscope #ai-act .yc3{background-image:radial-gradient(rgba(237,239,234,.05) 1px,transparent 1.2px);background-size:14px 14px}
