/* ==========================================================================
   App detail pages — /figdex, /myetho, /portfoliolab
   Standalone theme framework: each page is themed to its OWN app (colour,
   font, shape, signature element) rather than the portfolio's paper-hall look.
   Does NOT load site.css. Behaviour (mobile menu, screenshot dots, scrollspy,
   reveal) is reused from site.js, which keys off the shared class/id names.
   Every page is dark — the design home of all three apps.
   ========================================================================== */

*, *::before, *::after{ box-sizing: border-box; }

/* ── Theme tokens (defaults; each .t-* class below overrides) ─────────── */
:root{
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --gut: clamp(20px, 5vw, 48px);
  --max: 1100px;
}

/* Figdex — navy + LEGO yellow */
.t-figdex{
  --bg: #0D1B2A;  --deep: #0A1420;  --card: #132233;  --raised: #17293C;
  --border: #1E3A5F;  --border-2: #294B72;
  --text: #FFFFFF;  --text-2: #8A9BB0;  --text-3: #4A5A6A;
  --accent: #FFD700;  --accent-deep: #F5C800;  --accent-ink: #0D1B2A;
  --pos: #2ECC8A;  --warn: #E8961A;  --info: #4A9EFF;
  --radius-card: 14px;  --radius-pill: 20px;  --radius-chip: 6px;
}
/* MyEtho — near-black + Etho orange */
.t-myetho{
  --bg: #060608;  --deep: #0D0D12;  --card: #13131A;  --raised: #1A1A24;
  --border: #25252F;  --border-2: #3A3A50;
  --text: #F0F0F8;  --text-2: #6B6B80;  --text-3: #3A3A50;
  --accent: #FF7A35;  --accent-deep: #E05E1A;  --accent-ink: #060608;
  --pos: #4ADE80;  --warn: #FACC15;  --info: #FB923C;
  --radius-card: 16px;  --radius-pill: 999px;  --radius-chip: 4px;
}
/* PortfolioLab — graphite + brand blue */
.t-portfoliolab{
  --bg: #1C1C1E;  --deep: #151517;  --card: #2C2C2E;  --raised: #3A3A3C;
  --border: rgba(255,255,255,.12);  --border-2: rgba(255,255,255,.22);
  --text: #FFFFFF;  --text-2: #ABABAB;  --text-3: #636366;
  --accent: #5BA8E0;  --accent-deep: #1A4F7C;  --accent-ink: #0A1A28;
  --pos: #25C28F;  --neg: #E8744A;  --gold: #EF9F27;
  --radius-card: 14px;  --radius-pill: 999px;  --radius-chip: 6px;
}

/* ── Base ────────────────────────────────────────────────────────────── */
html{ scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce){ html{ scroll-behavior: auto; } }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; }
ul{ margin: 0; padding: 0; list-style: none; }
p{ margin: 0; }
h1, h2, h3{ margin: 0; font-weight: 700; }
a{ color: inherit; text-decoration: none; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip{
  position: fixed; top: 8px; left: 8px; z-index: 99;
  padding: 10px 16px; background: var(--accent); color: var(--accent-ink);
  font-weight: 600; border-radius: var(--radius-chip); transform: translateY(-200%);
}
.skip:focus{ transform: none; }

.shell{ width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar{
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner{
  position: relative; display: flex; align-items: center;
  gap: clamp(14px, 3vw, 36px); padding-block: 12px;
}
.topnav{ flex: 1; display: flex; justify-content: flex-end; gap: clamp(14px, 2.5vw, 30px); align-items: center; }
.topnav__link{
  position: relative; display: block; padding: 5px 0;
  font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-2); white-space: nowrap; transition: color .2s var(--ease);
}
.topnav__link::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .26s var(--ease);
}
.topnav__link:hover{ color: var(--text); }
.topnav__link:hover::after{ transform: scaleX(1); }
.topnav__link.is-active{ color: var(--text); }
.topnav__link.is-active::after{ transform: scaleX(1); }
/* Portfolio exit link reads as a quiet pill */
.topnav__link--exit{
  color: var(--text-2); border: 1px solid var(--border-2);
  padding: 5px 12px; border-radius: var(--radius-pill);
}
.topnav__link--exit::after{ display: none; }
.topnav__link--exit:hover{ color: var(--text); border-color: var(--accent); }

/* Brand cluster on the left of the bar */
.topbrand{ display: flex; align-items: center; gap: 10px; flex: none; }
.topbrand img{ width: 26px; height: 26px; border-radius: 7px; }
.topbrand span{ font-weight: 700; font-size: 15px; letter-spacing: .01em; }

/* ── Mobile menu (mirrors the portfolio's pattern, themed) ───────────── */
.navtoggle{ display: none; }
@media (max-width: 760px){
  .topbrand{ display: none; }
  .navtoggle{
    display: flex; align-items: center; justify-content: flex-start; gap: 11px;
    flex: 1; min-width: 0; padding: 8px 0; background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text);
  }
  .navtoggle__current{
    position: absolute; left: 50%; transform: translateX(-50%);
    max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-weight: 700;
  }
  .navtoggle__bars{ display: inline-flex; flex-direction: column; gap: 3px; width: 18px; flex: none; }
  .navtoggle__bars span{ height: 2px; background: var(--accent); border-radius: 1px; transition: transform .25s var(--ease), opacity .2s var(--ease); }
  .topbar.is-open .navtoggle__bars span:nth-child(1){ transform: translateY(5px) rotate(45deg); }
  .topbar.is-open .navtoggle__bars span:nth-child(2){ opacity: 0; }
  .topbar.is-open .navtoggle__bars span:nth-child(3){ transform: translateY(-5px) rotate(-45deg); }

  .topnav{
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; align-items: stretch;
    padding: 4px var(--gut) 12px; background: var(--deep);
    border-bottom: 1px solid var(--border); display: none;
  }
  .topbar.is-open .topnav{ display: flex; }
  .topnav__link{
    padding: 14px 2px; font-size: 14px; text-align: center;
    border-bottom: 1px solid var(--border);
  }
  .topnav__link:last-child{ border-bottom: 0; }
  .topnav__link::after{ display: none; }
  .topnav__link.is-active{ color: var(--accent); }
  .topnav__link--exit{ border: 0; border-radius: 0; margin-top: 2px; color: var(--text-2); }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.apx{ padding-top: clamp(96px, 16vh, 130px); }
.apx__hero{ padding-bottom: clamp(28px, 5vh, 48px); }
.apx__id{ display: flex; align-items: center; gap: clamp(16px, 3.5vw, 24px); }
.apx__icon{
  width: clamp(74px, 15vw, 100px); height: clamp(74px, 15vw, 100px); flex: none;
  border-radius: 22%; border: 1px solid var(--border);
}
.apx__name{ font-size: clamp(2.2rem, 8vw, 3.6rem); line-height: 1; letter-spacing: -.02em; color: var(--text); }
.apx__kicker{ margin-top: 8px; font-size: clamp(12px, 2.6vw, 14px); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.apx__lede{ margin-top: clamp(20px, 3.5vh, 30px); max-width: 54ch; font-size: clamp(1.15rem, 2.6vw, 1.5rem); line-height: 1.4; color: var(--text); }
.apx__lede strong{ color: var(--accent); font-weight: 700; }

/* Status pill */
.badge{
  display: inline-flex; align-items: center; gap: 9px; margin-top: clamp(22px, 3.5vh, 30px);
  padding: 8px 16px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--text);
}
.badge__dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 10px var(--accent); }

/* ── Sections ────────────────────────────────────────────────────────── */
.apx__section{ padding-block: clamp(32px, 6vh, 60px); border-top: 1px solid var(--border); }
.apx__eyebrow{ font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.apx__h2{ margin-top: 10px; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.1; letter-spacing: -.01em; color: var(--text); }
.apx__prose{ margin-top: clamp(18px, 3vh, 26px); max-width: 64ch; color: var(--text-2); font-size: clamp(1rem, 2vw, 1.1rem); }
.apx__prose strong{ color: var(--text); font-weight: 600; }
.apx__prose + .apx__prose{ margin-top: 16px; }

/* ── Stat chips ──────────────────────────────────────────────────────── */
.apx__stats{ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(10px, 2vw, 14px); margin-top: clamp(24px, 4vh, 34px); }
@media (min-width: 720px){ .apx__stats{ grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat{ padding: clamp(16px, 2.5vw, 20px); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); }
.stat__num{ font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__label{ margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.stat--feature{ background: var(--accent); border-color: var(--accent); grid-column: span 2; }
.stat--feature .stat__num, .stat--feature .stat__label{ color: var(--accent-ink); }
.stat--feature .stat__label{ opacity: .8; font-weight: 600; }

/* ── Edge callout ────────────────────────────────────────────────────── */
.apx__edge{
  margin-top: clamp(24px, 4vh, 34px); padding: clamp(20px, 3.5vw, 28px);
  background: var(--card); border: 1px solid var(--accent);
  border-left-width: 3px; border-radius: var(--radius-card);
  color: var(--text); font-size: clamp(1.05rem, 2.1vw, 1.2rem); line-height: 1.5;
}
.apx__edge .apx__eyebrow{ display: block; margin-bottom: 12px; }

/* ── Features ────────────────────────────────────────────────────────── */
.apx__features{ display: grid; gap: 12px; margin-top: clamp(22px, 3.5vh, 30px); }
@media (min-width: 720px){ .apx__features{ grid-template-columns: 1fr 1fr; gap: 12px clamp(24px, 5vw, 48px); } }
.apx__features li{
  display: flex; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  font-size: clamp(.98rem, 2vw, 1.05rem); color: var(--text);
}
.apx__features li::before{ content: ""; width: 7px; height: 7px; margin-top: .5em; flex: none; border-radius: 2px; background: var(--accent); }

/* ── Screens (reuses .app__shots/.phone/.app__dots from site.js dots) ── */
.apx__screens .app__shots{
  display: flex; gap: clamp(14px, 2.4vw, 22px); margin-top: clamp(22px, 3.5vh, 30px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 6px;
}
.apx__screens .app__shots::-webkit-scrollbar{ display: none; }
.phone{
  flex: 0 0 min(62vw, 260px); scroll-snap-align: center; position: relative;
  aspect-ratio: 390 / 844; padding: 5px; border-radius: 26px;
  border: 1px solid var(--border-2); background: var(--raised);
}
.phone img{ width: 100%; height: 100%; object-fit: cover; border-radius: 22px; }
@media (min-width: 900px){
  .apx__screens .app__shots{ overflow: visible; justify-content: center; }
  .phone{ flex: 0 1 232px; }
}
.app__dots{ display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.app__dot{
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  transition: background-color .25s var(--ease), transform .25s var(--ease);
}
.app__dot.is-on{ background: var(--accent); transform: scale(1.3); }
.apx__caption{ margin-top: 14px; text-align: center; font-size: 12.5px; font-weight: 500; letter-spacing: .04em; color: var(--text-2); }

/* ── Tags ────────────────────────────────────────────────────────────── */
.apx__tags{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(22px, 3.5vh, 30px); }
.apx__tags li{
  padding: 7px 13px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 500; color: var(--text-2);
}

/* ── Signature: MyEtho spectrum + E-number hero ──────────────────────── */
.spectrum-hero{ margin-top: clamp(24px, 4vh, 34px); max-width: 440px; }
.spectrum-hero__e{ display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.spectrum-hero__e b{ font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 700; color: #FB923C; }
.spectrum-hero__e span{ font-size: clamp(4.4rem, 16vw, 8.75rem); font-weight: 700; line-height: .9; color: #FB923C; }
.spectrum-bar{ height: 10px; margin-top: 16px; border-radius: 5px; background: rgba(37,37,47,.6); overflow: hidden; }
.spectrum-bar__fill{ height: 100%; border-radius: 5px; background: linear-gradient(90deg, #4ADE80, #FACC15, #FB923C); }
.spectrum-scale{ display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--text-2); }
/* Full 6-stop reference bar — the app's signature ethanol spectrum */
.spectrum-ref{ height: 12px; border-radius: 6px; background: linear-gradient(90deg, #4ADE80 0%, #A2D54B 20%, #FACC15 40%, #FB923C 62%, #F97316 82%, #EF4444 100%); }

/* PortfolioLab — a small row of demo % pills as a signature flourish */
.pl-demo{ display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(24px, 4vh, 34px); }

/* ── Signature: PortfolioLab % pills ─────────────────────────────────── */
.pl-pill{ display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-pill--up{ color: var(--pos); background: color-mix(in srgb, var(--pos) 15%, transparent); }
.pl-pill--down{ color: var(--neg); background: color-mix(in srgb, var(--neg) 15%, transparent); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.apx__footer{ margin-top: clamp(20px, 4vh, 40px); padding-block: clamp(44px, 8vh, 80px) 32px; background: var(--deep); border-top: 1px solid var(--border); }
.apx__foot-eyebrow{ font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.apx__foot-head{ margin-top: 12px; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; letter-spacing: -.02em; color: var(--text); }
.apx__mail{ display: inline-block; margin-top: clamp(20px, 3vh, 28px); font-size: clamp(1.1rem, 3vw, 1.6rem); font-weight: 600; color: var(--text); border-bottom: 2px solid var(--accent); padding-bottom: 4px; transition: color .2s var(--ease); }
.apx__mail:hover{ color: var(--accent); }
.apx__foot-links{ display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: clamp(26px, 4vh, 40px); font-size: 13px; font-weight: 500; color: var(--text-2); }
.apx__foot-links a{ transition: color .2s var(--ease); }
.apx__foot-links a:hover{ color: var(--accent); }
.apx__foot-links .sep{ color: var(--text-3); }
.apx__copy{ margin-top: clamp(30px, 5vh, 48px); padding-top: 20px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }

/* ── Reveal (opt-in via .js from the head failsafe; site.js adds is-in) ─ */
.js [data-reveal]{ opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].is-in{ opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){ .js [data-reveal]{ opacity: 1; transform: none; } }
