/* Hallmark · genre: playful · page: Titik OS (Services, Packages, Works) · theme: custom (site tokens) · tone: playful-bold · anchor hue: 265
 * Loaded after desk.css, whose windows, icons and taskbar it reuses; this file makes the
 * desktop fill the screen and adds the Explorer, Quick look, Compare.sheet, the search and
 * the tooltips. The header sits over the wallpaper (header theme: dark), so everything
 * starts below --os-top.
 */

.os {
  --os-top: calc(var(--header-h) + var(--promo-h, 2.5rem) + var(--ruler-offset, 0px) + var(--space-sm));
  position: relative;
  height: calc(100dvh - var(--ruler-offset, 0px)); /* the taskbar ends above the bottom ruler */
  min-height: 38rem;
  /* With the design rulers on (desktop + mouse), the screen sits between the side rulers, so
   * no window, icon or clock can slide under them. */
  padding-inline: var(--ruler-offset, 0px);
  background-color: var(--color-ink);
}

html:not(.js) .os {
  display: none;
}

.os .os__screen {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  background-color: var(--color-ink);
}

/* Wallpaper: blue pools on ink, the dot grid, and the mark, very faint. */
.os__wallpaper {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: clip;
  background:
    radial-gradient(60% 70% at 85% 25%, color-mix(in oklch, var(--color-blue) 55%, transparent), transparent 70%),
    radial-gradient(50% 60% at 10% 95%, color-mix(in oklch, var(--color-blue-night) 90%, transparent), transparent 70%),
    var(--color-ink);
}

.os__grid {
  --grid-dot: color-mix(in oklch, var(--color-paper) 12%, transparent);
  color: var(--color-lime);
}

.os__watermark {
  position: absolute;
  right: -4%;
  bottom: -8%;
  width: min(48vw, 40rem);
  color: var(--color-paper);
  opacity: 0.05;
}

.os__watermark svg {
  width: 100%;
  height: auto;
}

/* The highest a window may go (desk.js reads its top). */
.os__safe {
  position: absolute;
  inset-block-start: var(--os-top);
  inset-inline-start: 0;
  width: 0;
  height: 0;
}

/* Desktop icons: a column on the left, wrapping into more columns on short screens. */
.os .desk__icons {
  inset-block: var(--os-top) calc(var(--desk-bar-h) + var(--space-md));
  inset-inline-start: calc(var(--gutter) - var(--space-xs));
  grid-template-rows: repeat(auto-fill, minmax(5.75rem, max-content));
  grid-auto-columns: 6rem;
  grid-auto-flow: column;
  gap: var(--space-xs) var(--space-sm);
}

/* The Trash, in the bottom-right corner. */
.os__corner {
  position: absolute;
  inset-block-end: calc(var(--desk-bar-h) + var(--space-md));
  inset-inline-end: var(--gutter);
  z-index: 1;
}

@media (max-width: 39.99rem) {
  .os .desk__icons {
    inset-inline: var(--space-sm);
    grid-template-rows: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
  }

  .os .desk__icons .desk-icon {
    width: 100%;
  }

  .os__corner {
    inset-inline-end: var(--space-sm);
  }
}

/* Windows stay below the header, and so does a maximised one. */
.os .win {
  max-height: calc(100% - var(--os-top) - var(--desk-bar-h) - var(--space-md));
}

.os .win.is-max {
  inset-block-start: var(--os-top);
  max-height: none;
}

.os .win__body {
  overscroll-behavior: contain;
}

/* Tooltip (os.js): the line under each icon and file. */
.os-tip {
  position: absolute;
  z-index: 500;
  max-width: 16rem;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  background-color: var(--color-paper);
  color: var(--color-ink);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 0.75rem 1.5rem -0.75rem var(--color-shadow), 0 0 0 1px color-mix(in oklch, var(--color-ink) 10%, transparent);
  pointer-events: none;
  opacity: 0;
  translate: -50% calc(-100% + 0.25rem);
  transition: opacity var(--dur-short) var(--ease-out), translate var(--dur-short) var(--ease-out);
}

.os-tip.is-shown {
  opacity: 1;
  translate: -50% -100%;
}

.os-tip::after {
  content: "";
  position: absolute;
  inset-block-start: 100%;
  left: calc(50% + var(--arrow, 0px));
  border: 0.35rem solid transparent;
  border-block-start-color: var(--color-paper);
  translate: -50% 0;
}

/* Near the top of the screen the tip hangs below its icon instead. */
.os-tip.is-below {
  translate: -50% -0.25rem;
}

.os-tip.is-below.is-shown {
  translate: -50% 0;
}

.os-tip.is-below::after {
  inset-block: auto 100%;
  border-block-start-color: transparent;
  border-block-end-color: var(--color-paper);
}

/* Glyphs ---------------------------------------------------------------------------- */

/* Folders: the three dots inside. Services blue, Packages lime. */
.os-glyph--services,
.os-glyph--packages {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  padding-block-start: 0.35rem;
}

.os-glyph--services i,
.os-glyph--packages i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background-color: var(--color-paper);
}

.os-glyph--packages,
.os-glyph--packages::before {
  background-color: var(--color-lime) !important;
}

.os-glyph--packages {
  box-shadow: inset 0 -0.6rem 0 color-mix(in oklch, var(--color-ink) 18%, transparent) !important;
}

.os-glyph--packages i {
  background-color: var(--color-ink);
}

/* Spreadsheet: a page with a grid and a lime header row. */
.os-glyph--sheet {
  width: 2.6rem;
  height: 3.1rem;
  border-radius: 0.3rem;
  background:
    linear-gradient(var(--color-lime), var(--color-lime)) top / 100% 0.7rem no-repeat,
    repeating-linear-gradient(to right, transparent 0 0.6rem, var(--color-rule) 0.6rem calc(0.6rem + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 0.5rem, var(--color-rule) 0.5rem calc(0.5rem + 1px)),
    var(--color-paper);
  box-shadow: 0 0.25rem 0.75rem -0.25rem var(--color-shadow);
}

/* Browser: a window with the three dots in its bar. */
.os-glyph--browser {
  width: 3.25rem;
  height: 2.6rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(var(--color-ink-3), var(--color-ink-3)) top / 100% 0.65rem no-repeat,
    var(--color-paper);
  box-shadow: 0 0.25rem 0.75rem -0.25rem var(--color-shadow);
}

.os-glyph--browser i {
  position: absolute;
  inset-block-start: 0.22rem;
  inset-inline-start: 0.3rem;
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background-color: var(--color-blue);
  box-shadow: 0.32rem 0 0 var(--color-blue-soft), 0.64rem 0 0 var(--color-lime);
}

/* Trash: a bin with a lid. */
.os-glyph--trash {
  width: 2.4rem;
  height: 2.6rem;
  margin-block-start: 0.4rem;
  border-radius: 0.2rem 0.2rem 0.55rem 0.55rem;
  background:
    repeating-linear-gradient(to right, transparent 0 0.45rem, color-mix(in oklch, var(--color-ink) 18%, transparent) 0.45rem calc(0.45rem + 2px)) center / 70% 70% no-repeat,
    color-mix(in oklch, var(--color-paper) 85%, transparent);
}

.os-glyph--trash::before {
  content: "";
  position: absolute;
  inset-block-start: -0.45rem;
  inset-inline: -0.25rem;
  height: 0.3rem;
  border-radius: 0.2rem;
  background-color: color-mix(in oklch, var(--color-paper) 85%, transparent);
}

/* Explorer --------------------------------------------------------------------------- */

.os-explorer {
  --win-w: 46rem;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(32rem, calc(100% - var(--os-top) - var(--desk-bar-h) - var(--space-md)));
}

.os-explorer__body {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  min-height: 0;
}

.os-side {
  display: grid;
  align-content: start;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-xs);
  border-inline-end: var(--rule-hair) solid var(--color-rule);
  background-color: var(--color-paper-2);
}

.os-side__title {
  padding-inline: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.os-side__list {
  display: grid;
  gap: 2px;
}

.os-side__link {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 2.25rem;
  padding: 0 var(--space-xs);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-weight: 650;
  text-align: start;
  text-decoration: none;
}

.os-side__link[aria-current="true"] {
  background-color: var(--color-ink);
  color: var(--color-paper);
}

@media (hover: hover) {
  .os-side__link:not([aria-current="true"]):hover {
    background-color: var(--color-rule);
  }
}

.os-side__icon {
  flex: none;
  width: 1rem;
  height: 0.8rem;
  border-radius: 0.15rem 0.25rem 0.25rem 0.25rem;
  background-color: var(--color-blue);
}

.os-side__icon--packages {
  background-color: var(--color-lime);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--color-ink) 25%, transparent);
}

.os-side__icon--sheet {
  width: 0.8rem;
  height: 1rem;
  background: linear-gradient(var(--color-lime), var(--color-lime)) top / 100% 0.3rem no-repeat, var(--color-paper);
  box-shadow: inset 0 0 0 1px var(--color-rule);
}

.os-side__icon--browser {
  background: linear-gradient(var(--color-ink-3), var(--color-ink-3)) top / 100% 0.25rem no-repeat, var(--color-paper);
  box-shadow: inset 0 0 0 1px var(--color-rule);
}

.os-side__count {
  margin-inline-start: auto;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.os-side__link[aria-current="true"] .os-side__count {
  color: var(--color-lime);
}

.os-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.os-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.os-path {
  border: 0;
}

.os-path b {
  color: var(--color-ink);
}

.os-view {
  display: flex;
  gap: 2px;
  padding-inline-end: var(--space-xs);
}

.os-view__btn {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-muted);
}

.os-view__btn svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.os-view__btn[aria-pressed="true"] {
  background-color: var(--color-paper-2);
  color: var(--color-ink);
}

.os-folder {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.os-folder[hidden] {
  display: none;
}

.os-folder.is-entering {
  animation: folder-in var(--dur-long) var(--ease-out);
}

@keyframes folder-in {
  from {
    opacity: 0;
    translate: 0.75rem 0;
  }
}

.os-folder__head {
  display: none;
}

.os-files {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: var(--space-sm);
  padding: var(--space-md);
}

/* A file: its own three dots as the icon. */
.os-file {
  width: 8.5rem;
  color: var(--color-ink);
  --color-focus: var(--color-blue);
}

.os-file__glyph {
  position: relative;
  display: grid;
  place-items: center;
  padding-block: var(--space-2xs);
}

.os-file__dots {
  width: 3.75rem;
  border-radius: 0.9rem;
  box-shadow: 0 0.4rem 0.8rem -0.5rem var(--color-shadow);
  transition: rotate var(--dur-long) var(--ease-out);
}

.os-file__badge {
  position: absolute;
  inset-block-start: -0.2rem;
  inset-inline-end: -0.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-blue);
  color: var(--color-paper);
  font-size: 0.6rem;
  font-weight: 800;
  white-space: nowrap;
}

.os-file .desk-icon__label {
  text-shadow: none;
}

.os-file__kind,
.os-file__meta {
  display: none;
}

@media (hover: hover) {
  .os-file:hover {
    border-color: var(--color-rule);
    background-color: var(--color-paper-2);
  }

  .os-file:hover .odots {
    --x1: 25%; --y1: 50%;
    --x2: 50%; --y2: 50%;
    --x3: 75%; --y3: 50%;
  }
}

.os-file.is-selected {
  border-color: color-mix(in oklch, var(--color-blue) 45%, transparent);
  background-color: color-mix(in oklch, var(--color-blue) 10%, transparent);
}

.os-file.is-selected .desk-icon__label {
  background-color: var(--color-blue);
  color: var(--color-paper);
}

/* List view: rows with kind and timeline. */
.os-folder.is-list .os-folder__head {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-block-end: var(--rule-hair) solid var(--color-rule);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
}

.os-folder.is-list .os-folder__head span:first-child {
  grid-column: 2;
}

.os-folder.is-list .os-files {
  display: grid;
  gap: 2px;
  padding: var(--space-xs);
}

.os-folder.is-list .os-file {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
  align-items: center;
  justify-items: start;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-2xs) var(--space-xs);
  text-align: start;
}

.os-folder.is-list .os-file__dots {
  width: 2rem;
  border-radius: 0.5rem;
}

.os-folder.is-list .os-file__badge {
  display: none;
}

.os-folder.is-list .os-file__kind,
.os-folder.is-list .os-file__meta {
  display: block;
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.os-folder.is-list .desk-icon__label {
  font-size: var(--text-sm);
}

/* Phones: the sidebar becomes a row of tabs over the files. */
@media (max-width: 39.99rem) {
  .os-explorer__body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .os-side {
    padding: var(--space-xs);
    border-inline-end: 0;
    border-block-end: var(--rule-hair) solid var(--color-rule);
  }

  .os-side__title {
    display: none;
  }

  .os-side__list {
    display: flex;
    gap: var(--space-2xs);
    overflow-x: auto;
  }

  .os-side__link {
    width: auto;
    white-space: nowrap;
  }

  .os-side__count {
    margin-inline-start: var(--space-2xs);
  }

  .os-side:has(.os-side__cta) {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .os-side__cta {
    min-height: 2.25rem;
    margin: 0;
    padding-inline: var(--space-md);
  }

  .os-file {
    width: calc(50% - var(--space-sm) / 2);
  }
}

/* Quick look ------------------------------------------------------------------------- */

.os-info {
  --win-w: 27rem;
}

.os-info__ql {
  color: var(--color-muted);
  font-weight: 600;
}

.os-info__body {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg);
}

.os-info__hero {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.os-info__dots {
  width: 4.5rem;
}

.os-info__kicker {
  color: var(--color-blue-deep);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.os-info__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.os-info__lede {
  color: var(--color-muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.os-info__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: var(--rule-hair) solid var(--color-rule);
}

.os-info__facts div {
  display: grid;
  align-content: start;
  gap: 0.1rem;
  padding: var(--space-xs) var(--space-xs) var(--space-xs) 0;
}

.os-info__facts div + div {
  padding-inline-start: var(--space-sm);
  border-inline-start: var(--rule-hair) solid var(--color-rule);
}

.os-info__facts dt {
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.os-info__facts dd {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 750;
}

.os-info__sub {
  margin-block-end: calc(-1 * var(--space-xs));
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.os-info__list {
  display: grid;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  line-height: 1.4;
}

.os-info__list li {
  display: flex;
  gap: var(--space-xs);
}

.os-info__list .icon {
  width: 1.1rem;
  height: 1.1rem;
  margin-block-start: 0.05rem;
  color: var(--color-blue);
  stroke-width: 2.5;
}

.os-info__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Compare.sheet ---------------------------------------------------------------------- */

.os-sheet {
  --win-w: 50rem;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.os-sheet__fx {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.25rem;
  padding: 0 var(--space-sm);
  border-block-end: var(--rule-hair) solid var(--color-rule);
  font-size: var(--text-sm);
}

.os-sheet__ref {
  min-width: 3.5rem;
  padding: 0.1rem var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: 0.3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.os-sheet__fn {
  color: var(--color-muted);
  font-style: italic;
  font-weight: 700;
}

.os-sheet__val {
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.os-sheet__table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.os-sheet__table td,
.os-sheet__table th {
  padding: 0.4rem var(--space-xs);
  border: var(--rule-hair) solid var(--color-rule);
  text-align: start;
  white-space: nowrap;
}

.os-sheet__letters td,
.os-sheet__no {
  background-color: var(--color-paper-2);
  color: var(--color-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-align: center !important;
}

.os-sheet__no {
  width: 2.25rem;
}

.os-sheet__cell {
  cursor: cell;
}

.os-sheet__cell--head {
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-weight: 750;
}

.os-sheet__cell--head a {
  color: var(--color-lime);
}

.os-sheet__cell--label {
  font-weight: 650;
}

.os-sheet__cell.is-yes {
  color: var(--color-blue);
  font-weight: 800;
  text-align: center;
}

.os-sheet__cell.is-no {
  color: var(--color-rule);
  text-align: center;
}

.os-sheet__cell.is-picked {
  outline: 2px solid var(--color-blue);
  outline-offset: -2px;
  background-color: color-mix(in oklch, var(--color-blue) 8%, var(--color-paper));
}

.os-sheet__cell--head.is-picked {
  background-color: var(--color-blue);
}

/* Trash ---------------------------------------------------------------------------- */

.os-trash__file {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
}

.os-trash__zip {
  flex: none;
  width: 1.75rem;
  height: 2.1rem;
  border-radius: 0.2rem;
  background:
    repeating-linear-gradient(to bottom, var(--color-ink) 0 0.2rem, transparent 0.2rem 0.4rem) center 0.2rem / 0.3rem 1rem no-repeat,
    var(--color-lime);
}

/* Taskbar search --------------------------------------------------------------------- */

.os-search {
  position: relative;
  flex: 0 1 15rem;
  min-width: 0;
}

.os-search__box {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  height: 2rem;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-pill);
  background-color: color-mix(in oklch, var(--color-paper) 12%, transparent);
}

.os-search__box:focus-within {
  background-color: color-mix(in oklch, var(--color-paper) 22%, transparent);
  outline: 2px solid var(--color-lime);
}

.os-search__box svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.75;
}

.os-search__box input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--color-paper);
  font-size: var(--text-sm);
  outline: none;
}

.os-search__box input::placeholder {
  color: color-mix(in oklch, var(--color-paper) 60%, transparent);
}

.os-search__results {
  position: absolute;
  inset-block-end: calc(100% + var(--space-xs));
  inset-inline-start: 0;
  width: min(22rem, calc(100vw - 2rem));
  max-height: 22rem;
  overflow-y: auto;
  padding: var(--space-2xs);
  border-radius: var(--radius-md);
  background-color: var(--color-paper);
  color: var(--color-ink);
  box-shadow: 0 1.5rem 3rem -1rem var(--color-shadow);
}

.os-search__results[hidden] {
  display: none;
}

.os-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: 0.6rem;
  font-size: var(--text-sm);
  font-weight: 650;
  cursor: pointer;
}

.os-result[hidden] {
  display: none;
}

.os-result__dots {
  width: 1.75rem;
  border-radius: 0.45rem;
}

.os-result__kind {
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.os-result[aria-selected="true"],
.os-result:hover {
  background-color: var(--color-paper-2);
}

.os-result[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--color-blue);
}

.os-result--none {
  grid-template-columns: 1fr;
  color: var(--color-muted);
  font-weight: 500;
  cursor: default;
}

@media (max-width: 39.99rem) {
  .os-search {
    flex-basis: 8rem;
  }

  .os .desk__tasks {
    display: none;
  }

  .os .desk__tray {
    margin-inline-start: auto;
  }
}

/* Titik OS inside the home page's monitor ([data-os] without .os): no site header over it. */
[data-os]:not(.os) {
  --os-top: 0px;
}

[data-os]:not(.os) .os__watermark {
  width: 42%;
}

/* The way out of the home desktop's Explorer: all works. */
.os-side__cta {
  justify-self: stretch;
  margin-block-start: auto;
  font-size: var(--text-sm);
}

.os-side:has(.os-side__cta) {
  grid-template-rows: auto auto 1fr;
}

.os-side:has(.os-side__cta) .os-side__cta {
  align-self: end;
}

/* Project files (home desktop): the site's first screen, with the client's favicon. */
.os-file--work {
  width: 9rem;
}

.os-file__thumb {
  display: block;
  width: 6.5rem;
  aspect-ratio: 16 / 10;
  overflow: clip;
  border-radius: 0.5rem;
  background-color: var(--color-paper-2);
  box-shadow: 0 0.5rem 1rem -0.6rem var(--color-shadow), 0 0 0 1px var(--color-rule);
  transition: translate var(--dur-long) var(--ease-out), box-shadow var(--dur-long) var(--ease-out);
}

.os-file__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.os-file__fav {
  position: absolute;
  inset-block-end: 0;
  inset-inline-end: 0.6rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.45rem;
  background-color: var(--color-paper);
  box-shadow: 0 0.25rem 0.5rem -0.2rem var(--color-shadow);
}

.os-file__fav .wb__fav {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0.25rem;
  object-fit: contain;
}

.os-file__fav .wb__fav.is-mono {
  filter: brightness(0);
}

.os-file__fav .wb__fav--letter {
  display: grid;
  place-items: center;
  background-color: var(--fav-bg);
  color: var(--fav-fg);
  font-size: 0.65rem;
  font-weight: 800;
}

@media (hover: hover) {
  .os-file--work:hover .os-file__thumb {
    translate: 0 -0.2rem;
    box-shadow: 0 0.9rem 1.4rem -0.8rem var(--color-shadow), 0 0 0 1px var(--color-blue);
  }
}

.os-folder.is-list .os-file__thumb {
  width: 2.5rem;
}

.os-folder.is-list .os-file__fav {
  display: none;
}

/* Quick look for a project: a 3D preview and what we built --------------------------------
 * The scene turns toward the pointer (os.js sets --tx / --ty on [data-tilt3d]); the site
 * scrolls inside its frames while you hover (on touch: slowly, by itself). */

@property --tx {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

@property --ty {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

/* Side by side when the window is wide enough (a container query on the window, so a
 * maximised or narrow window decides, not the screen). */
.os-work {
  --win-w: 54rem;
  container: os-work / inline-size;
}

.os-work__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@container os-work (min-width: 44rem) {
  .os-work__body {
    grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 1fr);
  }

  /* the stage runs the full height of the text beside it */
  .os-work .os-work__stage {
    aspect-ratio: auto;
    border-inline-end: var(--rule-hair) solid var(--color-rule);
  }
}

.os-work__stage {
  position: relative;
  overflow: clip;
  min-height: 19rem;
  aspect-ratio: 4 / 3.2;
  background:
    radial-gradient(circle, color-mix(in oklch, var(--color-ink) 12%, transparent) 0 1px, transparent 1.5px) 0 0 / 1.25rem 1.25rem,
    radial-gradient(80% 70% at 50% 35%, color-mix(in oklch, var(--color-blue) 22%, var(--color-paper)), var(--color-paper-2));
  perspective: 1100px;
}

/* the soft shadow the scene stands on */
.os-work__stage::after {
  content: "";
  position: absolute;
  inset-inline: 14%;
  inset-block-end: 7%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklch, var(--color-ink) 22%, transparent), transparent);
  pointer-events: none;
}

.os-work__scene {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(9deg + var(--ty))) rotateY(calc(-17deg + var(--tx)));
  transition: transform var(--dur-reveal) var(--ease-out);
}

.os-work__frame {
  position: absolute;
  overflow: clip;
  background-color: var(--color-paper);
  box-shadow: 0 2rem 3rem -1.5rem var(--color-shadow), 0 0 0 1px color-mix(in oklch, var(--color-ink) 12%, transparent);
}

.os-work__frame--desktop {
  left: 7%;
  top: 13%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 72%;
  aspect-ratio: 16 / 10.5;
  border-radius: 0.7rem;
  transform: translateZ(0);
}

.os-work__bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.6rem;
  background-color: var(--color-ink-2);
  color: var(--color-muted-dark);
  font-size: 0.6rem;
  font-weight: 600;
}

.os-work__bar i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background-color: var(--color-blue);
}

.os-work__bar i:nth-child(2) {
  background-color: var(--color-blue-soft);
}

.os-work__bar i:nth-child(3) {
  background-color: var(--color-lime);
}

.os-work__bar span {
  margin-inline-start: 0.4rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.os-work__scroll {
  overflow: clip;
  container-type: size;
  min-height: 0;
  height: 100%;
}

.os-work__scroll img {
  width: 100%;
  height: auto;
  transition: transform 1.2s var(--ease-in-out);
}

.os-work__frame--phone {
  right: 7%;
  bottom: 9%;
  width: 20%;
  aspect-ratio: 9 / 18.5;
  border: 0.3rem solid var(--color-ink);
  border-radius: 1rem;
  transform: translateZ(80px);
}

.os-work__frame--card {
  right: 4%;
  bottom: 10%;
  width: 38%;
  aspect-ratio: 16 / 10;
  border: 2px solid var(--color-paper);
  border-radius: 0.5rem;
  transform: translateZ(70px);
}

/* What we built, floating in front of the screen. */
.os-work__chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 55%;
  padding: 0.3rem 0.7rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-ink);
  color: var(--color-paper);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 0.75rem 1.5rem -0.75rem var(--color-shadow);
}

.os-work__chip b {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background-color: var(--color-lime);
  color: var(--color-ink);
  font-size: 0.65rem;
}

.os-work__chip--1 {
  left: 9%;
  top: 62%;
  transform: translateZ(120px);
}

.os-work__chip--2 {
  left: 34%;
  top: 9%;
  transform: translateZ(95px);
}

/* Small windows (phones): less depth, so the chips stay inside the stage. */
@container os-work (max-width: 30rem) {
  .os-work__chip {
    font-size: 0.62rem;
  }

  .os-work__chip--1 {
    left: 13%;
    transform: translateZ(55px);
  }

  .os-work__chip--2 {
    transform: translateZ(45px);
  }
}

.os-work__hint {
  position: absolute;
  inset-inline-start: var(--space-sm);
  inset-block-end: var(--space-xs);
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

@media (hover: none) {
  .os-work__hint {
    display: none;
  }
}

/* Hover: the sites scroll down inside their frames. */
@media (hover: hover) {
  .os-work__stage:hover .os-work__scroll img {
    transform: translateY(calc(-100% + 100cqh));
    transition: transform 9s linear;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .os-work__chip {
    animation: chip-float 3.2s var(--ease-in-out) infinite alternate;
  }

  .os-work__chip--2 {
    animation-delay: -1.6s;
  }

  /* Touch: no pointer to follow, so the scene sways and the sites scroll by themselves. */
  @media (hover: none) {
    .os-work.is-front .os-work__scene {
      animation: scene-sway 9s var(--ease-in-out) infinite alternate;
    }

    .os-work.is-front .os-work__scroll img {
      animation: preview-scroll 16s var(--ease-in-out) infinite alternate;
    }
  }
}

@keyframes chip-float {
  to {
    translate: 0 -0.35rem;
  }
}

@keyframes scene-sway {
  from {
    --tx: -9deg;
  }

  to {
    --tx: 9deg;
  }
}

@keyframes preview-scroll {
  0%,
  10% {
    transform: translateY(0);
  }

  90%,
  100% {
    transform: translateY(calc(-100% + 100cqh));
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-work__scene,
  .os-work__scroll img,
  .os-work__chip {
    animation: none !important;
    transition: none !important;
  }
}

.os-work__info {
  display: grid;
  align-content: start;
  gap: var(--space-sm);
  padding: var(--space-lg);
}

.os-work__list {
  display: grid;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: 600;
}

.os-work__list li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.os-work__no {
  display: grid;
  flex: none;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--color-blue);
  border-radius: 50%;
  color: var(--color-blue);
  font-size: 0.7rem;
  font-weight: 800;
}

.os-work__services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

.os-work__services a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 1.9rem;
  padding: 0 var(--space-sm);
  border: var(--rule-hair) solid var(--color-rule);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  text-decoration: none;
}

.os-work__services a::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background-color: var(--color-blue);
}

@media (hover: hover) {
  .os-work__services a:hover {
    border-color: var(--color-ink);
  }
}

/* Titik Browser: the Works app as a big window (works.css styles what's inside) ---------- */

.os-browser {
  --win-w: 76rem;
  grid-template-columns: minmax(0, 1fr); /* the tab strip scrolls; it never widens the window */
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100% - var(--os-top) - var(--desk-bar-h) - var(--space-lg));
}

.os .win.is-max.os-browser {
  height: auto;
}

/* clip, not hidden: a tab scrolled into view must never shift the whole window sideways. */
.os-browser {
  overflow: clip;
}

.os-browser .wb {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.os-browser .wb__body {
  height: auto;
  min-height: 0;
}

.os-result__fav {
  display: grid;
  place-items: center;
  width: 1.75rem;
}

/* Under the desktop -------------------------------------------------------------------
 * The page in plain words: a project's case study or the page's intro, then the directory
 * of links (inc/titik-os.php). os.js swaps it when another window or tab takes the address. */

.os-page {
  background-color: var(--color-paper);
}

.os-page.is-loading {
  opacity: 0.5;
  transition: opacity var(--dur-short) var(--ease-out);
}

.o-depth + .os-index,
.os-case + .os-index {
  padding-block-start: 0;
}

/* A project's case study. */
.os-case__head {
  display: grid;
  gap: var(--space-sm);
}

.os-case__kicker {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  color: var(--color-blue-deep);
  font-size: var(--text-md);
  font-weight: 750;
  line-height: 1.3;
}

.os-case__kicker::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-block-start: 0.4em; /* on the first line when the text wraps */
  border-radius: 50%;
  background-color: var(--color-blue);
}

.os-case__summary {
  max-width: 44rem;
}

.os-case__grid {
  display: grid;
  gap: var(--space-xl);
  align-items: start;
}

@media (min-width: 56rem) {
  .os-case__grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }
}

.os-case__shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 var(--rule-hair) var(--color-rule), 0 1.5rem 3rem -1.5rem var(--color-shadow);
  object-fit: cover;
  object-position: top;
}

.os-case__facts {
  border-block-start: var(--rule-hair) solid var(--color-ink);
}

.os-case__facts > div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.6fr) minmax(0, 1fr);
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xs);
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.os-case__facts dt {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 700;
}

.os-case__facts dd {
  font-weight: 650;
}

.os-case__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.os-case__story {
  max-width: 46rem;
}

.os-case__built {
  display: grid;
  gap: var(--space-lg);
}

.os-case__sub {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  line-height: var(--leading-tight);
  text-transform: uppercase;
}

.os-case__page {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.os-case__list {
  display: grid;
  gap: var(--space-md) var(--space-xl);
}

@media (min-width: 48rem) {
  .os-case__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.os-case__list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-sm);
  padding-block-start: var(--space-md);
  border-block-start: var(--rule-hair) solid var(--color-rule);
  line-height: var(--leading-body);
}

.os-case__list b {
  display: block;
  font-weight: 750;
}

.os-case__no {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid var(--color-blue);
  border-radius: 50%;
  color: var(--color-blue);
  font-size: var(--text-sm);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.os-case__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.os-index__shot {
  width: 4.5rem;
  height: auto;
  aspect-ratio: 16 / 10;
  border-radius: 0.5rem;
  object-fit: cover;
  object-position: top;
}

.os-index__grid {
  display: grid;
  gap: var(--space-2xl);
}

@media (min-width: 56rem) {
  .os-index__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.os-index__group {
  display: grid;
  align-content: start;
  gap: var(--space-md);
}

.os-index__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  text-transform: uppercase;
}

.os-index__list {
  border-block-start: var(--rule-hair) solid var(--color-ink);
}

.os-index__list li {
  border-block-end: var(--rule-hair) solid var(--color-rule);
}

.os-index__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-xs);
  text-decoration: none;
  transition: background-color var(--dur-short) var(--ease-out);
}

.os-index__dots {
  width: 3rem;
  border-radius: 0.7rem;
}

.os-index__text {
  display: grid;
  gap: 0.1rem;
}

.os-index__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  font-weight: 750;
}

.os-index__desc {
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.os-index__link .icon {
  color: var(--color-blue);
  transition: translate var(--dur-long) var(--ease-out);
}

@media (hover: hover) {
  .os-index__link:hover {
    background-color: var(--color-paper-2);
  }

  .os-index__link:hover .icon {
    translate: 0.3rem 0;
  }

  .os-index__link:hover .odots {
    --x1: 25%; --y1: 50%;
    --x2: 50%; --y2: 50%;
    --x3: 75%; --y3: 50%;
  }
}
