/* Hero with a working phone. Everything inside the phone is a pretend copy of the app: nothing is saved. */

.hero-demo { padding: 28px 0 64px; }
.hero-demo .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: 56px; }
/* The line above the phone, with a hand-drawn arrow down to it */
.try-note { text-align: center; display: flex; flex-direction: column; align-items: center; }
.try-note p { margin: 0; }
.try-big { font-family: var(--hand); font-size: 30px; line-height: 1.1; letter-spacing: 0.02em; }
.try-small { font-size: 15px; color: var(--muted); margin-top: 4px !important; }
.try-arrow { display: block; margin-top: 4px; color: var(--ink); }
.demo-col { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo-reset {
  font: inherit; font-size: 15px; color: var(--muted); background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 6px 10px;
}
.demo-reset:hover { color: var(--ink); }

/* The phone body: drawn in CSS, so it stays sharp at any size */
.cd-phone {
  --cd-ink: #161616;
  --cd-surface: #F9F7F3;
  --cd-panel: #ECEAE5;
  --cd-muted: #55524d;
  position: relative; width: 320px; max-width: 100%; height: 668px; flex-shrink: 0;
  background: #121212; border-radius: 54px; padding: 11px;
  box-shadow: inset 0 0 0 1.5px #3a3a3a, inset 0 0 0 5px #121212, inset 0 0 0 6px #2b2b2b,
              0 40px 70px -30px rgba(22, 22, 22, 0.45), 0 12px 24px -12px rgba(22, 22, 22, 0.3);
  font-family: var(--body); font-weight: 500; color: var(--cd-ink); line-height: 1.35;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
}
.cd-side { position: absolute; width: 4px; background: #121212; border-radius: 2px; }
.cd-side.l1 { left: -3px; top: 118px; height: 30px; }
.cd-side.l2 { left: -3px; top: 168px; height: 54px; }
.cd-side.l3 { left: -3px; top: 232px; height: 54px; }
.cd-side.r1 { right: -3px; top: 190px; height: 84px; }
.cd-island { position: absolute; top: 21px; left: 50%; transform: translateX(-50%); width: 92px; height: 27px; background: #000; border-radius: 20px; z-index: 50; pointer-events: none; }
.cd-indicator { position: absolute; bottom: 19px; left: 50%; transform: translateX(-50%); width: 110px; height: 4px; border-radius: 4px; background: var(--cd-ink); z-index: 50; pointer-events: none; }

.cd-screen { position: relative; height: 100%; border-radius: 43px; overflow: hidden; background: var(--cd-surface); display: flex; flex-direction: column; isolation: isolate; }
:where(.cd-screen button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
.cd-screen :focus-visible { outline: 2px solid var(--cd-ink); outline-offset: 2px; border-radius: 8px; }
.cd-screen img { max-width: none; }

/* Status bar */
.cd-status { height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 6px 26px 0 34px; font-size: 13.5px; font-weight: 600; position: relative; z-index: 45; }
.cd-status-icons { display: flex; align-items: center; gap: 5px; }
.cd-status svg { display: block; }

/* Main area and tabs */
.cd-main { flex: 1; position: relative; min-height: 0; }
.cd-view { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 2px 16px 14px; display: flex; flex-direction: column; }
.cd-view::-webkit-scrollbar { display: none; }
.cd-tabbar { flex-shrink: 0; height: 66px; border-top: 1px solid var(--cd-ink); display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px 4px 18px; background: var(--cd-surface); }
.cd-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 10px; }
.cd-tab img { width: 22px; height: 22px; }

/* Shared pieces */
.cd-ico { width: 22px; height: 22px; display: block; }
.cd-title { font-family: var(--hand); font-weight: 400; font-size: 25px; line-height: 1.1; letter-spacing: 0.05em; margin: 0; }
.cd-navtitle { text-align: center; font-weight: 600; font-size: 15px; padding: 8px 0 12px; }
.cd-primary { display: block; width: 100%; background: var(--cd-ink); color: var(--cd-surface); border-radius: 14px; padding: 13px 10px; text-align: center; font-size: 14.5px; flex-shrink: 0; }
.cd-primary:active { transform: scale(0.985); }
/* A soft tap on the check-in button, twice, to show the phone can be used */
.cd-primary { position: relative; }
.cd-primary.cd-hint { animation: cd-press 1.3s ease-out 2; }
.cd-primary.cd-hint::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: cd-ring 1.3s ease-out 2; }
@keyframes cd-press { 0%, 40%, 100% { transform: scale(1); } 14% { transform: scale(0.96); } }
@keyframes cd-ring { 0% { box-shadow: 0 0 0 0 rgba(22, 22, 22, 0.4); } 75%, 100% { box-shadow: 0 0 0 12px rgba(22, 22, 22, 0); } }
.cd-link { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.cd-card { border: 1.5px solid var(--cd-ink); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; }
.cd-card p { margin: 0 0 8px; }
.cd-panel { background: var(--cd-panel); border-radius: 14px; font-size: 13.5px; }
.cd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; min-height: 44px; width: 100%; }
.cd-row + .cd-row { border-top: 1px solid #D9D6CF; }
.cd-row-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: 12.5px; }
.cd-log { background: var(--cd-surface); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; }
.cd-h { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
.cd-h:first-child { margin-top: 4px; }
.cd-sub { font-size: 12px; margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.cd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-chip { background: var(--cd-panel); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; line-height: 1.2; transition: background-color 0.12s, color 0.12s; }
.cd-chip[aria-pressed="true"] { background: var(--cd-ink); color: var(--cd-surface); }

/* Home */
.cd-home-top { display: flex; justify-content: flex-end; align-items: center; gap: 4px; min-height: 36px; }
.cd-points { font-size: 12.5px; padding: 8px 6px; }
.cd-gear { padding: 7px; }
.cd-hero { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 6px 0 10px; flex: 1; min-height: 190px; }
.cd-hero-pic { width: 222px; height: 222px; margin-left: -22px; }
.cd-rail { display: flex; flex-direction: column; gap: 4px; padding-right: 4px; width: 52px; align-items: center; }
.cd-rail button { min-width: 44px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.cd-rail img { width: 24px; height: 24px; }
.cd-live { font-size: 10px; line-height: 1.1; max-width: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-fast-line { margin: 0 0 12px; font-size: 13.5px; }
.cd-home-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }

/* Covers (check-in, result) and sheets */
.cd-cover { position: absolute; left: 0; right: 0; top: 48px; bottom: 0; background: var(--cd-surface); z-index: 20; display: flex; flex-direction: column; }
.cd-cover.enter { animation: cd-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cd-cover-top { display: flex; justify-content: flex-end; padding: 0 10px; flex-shrink: 0; }
.cd-close { padding: 9px; }
.cd-cover-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 0 16px 16px; }
.cd-cover-body::-webkit-scrollbar { display: none; }
.cd-cover-foot { padding: 10px 16px 30px; flex-shrink: 0; }
.cd-lead { font-size: 13px; margin: 10px 0 4px; }
.cd-note { width: 100%; font: inherit; font-size: 13px; color: var(--cd-ink); background: var(--cd-panel); border: 0; border-radius: 12px; padding: 10px 12px; resize: none; height: 64px; user-select: text; -webkit-user-select: text; }
.cd-note::placeholder { color: var(--cd-muted); }
.cd-result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 20px; text-align: center; font-size: 15px; }
.cd-result img { width: 230px; height: 230px; }
.cd-result p { margin: 0; min-height: 21px; }

.cd-backdrop { position: absolute; inset: 0; background: rgba(22, 22, 22, 0.28); z-index: 30; animation: cd-fade 0.2s ease-out; }
.cd-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--cd-surface); border-radius: 22px 22px 0 0; padding: 8px 16px 34px; max-height: 78%; overflow-y: auto; scrollbar-width: none; animation: cd-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cd-sheet::-webkit-scrollbar { display: none; }
.cd-grabber { width: 36px; height: 5px; border-radius: 5px; background: #CFCBC4; margin: 0 auto 10px; }
.cd-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cd-sheet-head strong { font-size: 15px; font-weight: 600; }
.cd-sheet .cd-close { padding: 6px; }
.cd-sheet .cd-ico { width: 18px; height: 18px; }
.cd-sheet p { font-size: 13px; margin: 0 0 10px; }

.cd-toast { position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); background: var(--cd-ink); color: var(--cd-surface); font-size: 12.5px; padding: 8px 14px; border-radius: 999px; z-index: 40; white-space: nowrap; pointer-events: none; animation: cd-fade 0.18s ease-out; }

/* Track */
.cd-today-line { padding: 12px 14px 2px; }
.cd-today-link { padding: 4px 14px 12px; display: block; }
.cd-fast-run { display: block; font-size: 12px; color: var(--cd-muted); }

/* History */
.cd-seg { display: flex; gap: 6px; margin-bottom: 12px; }
.cd-seg .cd-chip[aria-pressed="true"]::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin: 0 6px 1px 0; vertical-align: middle; }
.cd-month { text-align: center; font-size: 14px; margin-bottom: 8px; }
.cd-cal { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; text-align: center; }
.cd-dow { font-size: 10.5px; padding-bottom: 4px; }
.cd-day { height: 50px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5px; font-size: 11.5px; text-align: center; border: 1.5px solid transparent; }
.cd-day.today { border-color: var(--cd-ink); }
.cd-day.future { color: #B5B1AA; cursor: default; }
.cd-day small { font-size: 9px; display: block; margin-top: -1px; }
.cd-marks { display: flex; gap: 1px; margin-top: 3px; height: 15px; }
.cd-marks img { width: 15px; height: 15px; }
.cd-legend { display: flex; justify-content: center; gap: 14px; font-size: 11px; color: var(--cd-muted); margin-top: 14px; }
.cd-legend span { display: flex; align-items: center; gap: 4px; }
.cd-legend img { width: 14px; height: 14px; }
.cd-detail { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; padding: 12px 14px; }
.cd-detail dt { color: var(--cd-muted); }
.cd-detail dd { margin: 0; }

/* Companion */
.cd-comp { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cd-comp-pic { width: 210px; height: 210px; margin-top: 6px; }
.cd-comp .cd-title { font-size: 30px; margin-top: 4px; }
.cd-comp p { margin: 8px 0 2px; font-size: 13.5px; }
.cd-comp .cd-points { font-size: 13.5px; }
.cd-prizes-h { align-self: flex-start; font-size: 13.5px; margin: 16px 0 8px; }
.cd-prizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.cd-prize { aspect-ratio: 1; background: var(--cd-panel); border-radius: 14px; display: grid; place-items: center; border: 1.5px solid transparent; overflow: hidden; }
.cd-prize img { width: 92%; height: 92%; }
.cd-prize.locked img { width: 22px; height: 22px; opacity: 0.55; }
.cd-prize[aria-pressed="true"] { border-color: var(--cd-ink); }
.cd-points-list { list-style: none; padding: 0; margin: 0; }
.cd-points-list li { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 13px; }
.cd-points-list li + li { border-top: 1px solid #D9D6CF; }

@keyframes cd-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes cd-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .hero-demo .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .demo-col { min-width: 0; }
}
@media (max-width: 360px) {
  .cd-phone { height: 640px; border-radius: 48px; padding: 9px; }
  .cd-screen { border-radius: 39px; }
  .cd-hero-pic { width: 170px; height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .cd-cover.enter, .cd-sheet, .cd-backdrop, .cd-toast { animation: none; }
  .cd-chip { transition: none; }
  .cd-primary.cd-hint, .cd-primary.cd-hint::after { animation: none; }
}

.cd-ring { position: relative; width: 132px; height: 132px; margin: 4px auto 10px; display: grid; place-items: center; }
.cd-ring svg { position: absolute; inset: 0; }
.cd-ring span { font-size: 17px; }
.cd-fast-line { text-align: center; }
