/* TrafficMeter's section. The site's type and buttons, the program's own
   "measuring glass": laboratory greys and the liquid of the app, whose colour
   follows what is used (TrafficMeter's LiquidPalette, in OKLCH, so a blend
   never turns to mud). Loaded after studio.css. */

.tm-page {
    --tm-glass: #E9EEF0;
    --tm-panel: #F6F9FA;
    --tm-ink: #14232E;
    --tm-muted: #6B7F8A;
    --tm-line: #C9D4D9;
    --tm-green: oklch(.64 .15 152);
    --tm-yellow: oklch(.79 .163 100);
    --tm-amber: oklch(.70 .155 68);
    --tm-h: clamp(300px, 50vh, 440px);
}

/* What the hero's glass shows: the level of the liquid and its colour. Both
   are registered, so they animate; their initial values are the reading
   after the animation (and the only one under reduced motion). */
@property --tm-level { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
@property --tm-liquid { syntax: "<color>"; inherits: true; initial-value: oklch(.79 .163 100); }

/* The first screen */

.tm-hero { padding: clamp(8px, 2vw, 24px) 12px 0; }
.tm-hero-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(36px, 7vw, 112px);
    padding: clamp(40px, 6vw, 84px) clamp(24px, 6vw, 96px);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(60% 80% at 12% 100%, rgba(255, 255, 255, .7), transparent 70%),
        var(--tm-glass);
    color: var(--tm-ink);
}

.tm-burette {
    display: grid;
    grid-template-columns: auto 96px;
    column-gap: 14px;
    justify-items: center;
    margin-right: 92px;   /* room for the reading on the right of the glass */
}
.tm-scale {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: start;
    height: calc(var(--tm-h) - 40px);
    margin: 0;
    padding: 0;
    list-style: none;
    font: 500 11px/1 var(--font-mono);
    color: var(--tm-muted);
    text-align: right;
}
.tm-scale li { transform: translateY(-50%); }
.tm-scale li:first-child { transform: none; }

.tm-glass {
    position: relative;
    grid-column: 2;
    width: 96px;
    height: var(--tm-h);
    animation: tm-drain 3.2s var(--ease) .4s both;
}
.tm-tube {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 2px solid rgba(20, 35, 46, .26);
    border-top-color: rgba(20, 35, 46, .12);
    border-radius: 8px 8px 48px 48px / 8px 8px 64px 64px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .25) 38%, rgba(255, 255, 255, .55) 78%, rgba(255, 255, 255, .2));
}
/* Graduation on the glass: a tick every 2 GB, a long one every 10. */
.tm-tube::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 18px;
    height: calc(var(--tm-h) - 40px);
    background:
        repeating-linear-gradient(to bottom, rgba(20, 35, 46, .42) 0 1.5px, transparent 1.5px calc((var(--tm-h) - 40px) / 4)) left / 18px 100% no-repeat,
        repeating-linear-gradient(to bottom, rgba(20, 35, 46, .3) 0 1px, transparent 1px calc((var(--tm-h) - 40px) / 20)) left / 9px 100% no-repeat;
    pointer-events: none;
}
.tm-liquid {
    position: absolute;
    inset: auto 0 0 0;
    height: var(--tm-level);
    background: linear-gradient(180deg,
        color-mix(in oklch, var(--tm-liquid) 72%, white),
        var(--tm-liquid) 24%,
        color-mix(in oklch, var(--tm-liquid) 93%, black));
}
.tm-surface {
    position: absolute;
    inset: -3px 0 auto;
    height: 6px;
    border-radius: 50%;
    background: color-mix(in oklch, var(--tm-liquid) 45%, white);
}
/* The reading points at the surface from beside the glass. */
.tm-reading {
    position: absolute;
    left: calc(100% + 12px);
    bottom: var(--tm-level);
    transform: translateY(50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--tm-ink);
    color: #fff;
    font: 600 12px/1 var(--font-mono);
    white-space: nowrap;
    animation: tm-read .5s var(--ease) 3.4s both;
}
.tm-reading::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    border: 6px solid transparent;
    border-right-color: var(--tm-ink);
    transform: translateY(-50%);
}
.tm-cock {
    grid-column: 2;
    width: 40px;
    height: 12px;
    margin-top: 8px;
    border-radius: 4px;
    background: var(--tm-amber);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
}
.tm-tip {
    position: relative;
    grid-column: 2;
    width: 8px;
    height: 30px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(rgba(20, 35, 46, .32), rgba(20, 35, 46, .14));
}
.tm-drop {
    position: absolute;
    left: 50%;
    top: 100%;
    width: 8px;
    height: 11px;
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    background: var(--tm-yellow);
    transform: translate(-50%, 2px);
    opacity: 0;
    animation: tm-drip 2.6s ease-in 3.6s infinite;
}

@keyframes tm-drain {
    from { --tm-level: 97%; --tm-liquid: var(--tm-green); }
    to { --tm-level: 50%; --tm-liquid: var(--tm-yellow); }
}
@keyframes tm-read { from { opacity: 0; } to { opacity: 1; } }
@keyframes tm-drip {
    0% { opacity: 0; transform: translate(-50%, 0) scale(.4); }
    25% { opacity: 1; transform: translate(-50%, 2px) scale(1); }
    60% { opacity: 1; transform: translate(-50%, 46px) scale(1, 1.15); }
    61%, 100% { opacity: 0; transform: translate(-50%, 46px); }
}
@media (prefers-reduced-motion: reduce) {
    .tm-glass, .tm-reading, .tm-drop { animation: none; }
}

.tm-hero-text { min-width: 0; }
.tm-title {
    margin: 14px 0 18px;
    /* One word that must stay whole: Unbounded is wide, so the size follows
       the viewport down to a phone. */
    font: 600 clamp(28px, 8.2vw, 108px)/.95 var(--font-display);
    letter-spacing: -.05em;
}
.tm-lead { max-width: 560px; font-size: clamp(17px, 1.55vw, 21px); line-height: 1.5; color: #33424D; text-wrap: pretty; }

/* The download plate: the button, then what is in the file. */
.tm-plate {
    max-width: 580px;
    margin-top: clamp(26px, 3vw, 38px);
    padding: 22px 24px 20px;
    border: 1px solid var(--tm-line);
    border-radius: var(--radius-l);
    background: var(--tm-panel);
    scroll-margin-top: 24px;
}
.tm-get { height: 56px; padding: 0 26px; font-size: 16px; background: var(--tm-ink); }
.tm-get svg { width: 18px; height: 18px; transform: rotate(90deg); }
.tm-get:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; }
.tm-specs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    margin: 20px 0 0;
}
.tm-specs div { min-width: 0; }
.tm-specs dt { font: 500 11px/1.4 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--tm-muted); }
.tm-specs dd { margin: 3px 0 0; font-size: 15px; line-height: 1.4; color: var(--tm-ink); }
.tm-specs .tm-sum { grid-column: 1 / -1; }
.tm-sum code { font: 400 12px/1.55 var(--font-mono); color: var(--tm-ink); overflow-wrap: anywhere; user-select: all; }
.tm-note { margin-top: 16px; font-size: 14.5px; line-height: 1.5; color: var(--tm-muted); }
.tm-soon { font: 600 18px/1.35 var(--font-body); color: var(--tm-ink); }
.tm-soon + .tm-specs { margin-top: 12px; }

/* The program itself */

.tm-shot { padding-top: clamp(40px, 6vw, 88px); }
.tm-window {
    margin: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(20, 35, 46, .1), 0 60px 120px -60px rgba(20, 35, 46, .55);
}
.tm-window img { display: block; width: 100%; height: auto; }

/* Sections */

.tm-section { padding-top: clamp(64px, 8vw, 120px); scroll-margin-top: 24px; }
.tm-h2 { font: 600 clamp(28px, 3.4vw, 44px)/1.06 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.tm-section .tm-h2 { color: var(--tm-ink); }
.tm-section-lead { margin-top: 14px; max-width: 620px; font-size: clamp(17px, 1.45vw, 20px); color: var(--slate); text-wrap: pretty; }
.tm-section-note { margin-top: 26px; max-width: 640px; font-size: 15px; color: var(--slate); }

.tm-measures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 36px 0 0;
}
.tm-measures div {
    padding: 22px 22px 24px;
    border: 1px solid var(--tm-line);
    border-radius: 22px;
    background: var(--tm-panel);
}
.tm-measures dt { font: 500 11.5px/1.4 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--tm-ink); }
.tm-measures dd { margin: 10px 0 0; font-size: 16px; line-height: 1.55; color: #3B3542; }

/* The guide is a sequence: the numbers are the order of the steps. */
.tm-steps { counter-reset: step; max-width: 760px; margin: 36px 0 0; padding: 0; list-style: none; }
.tm-steps li { position: relative; padding: 0 0 30px 64px; counter-increment: step; }
.tm-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--tm-ink);
    color: #fff;
    font: 600 14px/1 var(--font-mono);
}
.tm-steps li::after {
    content: "";
    position: absolute;
    left: 21px;
    top: 50px;
    bottom: 6px;
    width: 2px;
    border-radius: 1px;
    background: var(--tm-line);
}
.tm-steps li:last-child { padding-bottom: 0; }
.tm-steps li:last-child::after { display: none; }
.tm-steps h3 { margin: 10px 0 6px; font: 600 19px/1.3 var(--font-body); color: var(--tm-ink); }
.tm-steps p { font-size: 16px; line-height: 1.6; color: #3B3542; }

/* The license: the site's dark box, lit by the liquid's colours. */
.tm-license { padding: clamp(64px, 8vw, 120px) 12px 0; scroll-margin-top: 24px; }
.tm-license > .container { padding: 0; }
.tm-license-box { padding: clamp(56px, 8vw, 110px) clamp(24px, 6vw, 96px); }
.tm-license-box::before {
    animation: none;
    background:
        radial-gradient(46% 60% at 14% 82%, color-mix(in oklch, var(--tm-green) 85%, transparent), transparent 72%),
        radial-gradient(42% 55% at 86% 18%, color-mix(in oklch, var(--tm-amber) 62%, transparent), transparent 70%);
}
.tm-license-box .tm-h2 { color: #fff; }
.tm-license-box .contact-lead { margin: 16px 0 30px; }

/* Plans: glass panels on the dark box, the price in instrument numerals. */
.tm-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    max-width: 760px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tm-plan {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 24px;
    background: rgba(255, 255, 255, .06);
}
.tm-plan-title { font: 600 17px/1.3 var(--font-body); color: #fff; }
.tm-price { font: 600 clamp(30px, 3.4vw, 40px)/1 var(--font-display); letter-spacing: -.03em; color: #fff; }
.tm-price s { margin-right: 6px; font-size: .55em; font-weight: 500; letter-spacing: 0; color: rgba(255, 255, 255, .5); }
.tm-plan-note { flex: 1; font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .72); }
.tm-plan .btn { align-self: flex-start; margin-top: 6px; }
.tm-offer-link { margin-top: 24px; font-size: 15px; }
.tm-offer-link a { color: rgba(255, 255, 255, .85); text-decoration: underline; text-underline-offset: 3px; }
.tm-offer-link a:hover { color: #fff; }
.tm-terms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tm-section-note a { color: var(--magenta); text-decoration: underline; text-underline-offset: 3px; }

.tm-popover {
    width: min(460px, calc(100vw - 32px));
    margin: auto;
    padding: 30px 30px 28px;
    border: 0;
    border-radius: 28px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 50px 140px -30px rgba(20, 5, 30, .6);
}
.tm-popover::backdrop { background: rgba(19, 10, 23, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tm-popover-title { margin-bottom: 10px; font: 600 22px/1.2 var(--font-display); letter-spacing: -.02em; }
.tm-popover p { margin-bottom: 22px; color: var(--slate); }

.tm-page .footer { margin-top: clamp(40px, 6vw, 80px); }

@media (max-width: 960px) {
    .tm-measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tm-page .bar-links a[href^="#"] { display: none; }
}
@media (max-width: 720px) {
    .tm-page { --tm-h: 220px; }
    .tm-hero-inner { grid-template-columns: minmax(0, 1fr); justify-items: start; }
    .tm-burette { grid-template-columns: auto 76px; margin-right: 88px; }
    .tm-glass { width: 76px; }
}
@media (max-width: 560px) {
    .tm-measures, .tm-terms { grid-template-columns: minmax(0, 1fr); }
    .tm-specs { grid-template-columns: minmax(0, 1fr); }
    .tm-plate { padding: 18px; }
    .tm-get { width: 100%; justify-content: center; }
    .tm-steps li { padding-left: 56px; }
}
