/* ==========================================================================
   products.deltawingsim.com

   Design tokens are lifted from the web-companion stylesheet so the
   storefront, the companion app and the Mac client all read as one
   product family: the same olive accent, the same category hues, the
   same system-font stack.

   What differs is the layout. The companion is app chrome — dense,
   sidebar-driven. This is a public page, so it trades density for
   breathing room and a single readable column.
   ========================================================================== */

:root {
  /* Surfaces */
  --fd-bg:            #ecece9;
  --fd-panel:         #ffffff;
  --fd-panel-alt:     #f7f7f5;
  --fd-hover:         rgba(0, 0, 0, 0.04);

  /* Text */
  --fd-text:          rgba(0, 0, 0, 0.88);
  --fd-text-dim:      rgba(0, 0, 0, 0.55);
  --fd-text-faint:    rgba(0, 0, 0, 0.38);

  /* Lines */
  --fd-border:        rgba(0, 0, 0, 0.08);
  --fd-border-strong: rgba(0, 0, 0, 0.12);

  /* Accents */
  --fd-accent:        #b8b846;
  --fd-accent-soft:   rgba(184, 184, 70, 0.16);
  --fd-accent-fg:     #ffffff;
  --fd-success:       #46b87f;
  --fd-success-soft:  rgba(70, 184, 127, 0.15);
  --fd-warn:          #afc73e;
  --fd-warn-soft:     rgba(175, 199, 62, 0.16);
  --fd-info:          #5968b3;
  --fd-info-soft:     rgba(89, 104, 179, 0.14);

  /* Category hues — same wheel positions as the Mac client */
  --cat-aircraft:     hsl(60,  43%, 50%);
  --cat-plugin:       hsl(305, 43%, 56%);
  --cat-library:      hsl(150, 43%, 50%);
  --cat-tool:         hsl(25,  60%, 50%);

  /* Type */
  --fd-font-ui:   -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
                  "Segoe UI", Roboto, system-ui, sans-serif;
  --fd-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 860px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fd-bg:            #1c1c1e;
    --fd-panel:         #2c2c2e;
    --fd-panel-alt:     #232326;
    --fd-hover:         rgba(255, 255, 255, 0.06);

    --fd-text:          rgba(255, 255, 255, 0.92);
    --fd-text-dim:      rgba(255, 255, 255, 0.58);
    --fd-text-faint:    rgba(255, 255, 255, 0.40);

    --fd-border:        rgba(255, 255, 255, 0.10);
    --fd-border-strong: rgba(255, 255, 255, 0.16);

    --fd-accent:        #c9c95a;
    --fd-accent-soft:   rgba(201, 201, 90, 0.18);
    --fd-accent-fg:     #1c1c1e;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fd-bg);
  color: var(--fd-text);
  font-family: var(--fd-font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

/* Keyboard users land on this before the nav; invisible until focused. */
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--fd-panel);
  color: var(--fd-text);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--fd-border-strong);
}

:focus-visible {
  outline: 2px solid var(--fd-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */

.site-head {
  border-bottom: 1px solid var(--fd-border);
  background: var(--fd-panel);
  position: sticky;
  top: 0;
  z-index: 5;
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.brand-mark { border-radius: 6px; display: block; }

.crumb {
  color: var(--fd-text-dim);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}
.crumb:hover { background: var(--fd-hover); color: var(--fd-text); }

.site-foot {
  margin-top: 64px;
  padding: 28px 0 48px;
  border-top: 1px solid var(--fd-border);
  color: var(--fd-text-faint);
  font-size: 13px;
}
.site-foot a { color: var(--fd-text-dim); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero { padding: 44px 0 8px; }

.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 680;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fd-text-dim);
}

.lede {
  margin: 10px 0 0;
  color: var(--fd-text-dim);
  font-size: 17px;
}

.product-hero { padding-bottom: 4px; }

/* --------------------------------------------------------------------------
   Product index
   -------------------------------------------------------------------------- */

.grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.card {
  display: block;
  text-decoration: none;
  background: var(--fd-panel);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius);
  padding: 18px;
  /* The category colour reads as a spine on the left edge rather than a
     full tint, so a page of eight products doesn't turn into a paintbox. */
  border-left: 3px solid var(--cat-color, var(--fd-accent));
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.card:hover {
  border-color: var(--fd-border-strong);
  border-left-color: var(--cat-color, var(--fd-accent));
  transform: translateY(-1px);
}

.cat-aircraft { --cat-color: var(--cat-aircraft); }
.cat-plugin   { --cat-color: var(--cat-plugin); }
.cat-library  { --cat-color: var(--cat-library); }
.cat-tool     { --cat-color: var(--cat-tool); }

.card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cat-color, var(--fd-text-dim));
}

.card-title {
  margin: 6px 0 8px;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 640;
}

.card-meta { margin: 0 0 14px; font-size: 14px; }

.card-go {
  font-size: 13px;
  font-weight: 600;
  color: var(--fd-text-dim);
}
.card:hover .card-go { color: var(--fd-accent); }

.ver-pill {
  font-family: var(--fd-font-mono);
  font-size: 13px;
  background: var(--fd-accent-soft);
  padding: 1px 7px;
  border-radius: 6px;
}

.muted { color: var(--fd-text-dim); }

/* --------------------------------------------------------------------------
   Panels
   -------------------------------------------------------------------------- */

.panel { margin-top: 40px; }

.panel > h2 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 660;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fd-text-dim);
}

.empty {
  margin: 0;
  padding: 20px;
  background: var(--fd-panel-alt);
  border: 1px dashed var(--fd-border-strong);
  border-radius: var(--radius);
  color: var(--fd-text-dim);
}

/* A quiet aside inside a panel — same voice as .empty, no dashed box. */
.empty-quiet {
  margin: 0;
  color: var(--fd-text-dim);
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
  background: var(--fd-panel);
  border: 1px solid var(--fd-border-strong);
}
.btn:hover { background: var(--fd-hover); }

.more { margin: 20px 0 0; }

/* --------------------------------------------------------------------------
   Current version

   A statement of fact, not a call to action. This site publishes no
   builds, so there is deliberately nothing clickable here.
   -------------------------------------------------------------------------- */

.current {
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--fd-panel);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.current-ver {
  font-family: var(--fd-font-mono);
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Manuals
   -------------------------------------------------------------------------- */

.manual-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--fd-panel);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.manual-list li + li { border-top: 1px solid var(--fd-border); }

.manual {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  text-decoration: none;
}
.manual:hover { background: var(--fd-hover); }

.manual-ext {
  flex: none;
  min-width: 46px;
  text-align: center;
  font-family: var(--fd-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--fd-info-soft);
  color: var(--fd-info);
}

.manual-title { flex: 1 1 auto; font-weight: 520; }

.manual-size {
  flex: none;
  font-size: 13px;
  color: var(--fd-text-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Uploaded documents

   The changelog you upload, framed in the site chrome. Its content is a
   <pre> block, so the job here is to keep the monospace and the exact
   line breaks while making it read as part of the page rather than as a
   raw file dumped on screen.
   -------------------------------------------------------------------------- */

/* Wider than the 860px prose measure, narrower than the PDF viewer.
   These are monospace lines that often run long, and a wider column
   means fewer wrapped lines — but text still needs a measure, so this
   stops well short of full width. */
.wrap-doc { max-width: 1100px; }

.doc {
  margin-top: 12px;
  background: var(--fd-panel);
  border: 1px solid var(--fd-border);
  border-radius: var(--radius);
  padding: 24px 26px;
  overflow-x: auto;
}

.doc pre {
  margin: 0;
  font-family: var(--fd-font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  /* pre-wrap, not pre: a changelog line can run long, and horizontal
     scrolling to read a bug fix is miserable on a phone. Long words
     (URLs, build identifiers) still break rather than force the
     container wide. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* A hanging indent on wrapped lines. Every entry in a changelog starts
     "- ", so when a long fix wraps, the continuation lining up under the
     text rather than under the dash keeps the list scannable — you can
     still see at a glance where one item ends and the next begins. */
  padding-left: 2ch;
  text-indent: -2ch;
  color: var(--fd-text);
}

/* The PDF viewer page gets a wider column than the 860px reading
   measure. A manual is a document to look at, not prose to read, and an
   860px frame wastes most of a desktop screen. */
.wrap-wide { max-width: 1500px; }

/* One compact row above the frame instead of a hero block. */
.doc-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 22px 0 4px;
}

.doc-bar h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 660;
}

.doc-bar .eyebrow { margin: 0 0 2px; display: block; }

.doc-bar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.doc-note { margin: 8px 0 12px; font-size: 12.5px; }

/* The embedded PDF. Fills what's left of the viewport after the sticky
   header, the title row and the footer — the document is the page, so
   it gets the space. min-height keeps it usable in a short window. */
.pdf-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 230px);
  min-height: 560px;
  border: 1px solid var(--fd-border);
  border-radius: var(--radius);
  background: var(--fd-panel);
}

/* Nothing below the frame on this page, so don't push a big footer gap
   under it. */
.wrap-wide + .site-foot,
main.wrap-wide ~ .site-foot { margin-top: 28px; }

@media (max-width: 560px) {
  .doc { padding: 16px 14px; }
  .doc pre { font-size: 12.5px; }
  .doc-bar { padding-top: 16px; }
  .doc-bar h1 { font-size: 19px; }
  .doc-bar-actions { width: 100%; justify-content: space-between; }
  /* On a phone the frame is a preview at best — several mobile browsers
     refuse to render an embedded PDF at all. Keep it short so the
     "open directly" link stays reachable without a long scroll. */
  .pdf-frame { height: 65vh; min-height: 0; }
}

/* --------------------------------------------------------------------------
   Channel chips

   Used on the index card and the "current version" line. There is no
   changelog styling in this file: a product's changelog is an HTML
   document you upload, served verbatim with its own markup (or none).
   -------------------------------------------------------------------------- */

.chip {
  font-size: 11px;
  font-weight: 660;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fd-hover);
  color: var(--fd-text-dim);
}
.chip-release { background: var(--fd-success-soft); color: var(--fd-success); }
.chip-beta    { background: var(--fd-info-soft);    color: var(--fd-info); }
.chip-alpha   { background: var(--fd-warn-soft);    color: #8a7c14; }

@media (prefers-color-scheme: dark) {
  .chip-alpha { color: var(--fd-warn); }
}

/* --------------------------------------------------------------------------
   Narrow screens
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  .hero { padding-top: 32px; }
  .brand-name { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   Print — a changelog is something support staff actually print.
   -------------------------------------------------------------------------- */

@media print {
  .site-head, .site-foot, .skip, .more { display: none; }
  body { background: #fff; color: #000; }
}
