/* jirafaGraph website. Palette from the app's welcome and summary cards
   (src/view/main/welcome/welcomecard.cpp). Contrast (WCAG): navy on white
   8.6, navy on lavender 6.5, white on violet 5.5, navy on gold 4.5; blue
   (3.7 on white) is used only for large text and decoration. */

/* Roboto Bold (Apache 2.0), subset to Latin-1 and punctuation as WOFF2:
   assets/fonts/NOTICE.txt. A character outside it falls back to the next
   font in --display. */
@font-face {
  font-family: 'Roboto';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('/assets/fonts/Roboto-Bold-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --navy: rgb(29, 78, 126);
  --blue: rgb(42, 138, 208);
  --violet: rgb(123, 79, 201);
  --violet-deep: rgb(90, 55, 160);
  --lavender: rgb(227, 220, 247);
  --lavender-soft: rgb(239, 234, 252);
  --gold: rgb(242, 176, 30);
  --sky: rgb(228, 246, 250);
  --white: #fff;
  --frame: rgba(123, 79, 201, 0.28);
  --radius: 22px;
  --shadow: 0 10px 30px rgba(29, 78, 126, 0.12);
  --display: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--navy);
  background-color: var(--sky);
  background-image: url('/assets/img/sky.jpg');
  background-size: cover;
  background-position: center top;
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1,
h2,
h3,
.button,
.daily-badge,
.countdown b,
.lang button {
  font-family: var(--display);
  font-weight: 700;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(1.9rem, 5.5vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.card > :last-child,
.slot > :last-child {
  margin-bottom: 0;
}

a {
  color: var(--violet-deep);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Read by screen readers, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--white);
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 10;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header .wrap {
  display: flex;
  flex-wrap: wrap; /* narrower than 300 px, the language buttons go below */
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 8px;
}

.brand img {
  display: block;
  width: clamp(170px, 42vw, 300px);
  height: auto;
}

.lang {
  display: flex;
  background: var(--lavender-soft);
  border: 1.5px solid var(--frame);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 0.95rem;
  min-width: 44px;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
}

.lang button[aria-pressed='true'] {
  background: var(--violet);
  color: var(--white);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: center;
  padding: 24px 0 8px;
}

.hero .lead {
  font-size: 1.15rem;
  max-width: 38em;
}

.hero-art {
  justify-self: center;
  width: min(150px, 40vw);
  height: auto;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.6fr 1fr;
    gap: 32px;
    padding-top: 40px;
  }
  .hero-art {
    width: min(260px, 100%);
    order: 2;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.button-violet {
  background: var(--violet);
  color: var(--white);
}

.button-violet:hover {
  background: var(--violet-deep);
}

.button-gold {
  background: var(--gold);
  color: var(--navy);
}

.button-soft {
  background: var(--lavender-soft);
  color: var(--navy);
  border-color: var(--frame);
}

.button-soft:hover {
  background: var(--lavender);
}

.store-search {
  font-family: var(--display);
  font-weight: 700;
  margin: 0;
}

.note {
  font-size: 0.95rem;
}

/* Cards: the app's lavender boards with a violet frame */

.card {
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid var(--frame);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.board {
  background: var(--lavender);
}

/* What's new: a list with the cards' gold dots */

.news ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px 24px;
}

@media (min-width: 760px) {
  .news ul {
    grid-template-columns: 1fr 1fr;
  }
}

.news li {
  position: relative;
  padding-left: 1.3em;
}

.news li::before {
  content: '';
  position: absolute;
  left: 0.15em;
  top: 0.5em;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--gold);
}

main {
  display: block;
}

main > section {
  margin: 28px 0;
}

.grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-2 {
    grid-template-columns: 1.2fr 1fr;
  }
}

.card h3::before {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 176, 30, 0.25);
  vertical-align: 0.05em;
}

/* Daily */

.daily .slot {
  min-height: 9rem;
}

.daily-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 16px;
  font-size: 1.15rem;
  margin-bottom: 0.4em;
}

.daily-date {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.4em;
}

.countdown {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 1em;
}

.countdown-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  padding: 8px 10px;
  border-radius: 16px;
  background: var(--white);
  border: 1.5px solid var(--frame);
}

.countdown b {
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.countdown small {
  font-size: 0.85rem;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.facts li {
  background: var(--white);
  border: 1.5px solid var(--frame);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 600;
}

/* Code form */

.code-form {
  margin-bottom: 1em;
}

.code-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.code-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-row input {
  flex: 1 1 14em;
  min-width: 0;
  min-height: 48px;
  padding: 10px 16px;
  font: inherit;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--navy);
  background: var(--white);
  border: 1.5px solid var(--violet);
  border-radius: 999px;
}

.code-row input[aria-invalid='true'] {
  border-color: rgb(176, 32, 48);
  border-width: 2.5px;
}

.form-error {
  color: rgb(150, 24, 40);
  font-weight: 600;
  margin: 8px 0 0;
}

/* Share page */

.share-card {
  max-width: 720px;
  margin: 32px auto;
}

.share-card .lead {
  font-size: 1.12rem;
}

.code-line code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: var(--lavender-soft);
  padding: 2px 8px;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 8px 0 4px;
}

.actions [data-store] {
  display: contents;
}

.copy-status {
  min-height: 1.5em;
  font-weight: 600;
}

/* Empty until "Open in jirafaGraph" seems to have opened nothing. */
.open-hint:empty {
  margin: 0;
}

.share-card h2 {
  font-size: 1.2rem;
  margin-top: 1em;
}

@media (max-width: 480px) {
  .actions .button {
    width: 100%;
  }
}

/* Footer */

.site-footer {
  padding: 24px 0 40px;
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 0.4em;
}

@media (prefers-reduced-motion: no-preference) {
  .button {
    transition: background-color 0.15s ease;
  }
}

/* Daily twist and the month view (calendar/) */

.daily-week {
  font-family: var(--display);
  font-weight: 700;
  margin-bottom: 0.3em;
}

.daily-twist {
  position: relative;
  padding-left: 1.6em;
  font-weight: 600;
}

/* The app's gold twist disc, with its white star. */
.daily-twist::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.25em;
  height: 1.25em;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  font-size: 0.85em;
  line-height: 1.25em;
  text-align: center;
}

.calendar {
  max-width: 820px;
  margin: 32px auto;
}

.month-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 16px;
}

.month-nav .next {
  margin-left: auto;
}

.cal-week {
  margin-top: 1.2em;
}

.cal-days {
  list-style: none;
  padding: 0;
  margin: 0 0 1em;
  display: grid;
  gap: 10px;
}

@media (min-width: 760px) {
  .cal-days {
    grid-template-columns: 1fr 1fr;
  }
}

.cal-day {
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px solid var(--frame);
  border-radius: 16px;
  padding: 12px 14px;
}

.cal-day.today {
  border: 2.5px solid var(--violet);
}

.cal-day p {
  margin: 0 0 0.3em;
}

.cal-day > :last-child {
  margin-bottom: 0;
}

.cal-day-title {
  font-family: var(--display);
  font-weight: 700;
}

.cal-day-title .daily-badge {
  font-size: 0.9rem;
  padding: 1px 10px;
  margin: 0;
}

