/* ==========================================================================
   Dial Your Shot brand mark - "Taste Line" (BrandMark.razor)
   Generated by design/brand/_build/build.py - edit the generator, not this file.

   The name is ink. All of the colour lives in one hairline under it: the extraction
   spectrum (sour -> sweet -> bitter) with a ring locked on the sweet spot.
   The line, ring and core share one box (svg.dys-scale): the line is that element's
   CSS background, the ring and core are circles at 50%/50% in the same box, so they
   cannot drift apart. Keep every offset inside it a whole px: even rings and rules.
   ========================================================================== */

:root {
    --taste-sour:   var(--color-info, #3b82f6);
    --taste-sweet:  var(--color-sweet, #22c55e);
    --taste-bitter: var(--color-danger, #ef4444);
    /* OKLCH-sampled stops either side of the sweet plateau (42% - 58%) */
    --taste-l: #3b82f6 0%, #0590f5 3.5%, #009df2 7%, #00a9ec 10.5%, #00b4e5 14%, #00bedc 17.5%, #00c6d2 21%, #00cec9 24.5%, #2dd4bf 28%, #00d2ac 31.5%, #00ce97 35%, #00ca7d 38.5%;
    --taste-r: #82be24 61.5%, #b5b400 65%, #daa900 68.5%, #f59e0b 72%, #f79300 75.5%, #f88900 79%, #f87e05 82.5%, #f87315 86%, #f76722 89.5%, #f55c2e 93%, #f25039 96.5%, #ef4444 100%;
    --taste-spectrum: linear-gradient(90deg, var(--taste-l), var(--taste-sweet) 42% 58%, var(--taste-r));
}
html.theme-light {
    --taste-l: #2563eb 0%, #006fe3 3.5%, #007ad8 7%, #0082cb 10.5%, #0089bd 14%, #008eae 17.5%, #0091a0 21%, #009393 24.5%, #0d9488 28%, #00997f 31.5%, #009d73 35%, #00a161 38.5%;
    --taste-r: #939900 61.5%, #ca8a04 65%, #d77b00 68%, #e16b00 71%, #ea580c 74%, #e85210 77.7%, #e74c14 81.4%, #e54518 85.1%, #e33e1b 88.9%, #e1371f 92.6%, #de2f23 96.3%, #dc2626 100%;
}

.dys {
    --ink: var(--text-primary, #e8eaf0);
    --w: 228px; --wt: 30; --gap: 5px; --rule: 2px; --ring: 10px; --ring-w: 1.5px; --cut: 2px; --core: 4px;
    --legend: .72rem;
    position: relative;
    display: grid;
    gap: var(--gap);
    width: max-content;
    line-height: 1;
    color: var(--ink);
}

/* The accessible name and the link text: real text, read once, in English. */
.dys-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Michroma outlines; the stroke (font units) is the optical weight per size. */
.dys-word {
    display: block;
    width: var(--w);
    height: auto;
    aspect-ratio: 16.2724;
    overflow: visible;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: var(--wt);
    stroke-linejoin: round;
}

.dys-scale {
    --hole: calc(var(--ring) / 2 + var(--cut));
    display: block;
    width: 100%;
    height: var(--ring);
    overflow: visible;
    contain: inline-size; /* its 300px default width must not widen the lockup */
    background:
        radial-gradient(closest-side, var(--taste-sour) calc(100% - .35px), #0000) 0 50% / var(--rule) var(--rule) no-repeat,
        radial-gradient(closest-side, var(--taste-bitter) calc(100% - .35px), #0000) 100% 50% / var(--rule) var(--rule) no-repeat,
        linear-gradient(90deg, var(--taste-l),
            var(--taste-sweet) min(42%, calc(50% - var(--hole))) calc(50% - var(--hole)),
            #0000 0 calc(50% + var(--hole)),
            var(--taste-sweet) 0 max(58%, calc(50% + var(--hole))),
            var(--taste-r)) 50% 50% / calc(100% - var(--rule)) var(--rule) no-repeat;
}
.dys-ring {
    r: calc(var(--ring) / 2 - var(--ring-w) / 2);
    fill: none;
    stroke: currentColor;
    stroke-width: var(--ring-w);
}
.dys-core {
    r: calc(var(--core) / 2);
    fill: var(--taste-sweet);
}
.dys-fc { display: none; }

/* SOUR / SWEET SPOT / BITTER, from the existing i18n keys. SWEET SPOT sits on the ring:
   equal side columns, and the trailing tracking of the centre and last labels is cancelled. */
.dys-legend {
    --track: .18em;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: .6em;
    contain: inline-size;
    font: 600 var(--legend)/1 var(--font-display, 'Inter', 'Segoe UI', system-ui, sans-serif);
    letter-spacing: var(--track);
    text-transform: uppercase;
    color: var(--text-secondary);
}
.dys-legend b {
    font-weight: inherit;
    overflow-wrap: anywhere; /* enlarged text wraps inside its column instead of colliding */
}
.dys-legend b::before { content: attr(data-l); }
.dys-legend b:nth-child(2) { color: var(--text-primary); margin-right: calc(-1 * var(--track)); }
.dys-legend b:last-child { text-align: right; margin-right: calc(-1 * var(--track)); }
/* No capitals in these scripts: real size, no tracking (it breaks the Devanagari headstroke). */
.dys-legend:lang(ar), .dys-legend:lang(hi), .dys-legend:lang(zh) {
    --track: 0em;
    font-size: calc(var(--legend) * 1.2);
}

/* ---- variants ------------------------------------------------------------ */

/* Header: desktop values are the defaults above. */
@media (max-resolution: 1.2dppx) {
    .dys--header { --ring-w: 2px; } /* whole-px ring on 100% screens: crisp, not grey */
}
@media (max-width: 860px) {
    .dys--header { --w: 170px; --wt: 44; --gap: 3px; --rule: 2px; --ring: 8px; --ring-w: 1.25px; --cut: 2px; --core: 3.2px; }
    .dys--header .dys-legend { display: none; }
}
@media (max-width: 350px) {
    .dys--header { --w: 154px; --wt: 48; }
}

/* Card (sign in, sign up, username, profile): the name only - the header right above
   already carries the line. Fluid down to the 218px a 320px phone leaves inside the card. */
.dys--card { --w: 248px; --wt: 30; width: min(var(--w), 100%); }
.dys--card .dys-word { width: 100%; }

/* Eyebrow (landing hero): the line alone, decorative. */
.dys--eyebrow { --w: 56px; --rule: 2px; --ring: 8px; --ring-w: 1.25px; --cut: 2px; --core: 3.2px; width: var(--w); flex: none; }

/* Hero (OG card, marketing): one size knob. BrandMark wraps it in .dys-fit, so it
   always fits its container; geometry steps down with the container. */
.dys-fit { container-type: inline-size; }
.dys--hero { --w: 944px; --wt: 18; --gap: 22px; --rule: 4px; --ring: 30px; --ring-w: 4.5px; --cut: 7px; --core: 8.5px; --legend: 15px; }
.dys--hero .dys-legend { margin-top: 8px; }
@supports (width: 1cqi) {
    .dys--hero { --w: min(944px, 100cqi); }
}
@container (max-width: 900px) {
    .dys--hero { --wt: 26; --gap: 12px; --rule: 2px; --ring: 18px; --ring-w: 2.5px; --cut: 4px; --core: 5.5px; --legend: 12px; }
    .dys--hero .dys-legend { margin-top: 4px; }
}
@container (max-width: 520px) {
    .dys--hero { --wt: 36; --gap: 6px; --rule: 2px; --ring: 10px; --ring-w: 1.5px; --cut: 2px; --core: 4px; --legend: 10px; }
    .dys--hero .dys-legend { margin-top: 2px; }
}

/* ---- the header link ------------------------------------------------------- */
.app-title-link {
    align-self: flex-start; /* the link (tap target, focus ring) is the mark alone */
    border-radius: 6px;
}
/* On desktop the mark stands alone in the header. On phones the account row sits 5px
   under the link (bar-menu.css), so the outline pulls in to stay clear of it. */
.app-title-link:focus-visible {
    outline: 2px solid var(--accent-amber);
    outline-offset: 2px;
}
@media (max-width: 860px) {
    .app-title-link:focus-visible { outline-offset: 1px; }
}
/* Hover / focus: the sweet spot fills the ring. No colour change. */
.dys-core { transition: r var(--transition-fast, .15s ease); }
.app-title-link:hover .dys-core,
.app-title-link:focus-visible .dys-core { r: calc(var(--ring) / 2 - var(--ring-w) - .5px); }
@media (prefers-reduced-motion: reduce) {
    .dys-core { transition: none; }
}

/* ---- Windows contrast themes ------------------------------------------------ */
/* The gradient is dropped (background-image: none); draw the line from the centre
   outwards in the system colour (LinkText in the header link, CanvasText elsewhere). */
@media (forced-colors: active) {
    .dys-fc {
        display: inline;
        stroke: currentColor;
        stroke-width: var(--rule);
        stroke-dasharray: 0 var(--hole) 100000px;
    }
    .dys-core { fill: currentColor; }
}

/* ---- print ------------------------------------------------------------------ */
/* Paper is white and "Background graphics" is off by default: black ink, light stops,
   and keep the line (it is a background). */
@media print {
    .dys {
        --ink: #000;
        --taste-sour: #2563eb;
        --taste-sweet: #16a34a;
        --taste-bitter: #dc2626;
        --taste-l: #2563eb 0%, #006fe3 3.5%, #007ad8 7%, #0082cb 10.5%, #0089bd 14%, #008eae 17.5%, #0091a0 21%, #009393 24.5%, #0d9488 28%, #00997f 31.5%, #009d73 35%, #00a161 38.5%;
        --taste-r: #939900 61.5%, #ca8a04 65%, #d77b00 68%, #e16b00 71%, #ea580c 74%, #e85210 77.7%, #e74c14 81.4%, #e54518 85.1%, #e33e1b 88.9%, #e1371f 92.6%, #de2f23 96.3%, #dc2626 100%;
    }
    .dys-scale { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .dys-legend { color: #555; }
    .dys-legend b:nth-child(2) { color: #000; }
}
