/* Dr. Luckeydoo site. Colours are the app's own tokens (theme/color.ts). */

@font-face {
  font-family: "Literata";
  src: url("../fonts/Literata-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("../fonts/Literata-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #23201b;          /* color.ink */
  --ink-muted: #544e44;    /* color.inkMuted */
  --paper: #f4ebd9;        /* mean of assets/look/paperCream */
  --manila: #e0d3b6;       /* color.manilaCard */
  --paper-edge: #b3a894;   /* color.paperEdge */
  --rule: #cfc7b6;         /* color.rule */
  --navy: #24406b;         /* color.navy */
  --link: #1f5f8b;         /* color.link */
  --desk: #6b4a2e;         /* color.clipboardBoard, the fallback under the walnut */
  --shadow: #3a2c1c;       /* color.deskShadow */
  --print: "Literata", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { background: var(--desk); }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--desk);
  background-image: url("../img/walnut.webp");
  background-size: 536px auto;
  background-repeat: repeat;
  color: var(--ink);
  font-family: var(--print);
  font-size: 18px;
  line-height: 1.55;
  padding: 24px 16px 32px;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
a:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 2px; }

.sheet {
  max-width: 560px;
  overflow-wrap: break-word;
  margin: 0 auto;
  background-color: var(--paper);
  background-image: url("../img/paper.webp");
  background-size: cover;
  border: 1px solid var(--paper-edge);
  box-shadow: 4px 6px 0 rgba(58, 44, 28, 0.55);
  padding: 28px clamp(14px, 5vw, 22px) 30px;
}

.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 10;
}
.skip:focus { top: 8px; }

/* Landing */
.landing { text-align: center; }

.icon {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 24px;
  box-shadow: 2px 3px 0 rgba(58, 44, 28, 0.45);
}

.name {
  font-family: var(--print);
  font-weight: 700;
  font-size: clamp(24px, 8vw, 32px);
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: break-word;
  letter-spacing: 0;
  color: var(--navy);
  margin: 0 0 8px;
  display: inline-block;
  padding: 4px 12px 6px;
  border: 3px solid var(--navy);
  border-radius: 6px;
  transform: rotate(-2deg);
}

.mark {
  position: relative;
  width: 168px;
  height: 168px;
  margin: 6px auto 10px;
}
.mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tagline {
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  margin: 8px 0 10px;
}

.sub {
  font-size: clamp(17px, 5vw, 19px);
  color: var(--ink);
  margin: 0 0 24px;
}

.store {
  margin: 0 auto 10px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.store .soon {
  display: inline-block;
  min-height: 52px;
  padding: 13px 20px;
  border: 2px dashed var(--ink-muted);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  background: var(--manila);
}
.store a { display: inline-block; line-height: 0; }
.store img { height: 64px; width: auto; }

.appstore {
  font-size: 16px;
  color: var(--ink-muted);
  margin: 0 0 26px;
}

.built {
  font-size: 17px;
  margin: 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

/* Footer: its own slip of manila under the sheet */
.foot {
  max-width: 560px;
  margin: 18px auto 0;
  background: var(--manila);
  border: 1px solid var(--paper-edge);
  box-shadow: 3px 4px 0 rgba(58, 44, 28, 0.5);
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: center;
  text-align: center;
}
.foot li { padding: 4px 0; }
.foot a { display: inline-block; padding: 6px 0; }

/* Reading pages */
.page .head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.page .head img {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}
.page .head a { font-weight: 700; color: var(--navy); text-decoration: none; font-size: 18px; }
.page .head a:hover { text-decoration: underline; }
.page h1 {
  font-size: clamp(26px, 8vw, 32px);
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--navy);
}
.page .date { color: var(--ink-muted); font-size: 16px; margin: 0 0 22px; }
.page h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 28px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.page h3 { font-size: 18px; margin: 18px 0 4px; }
.page p, .page li { font-size: 17px; }
.page ul { padding-left: 22px; margin: 6px 0 12px; }
.page li { margin: 4px 0; }
.page dl { margin: 6px 0 12px; }
.page dt { font-weight: 700; margin-top: 10px; }
.page dd { margin: 2px 0 0 0; }

/* The stamping, on load. Timing from the icon report: 200 ms land, 240 ms settle,
   240 ms for the second stamp. Ease out with no overshoot, so nothing bounces. */
@media (prefers-reduced-motion: no-preference) {
  .name { animation: stamp-name 200ms cubic-bezier(0.2, 0, 0, 1) 150ms both; }
  .mark .dollar { animation: stamp-land 440ms cubic-bezier(0.2, 0, 0, 1) 450ms both; }
  .mark .aplus { animation: stamp-land-2 240ms cubic-bezier(0.2, 0, 0, 1) 890ms both; }
}

@keyframes stamp-name {
  from { opacity: 0; transform: rotate(-2deg) scale(1.12); }
  to   { opacity: 1; transform: rotate(-2deg) scale(1); }
}
/* 0 to 200 ms: lands at 100%. 200 to 440 ms: the stamp lifts and the ink settles. */
@keyframes stamp-land {
  0%      { opacity: 0; transform: scale(1.1); filter: drop-shadow(0 6px 4px rgba(58, 44, 28, 0.35)); }
  45.45%  { opacity: 1; transform: scale(1);   filter: drop-shadow(0 1px 1px rgba(58, 44, 28, 0.45)); }
  100%    { opacity: 1; transform: scale(1);   filter: drop-shadow(0 0 0 rgba(58, 44, 28, 0)); }
}
@keyframes stamp-land-2 {
  0%   { opacity: 0; transform: scale(1.1); filter: drop-shadow(0 6px 4px rgba(58, 44, 28, 0.35)); }
  100% { opacity: 1; transform: scale(1);   filter: drop-shadow(0 0 0 rgba(58, 44, 28, 0)); }
}

@media (min-width: 700px) {
  body { padding-top: 48px; }
  .sheet { padding: 40px 48px 40px; }
  .name { font-size: 48px; }
  .mark { width: 200px; height: 200px; }
}
