/* algizmobile — the safe dial. Owner: DIAL. Markup is generated by js/dial.js (window.AlgizDial).
   Geometry: every length is in cqw of .adl (1cqw = 1% of the dial's width), so the whole object scales 140–380 px.
   Lighting rule: the light never rotates. Only .adl-rot, .adl-wall-ridges and .adl-rune turn; every highlight,
   sheen and shadow is a fixed sibling layer above or below them. */

.adl{
  --adl-shadow:15,61,76;               /* ground shadow tint (Fjord) */
  --adl-ring:var(--fjord);             /* progress + focus ring */
  position:relative; width:100%; min-width:140px; max-width:380px; aspect-ratio:1;
  container-type:inline-size; container-name:adl;
  user-select:none; -webkit-user-select:none; -webkit-tap-highlight-color:transparent;
  outline:none; isolation:isolate;
}
.on-dark .adl, .adl.adl--dark{ --adl-shadow:0,8,12; --adl-ring:var(--lamp); }
.adl:focus-visible{ outline:none; }
.adl *, .adl *::before, .adl *::after{ pointer-events:none; }
.adl svg{ display:block; overflow:visible; }

/* every layer is a circle positioned by inset (cqw from the dial's own box) */
.adl-l{ position:absolute; border-radius:50%; }

/* ---------- outside the body: progress, focus, ground ---------- */
/* both rings share the body's tilt, so they hug the dial instead of floating as flat circles */
.adl-progress{ position:absolute; inset:0; width:100%; height:100%; transform:perspective(160cqw) rotateX(9deg) rotate(-90deg); transform-origin:50% 55%;
  opacity:0; transition:opacity var(--t-std) var(--ease); }
.adl-progress.is-on{ opacity:1; }
.adl-progress circle{ fill:none; stroke-width:.7; }
.adl-progress .p-track{ stroke:var(--adl-ring); opacity:.14; }
.adl-progress .p-arc{ stroke:var(--adl-ring); stroke-linecap:round; stroke-dasharray:1 1; stroke-dashoffset:1; }

.adl-focus{ inset:2.2cqw; transform:perspective(160cqw) rotateX(9deg); transform-origin:50% 55%; border:2px solid transparent; transition:border-color var(--t-quick) var(--ease); }
.adl:focus-visible .adl-focus{ border-color:var(--adl-ring); }

/* soft ground shadow + tighter contact shadow, tinted Fjord; shifted by JS with the tilt */
.adl-ground{ inset:6cqw; transform:translate(0, 4.2cqw); }
.adl-ground::before, .adl-ground::after{ content:""; position:absolute; border-radius:50%; }
.adl-ground::before{ inset:-6cqw -5cqw -9cqw;
  background:radial-gradient(closest-side, rgba(var(--adl-shadow),.30), rgba(var(--adl-shadow),.13) 55%, rgba(var(--adl-shadow),0)); }
.adl-ground::after{ inset:1cqw 2cqw -1.4cqw;
  background:radial-gradient(closest-side, rgba(var(--adl-shadow),.42), rgba(var(--adl-shadow),.18) 70%, rgba(var(--adl-shadow),0)); }

/* ---------- body: a short cylinder seen slightly from above (tilt written by JS) ---------- */
.adl-body{ position:absolute; inset:0; transform:perspective(160cqw) rotateX(9deg); transform-origin:50% 55%; }

/* housing — fixed to the page */
.adl-housing{ inset:5cqw;
  background:linear-gradient(158deg, #FDFEFE 0%, #E3E9EB 22%, #B3BFC4 52%, #77878E 80%, #55646B 100%);
  box-shadow:0 .25cqw .35cqw rgba(var(--adl-shadow),.40), 0 1.4cqw 2.4cqw -.6cqw rgba(var(--adl-shadow),.34); }
/* brushed top face of the bezel: circular brushing + anisotropic bow-tie sheen (fixed) */
.adl-bezel{ inset:6.3cqw;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.10) 0 .5px, rgba(40,60,70,.045) .5px 1.2px),
    radial-gradient(closest-side, transparent 90.6%, rgba(40,60,70,.45) 91%, rgba(255,255,255,.8) 91.8%, transparent 92.4%),
    conic-gradient(from -45deg, #FFFFFF 0deg, #C0CBD0 34deg, #7F8F96 90deg, #B5C1C6 140deg, #EEF3F4 180deg, #B0BDC2 222deg, #7B8B92 270deg, #BCC7CC 318deg, #FFFFFF 360deg); }
.adl-bezel::after{ content:""; position:absolute; inset:0; border-radius:50%;
  background:linear-gradient(165deg, rgba(255,255,255,.30), rgba(255,255,255,0) 42%, rgba(20,45,55,0) 60%, rgba(20,45,55,.20));
  box-shadow:inset 0 .18cqw .1cqw rgba(255,255,255,.85), inset 0 -.18cqw .2cqw rgba(30,50,60,.25); }
/* inner chamfer falling into the well: faces down-and-away at the top, so it is dark there and lit at the bottom */
.adl-lip{ inset:11.2cqw;
  background:linear-gradient(160deg, #56656C 0%, #7E8D94 30%, #C9D3D7 70%, #F2F6F7 100%); }
.adl-well{ inset:12.3cqw; background:radial-gradient(closest-side, #1A262B 80%, #2B383E 100%); }

/* side wall of the rotating grip: a second knurled disc offset downward; its ridges turn with the grip */
.adl-wall{ position:absolute; inset:13.5cqw; border-radius:50%; transform:translate(0, 2.1cqw); }
.adl-wall-ridges{ position:absolute; inset:0; border-radius:50%; will-change:transform;
  background:repeating-conic-gradient(from 0deg, #3E4C53 0deg, #9AA8AE .9deg, #B9C4C8 1.25deg, #76858C 1.9deg, #3E4C53 3deg); }
.adl-wall-shade{ position:absolute; inset:0; border-radius:50%;
  background:linear-gradient(180deg, rgba(14,30,38,.10) 45%, rgba(14,30,38,.62) 100%),
             linear-gradient(90deg, rgba(14,30,38,.35), rgba(14,30,38,0) 35%, rgba(255,255,255,.10) 55%, rgba(14,30,38,.40));
  box-shadow:0 .3cqw .5cqw rgba(0,10,14,.55); }

/* ---------- the rotating part: knurled grip + enamel face + ticks (one wrapper) ---------- */
.adl-rot{ position:absolute; inset:13.5cqw; border-radius:50%; will-change:transform; }
.adl-grip{ position:absolute; inset:0; border-radius:50%;
  /* turned bands are radially symmetric, so they may rotate; outer chamfer 96.5–100 %, knurl, inner polished step 83.6–88 % */
  background:
    radial-gradient(closest-side, transparent 81.8%, #56656C 82%, #8E9CA2 83.6%, #E9EEF0 85.2%, #FFFFFF 86.2%, #AEBAC0 87.6%, #56656C 88.2%, transparent 88.6%,
      transparent 96.2%, #4F5E65 96.5%, #DCE3E6 97.6%, #9AA8AE 99.2%, #5E6D74 100%),
    repeating-conic-gradient(from 0deg, #5F6E75 0deg, #D9E1E4 .85deg, #F6F9FA 1.2deg, #B5C1C6 1.85deg, #5F6E75 3deg); }
.adl-face{ position:absolute; inset:6.6cqw; border-radius:50%;
  background:radial-gradient(closest-side, #134A5B 0%, #0F3D4C 62%, #0C3341 92%, #092A35 100%); }
.adl-ticks{ position:absolute; inset:6.6cqw; width:60cqw; height:60cqw; }

.adl-ticks path{ fill:none; stroke-linecap:butt; }
.adl-ticks .t-minor{ stroke:rgba(246,248,249,.62); stroke-width:.7; }
.adl-ticks .t-five{ stroke:rgba(246,248,249,.82); stroke-width:1; }
.adl-ticks .t-ten{ stroke:#F6F8F9; stroke-width:1.3; }
.adl-ticks .t-detent{ stroke:#F6F8F9; stroke-width:2.6; transition:stroke var(--t-std) var(--ease); }
.adl-ticks .t-ring{ stroke:rgba(201,211,215,.30); stroke-width:.6; }
.adl-ticks .t-flash{ stroke:var(--pine-bright); stroke-width:2.2; opacity:0; }
.adl-ticks text{ fill:#F6F8F9; font-family:var(--font); font-weight:500; font-size:12.5px; letter-spacing:-.02em;
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; text-anchor:middle; dominant-baseline:central; }
.adl-ticks .n-detent{ font-weight:600; }

/* fixed light over the grip: bow-tie sheen of a turned part + top light; masked to the knurl ring */
.adl-grip-light{ inset:13.5cqw;
  -webkit-mask:radial-gradient(closest-side, transparent calc(83.6% - .5px), #000 83.6%);
          mask:radial-gradient(closest-side, transparent calc(83.6% - .5px), #000 83.6%);
  background:
    linear-gradient(170deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,0) 40%, rgba(12,30,38,0) 58%, rgba(12,30,38,.30) 100%),
    conic-gradient(from -90deg, rgba(255,255,255,.04) 0deg, rgba(255,255,255,.62) 45deg, rgba(255,255,255,.04) 100deg,
      rgba(12,30,38,.14) 140deg, rgba(12,30,38,.46) 225deg, rgba(12,30,38,.12) 300deg, rgba(255,255,255,.04) 360deg);
  box-shadow:inset 0 .28cqw .18cqw rgba(255,255,255,.75), inset 0 -.35cqw .35cqw rgba(10,25,32,.45); }
/* fixed light over the enamel: recess shadow under the grip's inner lip + a soft daylight window reflection */
.adl-face-light{ inset:20.1cqw;
  background:
    radial-gradient(ellipse 58% 30% at 34% 18%, rgba(255,255,255,.16), rgba(255,255,255,0) 70%),
    linear-gradient(158deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 38%, rgba(0,12,18,0) 62%, rgba(0,12,18,.22) 100%);
  box-shadow:inset 0 .9cqw 1.3cqw rgba(0,10,15,.62), inset 0 -.2cqw .3cqw rgba(255,255,255,.08), 0 0 0 .22cqw rgba(30,48,56,.55); }

/* ---------- raised centre cap ---------- */
.adl-cap-shadow{ inset:38cqw; box-shadow:.35cqw 1.3cqw 1.9cqw rgba(0,8,12,.62), 0 .3cqw .4cqw rgba(0,8,12,.5); }
.adl-cap{ inset:38cqw;
  background:
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.12) 0 .5px, rgba(40,60,70,.05) .5px 1.1px),
    radial-gradient(closest-side, #E9EEF0 0%, #D7DFE2 45%, #B3BFC4 78%, #7E8D93 96%, #5E6D74 100%); }
.adl-rune-wrap{ inset:38cqw; filter:drop-shadow(0 .16cqw 0 rgba(255,255,255,.9)); }
.adl-rune{ position:absolute; inset:0; border-radius:50%; will-change:transform; }
.adl-rune svg{ position:absolute; left:28%; top:28%; width:44%; height:44%; }
.adl-rune path{ fill:none; stroke:#34434A; stroke-width:2.5; stroke-linecap:square; stroke-linejoin:miter; }
.adl-cap-light{ inset:38cqw;
  background:
    radial-gradient(circle at 36% 28%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.45) 14%, rgba(255,255,255,0) 40%),
    radial-gradient(circle at 62% 74%, rgba(20,38,46,0) 38%, rgba(20,38,46,.34) 100%);
  box-shadow:inset 0 .22cqw .15cqw rgba(255,255,255,.9), inset 0 -.3cqw .45cqw rgba(20,38,46,.35); }

/* ---------- index mark + bolts (fixed to the housing) ---------- */
.adl-index{ position:absolute; inset:0; width:100%; height:100%; transform-origin:50% 50%; }
.adl-index .i-l{ fill:#F7D271; }
.adl-index .i-r{ fill:#D8A532; }
.adl-index .i-edge{ fill:none; stroke:rgba(110,76,10,.55); stroke-width:.18; stroke-linejoin:round; }
.adl-index .i-seat{ fill:rgba(30,48,56,.28); }

.adl-arm{ position:absolute; inset:0; }
.adl-slot{ position:absolute; left:48.4cqw; top:7.6cqw; width:3.2cqw; height:5.4cqw; border-radius:.9cqw;
  background:linear-gradient(180deg, #1F2C31, #3A484E);
  box-shadow:inset 0 .25cqw .3cqw rgba(0,0,0,.6), 0 .12cqw 0 rgba(255,255,255,.7); }
.adl-bolt{ position:absolute; left:48.8cqw; top:7.9cqw; width:2.4cqw; height:4.4cqw; border-radius:.7cqw;
  background:linear-gradient(90deg, #8E9CA2 0%, #F3F6F7 38%, #C5CFD3 62%, #6F7E85 100%);
  box-shadow:inset 0 -.25cqw .2cqw rgba(30,48,56,.35), 0 .2cqw .3cqw rgba(0,10,14,.45);
  transform:translateY(0); transition:transform var(--t-std) var(--ease-exit); }
.adl.is-locked .adl-bolt{ transform:translateY(3.1cqw); transition:transform var(--t-std) var(--ease); }
.adl.is-locked .adl-ticks .t-detent{ stroke:var(--pine-bright); }
.adl.is-flash .adl-ticks .t-flash{ animation:adl-flash 760ms var(--ease) 120ms 1 both; }
@keyframes adl-flash{ 0%{ opacity:0; } 30%{ opacity:1; } 100%{ opacity:0; } }

/* ---------- hit area: the round housing only, so page scroll still works on the square's corners ---------- */
.adl-hit{ position:absolute; inset:5cqw; border-radius:50%; pointer-events:auto !important; touch-action:none; cursor:grab; }
.adl.is-dragging .adl-hit{ cursor:grabbing; }

/* small dials: drop minor ticks and every other numeral, enlarge the rest so they stay legible */
@container adl (max-width:220px){
  .adl-ticks .t-minor{ opacity:0; }
  .adl-ticks .n-minor{ display:none; }
  .adl-ticks text{ font-size:19px; font-weight:600; }
  .adl-ticks .t-five{ stroke-width:1.3; }
}
