1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
/* Documentation site chrome. Everything below the `.gl-doc-` prefix belongs
   to this site rather than to the design system it documents — including the
   width/height constants used directly below. The source design system
   defines no container-width tokens at all, so there is nothing under
   `--gl-*` for a doc shell to reach for; the Space foundation page's own
   notes say to omit that group entirely rather than invent one. */

.gl-doc-skip {
  position: absolute;
  inset-inline-start: var(--gl-space-xs);
  inset-block-start: -4rem;
  z-index: 40;
  padding: var(--gl-space-2xs) var(--gl-space-xs);
  background: var(--gl-color-surface-card);
  border: 1px solid var(--gl-color-border-default);
  border-radius: var(--gl-radius-sm);
  box-shadow: var(--gl-shadow-float);
  transition: inset-block-start var(--gl-dur-fast) var(--gl-ease);
}
.gl-doc-skip:focus { inset-block-start: var(--gl-space-2xs); }

.gl-doc-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  height: 3.5rem;
  background: color-mix(in srgb, var(--gl-color-surface-page) 92%, transparent);
  border-bottom: 1px solid var(--gl-color-border-hairline);
}
.gl-doc-header__inner {
  display: flex;
  align-items: center;
  gap: var(--gl-space-xs);
  height: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gl-space-xs);
}

.gl-doc-wordmark {
  display: flex;
  align-items: baseline;
  gap: var(--gl-space-2xs);
  color: var(--gl-color-text-primary);
  text-decoration: none;
  font-family: var(--gl-font-sans);
  font-size: var(--gl-step-0);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.gl-doc-wordmark:hover { color: var(--gl-color-text-primary); }
.gl-doc-wordmark__mark {
  width: 1.375rem;
  height: 1.375rem;
  flex: none;
  align-self: center;
  color: var(--gl-color-accent);
}
.gl-doc-wordmark__version {
  font-family: var(--gl-font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--gl-color-text-tertiary);
}

.gl-doc-header__actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--gl-space-2xs); }

/* Shows the theme in effect, following the same selectors as tokens.css. */
[data-theme-toggle] { --gl-icon: var(--gl-icon-sun); --gl-icon-style-size: 1rem; }
:root[data-theme="dark"] [data-theme-toggle] { --gl-icon: var(--gl-icon-moon); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] { --gl-icon: var(--gl-icon-moon); }
}

.gl-doc-layout {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: var(--gl-space-l);
  max-width: 72rem;
  margin-inline: auto;
  padding: var(--gl-space-m) var(--gl-space-xs) var(--gl-space-2xl);
}

.gl-doc-sidebar {
  position: sticky;
  inset-block-start: calc(3.5rem + var(--gl-space-m));
  align-self: start;
  max-height: calc(100vh - 3.5rem - var(--gl-space-l));
  overflow-y: auto;
  padding-inline-end: var(--gl-space-2xs);
}
.gl-doc-nav__group + .gl-doc-nav__group { margin-top: var(--gl-space-s); }
.gl-doc-nav__heading {
  margin-bottom: var(--gl-space-2xs);
  font-family: var(--gl-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gl-color-text-tertiary);
}
.gl-doc-nav__link {
  display: block;
  padding: var(--gl-space-3xs) var(--gl-space-xs);
  margin-inline-start: calc(var(--gl-space-xs) * -1);
  border-inline-start: 2px solid transparent;
  border-radius: 0 var(--gl-radius-sm) var(--gl-radius-sm) 0;
  color: var(--gl-color-text-secondary);
  font-size: var(--gl-step--1);
  text-decoration: none;
  transition: color var(--gl-dur-fast) var(--gl-ease),
              background-color var(--gl-dur-fast) var(--gl-ease);
}
.gl-doc-nav__link:hover { color: var(--gl-color-text-primary); background: var(--gl-color-surface-fill); }
.gl-doc-nav__link[aria-current="page"] {
  color: var(--gl-color-accent-ink);
  border-inline-start-color: var(--gl-color-accent);
  background: var(--gl-color-accent-soft);
  font-weight: 500;
}

.gl-doc-main {
  min-width: 0;
  /* The design system's own body-text token (--gl-step-0, 18–20px) is right
     for a product screen but too large for long-form documentation prose.
     This site's own copy gets a plain, fixed 16px instead — the token above
     is unchanged, and specimen tables/demos below still show its real
     value. */
  font-size: 1rem;
}
.gl-doc-main > * { max-width: 50rem; }

.gl-doc-title { margin-bottom: var(--gl-space-xs); }
.gl-doc-title__section {
  display: block;
  margin-bottom: var(--gl-space-2xs);
  font-family: var(--gl-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gl-color-accent);
}

.gl-doc-main h2 {
  margin-block: var(--gl-space-2xl) var(--gl-space-xs);
  padding-bottom: var(--gl-space-2xs);
  border-bottom: 1px solid var(--gl-color-border-hairline);
}
.gl-doc-main h3 { margin-block: var(--gl-space-l) var(--gl-space-2xs); }
.gl-doc-main h4 { margin-block: var(--gl-space-s) var(--gl-space-2xs); }
.gl-doc-main p,
.gl-doc-main ul,
.gl-doc-main ol { max-width: 68ch; }
.gl-doc-main ul:not([class]),
.gl-doc-main ol:not([class]) { padding-inline-start: var(--gl-space-s); }

.gl-doc-footer {
  max-width: 72rem;
  margin-inline: auto;
  padding: var(--gl-space-s) var(--gl-space-xs) var(--gl-space-l);
  border-top: 1px solid var(--gl-color-border-hairline);
  color: var(--gl-color-text-tertiary);
  font-size: var(--gl-step--1);
}
.gl-doc-footer__inner { display: flex; flex-wrap: wrap; gap: var(--gl-space-xs); justify-content: space-between; }

/* `button.gl-doc-nav-toggle` (element + class) rather than a bare class:
   button.css's own base rule is `button:not(.icon-button)`, which is also
   one element + one class in specificity and sets `display: inline-flex` —
   a bare `.gl-doc-nav-toggle { display: none }` loses that fight and the
   toggle stays visible at every width. Matching its specificity here (and
   coming later in the concatenated stylesheet) settles it in source order. */
button.gl-doc-nav-toggle { display: none; }

@media (max-width: 60rem) {
  .gl-doc-layout { grid-template-columns: minmax(0, 1fr); gap: var(--gl-space-s); }
  .gl-doc-sidebar {
    position: static;
    max-height: none;
  }
  /* The toggle is a normal Button; the panel it opens gets its own card
     treatment. Putting the same card styling on the <aside> wrapper too
     nested a button-shaped box inside an outer box for no reason. */
  .gl-doc-nav {
    margin-top: var(--gl-space-xs);
    padding: var(--gl-space-xs);
    background: var(--gl-color-surface-card);
    border: 1px solid var(--gl-color-border-default);
    border-radius: var(--gl-radius-md);
  }
  .gl-doc-sidebar[data-collapsed="true"] > .gl-doc-nav { display: none; }
  button.gl-doc-nav-toggle {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 34rem) {
  .gl-doc-wordmark__version { display: none; }
  .gl-doc-layout { padding-inline: var(--gl-space-2xs); }
}