/* ANETIO – shared stylesheet (landing, sign-in, console, admin).
   Palette is derived from the ANETIO logo slate (#707696).
   Archivo's width axis carries the personality: expanded for headings, normal for text. */

@font-face {
  font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-wdth-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(/assets/fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #1f2433;
  --ink-2: #4a5170;
  --slate: #707696;
  --slate-deep: #3f4766;
  --paper: #f3f4f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #dcdfe8;
  --line-strong: #b9bed0;
  --signal: #c23b22;       /* bottlenecks, destructive actions */
  --signal-bg: #fbecea;
  --go: #2d7a62;           /* positive outcomes */
  --go-bg: #e6f3ee;
  --focus: #3b63d6;
  --radius-s: 4px;
  --radius-m: 8px;
  --shadow: 0 1px 0 rgba(31, 36, 51, .04), 0 1px 3px rgba(31, 36, 51, .06);
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sidebar: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e6e8f0;
    --ink-2: #a9aec4;
    --slate: #9aa1c0;
    --slate-deep: #c4c9e0;
    --paper: #14161d;
    --surface: #1b1e27;
    --surface-2: #20242f;
    --line: #2c3140;
    --line-strong: #3d4357;
    --signal: #ef6f57;
    --signal-bg: #3a1f1b;
    --go: #5cc4a1;
    --go-bg: #17322a;
    --focus: #8aa6ff;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 15px/1.55 var(--font);
  font-stretch: 100%;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: 'tnum' 1;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--slate-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -40px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { top: 8px; }

h1, h2, h3, h4, h5 { font-stretch: 112%; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }

/* ---------------------------------------------------------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; gap: .45em;
  font: 600 .92rem/1 var(--font); font-stretch: 105%;
  padding: .7em 1.1em; border-radius: var(--radius-s);
  border: 1px solid var(--slate-deep); background: var(--slate-deep); color: var(--paper);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-quiet { background: transparent; color: var(--slate-deep); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); border-color: var(--slate); }
.btn-danger { background: transparent; color: var(--signal); border-color: currentColor; }
.btn-danger:hover { background: var(--signal); color: #fff; border-color: var(--signal); }
.btn-small { padding: .45em .75em; font-size: .84rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--slate-deep); font: inherit; text-decoration: underline; cursor: pointer; }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .82rem; color: var(--ink-2); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  padding: .6em .7em;
}
textarea { min-height: 9rem; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.phone { display: grid; grid-template-columns: 5.5rem 1fr; gap: .5rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.inline-form { display: inline; }

.flash { padding: .8rem 1rem; border-radius: var(--radius-s); margin-bottom: 1.25rem; border-left: 4px solid; }
.flash-ok { background: var(--go-bg); border-color: var(--go); }
.flash-error { background: var(--signal-bg); border-color: var(--signal); }

/* ---------------------------------------------------------------- console shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 1.25rem 1rem 2rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.brand img { width: 168px; }
.brand-company { margin-top: .4rem; font-size: .82rem; color: var(--ink-2); }
.nav-group + .nav-group { margin-top: 1rem; }
.nav-group h2 { font-size: .78rem; font-weight: 600; color: var(--ink-2); margin: 0 0 .3rem .6rem; font-stretch: 100%; letter-spacing: .01em; }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group a {
  display: block; padding: .42rem .6rem; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; font-size: .93rem;
}
.nav-group a:hover { background: var(--surface-2); }
.nav-group a[aria-current="page"] { background: var(--paper); box-shadow: inset 3px 0 0 var(--slate-deep); font-weight: 600; }
.sidebar-foot { margin-top: auto; font-size: .85rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.sidebar-foot .who { font-weight: 600; }

.topbar {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: .75rem 2rem; border-bottom: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; z-index: 5;
}
.search { display: flex; gap: .4rem; flex: 1 1 260px; max-width: 420px; }
.menu-toggle { display: none; }
.add-menu { position: relative; }
.add-menu summary { list-style: none; }
.add-menu summary::-webkit-details-marker { display: none; }
.add-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; z-index: 10;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(31,36,51,.12);
  padding: .35rem;
}
.add-menu .menu a { display: block; padding: .55rem .7rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); }
.add-menu .menu a:hover { background: var(--paper); }
.add-menu .menu span { display: block; font-size: .8rem; color: var(--ink-2); }

.main { padding: 2rem; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; color: var(--ink-2); }
.back { display: inline-block; margin-bottom: .75rem; font-size: .9rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.25rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.panel-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.5rem; }
.grid-2 > .panel { margin-bottom: 0; }
.stack > * + * { margin-top: 1.5rem; }

/* KPI strip: one ruled band instead of floating cards */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin-bottom: 1.5rem; }
.kpi { padding: 1rem 1.25rem; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi dt { font-size: .84rem; color: var(--ink-2); }
.kpi dd { margin: .2rem 0 0; font-size: 1.6rem; font-weight: 700; font-stretch: 112%; }
.kpi .delta { font-size: .82rem; font-weight: 500; font-stretch: 100%; }
.delta.up { color: var(--go); }
.delta.down { color: var(--signal); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: .82rem; padding: .5rem .6rem; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--surface-2); }
td.actions-cell { white-space: nowrap; text-align: right; }
.empty { padding: 1.5rem; text-align: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-m); }
.tag { display: inline-block; font-size: .76rem; padding: .1em .5em; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.tag-signal { color: var(--signal); border-color: currentColor; background: var(--signal-bg); }
.tag-go { color: var(--go); border-color: currentColor; background: var(--go-bg); }

.pager { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: 1rem; align-items: center; }
.pager a, .pager span { padding: .35rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; font-size: .88rem; }
.pager [aria-current] { background: var(--slate-deep); color: var(--paper); border-color: var(--slate-deep); }

/* Chart (server-rendered SVG) */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--slate); }
.chart .bar.current { fill: var(--slate-deep); }
.chart text { fill: var(--ink-2); font-size: 9px; font-family: var(--font); }
.chart .grid { stroke: var(--line); }

/* Notes: profit reports as a card grid, targets full width */
.note-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.note-head h2 { margin: 0; font-size: 1.05rem; }
.note-date { font-size: .82rem; color: var(--ink-2); white-space: nowrap; }
.note .prose > :last-child { margin-bottom: 0; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.note-grid .note { margin: 0; }
.note-grid .note-head { flex-direction: column; gap: .2rem; }
.note-grid .prose { color: var(--ink-2); font-size: .92rem; }

/* Links to the company's other systems */
.related { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .88rem; color: var(--ink-2); }

/* Long-form text */
.prose { max-width: 72ch; }
.prose h3, .prose h4, .prose h5 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose table td, .prose table th { border: 1px solid var(--line); }
.list-docs { list-style: none; padding: 0; margin: 0; }
.list-docs li { padding: .9rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: start; }
.list-docs li:last-child { border-bottom: 0; }
.list-docs h3 { margin: 0; font-size: 1rem; }
.list-docs .meta { grid-column: 1; font-size: .84rem; color: var(--ink-2); }
.list-docs .doc-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: .4rem; }


/* Assistant */
.chat { display: grid; grid-template-columns: 230px 1fr; gap: 1.5rem; align-items: start; }
.chat-list { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.chat-list a { display: block; padding: .45rem .6rem; border-radius: var(--radius-s); text-decoration: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list a[aria-current] { background: var(--surface); font-weight: 600; box-shadow: inset 3px 0 0 var(--slate-deep); }
.thread { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1rem; }
.msg { max-width: 78ch; padding: .9rem 1.1rem; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); }
.msg-user { align-self: flex-end; background: var(--paper); border-color: var(--line-strong); }
.msg .who { font-size: .78rem; color: var(--ink-2); margin-bottom: .3rem; }
.composer textarea { min-height: 5rem; }
.composer [aria-busy="true"] { opacity: .6; pointer-events: none; }
.suggestions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }

/* Auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 2rem; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 1.5rem; }
.auth-card .brand img { width: 200px; }
.auth-foot { margin-top: 1.25rem; font-size: .88rem; }

/* Print view for documents ("Save as PDF") */
.print-page { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem; background: #fff; color: #1f2433; }
.print-page .doc-title { border-top: 1px solid #1f2433; border-bottom: 1px solid #1f2433; padding: .9rem 0; text-align: center; font-size: 1.5rem; }
.print-bar { display: flex; gap: .6rem; justify-content: flex-end; margin-bottom: 1.5rem; }
@media print {
  .print-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .print-page { padding: 0; }
}

/* ---------------------------------------------------------------- landing */
.site-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.25rem clamp(1rem, 4vw, 3rem); max-width: 1240px; margin: 0 auto; }
.site-head img { width: 170px; }
.site-head nav { display: flex; gap: 1.25rem; align-items: center; font-size: .95rem; }
.site-head nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-head nav a:not(.btn):hover { text-decoration: underline; }

.hero { max-width: 1240px; margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.2rem); font-weight: 800; font-stretch: 125%; line-height: 1.02; letter-spacing: -.025em; margin-bottom: 1.25rem; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 1.75rem; }
.hero-diagram { width: 100%; height: auto; }
.hero-diagram .wire { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
.hero-diagram .pulse { fill: none; stroke: var(--slate-deep); stroke-width: 2; stroke-dasharray: 6 300; animation: travel 3.2s linear infinite; }
.hero-diagram .pulse:nth-of-type(2) { animation-delay: .8s; }
.hero-diagram .pulse:nth-of-type(3) { animation-delay: 1.6s; }
.hero-diagram .pulse:nth-of-type(4) { animation-delay: 2.4s; }
.hero-diagram .node rect { fill: var(--surface); stroke: var(--line-strong); }
.hero-diagram .node text { fill: var(--ink); font: 600 14px var(--font); font-stretch: 110%; }
.hero-diagram .node .sub { fill: var(--ink-2); font: 400 12px var(--font); font-stretch: 100%; }
.hero-diagram .core rect { fill: var(--slate-deep); stroke: none; }
.hero-diagram .core text { fill: var(--paper); }
.hero-diagram .core .sub { fill: #c9cde0; }
@keyframes travel { from { stroke-dashoffset: 306; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-diagram .pulse { animation: none; stroke-dasharray: none; opacity: .35; } }

.band { border-top: 1px solid var(--line); }
.band-inner { max-width: 1240px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); }
.band h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); font-stretch: 118%; font-weight: 750; max-width: 24ch; }
.band .intro { color: var(--ink-2); max-width: 62ch; font-size: 1.05rem; }
.memory-layers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 2rem; border-top: 2px solid var(--ink); }
.memory-layers > div { padding: 1.25rem 1.25rem 0 0; }
.memory-layers > div + div { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.memory-layers h3 { font-size: 1.05rem; }
.memory-layers p { color: var(--ink-2); font-size: .95rem; }
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; }
.products article { border-top: 1px solid var(--line-strong); padding-top: 1.1rem; }
.products ul { padding-left: 1.1em; color: var(--ink-2); margin: 0; }
.example { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.example blockquote { margin: 0; padding: 1.25rem 1.5rem; background: var(--surface); border-left: 3px solid var(--signal); font-size: 1.02rem; }
.example blockquote footer { margin-top: .6rem; font-size: .85rem; color: var(--ink-2); }
.cta-band { background: var(--slate-deep); color: var(--paper); }
.cta-band h2 { color: var(--paper); }
.cta-band p { color: #d5d8e6; max-width: 56ch; }
.cta-band .btn { background: var(--paper); color: var(--slate-deep); border-color: var(--paper); }
.site-foot { max-width: 1240px; margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 3rem); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--ink-2); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .hero, .example { grid-template-columns: 1fr; }
  .memory-layers { grid-template-columns: 1fr 1fr; }
  .memory-layers > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .products { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 30; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: .6rem 1rem; }
  .main { padding: 1.25rem 1rem; }
  .chat { grid-template-columns: 1fr; }
  .site-head nav a:not(.btn) { display: none; }
}
@media (max-width: 560px) {
  .memory-layers { grid-template-columns: 1fr; }
  .memory-layers > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .kpis { grid-template-columns: 1fr; }
  .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); }
  .list-docs li { grid-template-columns: 1fr; }
  .list-docs .doc-actions { grid-row: auto; grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
