/* Life Notes website — hand-written styles, no framework. */

:root {
    --ink: #262b33;
    --muted: #5d6673;
    --line: #dfe3e8;
    --paper: #ffffff;
    --paper-alt: #eef6f0;
    --green: #23a849;
    --green-deep: #1b8239;
    --green-darker: #166c2f;
    --wrap: 1080px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Room for the scrollbar on every page, short or long: the header stays in place from one page to the next. */
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--green-deep);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--green-darker);
}

:focus-visible {
    outline: 2px solid var(--green-deep);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1em;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.wrap-narrow {
    max-width: 760px;
}

/* ---------- Header ---------- */

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
}

.brand:hover {
    color: var(--ink);
}

.brand img {
    width: 34px;
    height: 34px;
    display: block;
}

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    padding: 6px 0;
    font-size: 15px;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.site-nav a:hover {
    border-bottom-color: var(--line);
}

.site-nav a[aria-current="page"] {
    border-bottom-color: var(--green);
}

/* Ko-fi link: a small heart next to the text */
.site-nav .support a {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav .support svg {
    flex: none;
    width: 14px;
    height: 14px;
    fill: #e5484d;
}

.site-nav .lang a {
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.site-nav .lang a:hover {
    border-color: var(--muted);
    color: var(--ink);
}

.nav-toggle {
    display: none;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    background: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
}

/* The full nav needs about 830px (French labels): below that, the Menu button. */
@media (max-width: 860px) {
    .nav-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        width: 100%;
        padding-bottom: 12px;
    }

    .site-nav.open {
        display: block;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .site-nav a {
        padding: 8px 0;
    }

    .site-nav .lang {
        margin-top: 6px;
    }

    .site-nav .lang a {
        padding: 3px 9px;
    }
}

/* ---------- Buttons ---------- */

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    background: var(--green-deep);
    border: 1px solid var(--green-deep);
    border-radius: 6px;
    padding: 13px 20px;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    color: #fff;
    background: var(--green-darker);
    border-color: var(--green-darker);
}

.button svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.button.plain {
    color: var(--ink);
    background: var(--paper);
    border-color: #c3c9d1;
}

.button.plain:hover {
    color: var(--ink);
    background: var(--paper-alt);
    border-color: var(--muted);
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- Phone frame ---------- */

.phone {
    background: #1e2227;
    padding: 9px;
    border-radius: 34px;
    box-shadow: 0 24px 40px -24px rgba(38, 43, 51, 0.45);
}

.phone > img {
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 26px;
    background: #fff;
}

/* ---------- Home: hero ---------- */

.hero {
    background: var(--paper-alt);
    border-bottom: 1px solid #d9e7dd;
}

.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: center;
    gap: 72px;
    padding-top: 72px;
    padding-bottom: 72px;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 3.6rem);
    letter-spacing: -0.025em;
    line-height: 1.08;
}

.hero .lead {
    margin: 20px 0 0;
    max-width: 30em;
    font-size: 1.2rem;
    color: var(--muted);
}

.hero .actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 22px;
    margin-top: 32px;
}

.hero .note {
    margin: 26px 0 0;
    font-size: 15px;
    color: var(--muted);
}

@media (max-width: 820px) {
    .hero .wrap {
        grid-template-columns: 1fr;
        gap: 48px;
        padding-top: 48px;
        padding-bottom: 56px;
    }

    .hero .phone {
        width: min(280px, 78%);
        margin: 0 auto;
    }
}

/* ---------- Home: the phone of the hero, to play with (computers only, assets/js/demo.js) ---------- */

.hero .phone {
    position: relative;
}

.demo {
    position: relative;
    aspect-ratio: 9 / 16;
    border-radius: 26px;
    overflow: hidden;
    /* Keeps the scrolled page within the rounded corners */
    isolation: isolate;
    background: #fff;
    user-select: none;
    -webkit-user-select: none;
}

.demo-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* No scrollbar, as on a phone */
    scrollbar-width: none;
    cursor: grab;
}

.demo-scroll::-webkit-scrollbar {
    display: none;
}

.demo-scroll:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: -3px;
}

.demo.dragging .demo-scroll,
.demo.dragging .demo-spot {
    cursor: grabbing;
}

.demo-page {
    position: relative;
}

.demo img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-user-drag: none;
}

/* The bar of the app, on top of the scrolled page */
.demo-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    background: no-repeat top / 100% auto;
}

.demo-spot {
    position: absolute;
    padding: 0;
    border: 0;
    border-radius: 32%;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s;
}

.demo-spot.round {
    border-radius: 50%;
}

.demo-spot:hover {
    background: rgba(38, 43, 51, 0.08);
}

.demo-spot:active {
    background: rgba(38, 43, 51, 0.16);
}

.demo-spot:focus-visible {
    outline: 2px solid var(--green-deep);
    outline-offset: 0;
}

.demo-hint {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 14px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
    text-align: center;
    text-wrap: balance;
}

/* ---------- Home: sections ---------- */

.section {
    padding: 80px 0;
}

.section h2 {
    font-size: clamp(1.6rem, 3vw, 2rem);
}

.section .sub {
    margin: 8px 0 0;
    color: var(--muted);
}

.points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.points li {
    border-top: 2px solid var(--ink);
    padding-top: 18px;
}

.points h3 {
    font-size: 1.2rem;
}

.points p {
    margin: 6px 0 0;
    color: var(--muted);
}

.about {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 56px;
    margin-top: 80px;
}

.about .text p {
    font-size: 1.1rem;
}

.about .text p:last-child {
    margin-bottom: 0;
}

.signature {
    margin-top: 1.4em;
    font-weight: 700;
}

@media (max-width: 720px) {
    .section {
        padding: 56px 0;
    }

    .points {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 56px;
    }
}

/* ---------- Home: figures (users, ratings) ---------- */

.figures {
    background: var(--green-deep);
    color: #fff;
    padding: 64px 0;
}

.figures .wrap {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 48px 96px;
}

.laurel {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
}

.laurel svg {
    width: 56px;
    height: 112px;
    flex: none;
    fill: currentColor;
}

.laurel svg.flip {
    transform: scaleX(-1);
}

.laurel .inner {
    text-align: center;
    min-width: 150px;
}

.laurel .value {
    display: block;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.laurel .label {
    display: block;
    margin-top: 4px;
    font-size: 15px;
}

.laurel .stars {
    display: flex;
    justify-content: center;
    gap: 3px;
    margin-bottom: 6px;
}

.laurel .stars svg {
    width: 17px;
    height: 17px;
    fill: #ffd257;
}

/* ---------- Home: screenshots ---------- */

.shots {
    background: var(--paper-alt);
    border-top: 1px solid #d9e7dd;
    padding: 80px 0;
}

.shots-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

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

.shots-nav button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #c3c9d1;
    border-radius: 50%;
    cursor: pointer;
}

.shots-nav button:hover:not(:disabled) {
    border-color: var(--ink);
}

.shots-nav button:disabled {
    opacity: 0.35;
    cursor: default;
}

.shots-nav svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.shots-track {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 36px 0 0;
    /* Bleed to the viewport edges, keep the first item aligned with the text. 100% (the width of the page, without
       the scrollbar), not 100vw (which counts the scrollbar). */
    padding: 0 max(24px, calc((100% - var(--wrap)) / 2 + 24px)) 28px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-left: max(24px, calc((100% - var(--wrap)) / 2 + 24px));
    scrollbar-width: none;
}

.shots-track::-webkit-scrollbar {
    display: none;
}

.shots-track li {
    flex: none;
    width: 232px;
    scroll-snap-align: start;
}

.shots-track .phone {
    padding: 7px;
    border-radius: 28px;
    box-shadow: 0 18px 30px -22px rgba(38, 43, 51, 0.45);
}

.shots-track .phone img {
    border-radius: 21px;
}

.shots-track p {
    margin: 16px 4px 0;
    font-size: 15px;
    color: var(--muted);
}

.shots-track p strong {
    display: block;
    color: var(--ink);
}

@media (max-width: 720px) {
    .shots {
        padding: 56px 0;
    }

    .shots-track {
        gap: 20px;
    }

    .shots-track li {
        width: 200px;
    }
}

/* Drag with the mouse, click to enlarge */

.shots-track {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.shots-track.dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.shots-track button.phone {
    display: block;
    width: 100%;
    border: 0;
    font: inherit;
    cursor: zoom-in;
}

.shots-track.dragging button.phone {
    cursor: grabbing;
}

.shots-track img {
    -webkit-user-drag: none;
}

.lightbox {
    padding: 0;
    border: 0;
    background: none;
    max-width: none;
    max-height: none;
    overflow: visible;
    cursor: zoom-out;
}

.lightbox::backdrop {
    background: rgba(24, 27, 32, 0.82);
}

.lightbox img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    border-radius: 14px;
    background: #fff;
}

.lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: #fff;
    background: rgba(24, 27, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.lightbox-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 28px 0;
    font-size: 15px;
    color: var(--muted);
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
}

.site-footer p {
    margin: 0;
}

.site-footer .heart {
    color: #e0364f;
}

.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer a {
    color: var(--muted);
}

.site-footer a:hover {
    color: var(--ink);
}

/* ---------- Inner pages (changelog, tools, legal) ---------- */

.page {
    padding: 56px 0 88px;
}

.page-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    letter-spacing: -0.02em;
}

.page-sub {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 1.1rem;
}

/* Changelog */

.releases {
    margin-top: 48px;
}

.release {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 8px 32px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.release h2 {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.release time {
    display: block;
    margin-top: 4px;
    font-size: 15px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.release ul {
    margin: 0;
    padding-left: 20px;
}

.release li {
    margin-bottom: 8px;
}

.release li:last-child {
    margin-bottom: 0;
}

.release li::marker {
    color: var(--green);
}

@media (max-width: 640px) {
    .release {
        grid-template-columns: 1fr;
    }

    .release time {
        margin-bottom: 8px;
    }
}

/* Tools */

.tabs {
    display: flex;
    gap: 28px;
    margin-top: 32px;
    border-bottom: 1px solid var(--line);
}

.tabs a {
    padding: 10px 0;
    margin-bottom: -1px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.tabs a:hover {
    color: var(--ink);
}

.tabs a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--green);
}

.tool {
    margin-top: 32px;
}

.tool-help {
    max-width: 44em;
}

#jsonArea {
    display: block;
    width: 100%;
    min-height: 44vh;
    margin-top: 20px;
    padding: 14px 16px;
    resize: vertical;
    font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid #c3c9d1;
    border-radius: 6px;
}

#jsonArea:focus {
    outline: 2px solid var(--green-deep);
    outline-offset: -1px;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.notice {
    max-width: 44em;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 15px;
    color: var(--muted);
}

.notice p:last-child {
    margin-bottom: 0;
}

/* Legal */

.prose {
    margin-top: 32px;
}

.prose a {
    overflow-wrap: anywhere;
}

.prose ul {
    padding-left: 22px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
