/* The landing game at /start: a terminal-style card over a blurred calendar,
   laid out like the app's welcome modal (components/OverlayPanel) so the two
   read as one place. */
:root {
  /* Compass's default theme, light-beach (src/index.css). */
  --bg: #f3eee2;
  --panel: #e7e0cf;
  --fg: #403a2f;
  --dim: #5e5847;
  --line: #a89c81;
  --border: hsl(40 20% 30% / 15%);
  --overlay: hsl(40 25% 25% / 6%);
  --hot: #141412;
  --accent: #2b2a27;
  --on-accent: #f6f3ea;
  --font: "VT323", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-sans: "Rubik", ui-sans-serif, system-ui, sans-serif;
  --text: 21px;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.15;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Backdrop: a quiet sketch of the week view. It sits under an 85% veil
   and a blur, like the real calendar does behind the app's modals, so it
   only needs the right shapes. ---- */
.calendar {
  position: fixed;
  inset: 0;
  display: flex;
  font-family: var(--font-sans);
  color: var(--dim);
}

.cal-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 0 0 32px;
}

.cal-title {
  height: 48px;
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  color: var(--fg);
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  height: 42px;
  margin-left: 50px;
  align-items: end;
  text-align: center;
  font-size: 1.1rem;
}

.cal-grid {
  position: relative;
  flex: 1;
  margin: 29px 0 0 50px;
  border-top: 2px solid var(--border);
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(100% / 13 - 1px),
      var(--border) calc(100% / 13)
    ),
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(100% / 7 - 1px),
      var(--border) calc(100% / 7)
    );
}

.cal-event {
  position: absolute;
  width: calc(100% / 7 - 8px);
  border-radius: 4px;
}

.cal-side {
  width: 345px;
  padding: 24px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cal-side div {
  border-radius: 8px;
  background: var(--overlay);
}

@media (max-width: 1279px) {
  .cal-side {
    display: none;
  }
}

.veil {
  position: fixed;
  inset: 0;
  background: rgb(243 238 226 / 0.85);
  backdrop-filter: blur(4px);
}

/* ---- The card ---- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 480px;
  max-width: 92vw;
  /* A fixed height: the text types into a steady frame, and the card never
     resizes between screens. Long screens scroll inside it. */
  height: min(600px, 92dvh);
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    0 20px 25px -5px rgb(0 0 0 / 0.1),
    0 10px 10px -5px rgb(0 0 0 / 0.04);
}

/* Faint scanlines, on the card only. Never intercepts input. */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgb(64 58 47 / 0.04) 3px
  );
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 24px 0;
}

.card-top nav {
  display: flex;
  gap: 8px;
}

/* The welcome modal's "Log in" corner, drawn as terminal keys. */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  font-size: 19px;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill[hidden] {
  display: none;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 2px;
}

.screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 24px 20px;
}

.dim {
  color: var(--dim);
}

.pad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 24px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 17px;
}

.pad[hidden] {
  display: none;
}

/* Swap keyboard hints for touch hints on phones and tablets. */
.touch-only {
  display: none;
}

@media (hover: none) {
  .touch-only {
    display: initial;
  }

  .keys-only {
    display: none;
  }
}

/* A keycap chip, like the app's c-keycap (src/index.css), so key names stand
   out from the prose around them. */
kbd {
  display: inline-block;
  font: inherit;
  line-height: 1;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.key {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  min-height: 42px;
  cursor: pointer;
  text-transform: uppercase;
  touch-action: manipulation;
}

.key.selected,
.key:active {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

/* Hover only where there is a real pointer: on touch it sticks after a tap. */
@media (hover: hover) {
  .key:hover {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }

  .pill:hover {
    color: var(--on-accent);
    background: var(--accent);
    border-color: var(--accent);
  }
}

/* The selection bar is the keyboard cursor. Touch devices have none, and
   there it would make the first choice look like the recommended one. */
@media (hover: none) {
  .key.selected:not(:active) {
    color: var(--fg);
    background: transparent;
    border-color: var(--line);
  }

  .pill {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  :root {
    --text: 23px;
  }

  .card-top {
    padding: 20px 20px 0;
  }

  .screen {
    padding: 14px 20px 18px;
  }

  .pad {
    padding-inline: 20px;
  }
}
