/* FatDyn-X website. Plain CSS, no build step. Main page plus one page per topic. */
:root {
  --night: #041c24;
  --teal: #0f4c5c;
  --teal-dark: #0a3642;
  --teal-tint: #e4ecee;
  --paper: #f6f7f8;
  --line: #d9dee1;
  --ink: #18202a;
  --muted: #56606b;
  --accent: #e07a1f;
  --glow: #ffb057;
  --green: #1d6b45;
  --white: #ffffff;
  --head: 62px;
  --wrap: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head) + 16px); }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.6; color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
ul { margin: 0; padding-left: 1.15em; }
li { margin: 0.25em 0; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 0.86em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }

/* ---- top bar ----------------------------------------------------------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--head); background: rgba(4, 28, 36, 0.94); backdrop-filter: blur(6px); color: var(--white); }
.top .wrap { height: 100%; display: flex; align-items: center; gap: 26px; }
.brand { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; color: var(--white); text-decoration: none; margin-right: auto; white-space: nowrap; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 4px; }
.top nav a { color: rgba(255,255,255,0.86); text-decoration: none; font-size: 0.93rem; font-weight: 600; padding: 8px 13px; border-radius: 3px; white-space: nowrap; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--white); background: rgba(255,255,255,0.09); }
.top nav a.on { color: var(--white); border-bottom-color: var(--accent); border-radius: 3px 3px 0 0; }
.top nav a.cta { border: 1px solid rgba(255,255,255,0.5); margin-left: 8px; }
.top nav a.cta:hover { background: var(--white); color: var(--night); }

/* ---- hero (main page) and page banner (topic pages) ---------------------- */
.hero, .banner { color: var(--white); background: var(--night) url("../img/hero-mesh.svg") center / cover no-repeat; }
.hero .wrap { min-height: min(680px, calc(100vh - var(--head))); display: flex; flex-direction: column; justify-content: center; padding-top: 70px; padding-bottom: 90px; }
.kicker { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--glow); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.6rem); font-weight: 700; letter-spacing: -0.025em; margin-top: 14px; }
.hero h1 span { color: var(--accent); }
.hero .sub { font-size: clamp(1.25rem, 2.6vw, 1.9rem); font-weight: 300; margin-top: 10px; max-width: 640px; line-height: 1.25; }
.hero .intro { font-size: 1.06rem; margin-top: 22px; max-width: 590px; color: rgba(255,255,255,0.86); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-block; padding: 12px 26px; border-radius: 3px; background: var(--accent); color: var(--white); text-decoration: none; font-weight: 700; border: 1px solid var(--accent); }
.btn:hover { background: #c96a14; border-color: #c96a14; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,0.6); }
.btn.ghost:hover { background: var(--white); color: var(--night); border-color: var(--white); }
.btn.dark { background: var(--teal); border-color: var(--teal); }
.btn.dark:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.banner .wrap { padding-top: 54px; padding-bottom: 58px; }
.banner h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.02em; margin-top: 10px; }
.banner p { font-size: 1.1rem; margin-top: 14px; max-width: 700px; color: rgba(255,255,255,0.88); }

/* ---- sections ----------------------------------------------------------- */
section { padding: 70px 0; }
section.alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
section.dark { background: var(--teal-dark); color: var(--white); }
.eyebrow { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); }
section h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); letter-spacing: -0.015em; margin-top: 8px; max-width: 820px; }
.lead { font-size: 1.08rem; color: #38414c; margin-top: 16px; max-width: 800px; }
section.dark .lead { color: rgba(255,255,255,0.86); }
section h3 { font-size: 1.05rem; }
.prose p { margin-top: 12px; max-width: 800px; }

/* facts strip under the hero */
.facts { background: var(--teal-dark); color: var(--white); }
.facts .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.facts .wrap > div { padding: 26px 22px; border-left: 1px solid rgba(255,255,255,0.14); }
.facts .wrap > div:first-child { border-left: 0; padding-left: 0; }
.facts strong { display: block; font-size: 1.22rem; color: var(--glow); }
.facts span { font-size: 0.9rem; opacity: 0.9; }

/* three pillars on the main page */
.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 34px; }
.pillar { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 5px; padding: 26px 26px 22px; color: var(--ink); text-decoration: none; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.pillar:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(10, 54, 66, 0.16); border-top-color: var(--accent); }
.pillar .n { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; color: var(--accent); }
.pillar h3 { font-size: 1.5rem; margin-top: 6px; color: var(--teal-dark); }
.pillar p { margin-top: 10px; font-size: 0.96rem; color: #333a45; }
.pillar ul { margin-top: 12px; font-size: 0.92rem; color: #333a45; flex: 1; }
.pillar .go { margin-top: 18px; font-weight: 700; color: var(--teal); }
.pillar:hover .go { color: var(--accent); }

/* feature tiles */
.grid { display: grid; gap: 16px; margin-top: 30px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 5px; padding: 20px 22px; }
section.alt .card { background: var(--paper); }
.card h3 { color: var(--teal); margin-bottom: 8px; }
.card p, .card li { font-size: 0.94rem; color: #333a45; }
.card p + p, .card ul + p, .card p + ul { margin-top: 8px; }
a.card { display: block; color: var(--ink); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
a.card:hover { border-color: var(--teal); box-shadow: 0 8px 20px rgba(10, 54, 66, 0.12); }
section.dark .card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.18); }
section.dark .card h3 { color: var(--glow); }
section.dark .card p, section.dark .card li { color: rgba(255,255,255,0.88); }
section.dark a.card:hover { border-color: var(--glow); background: rgba(255,255,255,0.1); box-shadow: none; }
.more { margin-top: 28px; }
.card.new { border-color: var(--teal); background: var(--teal-tint); }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: var(--accent); color: var(--white); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; vertical-align: 1px; }

/* route diagram on the main page */
.flow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(60px, 0.5fr) minmax(0, 0.7fr); align-items: stretch; margin-top: 34px; }
.flow-in { display: grid; grid-template-rows: auto auto; gap: 34px; }
.flow-box { background: var(--teal); color: var(--white); border: 2px solid var(--night); border-radius: 12px; padding: 22px 20px; text-align: center; font-size: 1.2rem; font-weight: 600; line-height: 1.35; }
.flow-row .flow-box { width: 340px; max-width: 100%; }
.flow-lead { display: flex; align-items: center; }
.flow-lead::after { content: ""; flex: 1; border-top: 2px solid var(--teal); }
.flow-solv { border: 2px solid var(--green); background: #f1f7f5; border-radius: 3px; padding: 12px 16px; }
.flow-solv h3 { font-size: 0.92rem; color: var(--green); margin-bottom: 4px; }
.flow-solv ul { columns: 2; column-gap: 28px; font-size: 0.86rem; }
.flow-solv li { break-inside: avoid; margin: 0.1em 0; }
.flow-down { color: var(--teal); line-height: 1; padding: 4px 0; width: 340px; max-width: 100%; text-align: center; }
.flow-m { display: none; }
.flow-arrows { width: 100%; height: 100%; }
.flow-arrows line { stroke: var(--teal); stroke-width: 2; }
.flow-out { display: flex; align-items: center; position: relative; }
.flow-out::before { content: ""; position: absolute; left: -11px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-left: 12px solid var(--teal); }
.flow-out .flow-box { width: 100%; padding: 30px 20px; font-size: 1.35rem; }

/* in-page links on topic pages */
.jump { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: var(--head); z-index: 10; }
.jump .wrap { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; }
.jump a { flex: 0 0 auto; font-size: 0.86rem; font-weight: 600; color: #3c4652; text-decoration: none; padding: 5px 12px; border: 1px solid var(--line); border-radius: 20px; white-space: nowrap; }
.jump a:hover { border-color: var(--teal); color: var(--teal); }

/* content pieces */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: center; margin-top: 30px; }
.note { margin-top: 24px; background: var(--teal-tint); border-left: 3px solid var(--teal); border-radius: 0 4px 4px 0; padding: 14px 18px; font-size: 0.95rem; }
.formula { margin-top: 26px; background: var(--teal-dark); color: var(--white); border-radius: 5px; padding: 20px 24px; text-align: center; }
.formula b { display: block; font-family: Cambria, Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.3rem; color: var(--glow); margin-bottom: 8px; }
.formula span { font-size: 0.9rem; opacity: 0.9; }
pre { margin: 26px 0 0; background: #10202a; color: #e6edf0; border-radius: 5px; padding: 16px 18px; overflow-x: auto; line-height: 1.45; }
pre b { color: var(--glow); font-weight: 400; }
.chips { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { background: var(--white); border: 1px solid var(--line); border-radius: 3px; padding: 5px 12px; font-size: 0.88rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin-top: 26px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 46px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); color: var(--white); font-weight: 700; font-size: 0.88rem; display: grid; place-items: center; }
.steps p { font-size: 0.94rem; color: #333a45; margin-top: 2px; }
ul.ok { list-style: none; padding-left: 0; }
ul.ok li { padding-left: 1.6em; position: relative; }
ul.ok li::before { content: "\2713"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
section.dark ul.ok li::before { color: var(--glow); }

figure { margin: 30px 0 0; }
figure img { border: 1px solid var(--line); border-radius: 5px; background: var(--white); width: 100%; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tbl { margin-top: 26px; overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.tbl h3 { font-size: 0.96rem; padding: 13px 16px 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--teal-dark); color: var(--white); text-align: left; padding: 8px 16px; font-weight: 600; font-size: 0.76rem; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
td { padding: 8px 16px; border-top: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.hi td { font-weight: 700; }
.big, .card p.big { font-size: 1.9rem; font-weight: 700; color: var(--teal); line-height: 1.15; }
.big small { display: block; font-size: 0.88rem; font-weight: 400; color: var(--muted); margin-top: 6px; line-height: 1.45; }

/* contact band and footer */
.contact { background: var(--night) url("../img/hero-mesh.svg") center bottom / cover no-repeat; color: var(--white); padding: 76px 0; }
.contact h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
.contact p { margin-top: 12px; max-width: 560px; color: rgba(255,255,255,0.88); }
.contact .addr { font-size: 0.92rem; margin-top: 22px; }
.next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
footer { background: var(--night); color: rgba(255,255,255,0.62); font-size: 0.8rem; padding: 20px 0; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 26px; justify-content: space-between; }
footer a { color: rgba(255,255,255,0.8); }

/* ---- small screens -------------------------------------------------------- */
@media (max-width: 900px) {
  .top .wrap { gap: 10px; padding: 0 14px; }
  .top nav { overflow-x: auto; }
  .top nav a { padding: 8px 9px; font-size: 0.86rem; }
  .top nav a.cta { display: none; }
  .wrap { padding: 0 18px; }
  section { padding: 48px 0; }
  .pillars, .g2, .g3, .g4, .split, .pair, .next { grid-template-columns: 1fr; }
  .flow { display: block; }
  .flow-arrows, .flow-out::before, .flow-lead::after { display: none; }
  .flow-lead { display: block; }
  .flow-m { display: block; width: auto; padding: 10px 0; }
  .flow-in { gap: 16px; }
  .flow-row .flow-box, .flow-down { max-width: none; width: auto; }
  .flow-solv ul { columns: 1; }
  .facts .wrap { grid-template-columns: 1fr 1fr; }
  .facts .wrap > div { padding: 16px 12px; border-left: 0; }
  .facts .wrap > div:first-child { padding-left: 0; }
  .hero .wrap { padding-top: 48px; padding-bottom: 60px; min-height: 0; }
}
@media (max-width: 560px) {
  .brand { font-size: 1.15rem; }
  .top nav a { padding: 8px 6px; font-size: 0.8rem; }
}
