/*
  Shared chrome for the app screens rebuilt on this site.

  Each screen is a faithful HTML rebuild of a SwiftUI view in benjisg/rework,
  drawn from its source, Theme values, and Gallery preview data. The window
  frame here is macOS's; everything inside a .mac-window is the app's.

  Screens are laid out at 1pt = 1px. A wrapper scales them down to fit with
  `--screen-scale`, so proportions and type stay exactly as the app draws them.
*/

.screen {
  /* Every value inside a screen is in app points. */
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-align: left;
  font-feature-settings: normal;
  letter-spacing: normal;
}
.screen *,
.screen *::before,
.screen *::after {
  box-sizing: border-box;
}

/* Scales a fixed-size screen to the width available, keeping its box. */
.screen-fit {
  --screen-w: 1180;
  --screen-h: 760;
  --screen-scale: 1;
  position: relative;
  width: calc(var(--screen-w) * var(--screen-scale) * 1px);
  height: calc(var(--screen-h) * var(--screen-scale) * 1px);
}
.screen-fit > .screen {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(var(--screen-w) * 1px);
  height: calc(var(--screen-h) * 1px);
  transform: scale(var(--screen-scale));
  transform-origin: top left;
}

/* ---------- macOS window ---------- */

.mac-window {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--content-fill);
  box-shadow:
    0 0 0 0.5px rgba(0, 0, 0, 0.22),
    0 22px 70px rgba(20, 30, 40, 0.22),
    0 8px 20px rgba(20, 30, 40, 0.1);
}
:root[data-theme="dark"] .mac-window {
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.14),
    0 22px 70px rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mac-window {
    box-shadow:
      0 0 0 0.5px rgba(255, 255, 255, 0.14),
      0 22px 70px rgba(0, 0, 0, 0.55);
  }
}

.traffic-lights {
  position: absolute;
  top: 18px;
  left: 20px;
  display: flex;
  gap: 8px;
  z-index: 5;
}
.traffic-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12);
}
.traffic-lights i:nth-child(2) { background: #febc2e; }
.traffic-lights i:nth-child(3) { background: #28c840; }

/* ---------- History window shell ---------- */
/* HomeView.swift: a 200pt word-only rail left of the content column. */

.history {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
  background: var(--content-fill);
}
.history-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px; /* Theme.History.navigationGap */
  padding: 123px 5px 20px; /* navigationTopInset (layout-constants.md); navigationHorizontalInset */
}
.history-rail a,
.history-rail span {
  /* Theme.Typography.historyNavigation: 18/23 medium, mono, tracking 0.8 */
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 23px;
  font-weight: 500;
  letter-spacing: 0.8px;
  color: var(--muted-ink);
  text-decoration: none;
}
.history-rail .is-selected {
  color: var(--selection);
}
.history-rail .history-rail__settings {
  position: absolute;
  right: 5px;
  bottom: 20px;
}
.history-content {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0 20px 0 20px; /* Theme.History.pageInset */
}

/* ---------- Shared bits ---------- */

.screen .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.screen .serif { font-family: var(--font-serif); }
.screen .muted { color: var(--muted-ink); }
.screen .lucide {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.125em;
}
