/* UPfit wallpaper page. Tokens follow the UPfit design system. */

@font-face { font-family: 'Raleway'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/Raleway-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Raleway'; font-weight: 800; font-style: normal; font-display: swap; src: url('../fonts/Raleway-ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/Poppins-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/Poppins-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/Poppins-SemiBold.woff2') format('woff2'); }

@property --acc { syntax: '<color>'; inherits: true; initial-value: #00BFC5; }
@property --acc-text { syntax: '<color>'; inherits: true; initial-value: #007f84; }

:root {
  --navy: #001247;
  --navy-2: #2A3174;
  --blue: #166397;
  --turquoise: #00BFC5;
  --orange: #FBAD50;
  --orange-dark: #F15A24;
  --red: #DD003B;
  --red-dark: #A8003D;

  --ink: #333333;
  --ink-muted: #5b6572;
  --gray-200: #e5e9ef;
  --gray-100: #f2f4f7;
  --gray-50: #f8f9fb;

  --font-display: 'Raleway', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --shadow-md: 0 2px 8px rgba(0, 18, 71, .08);
  --shadow-lg: 0 8px 24px rgba(0, 18, 71, .10);
  --ease: cubic-bezier(.2, .6, .2, 1);
  --dur: 250ms;

  /* Month accent, set from data at runtime */
  --acc: #00BFC5;
  --acc-ink: #001247;
  --acc-text: #007f84;
  --acc-soft: color-mix(in srgb, var(--acc) 14%, transparent);

  /* Page theme (light) */
  --bg: #ffffff;
  --bg-top: #f2f4f7;
  --fg: var(--navy);
  --fg-body: var(--ink);
  --fg-muted: var(--ink-muted);
  --surface: var(--gray-50);
  --surface-2: #ffffff;
  --line: var(--gray-200);
  --seg-bg: var(--gray-100);
  --seg-on: #ffffff;
  --seg-on-fg: var(--navy);
  --num-alpha: 16%;

  color-scheme: light;
  transition: --acc var(--dur) var(--ease), --acc-text var(--dur) var(--ease);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #001247;
    --bg-top: #001247;
    --fg: #ffffff;
    --fg-body: rgba(255, 255, 255, .86);
    --fg-muted: rgba(255, 255, 255, .72);
    --surface: rgba(255, 255, 255, .06);
    --surface-2: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .14);
    --seg-bg: rgba(255, 255, 255, .08);
    --seg-on: rgba(255, 255, 255, .92);
    --seg-on-fg: var(--navy);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, .35);
    --num-alpha: 22%;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-body);
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 640px) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--acc-text); text-underline-offset: 3px; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { font-family: var(--font-display); color: var(--fg); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--acc-text); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 48px); }
.ic { width: 1em; height: 1em; fill: currentColor; flex: none; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--navy); color: #fff; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--acc-text); margin-bottom: 10px;
}

/* ---------- Header ---------- */
.top { position: relative; z-index: 3; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.logo img { width: 152px; height: auto; }
.top__link {
  font-size: 14px; font-weight: 500; color: var(--fg); text-decoration: none;
  padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  transition: background var(--dur) var(--ease);
}
.top__link:hover { background: var(--surface); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(8px, 2vw, 24px) 0 clamp(48px, 6vw, 80px); }
.hero__num {
  position: absolute; z-index: 0; right: -.04em; bottom: -.16em;
  font-family: var(--font-display); font-weight: 800; line-height: 1;
  font-size: clamp(180px, 22vw, 360px); letter-spacing: -.04em;
  color: color-mix(in srgb, var(--acc) var(--num-alpha), transparent);
  pointer-events: none; user-select: none;
  transition: color var(--dur) var(--ease);
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; gap: 24px clamp(32px, 4vw, 64px);
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  grid-template-areas: "intro stage" "panel stage";
  align-items: start;
}
.intro { grid-area: intro; padding-top: clamp(8px, 3vw, 40px); }
.stage { grid-area: stage; min-width: 0; }
.panel { grid-area: panel; display: grid; gap: 24px; }

h1 { font-weight: 800; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.05; }
.lead { margin-top: 14px; font-size: 18px; color: var(--fg-muted); max-width: 30ch; }

/* ---------- Preview frame ---------- */
.notice {
  display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
  padding: 10px 14px; border-radius: var(--r-md);
  background: var(--acc-soft); color: var(--fg); font-size: 14px;
}
.frame { position: relative; margin: 0; }
.frame__img {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--r-lg); background: var(--gray-100);
  box-shadow: var(--shadow-lg);
}
@media (prefers-color-scheme: dark) { .frame__img { background: #0a1d5c; } }
.frame__img > img { width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms var(--ease); }
.frame__img > img.is-loading { opacity: .35; }
.frame__full {
  position: absolute; right: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 0; border-radius: var(--r-pill);
  background: var(--navy); color: #fff; font-size: 13px; font-weight: 500;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.frame:hover .frame__full, .frame__full:focus-visible { opacity: 1; }
@media (hover: none) { .frame__full { display: none; } }

.ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ring circle { fill: none; }
.ring__line { stroke: var(--acc); stroke-width: .9; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.ring__pulse { stroke: var(--acc); stroke-width: 3; opacity: 0; }
.ring.is-on .ring__line { animation: draw 700ms var(--ease) forwards; }
.ring.is-on .ring__pulse { animation: glow 1600ms 600ms var(--ease) 3; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glow { 0% { opacity: 0; } 40% { opacity: .35; } 100% { opacity: 0; } }

.teaser {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; padding: 24px;
  background: radial-gradient(circle at 70% 40%, color-mix(in srgb, var(--acc) 30%, transparent), transparent 60%), var(--navy);
  color: #fff;
}
.teaser__lock { width: 36px; height: 36px; color: var(--acc); }
.teaser__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(22px, 3vw, 36px); line-height: 1.15; max-width: 18ch; }
.teaser__count { font-size: 15px; color: rgba(255, 255, 255, .8); }

.caption { margin-top: 18px; display: grid; gap: 4px; }
.caption__month { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--fg); }
.caption__text { font-size: 17px; color: var(--fg-body); }
.caption__text span { display: block; }
.caption__text span + span { color: var(--acc-text); font-weight: 600; }
.caption__tip { font-size: 14px; color: var(--fg-muted); margin-top: 4px; }
.caption__tip b { font-weight: 600; color: var(--fg); }

.cat {
  margin-top: 18px; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px;
}
.cat strong { color: var(--fg); font-weight: 600; }
.cat p { flex: 1; }
.cat__ic { width: 28px; height: 28px; color: var(--acc-text); }

/* ---------- Toggles ---------- */
.toggles { display: grid; gap: 10px; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px;
  border-radius: var(--r-pill); background: var(--seg-bg);
}
.seg button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--fg-muted); font-size: 15px; font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--seg-on); color: var(--seg-on-fg); box-shadow: var(--shadow-md); }
.seg button[aria-pressed="true"] .ic { color: var(--acc-text); }
@media (prefers-color-scheme: dark) {
  .seg button[aria-pressed="true"] .ic { color: var(--navy); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: var(--r-pill); text-decoration: none;
  font-weight: 600; transition: filter var(--dur) var(--ease), background var(--dur) var(--ease);
}
.btn--main {
  width: 100%; min-height: 56px; padding: 14px 24px;
  background: var(--acc); color: var(--acc-ink); font-size: 16px;
}
.btn--main:hover { filter: brightness(.94); }
.btn--main .ic { width: 18px; height: 18px; }
.btn--ghost { background: transparent; color: var(--fg); border: 1.5px solid var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--ghost[aria-pressed="true"] { border-color: var(--acc); background: var(--acc-soft); }
.btn--sm { min-height: 40px; padding: 6px 16px; font-size: 14px; white-space: nowrap; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- Download ---------- */
.dl { display: grid; gap: 12px; }
.dl__hint { font-size: 13px; color: var(--fg-muted); text-align: center; min-height: 1.6em; }
.dl__formats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.dl__formats a {
  display: grid; justify-items: center; gap: 2px; padding: 10px 6px; height: 100%;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2);
  color: var(--fg); text-decoration: none; text-align: center;
  font-size: 14px; font-weight: 600; line-height: 1.3;
  transition: border-color var(--dur) var(--ease);
}
.dl__formats a:hover { border-color: var(--acc); }
.dl__formats span { font-size: 11px; font-weight: 400; color: var(--fg-muted); }
.dl__formats .ic { width: 18px; height: 18px; color: var(--acc-text); margin-bottom: 2px; }

.mobile-note {
  font-size: 14px; color: var(--fg); background: var(--acc-soft);
  padding: 12px 14px; border-radius: var(--r-md); text-align: center;
}

/* ---------- How to ---------- */
.howto { border-top: 1px solid var(--line); padding-top: 18px; }
.howto__title { font-weight: 600; color: var(--fg); font-size: 15px; margin-bottom: 10px; }
.howto__tabs { display: flex; gap: 8px; }
.howto__tab {
  flex: 1; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 8px 14px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); font-size: 14px; font-weight: 500; color: var(--fg);
}
.howto__chev { margin-left: auto; width: 12px; height: 12px; transition: transform var(--dur) var(--ease); }
.howto__tab[aria-expanded="true"] { border-color: var(--acc); }
.howto__tab[aria-expanded="true"] .howto__chev { transform: rotate(180deg); }
.howto__steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; font-size: 14px; }
.howto__steps li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.howto__steps li::before {
  content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--acc-soft); color: var(--fg); font-weight: 600; font-size: 13px;
}

.keys { font-size: 12px; color: var(--fg-muted); }
.keys kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 3px; text-align: center;
  font: 500 11px/18px var(--font-body); color: var(--fg);
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2);
}
@media (hover: none) { .keys { display: none; } }

/* ---------- Archive ---------- */
.archive { padding-block: clamp(24px, 4vw, 48px) clamp(40px, 6vw, 72px); }
.sec-head { margin-bottom: 24px; }
h2 { font-weight: 800; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; } }

.mo { --c: #00BFC5; position: relative; }
.mo__btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit;
}
.mo__pic {
  display: block; position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden;
  background: color-mix(in srgb, var(--c) 16%, var(--surface-2));
  outline: 3px solid transparent; outline-offset: 3px;
  transition: outline-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.mo__pic img { width: 100%; height: 100%; object-fit: cover; }
.mo__btn:hover .mo__pic { box-shadow: var(--shadow-lg); }
.mo.is-current .mo__pic { outline-color: var(--c); }
.mo__label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 14px; }
.mo__name { font-weight: 600; color: var(--fg); }
.mo__meta { font-size: 12px; color: var(--fg-muted); }

.mo__big {
  position: absolute; right: -.06em; bottom: -.22em;
  font-family: var(--font-display); font-weight: 800; line-height: 1; letter-spacing: -.04em;
  font-size: clamp(72px, 9vw, 112px);
  color: color-mix(in srgb, var(--c) 55%, transparent);
}
.mo__lock {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--fg); font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-md);
}
@media (prefers-color-scheme: dark) { .mo__lock { background: var(--navy); } }
.mo--locked .mo__name { color: var(--fg-muted); }
.mo--next .mo__meta { color: var(--fg); font-weight: 500; }

/* ---------- Newsletter + share ---------- */
.grow { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding-bottom: clamp(48px, 6vw, 80px); }
.card { border-radius: var(--r-xl); padding: clamp(24px, 3vw, 40px); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.card > p:not(.eyebrow) { color: var(--fg-body); }

.card--featured { background: var(--navy); border-color: var(--navy); color: rgba(255, 255, 255, .86); }
.card--featured h2 { color: #fff; }
.card--featured > p:not(.eyebrow) { color: rgba(255, 255, 255, .86); }
.card--featured .eyebrow { color: var(--orange); }
.card--featured .sub__note { color: rgba(255, 255, 255, .72); }
@media (prefers-color-scheme: dark) {
  .card--featured { background: rgba(255, 255, 255, .06); border: 2px solid var(--acc); }
}

.sub { display: grid; gap: 10px; justify-items: start; margin-top: 8px; }
.sub .btn--main { width: auto; padding-inline: 32px; }
.sub__note { font-size: 13px; color: var(--fg-muted); }

.share { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.share__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px;
  padding: 10px 16px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--fg); font-size: 15px; font-weight: 500; text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.share__btn:hover { border-color: var(--acc); }
.share__btn .ic { width: 18px; height: 18px; color: var(--acc-text); }
.share__btn.is-done { border-color: var(--acc); background: var(--acc-soft); }

/* ---------- FAQ ---------- */
.faq { padding-bottom: clamp(48px, 6vw, 80px); }
.faq__list { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 15px; color: var(--fg);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--acc-soft); color: var(--fg); font-weight: 500; transition: transform var(--dur) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 18px 16px; font-size: 14px; color: var(--fg-body); }
@media (max-width: 760px) { .faq__list { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.wave { display: grid; grid-template-columns: repeat(5, 1fr); height: 8px; }
.wave i:nth-child(1) { background: #00BFC5; }
.wave i:nth-child(2) { background: #FBAD50; }
.wave i:nth-child(3) { background: #F15A24; }
.wave i:nth-child(4) { background: #DD003B; }
.wave i:nth-child(5) { background: #A8003D; }
.foot { background: var(--navy); color: rgba(255, 255, 255, .8); font-size: 14px; }
.foot__in { display: flex; flex-wrap: wrap; gap: 8px 28px; padding-block: 24px 28px; }
.foot__in a { color: #fff; text-decoration: none; }
.foot__in a:hover { text-decoration: underline; }
.foot__in span { margin-left: auto; }

/* ---------- Feedback ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 12px);
  padding: 10px 18px; border-radius: var(--r-pill); background: var(--navy); color: #fff;
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
@media (prefers-color-scheme: dark) { .toast { background: #fff; color: var(--navy); } }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 50%; }

.nojs { max-width: 640px; margin: 24px auto; padding: 16px; text-align: center; }

/* ---------- Fullscreen preview ---------- */
.frame:fullscreen { display: grid; place-items: center; background: #000; }
.frame:fullscreen .frame__img { width: 100vw; height: 100vh; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
.frame:fullscreen .frame__img > img { object-fit: cover; }
.frame:fullscreen .frame__full { opacity: 1; }

/* ---------- Responsive ---------- */
/* One column: preview first, then the toggles and the download, then the details */
@media (max-width: 999px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 20px; }
  .stage, .panel { display: contents; }
  .intro { grid-area: auto; order: 1; padding-top: 0; }
  .notice { order: 2; margin: 0; }
  .frame { order: 3; }
  .toggles { order: 4; }
  .dl { order: 5; }
  .caption { order: 6; margin-top: 4px; }
  .cat { order: 7; margin-top: 0; }
  .howto { order: 8; }
  .keys { order: 9; }
  .toggles, .dl, .howto { width: 100%; max-width: 560px; }
  .lead { max-width: none; }
  .grow { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .top__link { font-size: 13px; padding: 7px 12px; }
  .logo img { width: 124px; }
  .hero__num { display: none; }
  .frame__img { border-radius: var(--r-md); }
  .sub { justify-items: stretch; }
  .sub .btn--main { width: 100%; }
  .cat { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .cat .btn { grid-column: 2; justify-self: start; }
  .foot__in span { margin-left: 0; }
}
@media (max-width: 400px) {
  .top__link { display: none; }
  .share { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
