/* Maggie — getmaggie.dev
   Black and white like the bird; the only colour is the session lights. */

:root {
  --ink: #05070b;
  --feather: #0e1218;
  --feather-2: #141a23;
  --rule: #222a36;
  --rule-soft: #1a212b;
  --white: #f4f6f9;
  --dusk: #9aa4b5;
  --mute: #5f6b7d;

  --blue: #0a84ff;
  --red: #ff453a;
  --yellow: #ffd60a;
  --teal: #64d2ff;
  --green: #30d158;

  --sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --wrap: 1120px;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--ink); color-scheme: dark; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 30px; line-height: 1.15; }
h3 { font-size: 19px; line-height: 1.3; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.9em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1240px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 10px;
  background: var(--white); color: var(--ink);
  font-weight: 600; font-size: 16px; line-height: 1;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; background: #fff; }
.btn-small { padding: 9px 14px; font-size: 14px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 10; background: rgba(5, 7, 11, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule-soft); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; }
.brand img { border-radius: 7px; }
.top-nav { display: flex; align-items: center; gap: 24px; font-size: 15px; color: var(--dusk); }
.top-nav .btn { color: var(--ink); }

/* Hero: the bird is the one bold thing */
.hero { padding: 48px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; align-items: center; }
.hero h1 {
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.lede { margin-top: 28px; max-width: 54ch; font-size: 19px; line-height: 1.5; color: var(--dusk); }
.lede, .section-lede { text-wrap: pretty; }
.hero-bird { position: relative; justify-self: end; width: 100%; max-width: 520px; }
.hero-bird img { display: block; width: 100%; height: auto; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.8)); }

.get { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 36px; }
.install {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 6px 0 16px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--feather);
  font-family: var(--mono); font-size: 14px; color: var(--white);
  max-width: 100%;
}
.install code { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.copy {
  font: inherit; font-family: var(--sans); font-size: 13px; font-weight: 600;
  padding: 7px 10px; border-radius: 7px; border: 0;
  background: var(--feather-2); color: var(--dusk); cursor: pointer;
}
.copy:hover { color: var(--white); }
.copy.is-done { color: var(--teal); }
.fine { margin-top: 18px; font-size: 14px; color: var(--mute); }
.fine a { color: var(--dusk); text-decoration: underline; text-underline-offset: 3px; }

/* The window */
.window { margin: 56px 0 0; }
.window figcaption { margin-top: 14px; font-size: 14px; color: var(--mute); max-width: 80ch; }

.win {
  border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
  background: var(--feather);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 40px 120px -40px rgba(0, 0, 0, 0.9);
  font-size: 12.5px; line-height: 1.4;
}
.win-bar { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-bottom: 1px solid var(--rule-soft); background: #0b0f15; }
.traffic { display: inline-flex; gap: 7px; }
.traffic i { width: 11px; height: 11px; border-radius: 50%; background: #2a323e; display: block; }
.win-title { flex: 1; text-align: center; color: var(--dusk); font-size: 12px; padding-right: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-title .crumb { color: var(--mute); }

.win-body { display: grid; grid-template-columns: 300px 1fr; min-height: 560px; }

/* Sidebar, drawn like the real one: a tree of folders, tinted rows */
.side { border-right: 1px solid var(--rule-soft); background: #0b0f15; display: flex; flex-direction: column; padding: 10px 8px 6px; }
.side-search { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 10px; padding: 6px 10px; border-radius: 8px; background: var(--feather-2); color: var(--mute); font-size: 12px; }
.filter-glyph { width: 12px; height: 8px; border-top: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); position: relative; }
.filter-glyph::after { content: ""; position: absolute; left: 2px; right: 2px; top: 2.5px; border-top: 1.5px solid var(--mute); }

.tree { display: flex; flex-direction: column; gap: 2px; }
.folder-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--dusk); font-size: 12.5px; font-weight: 600; }
.folder.is-nested { padding-left: 14px; }
.disclosure { width: 10px; color: var(--mute); font-size: 11px; }
.folder-icon { width: 13px; height: 10px; border-radius: 2px; border: 1.5px solid var(--mute); position: relative; }
.folder-icon::before { content: ""; position: absolute; left: -1.5px; top: -4px; width: 6px; height: 3px; border: 1.5px solid var(--mute); border-bottom: 0; border-radius: 2px 2px 0 0; }
.folder-icon.is-group { border-radius: 50%; width: 11px; height: 11px; }
.folder-icon.is-group::before { display: none; }
.folder-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font-weight: 500; color: var(--mute); }
.folder-light { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); margin-left: 4px; transition: background-color 500ms ease; }
.folder-light.is-blue { background: var(--blue); }
.folder-light.is-red { background: var(--red); }
.folder-light.is-yellow { background: var(--yellow); }
.folder-light.is-teal { background: var(--teal); }
.folder-light.is-green { background: var(--green); }

.row { margin: 1px 0 1px 18px; padding: 6px 8px 6px 8px; border-radius: 8px; background: var(--feather); border: 1px solid transparent; transition: background-color 500ms ease, border-color 500ms ease; }
.folder.is-nested .row { margin-left: 32px; }
.row.is-active { border-color: rgba(255, 255, 255, 0.14); }
.row-main { display: flex; align-items: center; gap: 6px; }
.spark { color: var(--dusk); font-size: 11px; }
.row-main b { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--white); }
.when { color: var(--dusk); font-size: 11px; white-space: nowrap; }
.row-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; padding-left: 16px; color: var(--mute); font-size: 11px; }
.where { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model { color: var(--mute); }
.speaker { width: 10px; height: 8px; position: relative; }
.speaker::before { content: ""; position: absolute; left: 0; top: 1.5px; width: 4px; height: 5px; background: var(--mute); border-radius: 1px; }
.speaker::after { content: ""; position: absolute; left: 3px; top: 0; width: 0; height: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-right: 4px solid var(--mute); }

.row.is-blue { background: rgba(10, 132, 255, 0.16); }
.row.is-red { background: rgba(255, 69, 58, 0.18); }
.row.is-yellow { background: rgba(255, 214, 10, 0.14); }
.row.is-teal { background: rgba(100, 210, 255, 0.14); }
.row.is-green { background: rgba(48, 209, 88, 0.16); }
.row.is-blue .when { color: #7cb8ff; }
.row.is-red .when { color: #ff8a82; }
.row.is-yellow .when { color: #ffe566; }
.row.is-teal .when { color: var(--teal); }
.row.is-green .when { color: #7ee2a0; }

.subagents { margin-top: 6px; padding-left: 16px; display: flex; flex-direction: column; gap: 3px; }
.subagents-head { display: flex; align-items: center; gap: 6px; color: var(--mute); font-size: 11px; font-weight: 600; }
.subagents-head .when { margin-left: auto; }
.subagent { display: flex; align-items: center; gap: 6px; color: var(--dusk); font-size: 11px; padding-left: 4px; }
.hook { color: var(--mute); }
.fork { margin-left: auto; color: var(--mute); }

.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; color: var(--dusk); font-size: 12.5px; font-weight: 500; }
.plus { font-size: 15px; color: var(--mute); }
.foot-icons { margin-left: auto; display: inline-flex; gap: 10px; }
.foot-icons i { width: 12px; height: 10px; border: 1.5px solid var(--mute); border-radius: 2px; display: block; }

.term { padding: 16px 20px; overflow: hidden; background: var(--feather); }
.term pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; color: #d6dbe3; }
.t-dim { color: var(--mute); }
.t-you { color: var(--white); }
.t-dot { color: var(--dusk); }
.t-tool { color: var(--white); font-weight: 500; }
.t-plus { color: #5fd08a; }
.t-minus { color: #ff8a82; }
.t-cursor { color: var(--white); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Status bar, like the real one */
.status { display: flex; gap: 18px; align-items: center; height: 30px; padding: 0 12px; border-top: 1px solid var(--rule-soft); background: #0b0f15; color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.status b { color: var(--dusk); font-weight: 500; }
.status-item { display: inline-flex; align-items: center; gap: 6px; }
.status-gap { flex: 1; }
.meter { width: 44px; height: 4px; border-radius: 2px; background: var(--feather-2); overflow: hidden; display: inline-block; }
.meter i { display: block; height: 100%; background: var(--dusk); }
.glyph { width: 10px; height: 10px; display: inline-block; border: 1.5px solid var(--mute); border-radius: 50%; }
.glyph-claude { border-radius: 2px; transform: rotate(45deg); width: 8px; height: 8px; }
.glyph-codex { border-radius: 50%; }
.glyph-cup { border-radius: 0 0 4px 4px; border-top: 0; width: 9px; height: 8px; }
.glyph-mic { border-radius: 5px; width: 6px; height: 10px; }
.glyph-chip { border-radius: 2px; width: 11px; height: 9px; }
.glyph-sessions { border-radius: 2px; width: 11px; height: 9px; border-left-width: 4px; }

/* Lights legend */
.lights { padding: 32px 0 40px; }
.section-lede { margin-top: 14px; font-size: 20px; color: var(--dusk); max-width: 50ch; }
.legend { margin: 40px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.legend > div { padding: 20px 20px 20px 0; border-top: 1px solid transparent; }
.legend > div + div { padding-left: 20px; border-left: 1px solid var(--rule-soft); }
.legend dt { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.legend dd { margin: 8px 0 0; color: var(--dusk); font-size: 15px; line-height: 1.45; }
.section-note { margin-top: 36px; max-width: 64ch; color: var(--dusk); }

.light {
  flex: none; display: inline-block;
  width: 10px; height: 10px; border-radius: 50%;
  background: transparent; border: 1.5px solid var(--mute);
}
.light.is-blue { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 10px rgba(10, 132, 255, 0.45); }
.light.is-red { background: var(--red); border-color: var(--red); box-shadow: 0 0 10px rgba(255, 69, 58, 0.5); }
.light.is-yellow { background: var(--yellow); border-color: var(--yellow); box-shadow: 0 0 10px rgba(255, 214, 10, 0.4); }
.light.is-teal { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 10px rgba(100, 210, 255, 0.4); }
.light.is-green { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(48, 209, 88, 0.4); }

/* Feature list */
.features { padding: 64px 0 40px; border-top: 1px solid var(--rule-soft); }
.features-grid { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.features-grid > div { padding: 26px 28px 30px 0; border-bottom: 1px solid var(--rule-soft); }
.features-grid > div:nth-child(3n+2), .features-grid > div:nth-child(3n+3) { padding-left: 28px; border-left: 1px solid var(--rule-soft); }
.features-grid p { margin-top: 10px; color: var(--dusk); font-size: 15.5px; text-wrap: pretty; }

/* Feature rows */
.feature { padding: 72px 0; }
.feature + .feature { border-top: 1px solid var(--rule-soft); }
.feature-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.feature-copy p { margin-top: 16px; color: var(--dusk); max-width: 46ch; text-wrap: pretty; }
.feature-copy h2 { max-width: 16ch; }

.panel {
  margin: 0;
  border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
  background: var(--feather);
  font-size: 13px; line-height: 1.45;
}

/* Source control panel */
.panel-scm .panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); }
.branch { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.muted { color: var(--mute); font-size: 12.5px; }
.changes { list-style: none; margin: 0; padding: 8px 8px; }
.changes li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; font-family: var(--mono); font-size: 12.5px; }
.chg { width: 16px; text-align: center; font-weight: 500; font-size: 11px; }
.chg-m { color: var(--yellow); } .chg-a { color: #5fd08a; }
.diffstat { margin-left: auto; display: inline-flex; gap: 8px; font-size: 11.5px; }
.diffstat em { font-style: normal; color: #5fd08a; }
.diffstat s { text-decoration: none; color: #ff8a82; }
.commits { padding: 6px 16px 12px; border-top: 1px solid var(--rule-soft); }
.commits > div { display: flex; gap: 12px; padding: 6px 0; color: var(--dusk); }
.sha { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.panel-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--rule-soft); background: #0b0f15; }
.pill { padding: 5px 10px; border-radius: 7px; background: var(--feather-2); color: var(--white); font-size: 12px; font-weight: 500; }

/* Board */
.panel-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; min-height: 300px; }
.col { padding: 12px 10px; }
.col + .col { border-left: 1px solid var(--rule-soft); }
.col-name { display: flex; justify-content: space-between; padding: 0 6px 10px; color: var(--mute); font-size: 11.5px; font-weight: 600; }
.card { padding: 10px 10px 10px 14px; border-radius: 8px; background: var(--feather-2); position: relative; margin-bottom: 8px; }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--rule); }
.card.is-blue::before { background: var(--blue); }
.card.is-red::before { background: var(--red); }
.card.is-yellow::before { background: var(--yellow); }
.card.is-teal::before { background: var(--teal); }
.card.is-green::before { background: var(--green); }
.card b { display: block; font-weight: 500; font-size: 12.5px; }
.card small { display: block; margin-top: 3px; color: var(--mute); font-size: 11px; }

/* Usage */
.panel-usage table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.panel-usage th, .panel-usage td { text-align: right; padding: 10px 16px; border-bottom: 1px solid var(--rule-soft); }
.panel-usage th:first-child, .panel-usage td:first-child { text-align: left; }
.panel-usage th { color: var(--mute); font-weight: 500; font-size: 12px; }
.panel-usage tbody tr.today td { color: var(--white); }
.panel-usage tbody td { color: var(--dusk); }
.panel-usage tfoot td { color: var(--white); font-weight: 500; border-bottom: 0; }
.limits { padding: 10px 16px 14px; border-top: 1px solid var(--rule-soft); background: #0b0f15; }
.limits > div { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; padding: 6px 0; color: var(--dusk); font-size: 12.5px; }
.limits > div span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 5px; border-radius: 3px; background: var(--feather-2); overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--white); border-radius: 3px; }

/* Voice */
.panel-voice { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.panel-voice p { max-width: 36ch; padding: 9px 13px; border-radius: 12px; line-height: 1.4; }
.say-you { align-self: flex-end; background: var(--white); color: var(--ink); border-bottom-right-radius: 4px; }
.say-maggie { align-self: flex-start; background: var(--feather-2); color: var(--white); border-bottom-left-radius: 4px; }

/* Prose sections */
.why-ade, .how, .why { padding: 72px 0; border-top: 1px solid var(--rule-soft); }
.why-ade { margin-top: 24px; }
.how-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.how-copy p { color: var(--dusk); max-width: 62ch; text-wrap: pretty; }
.why-ade .how-copy p { color: var(--white); font-size: 19px; line-height: 1.5; }
.how-copy p + p { margin-top: 18px; }
.how-copy a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.how-copy code { color: var(--white); }

/* Close */
.close { padding: 96px 0 104px; border-top: 1px solid var(--rule-soft); }
.close h2 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -0.025em; }
.close .get { margin-top: 28px; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 36px 0 48px; color: var(--mute); font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px; }
.foot p { max-width: 62ch; text-wrap: pretty; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; justify-content: flex-end; align-content: start; }
.foot a { color: var(--dusk); }

/* Responsive */
@media (max-width: 980px) {
  .legend { grid-template-columns: repeat(3, 1fr); }
  .legend > div:nth-child(4) { padding-left: 0; border-left: 0; }
  .legend > div:nth-child(n+4) { border-top: 1px solid var(--rule-soft); }
  .win-body { grid-template-columns: 260px 1fr; }
  .hero-bird { max-width: 400px; }
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 8px; }
  .hero-bird { order: -1; justify-self: center; max-width: 300px; }
  .feature-grid, .how-grid, .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .feature-copy h2, .feature-copy p { max-width: none; }
  .foot nav { justify-content: flex-start; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .features-grid > div { padding: 24px 0; border-left: 0 !important; }
  .features-grid > div:nth-child(2n) { padding-left: 24px; border-left: 1px solid var(--rule-soft) !important; }
  .panel-board { grid-template-columns: repeat(2, 1fr); }
  .col:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule-soft); }
  .col:nth-child(4) { border-top: 1px solid var(--rule-soft); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 32px 0 48px; }
  .lede { font-size: 18px; }
  .top-nav a:not(.btn) { display: none; }
  .win-body { grid-template-columns: 1fr; min-height: 0; }
  .side { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .side-foot { display: none; }
  .term pre { font-size: 11.5px; }
  .status .status-item:nth-child(2), .status .status-item:nth-child(5) { display: none; }
  .legend { grid-template-columns: 1fr; }
  .legend > div { padding-left: 0 !important; border-left: 0 !important; border-top: 1px solid var(--rule-soft); }
  .legend > div:first-child { border-top: 0; }
  .features-grid { grid-template-columns: 1fr; }
  .features-grid > div { padding-left: 0 !important; border-left: 0 !important; }
  .limits > div { grid-template-columns: 1fr 40px; }
  .limits .bar { grid-column: 1 / -1; }
  .install { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .row, .folder-light { transition: none; }
  .t-cursor { animation: none; }
}
