/* MagicTeams Portfolio — brutalist light theme (ui-ux-pro-max design system).
   Archivo display / system body / mono data. Blue accent #2563EB. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&display=swap');

:root {
  --bg: #fafafa; --fg: #09090b; --card: #fff; --muted: #e8ecf0;
  --muted-fg: #475569; --border: #09090b; --accent: #2563eb;
  --accent-ink: #fff; --dark: #09090b; --dark-fg: #fafafa;
  --shadow: 5px 5px 0 var(--border);
  --font-d: 'Archivo', system-ui, sans-serif;
  --font-b: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-m: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-b);
  font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--font-d); line-height: 1.1; margin: 0 0 .5rem; letter-spacing: -.01em; text-wrap: balance; }
section { scroll-margin-top: 64px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff;
  padding: .7rem 1.2rem; font-weight: 700; z-index: 100; }
.skip:focus-visible { left: 0; }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; }
h2 .idx { display: inline-block; background: var(--fg); color: var(--bg); font-size: 1rem;
  padding: .15rem .6rem; margin-right: .6rem; vertical-align: middle; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
section { padding: 4rem 0 3rem; border-top: 2px solid var(--border); }
.lede { color: var(--muted-fg); max-width: 62ch; font-size: 1.05rem; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg);
  border-bottom: 2px solid var(--border); }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.brand { font-family: var(--font-d); font-weight: 800; font-size: 1.05rem; color: var(--fg);
  text-decoration: none; margin-right: auto; }
.brand b { background: var(--accent); color: #fff; padding: 0 .4rem; }
.topnav { display: flex; gap: .25rem; flex-wrap: wrap; }
.topnav a { color: var(--fg); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: .55rem .7rem; min-height: 44px; display: inline-flex; align-items: center; }
.topnav a:hover { background: var(--muted); }
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.1rem;
  border: 2px solid var(--border); background: var(--accent); color: #fff !important;
  font-weight: 700; text-decoration: none; box-shadow: 3px 3px 0 var(--border); }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--border); }
.btn.ghost { background: var(--card); color: var(--fg) !important; }

/* hero */
.hero { background: var(--dark); color: var(--dark-fg); border-top: none; padding: 5rem 0 4rem; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); font-weight: 800; max-width: 14ch; }
.hero h1 .hl { color: #7aa5ff; }
.hero .lede { color: #c9c9d1; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.5rem 0 2.5rem; }
.hero .btn { box-shadow: 3px 3px 0 #3f3f46; border-color: #fafafa; }
.hero .btn.ghost { background: transparent; color: #fafafa !important; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2px; background: #3f3f46; border: 2px solid #3f3f46; }
.stat { background: var(--dark); padding: 1.1rem 1rem; }
.stat .num { font-family: var(--font-d); font-size: 2.2rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.stat .lbl { color: #a1a1aa; font-size: .9rem; }

/* flagship cards */
.flag-grid { display: grid; gap: 1.5rem; margin-top: 2rem; }
.flag { border: 2px solid var(--border); background: var(--card); box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr; }
@media (min-width: 860px) { .flag { grid-template-columns: 5fr 6fr; } .flag:nth-child(even) .flag-shot { order: 2; } }
.flag-shot { background: var(--muted); border-bottom: 2px solid var(--border); min-height: 220px; }
@media (min-width: 860px) { .flag-shot { border-bottom: none; border-right: 2px solid var(--border); }
  .flag:nth-child(even) .flag-shot { border-right: none; border-left: 2px solid var(--border); } }
.flag-shot { align-self: start; }
.flag-shot img { width: 100%; height: auto; display: block; }
.flag-body { padding: 1.5rem; }
.kicker { font-family: var(--font-m); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); font-weight: 700; }
.flag-body h3 { font-size: 1.6rem; margin: .3rem 0 .6rem; }
.flag-body p { margin: 0 0 .8rem; }
.flag-points { margin: 0 0 1rem; padding: 0; list-style: none; }
.flag-points li { padding-left: 1.4rem; position: relative; margin-bottom: .3rem; font-weight: 600; }
.flag-points li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.flag-links { display: flex; gap: .6rem; flex-wrap: wrap; }
.chip-link { display: inline-flex; align-items: center; min-height: 44px; padding: .45rem .9rem;
  border: 2px solid var(--border); background: var(--bg); color: var(--fg) !important;
  font-weight: 700; font-size: .9rem; text-decoration: none; }
.chip-link:hover { background: var(--muted); }
.chip-link.primary { background: var(--accent); color: #fff !important; }

/* agents */
.agent-grid { display: grid; gap: 1.25rem; margin-top: 2rem; }
@media (min-width: 860px) { .agent-grid { grid-template-columns: repeat(3, 1fr); } }
.agent { border: 2px solid var(--border); background: var(--card); box-shadow: var(--shadow); padding: 1.4rem; }
.agent h3 { font-size: 1.3rem; }
.agent p { font-size: .95rem; }
.core-note { margin-top: 1.5rem; border: 2px dashed var(--border); padding: 1rem 1.25rem; background: #fff; }
.core-note code { font-family: var(--font-m); font-size: .85rem; background: var(--muted); padding: .1rem .35rem; }

/* connectors */
.controls { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.5rem 0; align-items: center; }
.controls input[type="search"] { flex: 1 1 220px; min-height: 44px; border: 2px solid var(--border);
  padding: .55rem .8rem; font-size: 1rem; background: #fff; color: var(--fg); }
.filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.filters button { min-height: 44px; padding: .45rem .9rem; border: 2px solid var(--border);
  background: #fff; font-weight: 700; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.result-count { font-family: var(--font-m); font-size: .85rem; color: var(--muted-fg); }
.conn-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.conn { border: 2px solid var(--border); background: #fff; padding: 1.1rem; cursor: pointer;
  display: flex; flex-direction: column; gap: .5rem; min-height: 200px; }
.conn:hover { box-shadow: var(--shadow); transform: translate(-2px, -2px); }
.conn h3 { font-size: 1.2rem; margin: 0; }
.conn .vert { font-family: var(--font-m); font-size: .75rem; color: var(--muted-fg); }
.conn p { font-size: .9rem; margin: 0; flex: 1; }
.conn-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { font-family: var(--font-m); font-size: .72rem; font-weight: 700; border: 1.5px solid var(--border);
  padding: .1rem .45rem; background: var(--muted); }
.pill.live { background: #dcfce7; } .pill.rev { background: #dbeafe; }
.pill.warn { background: #fef3c7; } .pill.dim { background: var(--muted); color: var(--muted-fg); }
.pill.blue { background: var(--accent); color: #fff; }

/* modal */
dialog#detail { border: 2px solid var(--border); box-shadow: 8px 8px 0 var(--border);
  max-width: 720px; width: calc(100% - 2rem); padding: 0; }
dialog#detail::backdrop { background: rgba(9,9,11,.6); }
.modal-head { display: flex; align-items: baseline; gap: 1rem; padding: 1.2rem 1.4rem 0; }
.modal-head h3 { font-size: 1.5rem; flex: 1; }
.modal-x { min-width: 44px; min-height: 44px; border: 2px solid var(--border); background: #fff;
  font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.modal-x:hover { background: var(--fg); color: var(--bg); }
.modal-body { padding: 0 1.4rem 1.4rem; }
.modal-body video { width: 100%; border: 2px solid var(--border); margin: .8rem 0; background: #000; }
.ep { font-family: var(--font-m); font-size: .8rem; background: var(--dark); color: #e4e4e7;
  padding: .7rem .9rem; overflow-x: auto; white-space: nowrap; }
.dir-table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .9rem; }
.dir-table th, .dir-table td { border: 1.5px solid var(--border); padding: .4rem .6rem; text-align: left; }
.dir-table th { background: var(--muted); }

/* videos */
.video-feat { border: 2px solid var(--border); box-shadow: var(--shadow); background: #000; margin-top: 1.5rem; }
.video-feat video { width: 100%; display: block; aspect-ratio: 16/9; }
.video-grid { display: grid; gap: 1rem; margin-top: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.vid { border: 2px solid var(--border); background: #fff; }
.vid video { width: 100%; display: block; aspect-ratio: 16/9; background: #000; }
.vid .cap { padding: .6rem .8rem; font-weight: 700; font-size: .9rem; display: flex;
  justify-content: space-between; gap: .5rem; align-items: center; }
.vid .cap a { font-size: .8rem; white-space: nowrap; }

/* oss */
.oss-grid { display: grid; gap: .9rem; margin-top: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.repo { border: 2px solid var(--border); background: #fff; padding: 1rem; }
.repo:hover { box-shadow: 4px 4px 0 var(--border); }
.repo h3 { font-size: 1rem; font-family: var(--font-m); margin: 0 0 .3rem; }
.repo h3 a { color: var(--fg); text-decoration: none; }
.repo h3 a:hover { color: var(--accent); text-decoration: underline; }
.repo p { font-size: .86rem; margin: 0 0 .5rem; color: #27272a; }
.repo .stars { font-family: var(--font-m); font-size: .75rem; color: var(--muted-fg); }
.section-shot { border: 2px solid var(--border); box-shadow: var(--shadow); margin-top: 1.5rem;
  max-width: 860px; }
.section-shot img { width: 100%; height: auto; display: block; aspect-ratio: 16/9; background: var(--muted); }
.section-shot figcaption { background: #fff; border-top: 2px solid var(--border);
  padding: .5rem .8rem; font-size: .82rem; color: var(--muted-fg); }

/* distribution */
.dist-grid { display: grid; gap: 1rem; margin-top: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.dist { border: 2px solid var(--border); background: #fff; padding: 1.1rem; }
.dist h3 { font-size: 1.05rem; }
.dist .v { display: inline-block; background: var(--accent); color: #fff; font-weight: 800;
  padding: .1rem .5rem; font-size: .85rem; margin-bottom: .4rem; }
.dist p { font-size: .88rem; margin: 0; }

footer { background: var(--dark); color: var(--dark-fg); padding: 3rem 0; margin-top: 3rem; }
footer a { color: #7aa5ff; }
.foot-grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
footer h3 { font-size: 1rem; }
footer p, footer li { font-size: .9rem; color: #c9c9d1; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin-bottom: .35rem; }
.fine { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #3f3f46;
  font-size: .8rem; color: #a1a1aa; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (max-width: 640px) {
  .topnav { display: none; }
  section { padding: 2.5rem 0 2rem; }
}
