/* HN Group Wiki — a Wikipedia-style layout in the HN Group brand. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --pink: #E97DE8; --purple: #5514B4; --yellow: #E3E65B; --teal: #3E9BA3; --plum: #7A1F6C; --raspberry: #C2306B; --green: #5FAE7B; --navy: #1C2135;
  --bg: #F6F4FA; --surface: #FFFFFF; --surface-2: #F8F7FB; --text: #1B1A21; --muted: #5E6070; --border: #E2DDEB; --border-strong: #C9C1D8;
  --link: #5514B4; --link-visited: #6E3BC0; --link-new: #C2306B; --accent-soft: #EEE6FA; --notice: #FBF8E3; --notice-border: #E6DF9C;
  --danger: #B4234F; --success: #2E7D4F; --shadow: 0 1px 2px rgba(28,33,53,.05), 0 6px 20px rgba(28,33,53,.06);
  --radius: 14px; --sidebar: 200px; --header-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1020; --surface: #161A2E; --surface-2: #1C2138; --text: #ECEBF4; --muted: #A4A7BA; --border: #2A2F4A; --border-strong: #3A4062;
    --link: #B794F6; --link-visited: #C9A9F8; --link-new: #F48FB1; --accent-soft: #2A2350; --notice: #2B2A1A; --notice-border: #575125;
    --danger: #F28AA8; --success: #7CD3A0; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a.new { color: var(--link-new); }
a.external::after { content: "↗"; font-size: .75em; margin-left: .15em; opacity: .7; }
.footer a.external::after, .sidebar a.external::after { content: ""; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 20; background: var(--purple); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.on-dark { display: none !important; }
@media (prefers-color-scheme: dark) { .on-light { display: none !important; } .on-dark { display: inline-block !important; } }
.muted { color: var(--muted); }

/* Brand stripe */
.stripe { display: flex; height: 5px; }
.stripe i:nth-child(1) { flex: 14; background: var(--pink); } .stripe i:nth-child(2) { flex: 14; background: var(--purple); } .stripe i:nth-child(3) { flex: 6; background: var(--yellow); }
.stripe i:nth-child(4) { flex: 20; background: var(--teal); } .stripe i:nth-child(5) { flex: 10; background: var(--plum); } .stripe i:nth-child(6) { flex: 10; background: var(--raspberry); }
.stripe i:nth-child(7) { flex: 13; background: var(--green); } .stripe i:nth-child(8) { flex: 13; background: var(--navy); }

/* Header */
.site-header { display: flex; align-items: center; gap: 1rem; height: var(--header-h); padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .55rem; flex: none; width: calc(var(--sidebar) - 4px); }
.brand img { height: 32px; width: auto; }
.brand-wiki { font-weight: 800; font-size: 1.05rem; color: var(--text); letter-spacing: -.01em; padding-left: .55rem; border-left: 2px solid var(--border); }
.brand:hover { text-decoration: none; }
.search { flex: 1; max-width: 560px; display: flex; border: 1.5px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.search:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: .55rem 1rem; font: inherit; font-size: .95rem; color: var(--text); outline: none; }
.search button { border: 0; background: none; padding: 0 1rem; cursor: pointer; color: var(--muted); }
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: block; }
.user-tools { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; white-space: nowrap; }
.user-tools form { margin: 0; }
.user-name { font-weight: 600; }
.link-button { border: 0; background: none; color: var(--link); font: inherit; cursor: pointer; padding: 0; }
.link-button:hover { text-decoration: underline; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .05rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--link); vertical-align: 1px; }
.menu-toggle { display: none; width: 40px; height: 40px; padding: 11px 9px; border: 0; background: none; cursor: pointer; flex-direction: column; justify-content: space-between; flex: none; }
.menu-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* Page layout */
.page { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); max-width: 1400px; margin: 0 auto; }
.sidebar { padding: 1.4rem 1rem 2rem 20px; font-size: .9rem; }
.sidebar ul { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.sidebar li { margin: .1rem 0; }
.sidebar a { display: block; padding: .25rem .5rem; border-radius: 8px; }
.sidebar a:hover { background: var(--accent-soft); text-decoration: none; }
.sidebar h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 .3rem .5rem; font-weight: 700; }
.content { padding: 1.2rem 24px 2rem 4px; min-width: 0; }
.article { background: var(--surface); border: 1px solid var(--border); border-radius: 0 var(--radius) var(--radius) var(--radius); padding: 1.4rem 2rem 2rem; box-shadow: var(--shadow); min-height: 60vh; }

/* Tabs */
.tabs { display: flex; justify-content: space-between; gap: 1rem; }
.tabs ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.tabs li a { display: block; padding: .5rem .95rem; font-size: .88rem; font-weight: 600; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; color: var(--muted); }
.tabs li a:hover { text-decoration: none; color: var(--link); }
.tabs li.selected a { background: var(--surface); border-color: var(--border); color: var(--text); position: relative; top: 1px; }
.tabs li a.new { color: var(--link-new); }

/* Article text */
.first-heading { font-size: clamp(1.7rem, 3.5vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .2rem; padding-bottom: .45rem; border-bottom: 1px solid var(--border); }
.tagline { font-size: .85rem; color: var(--muted); margin: .4rem 0 1rem; }
.subtitle, .redirect-note { font-size: .85rem; color: var(--muted); margin: -.6rem 0 1rem; }
.body { overflow-wrap: break-word; }
.body::after { content: ""; display: table; clear: both; }
.body p { margin: .5rem 0 .9rem; }
.body h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin: 1.8rem 0 .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--border); }
.body h3 { font-size: 1.15rem; font-weight: 700; margin: 1.4rem 0 .5rem; }
.body h4 { font-size: 1rem; font-weight: 700; margin: 1.2rem 0 .4rem; }
.section-edit { font-size: .75rem; font-weight: 500; margin-left: .7rem; color: var(--muted); }
.body ul, .body ol { margin: .3rem 0 1rem; padding-left: 1.6rem; }
.body li { margin: .2rem 0; }
.body dl { margin: .3rem 0; } .body dd { margin-left: 1.6rem; }
.body code, .edit-toolbar code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .05rem .35rem; }
.body hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.clear { clear: both; }
.protected-icon { float: right; font-size: .95rem; margin-top: -2.6rem; opacity: .7; }

/* Infobox */
.infobox { float: right; clear: right; width: 300px; margin: 0 0 1rem 1.6rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); border-collapse: separate; border-spacing: 0; font-size: .86rem; line-height: 1.5; overflow: hidden; }
.infobox caption { caption-side: top; font-weight: 800; font-size: 1.1rem; padding: .7rem .5rem .5rem; background: var(--surface-2); border: 1px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; }
.infobox th, .infobox td { padding: .4rem .8rem; vertical-align: top; text-align: left; border-top: 1px solid var(--border); }
.infobox th[scope="row"] { width: 38%; font-weight: 700; color: var(--text); }
.infobox .ib-logo, .infobox .ib-image { text-align: center; padding: 1rem .8rem; background: var(--surface); }
.infobox .ib-logo img { max-width: 230px; max-height: 110px; width: auto; height: auto; }
.infobox .ib-header { text-align: center; background: var(--accent-soft); color: var(--text); font-weight: 700; }
.ib-caption { font-size: .8rem; color: var(--muted); margin-top: .4rem; }

/* Contents box */
.toc { display: inline-block; min-width: 220px; max-width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .7rem 1.2rem .8rem 1rem; margin: .4rem 0 1rem; font-size: .9rem; }
.toc-title { font-weight: 800; margin-bottom: .3rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: .1rem 0; }
.toc .toclevel-2 { padding-left: 1.4rem; }
.tocnumber { color: var(--muted); margin-right: .3rem; }

/* Images */
.thumb { margin: .3rem 0 1rem; padding: .7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; max-width: 280px; }
.thumb.tright { float: right; clear: right; margin-left: 1.4rem; } .thumb.tleft { float: left; margin-right: 1.4rem; } .thumb.tcenter { margin-left: auto; margin-right: auto; }
.thumb-image { background: var(--surface); border-radius: 8px; padding: .8rem; text-align: center; }
.thumb img { max-width: 100%; max-height: 160px; height: auto; }
.thumb figcaption { font-size: .82rem; color: var(--muted); padding-top: .5rem; line-height: 1.45; }
.missing-file { color: var(--link-new); font-style: italic; }

/* Tables */
.table-wrap { overflow-x: auto; margin: .6rem 0 1.2rem; }
.wikitable { border-collapse: collapse; font-size: .9rem; background: var(--surface); min-width: 50%; }
.wikitable caption { font-weight: 700; padding-bottom: .4rem; text-align: left; }
.wikitable th, .wikitable td { border: 1px solid var(--border-strong); padding: .45rem .7rem; text-align: left; vertical-align: top; }
.wikitable th { background: var(--surface-2); font-weight: 700; }
.swatch { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 4px; vertical-align: -.2em; margin-right: .35em; border: 1px solid rgba(0,0,0,.15); }

/* Notices, hatnotes, references, categories */
.hatnote { font-style: italic; color: var(--muted); padding-left: 1.6rem; margin: .2rem 0 .8rem; font-size: .92rem; }
.notice { background: var(--notice); border: 1px solid var(--notice-border); border-left: 4px solid #C9B92C; border-radius: 10px; padding: .7rem 1rem; margin: .6rem 0 1rem; font-size: .92rem; }
.notice.error { border-left-color: var(--danger); }
.notice.stub { background: var(--surface-2); border-color: var(--border); border-left-color: var(--teal); }
.notice.old-revision { border-left-color: var(--purple); }
.reference { font-size: .72em; line-height: 0; }
.references { font-size: .88rem; padding-left: 2rem; }
.references li { margin: .25rem 0; }
.ref-back { margin-right: .2rem; font-weight: 700; }
.catlinks { margin-top: 2rem; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .88rem; }
.catlinks ul { display: inline; list-style: none; padding: 0; margin: 0; }
.catlinks li { display: inline; }
.catlinks li + li::before { content: " · "; color: var(--muted); }
.category-columns { columns: 3 220px; column-gap: 2rem; }
.category-columns h3 { margin-top: 0; break-after: avoid; }
.category-columns ul { break-inside: avoid; }
.all-pages { columns: 3 220px; column-gap: 2rem; list-style: none; padding: 0 !important; }
.all-pages li { break-inside: avoid; }

/* Main Page */
.mp-box { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 0 0 1.2rem; background: var(--surface); }
.mp-box .mp-title { margin: 0; padding: .55rem 1rem; font-size: 1.05rem; border-bottom: 1px solid var(--border); background: var(--accent-soft); }
.mp-box.mp-teal .mp-title { background: color-mix(in srgb, var(--teal) 18%, var(--surface)); }
.mp-box.mp-pink .mp-title { background: color-mix(in srgb, var(--pink) 22%, var(--surface)); }
.mp-box.mp-green .mp-title { background: color-mix(in srgb, var(--green) 20%, var(--surface)); }
.mp-box.mp-yellow .mp-title { background: color-mix(in srgb, var(--yellow) 30%, var(--surface)); }
.mp-body { padding: .6rem 1.1rem .8rem; }
.mp-body > p:first-child { margin-top: .3rem; }
.mp-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.2rem; }
.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin: .4rem 0 .6rem; }
.company-card { display: flex; flex-direction: column; gap: .35rem; padding: .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); transition: border-color .15s, transform .15s; }
.company-card:hover { text-decoration: none; border-color: var(--link); transform: translateY(-2px); }
.cc-logo { height: 54px; display: flex; align-items: center; }
.cc-logo img { max-height: 54px; max-width: 100%; width: auto; }
.cc-name { font-weight: 700; color: var(--link); }
.cc-blurb { font-size: .82rem; color: var(--muted); line-height: 1.45; }
@media (prefers-reduced-motion: reduce) { .company-card { transition: none; } .company-card:hover { transform: none; } }

/* Editing */
.edit-form textarea { width: 100%; font: .9rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; padding: .8rem; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); resize: vertical; }
.edit-form textarea:focus, .edit-options input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--accent-soft); }
.edit-toolbar { font-size: .8rem; color: var(--muted); margin-bottom: .5rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.edit-options label { display: block; font-weight: 700; font-size: .9rem; margin: .9rem 0 .3rem; }
.edit-options input { width: 100%; font: inherit; padding: .55rem .8rem; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.edit-note { font-size: .82rem; color: var(--muted); }
.edit-buttons { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .55rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; }
.button:hover { border-color: var(--link); color: var(--link); text-decoration: none; }
.button.primary { background: var(--purple); border-color: var(--purple); color: #fff; }
.button.primary:hover { background: #4710A0; color: #fff; }
.button.quiet { border-color: transparent; }
.button.small { padding: .3rem .8rem; font-size: .8rem; }
.button.danger { color: var(--danger); }
.inline-form { display: inline; margin: 0; }
.preview { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 1rem 1.4rem; margin-bottom: 1.2rem; }
.preview::after { content: ""; display: table; clear: both; }
.preview-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .4rem; }
.admin-tools { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.admin-tools h2 { font-size: 1rem; margin: 0 0 .6rem; }

/* History, search */
.history { list-style: none; padding: 0 !important; font-size: .9rem; }
.history li { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.delta.plus { color: var(--success); } .delta.minus { color: var(--danger); }
.summary { color: var(--muted); font-style: italic; }
.new-flag { font-weight: 800; text-decoration: none; }
.search-big { display: flex; gap: .6rem; max-width: 640px; margin-bottom: 1rem; }
.search-big input { flex: 1; font: inherit; padding: .55rem .9rem; border: 1.5px solid var(--border-strong); border-radius: 999px; background: var(--surface-2); color: var(--text); }
.search-results { list-style: none; padding: 0 !important; }
.search-results li { margin: 0 0 1rem; }
.search-results a { font-weight: 700; font-size: 1.02rem; }
.snippet { font-size: .88rem; color: var(--muted); }
.snippet mark { background: var(--accent-soft); color: var(--text); font-weight: 700; border-radius: 3px; padding: 0 2px; }

.footer { font-size: .8rem; color: var(--muted); padding: 1rem .4rem; }
.footer p { margin: .3rem 0; }

/* Small screens */
@media (max-width: 960px) {
  .infobox { float: none; width: 100%; margin: 0 0 1rem; }
  .thumb.tright, .thumb.tleft { float: none; margin: .4rem auto 1rem; }
  .mp-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .menu-toggle { display: flex; }
  .page { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; position: absolute; z-index: 10; top: calc(var(--header-h) + 5px); left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); padding: 1rem 20px; columns: 2; }
  .sidebar.open { display: block; }
  .sidebar ul, .sidebar h3 { break-inside: avoid; }
  .brand { width: auto; }
  .content { padding: .8rem 12px 1.5rem; }
  .article { padding: 1rem 1.1rem 1.5rem; border-radius: 0 0 var(--radius) var(--radius); }
  .site-header { gap: .6rem; padding: 0 12px; }
  .user-name { display: none; }
}
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; height: auto; padding: .5rem 12px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-bottom: .2rem; }
  .sidebar { top: 108px; }
  .tabs { flex-wrap: wrap; } .tabs li a { padding: .45rem .65rem; font-size: .82rem; }
  .brand-wiki { font-size: .95rem; }
}

/* Long values (web addresses, emails) wrap inside infoboxes and tables on small screens. */
.infobox { table-layout: fixed; }
.infobox td, .infobox th, .wikitable td { overflow-wrap: anywhere; }
/* Smaller pictures inside Main Page boxes */
.mp-box .thumb { max-width: 190px; padding: .5rem; }
.mp-box .thumb img { max-height: 80px; }
.body dt { font-weight: 700; margin-top: .6rem; }
.body dl + dl { margin-top: 0; }
