/* The site's one stylesheet: the landing page, the legal pages and the 404.
 * Copied to website/site/site.css by build.mjs.
 *
 * Colours from the app's Dusk Slate theme (lib/app/theme.dart, seed #4A6382):
 * its dark surfaces, its blue-grey primary for links and actions, and the
 * amber of the After hours chip. Dark only, like the other Business Object
 * sites. System fonts only: nothing is fetched from elsewhere. The apps menu
 * and the legal pages follow Trading Sundays' site rule for rule. */

:root {
  color-scheme: dark;

  --bg: #0f1318;
  --surface: #171d25;
  --surface-2: #1e2630;
  --border: #2a3441;
  --text: #e3e8ef;
  --muted: #9aa6b5;
  --action: #a8c6ea;
  --amber: #f2b84b;
  --amber-ink: #2b1d00;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

a {
  color: var(--action);
}

a:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand img {
  border-radius: 10px;
}

/* --- the apps menu (as on Trading Sundays' site) ------------------------------------ */

.apps-nav {
  position: relative;
  z-index: 5;
}

.apps-menu {
  position: relative;
  display: inline-block;
}

.apps-menu summary {
  list-style: none;
  margin: 0 0 0 -8px;
  padding: 6px 10px 6px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.apps-menu summary::-webkit-details-marker {
  display: none;
}

.apps-menu summary:hover,
.apps-menu[open] summary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border);
}

.apps-menu summary:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
}

.brand .caret {
  opacity: 0.6;
  transition: transform 0.2s;
}

.apps-menu[open] .caret {
  transform: rotate(180deg);
}

.app-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: -8px;
  width: min(310px, calc(100vw - 32px));
  margin: 0;
  padding: 6px;
  list-style: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(5, 8, 12, 0.6);
  overflow: hidden;
}

.apps-menu[open] .app-menu {
  animation: menu-grow 0.13s steps(4, end) both;
}

.app-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  font-size: 1rem;
}

.app-menu a:hover,
.app-menu a:focus-visible {
  background: rgba(168, 198, 234, 0.12);
  outline: none;
}

.app-menu img {
  flex: none;
  border-radius: 9px;
}

.app-menu b {
  display: block;
  line-height: 1.25;
}

.app-menu small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.3;
}

.app-menu a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--amber);
  background: rgba(255, 255, 255, 0.04);
}

.app-menu li:first-child {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.apps-menu[open] .app-menu li {
  animation: menu-item 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-menu li:nth-child(1) { animation-delay: 0.16s; }
.app-menu li:nth-child(2) { animation-delay: 0.21s; }
.app-menu li:nth-child(3) { animation-delay: 0.26s; }
.app-menu li:nth-child(4) { animation-delay: 0.31s; }
.app-menu li:nth-child(5) { animation-delay: 0.36s; }

@keyframes menu-grow {
  from {
    clip-path: inset(0 100% 100% 0 round 14px);
  }

  to {
    clip-path: inset(0 0 0 0 round 14px);
  }
}

@keyframes menu-item {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}

/* --- the landing page ----------------------------------------------------------------- */

.bar,
.landing main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.bar {
  padding-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
  padding: 56px 0 72px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.sub {
  margin: 0 0 28px;
  max-width: 30ch;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  color: var(--text);
}

.play,
.soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
}

.play {
  color: var(--bg);
  background: var(--action);
  text-decoration: none;
}

.play:hover {
  background: #c4d9f2;
}

.soon {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
}

.soon svg {
  color: var(--amber);
}

.note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* The example notes: two cards, the way a note looks in the app's list. */
.example {
  position: relative;
  margin: 0;
  padding: 0 0 28px 24px;
}

.note-card {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.note-card-back {
  z-index: 0;
  margin: -12px 0 0 -24px;
  width: 88%;
  background: var(--surface);
  box-shadow: none;
  opacity: 0.85;
}

.note-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.note-time {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 2px solid var(--amber);
  border-radius: 8px;
  color: var(--amber);
  font-size: 0.82rem;
  font-weight: 600;
}

.note-who {
  margin: 10px 0 4px;
}

.note-text {
  margin: 0;
  font-size: 1.05rem;
}

.example figcaption {
  position: absolute;
  right: 4px;
  bottom: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.features ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature {
  padding: 22px 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(168, 198, 234, 0.12);
  color: var(--action);
}

.feature h3 {
  margin: 14px 0 6px;
  font-size: 1.15rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
}

.price,
.about {
  max-width: 720px;
  margin: 72px auto 0;
  text-align: center;
}

.price h2,
.about h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.02em;
}

.price p,
.about p {
  margin: 0 0 6px;
}

.price-tag {
  font-size: 1.25rem;
}

.price-tag b {
  color: var(--amber);
}

.about p {
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 36px 0 56px;
  }

  .features ul {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --- footer (as on Trading Sundays' site) ------------------------------------------------ */

.site-footer {
  max-width: 1080px;
  margin: 72px auto 0;
  padding: 24px 16px 56px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer p {
  margin: 16px 0 0;
}

/* --- the legal pages and 404 (as on Trading Sundays' site) ----------------------------- */

.doc header,
.doc main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

.doc header {
  padding-top: 24px;
}

.doc h1 {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 40px 0 4px;
}

.doc h2 {
  font-size: 1.2rem;
  margin: 32px 0 8px;
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 4px 0;
}

.doc code {
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
}

.updated {
  margin: 0 0 24px;
  color: var(--muted);
}

.doc .site-footer {
  max-width: 720px;
}

.lost main {
  min-height: 50vh;
}

/* --- reduced motion: everything stands still -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
