/* =====================================================================
   DOSIK TECHNOLOGY · BASE
   Reset · document · typography · RTL & bidi · focus · utilities ·
   accessibility modes (stop animations, underline links) · reduced motion
   Every layout rule uses logical properties (inline = right→left in RTL).
   ===================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: calc(100% * var(--fs-scale));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--hdr-h) + 16px);
  hanging-punctuation: first;
}
@media (prefers-reduced-motion: no-preference) {
  html:not(.a11y-still) { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-2);
  font: var(--fw-regular) var(--fz-body) / var(--lh-body) var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  /* a word or a kept-together name (Ui.KeepTogether: "Google Workspace" with a no-break space) that is wider than its whole
     line — very large text on a narrow phone — breaks instead of being cut off at the edge */
  overflow-wrap: break-word;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, h5 {
  margin: 0;
  color: var(--text);
  font-family: var(--f-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd, figure, blockquote { margin: 0; }
mark { background: none; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
table { border-collapse: collapse; }
main { overflow-x: clip; }   /* never a scroll container, so sticky children keep working */
main:focus { outline: none; }
[hidden] { display: none !important; }
html.no-scroll { overflow: hidden; }

/* ---------- typography roles ---------- */
.display { font-size: var(--fz-display); line-height: var(--lh-display); font-weight: var(--fw-bold); }
.h1 { font-size: var(--fz-h1); line-height: 1.08; font-weight: var(--fw-bold); }
.h2 { font-size: var(--fz-h2); line-height: 1.1; font-weight: var(--fw-bold); }
.h3 { font-size: var(--fz-h3); line-height: 1.25; font-weight: var(--fw-semibold); }
.h4 { font-size: var(--fz-h4); line-height: 1.3; font-weight: var(--fw-semibold); }
.lead { font-size: var(--fz-lead); line-height: 1.7; color: var(--text-2); }
.small { font-size: var(--fz-sm); line-height: 1.55; }
.muted { color: var(--text-3); }
.prose { max-width: var(--maxw-text); }
.prose > * + * { margin-top: 1em; }
.prose a, .text-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover, .text-link:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

/* gradient highlight — display sizes only (≥ 2rem, weight ≥ 600) */
.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.theme-dark .grad-text, .grad-text--dark { background-image: var(--grad-text-dark); }

/* ---------- RTL & bidi ----------
   Phone numbers, e-mails, hours ranges, ISO codes and Latin names inside Hebrew are isolated:
   <span dir="ltr" class="num">08-6105661</span> · <bdi>Microsoft</bdi>                         */
bdi { unicode-bidi: isolate; }
/* a Latin run is laid out as a unit (short names keep no-break spaces, Ui.KeepTogether), but it never widens its column:
   only a run longer than the whole line breaks inside, and a grid or flex column sizes as if it could */
bdi { overflow-wrap: anywhere; }
[dir="ltr"] { unicode-bidi: isolate; }
a[href^="tel:"], .nowrap, .num[dir="ltr"] { white-space: nowrap; }
/* a phone BUTTON may wrap its label at large text sizes; the number itself stays whole in its .num[dir=ltr] span */
a.btn[href^="tel:"] { white-space: normal; }
.num { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

/* ---------- icons ---------- */
.ico {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ico--fill { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- layout primitives ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--maxw-wide) + 2 * var(--gutter)); }
.container--text { max-width: calc(var(--maxw-text) + 2 * var(--gutter)); }
.section { padding-block: var(--sec-y); }
.stack { display: grid; gap: var(--stack-gap, var(--sp-4)); align-content: start; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--sp-3)); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-6); }

/* ---------- focus ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.theme-dark :focus-visible { outline-color: var(--focus-on-dark); }
/* a white form card inside a navy chapter is a light surface again: the light ring (≥ 3:1 on white) */
.theme-dark .form-card :focus-visible { outline-color: var(--focus); }
:focus:not(:focus-visible) { outline: none; }

/* ---------- utilities ---------- */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; z-index: var(--z-skip); top: 12px; inset-inline-start: 16px;
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--text); color: var(--white); font: var(--fw-semibold) 1rem/1 var(--f-display);
  transform: translateY(-160%); transition: transform var(--t-2) var(--e-out);
}
.skip:focus { transform: none; }
.theme-dark { color: var(--on-night-2); }
.theme-dark :is(h1, h2, h3, h4) { color: var(--on-night); }

/* ---------- accessibility modes ---------- */
/* "stop animations" (accessibility menu) — same result as the OS reduced-motion preference */
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after {
  animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .01s !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
}
html.a11y-links a:not(.btn) { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px !important; }
/* buttons get a dashed marker, except while focused: the focus ring (base.css focus rules) must stay visible (WCAG 2.4.7) */
html.a11y-links .btn:not(:focus-visible) { outline: 2px dashed currentColor; outline-offset: 2px; }
html.a11y-readable body { word-spacing: .08em; letter-spacing: .01em; }
html.a11y-contrast :focus-visible { outline: 3px solid #000; outline-offset: 3px; box-shadow: 0 0 0 6px #FFD400; }
html.a11y-contrast .theme-dark :focus-visible { outline-color: #fff; }
html.a11y-contrast .theme-dark .form-card :focus-visible { outline-color: #000; }
html.a11y-contrast .grad-text {
  background: none !important; color: currentColor !important; -webkit-text-fill-color: currentColor !important;
}

/* ---------- cross-page glass ----------
   Moving between /services, a pillar page, its services and the home pillar tabs, the pillar's glass slab flies from the card
   or tab into the next page's hero (cross-document view transitions: Chrome/Edge 126+, Safari 18.2+; other browsers simply
   navigate). Off under reduced motion and "עצירת אנימציות". One name per pillar, on the one visible slab of each page. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-group(glass-computing), ::view-transition-group(glass-cloud), ::view-transition-group(glass-backup),
::view-transition-group(glass-security), ::view-transition-group(glass-comms) { animation-duration: .55s; animation-timing-function: var(--e-out); }
html.a11y-still::view-transition-group(*), html.a11y-still::view-transition-old(*), html.a11y-still::view-transition-new(*) { animation: none !important; }
.pc-computing:is(.pcard, .ptab, .phero:not(.ahero)) :is(.pcard__glass, .ptab__glyph, .pglass) { view-transition-name: glass-computing; }
.pc-cloud:is(.pcard, .ptab, .phero:not(.ahero)) :is(.pcard__glass, .ptab__glyph, .pglass) { view-transition-name: glass-cloud; }
.pc-backup:is(.pcard, .ptab, .phero:not(.ahero)) :is(.pcard__glass, .ptab__glyph, .pglass) { view-transition-name: glass-backup; }
.pc-security:is(.pcard, .ptab, .phero:not(.ahero)) :is(.pcard__glass, .ptab__glyph, .pglass) { view-transition-name: glass-security; }
.pc-comms:is(.pcard, .ptab, .phero:not(.ahero)) :is(.pcard__glass, .ptab__glyph, .pglass) { view-transition-name: glass-comms; }

/* Windows high-contrast / forced colours: keep borders visible, drop decorative layers */
@media (forced-colors: active) {
  .btn, .card, .field input, .field select, .field textarea { border: 1px solid CanvasText; }
  .grad-text { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; }
}
