@font-face {
  font-family: "Times New Literature";
  src: url("./assets/TimesNewLiterature-Medium.otf") format("opentype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Times New Literature", Georgia, serif;
  font-weight: 500;
  background: #000;
  color: #0036d5;
}

* { box-sizing: border-box; }

::selection { background: #008000; color: #fff; }

html, body { margin: 0; min-width: 0; min-height: 100%; }

body {
  min-height: 100svh;
  background: #000;
  cursor: url("./assets/green-pointer.svg") 2 2, auto;
}

button, a { cursor: url("./assets/green-pointer.svg") 2 2, pointer; }

.home {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: min(24px, 5vw, 5svh);
}

.links {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.36;
}

.links a {
  display: block;
  color: #0036d5;
  font-size: min(clamp(26px, 3.2vw, 40px), calc(90vw / 9.1));
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration-line: underline;
  text-decoration-color: #0036d5;
  text-decoration-thickness: .055em;
  text-underline-offset: .07em;
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "liga" 1;
}

.ft-ligature { letter-spacing: 0; }
body.has-windows .links a[aria-expanded="true"] { text-underline-offset: .13em; }
.links a:visited { color: #0036d5; }
.links a:hover { text-underline-offset: .11em; }

:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }

.browser-window {
  position: fixed;
  inset: auto;
  margin: 0;
  width: min(920px, 60vw);
  max-width: none;
  height: min(720px, 76dvh);
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 1px solid #555;
  border-radius: 0;
  background: #000;
  color: #e8e8e8;
  box-shadow: 0 10px 30px #0003;
  overscroll-behavior: contain;
}

.browser-window[open] { display: flex; flex-direction: column; }
.browser-window[data-prepared]:not([open]) {
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  z-index: -1 !important;
}
.browser-window::backdrop { background: #0007; }
.browser-window.is-active { border-color: #b0b0b0; }
.browser-window.is-dragging .site-frame,
.browser-window.is-resizing .site-frame { pointer-events: none; }
.browser-window.is-dragging,
.browser-window.is-resizing { user-select: none; }

.resize-handle {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 24px;
  touch-action: none;
}
.resize-nw { top: -12px; left: -12px; cursor: nwse-resize; }
.resize-ne { top: -12px; right: -12px; cursor: nesw-resize; }
.resize-sw { bottom: -12px; left: -12px; cursor: nesw-resize; }
.resize-se { bottom: -12px; right: -12px; cursor: nwse-resize; }
.resize-se::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  background: repeating-linear-gradient(135deg, transparent 0 2px, #888 2px 3px, transparent 3px 4px);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  min-height: 42px;
  padding-inline: 4px;
  background: #fff;
  color: #111;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.is-dragging .window-bar { cursor: grabbing; }
.window-bar:focus-visible { outline: 2px solid #0036d5; outline-offset: -3px; }

.window-control {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  text-decoration: none;
}

.window-control:hover { background: #f0f0f0; color: #000; }
.window-control:focus-visible { outline-color: #0036d5; outline-offset: -5px; }

.window-content {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

/* An inactive window's first click activates it before interacting with its site. */
.browser-window[open]:not(.is-active) .window-content::after {
  content: "";
  position: absolute;
  inset: 0;
}

.site-frame { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.publisher-frame { background: #fff; }

.loading-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  background: #000;
  color: #8e8e8e;
  text-align: center;
  font-size: 18px;
  pointer-events: none;
}

.loading-state[hidden] { display: none; }
.loading-state.is-slow { background: #000e; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .links a { font-size: min(8.2vw, 34px); }
  .browser-window { width: calc(100vw - 24px); height: calc(100dvh - 48px); }
  .resize-handle { display: none; }
  .window-bar { min-height: 48px; padding-inline: 2px; cursor: default; }
  .window-control { width: 44px; height: 44px; }
}

@media (max-height: 500px) and (min-width: 641px) {
  .browser-window { height: calc(100dvh - 32px); }
}
