/* ESGweise house palette (the one the decks use): navy led, jade accent. */
:root {
  --navy: #182545;
  --deep: #0f1a33;
  --navy2: #2c3b5e;
  --accent: #38b49f;
  --accent-dk: #2b8c7c;
  --pale: #b5d0e7;
  --soft: #ecf5fa;
  --mint: #b6e8e0;
  --fog: #f4f7fa;
  --ink: #1e242a;
  --ink2: #5a6670;
  --muted: #8a939a;
  --rule: #d5dde5;
  --red: #a23b2f;
  --green: #2e7d5b;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px 40px; width: 100%; position: relative; z-index: 1; flex: 1; }

/* top strip: the website, in a new tab so nobody loses their place */
.strip { background: var(--deep); color: var(--pale); font-size: 12.5px; letter-spacing: .04em; position: relative; z-index: 5; }
.strip .in { max-width: 640px; margin: 0 auto; padding: 6px 18px; text-align: right; }
.strip a { color: var(--accent); text-decoration: none; font-weight: 600; }
.strip a:hover { text-decoration: underline; }

/* header: logo links back to the website */
header.top {
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 3px solid var(--accent);
}
header.top .in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
header.top a.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
header.top a.logo img { height: 34px; width: auto; display: block; }
header.top a.logo span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--pale); }
.who { font-size: 14px; color: var(--pale); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* footer: the rest of the website */
footer.site { position: relative; z-index: 1; border-top: 1px solid var(--rule); background: #fff; padding: 16px 18px 22px; font-size: 13px; color: var(--ink2); }
footer.site .in { max-width: 640px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; justify-content: space-between; }
footer.site a { color: var(--accent-dk); text-decoration: none; font-weight: 600; }
footer.site nav a { margin-left: 14px; font-weight: 500; }

/* background motion: the four-square mark drifting, and a slow wave along the foot */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#bg .sq { position: absolute; width: 18px; height: 18px; opacity: .14; animation: drift 38s linear infinite; }
#bg .sq.n { background: var(--navy); }
#bg .sq.j { background: var(--accent); }
#bg .sq.big { width: 34px; height: 34px; opacity: .08; }
#bg .mark { position: absolute; width: 44px; height: 44px; opacity: .12; animation: drift 52s linear infinite; }
#bg .mark i { position: absolute; width: 18px; height: 18px; }
#bg .mark i:nth-child(1) { left: 0; top: 0; background: var(--navy); }
#bg .mark i:nth-child(2) { right: 0; top: 0; background: var(--accent); }
#bg .mark i:nth-child(3) { left: 0; bottom: 0; background: var(--accent); }
#bg .mark i:nth-child(4) { right: 0; bottom: 0; background: var(--navy); }
@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(40px, -60px) rotate(45deg); }
  50%  { transform: translate(-20px, -120px) rotate(90deg); }
  75%  { transform: translate(-50px, -60px) rotate(135deg); }
  100% { transform: translate(0, 0) rotate(180deg); }
}
#bg .waves { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; }
#bg .waves svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; animation: wave 26s linear infinite; }
#bg .waves svg.two { animation-duration: 41s; animation-direction: reverse; opacity: .6; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { #bg .sq, #bg .mark, #bg .waves svg { animation: none; } }

h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 34px; line-height: 1.15; margin: 26px 0 8px; color: var(--navy); }
h2 { font-size: 24px; margin: 26px 0 10px; color: var(--navy); }
h3 { font-size: 18px; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
.kicker { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-dk); font-weight: 700; margin: 22px 0 4px; }
.sub { color: var(--ink2); font-size: 16px; }
.muted { color: var(--ink2); font-size: 14px; }
.card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 18px; margin: 14px 0; }
.card.mint { background: var(--soft); border-color: transparent; }
.card.teal { background: var(--navy); color: #fff; border-color: transparent; }
.card.teal h2, .card.teal h3 { color: #fff; }
.card.teal .kicker { color: var(--accent); }
.card.teal .muted { color: var(--pale); }
.situation { white-space: pre-line; font-size: 17px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text] {
  width: 100%; font: inherit; font-size: 18px; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 10px; background: #fff; color: var(--ink);
}
input[type=text]:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 17px;
  background: var(--navy); color: #fff; border: 0; border-radius: 999px;
  padding: 13px 26px; cursor: pointer; text-decoration: none;
}
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: var(--accent); color: var(--deep); }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.block { display: block; width: 100%; text-align: center; }

/* business picker */
.biz { display: grid; gap: 10px; margin: 8px 0 18px; }
.biz button {
  text-align: left; font: inherit; background: #fff; border: 1.5px solid var(--rule); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; color: var(--ink);
}
.biz button.on { border-color: var(--accent-dk); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent-dk); }
.biz b { display: block; font-size: 17px; margin-bottom: 3px; color: var(--navy); }
.biz span { font-size: 14px; color: var(--ink2); }

/* decisions */
.decision { margin: 22px 0; }
.decision .dom { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-dk); font-weight: 700; }
.decision .q { font-weight: 600; font-size: 18px; margin: 4px 0 10px; color: var(--navy); }
.opts { display: grid; gap: 8px; }
.opt {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: start;
  text-align: left; font: inherit; font-size: 16px; line-height: 1.4;
  background: #fff; border: 1.5px solid var(--rule); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--ink);
}
.opt .k {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); color: var(--navy); font-weight: 700; font-size: 15px;
}
.opt.on { border-color: var(--accent-dk); background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent-dk); }
.opt.on .k { background: var(--accent-dk); color: #fff; }
.opt:disabled { cursor: default; opacity: .75; }
.opt.on:disabled { opacity: 1; }
.opt .fx { grid-column: 2; font-size: 14px; color: var(--ink2); margin-top: 4px; }
.opt .ex { grid-column: 2; font-size: 15px; margin-top: 6px; color: var(--ink); }

/* dials */
.dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.dial { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 10px 8px; text-align: center; }
.card.teal .dial { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.dial .v { font-family: "Source Serif 4", Georgia, serif; font-size: 28px; font-weight: 600; line-height: 1.1; }
.dial .l { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; margin-top: 3px; }
.dial .d { font-size: 13px; font-weight: 600; margin-top: 3px; }
.up { color: var(--green); } .down { color: var(--red); }
.card.teal .up { color: #9fe0bd; } .card.teal .down { color: #f4b3a8; }
.bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.card.teal .bar { background: rgba(255,255,255,.18); }
.bar i { display: block; height: 100%; background: var(--accent); }

.score { text-align: center; padding: 26px 18px; }
.score .n { font-family: "Source Serif 4", Georgia, serif; font-size: 72px; font-weight: 600; line-height: 1; color: var(--accent); }
.score .of { font-size: 14px; text-transform: uppercase; letter-spacing: .15em; opacity: .85; }
.rank { font-size: 16px; margin-top: 8px; }
ol.top { padding-left: 22px; margin: 6px 0 0; }
ol.top li { padding: 3px 0; display: flex; justify-content: space-between; gap: 10px; }
ol.top li b { font-family: "Source Serif 4", Georgia, serif; color: var(--navy); }
.note { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 10px 0; background: #fff; font-size: 15px; }
.wait { text-align: center; padding: 40px 10px; }
.pulse { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; margin-bottom: 14px; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .5; } }
.status { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); color: #fff; font-size: 14px; padding: 8px 18px; text-align: center; display: none; z-index: 6; }
.status.show { display: block; }
.err { color: var(--red); font-weight: 600; }
.habits { padding-left: 20px; }
.habits li { margin: 8px 0; }
.progress { display: flex; gap: 6px; margin: 10px 0 0; }
.progress i { flex: 1; height: 5px; border-radius: 3px; background: var(--rule); }
.progress i.done { background: var(--navy); }
.progress i.now { background: var(--accent); }
