/* reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
ul, ol { list-style: none; padding: 0; margin: 0; }

main, header, footer, section { position: relative; z-index: 1; }

/* typography */
h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 var(--space-5);
  color: var(--text);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.12; }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
h4 { font-size: 1.05rem; line-height: 1.3; font-weight: 600; }

/* ==========================================================================
   language display typography — Typography Guidelines v1.1
   ("Language-specific Display Typography" + "Quality Assurance")

   Hierarchy, spacing, weights and colours stay identical across locales; the
   spec adjusts ONLY the Hero/H1 so a denser script does not read heavier than
   the 72px English hero:

     EN 72px / 1.05  (unchanged — the per-page `.ds-type … hero h1` baseline)
     TC 68px / 1.05
     JP 60px / 1.00  (range floor 60–64px: JP copy runs longest, and QA asks
                      that "Japanese should not wrap excessively")
     KR 64px / 1.00  (range floor 64–68px, paired with keep-all below)

   Specificity: `html[lang=…] body.ds-type h1` is (0,2,3) and beats every
   per-page hero rule — `.ds-type .hero h1`, `.ds-type .product-hero h1`,
   `.ds-type .hw-hero h1`, `.ds-type .svcs-hero h1`, all (0,2,1) — on weight
   alone, so it holds regardless of stylesheet load order. Each page carries a
   single h1, so scoping to h1 needs no hero-class enumeration. (On the four
   workstation pages that h1 is the .visually-hidden one added in v1.17.7, not a
   hero; sizing it is harmless because it is clipped to 1x1.)

   clamp() keeps each locale on the EN curve, scaled by target/72 (TC .9444,
   JP .8333, KR .8889) for both the minimum and the slope, so every language
   still reaches its desktop maximum at ~1120px and shrinks in step below it.
   ========================================================================== */
html[lang="zh-Hant"] body.ds-type h1 {
  font-size: clamp(2.6rem, 4.72vw + 0.94rem, 4.25rem);  /* 41.6px → 68px */
  line-height: 1.05;
}
html[lang="ja"] body.ds-type h1 {
  font-size: clamp(2.29rem, 4.17vw + 0.83rem, 3.75rem); /* 36.6px → 60px */
  line-height: 1.0;
}
html[lang="ko"] body.ds-type h1 {
  font-size: clamp(2.44rem, 4.44vw + 0.89rem, 4rem);    /* 39px → 64px */
  line-height: 1.0;
}

/* korean line breaking: break at word boundaries only (72px headlines
   otherwise split mid-syllable). scoped to lang=ko — JP/TC have no spaces,
   so keep-all there would overflow narrow viewports. overflow-wrap stays
   as the escape hatch for any word wider than the line. */
html[lang="ko"] h1,
html[lang="ko"] h2,
html[lang="ko"] h3 {
  word-break: keep-all;
  overflow-wrap: break-word;
}

p { margin: 0 0 var(--space-4); color: var(--text-dim); }
strong { color: var(--text); font-weight: 600; }

/* ==========================================================================
   gradient text — the colour stops ARE the ink, so they are contrast-checked

   These classes paint the glyphs by clipping a linear-gradient to the text and
   setting -webkit-text-fill-color: transparent. Automated checkers (WAVE) read
   the transparent fill and report 1:1; axe-core marks it incomplete. Neither
   number is real — but neither is "it's fine". The honest test is: every stop
   of the gradient must clear the threshold against the ground the element
   actually sits on, because different letters land on different stops.

   Every use on this site is >=48px/700 → WCAG 1.4.3 large text → 3:1.
   v1.17.5 deepened every stop that sat under that bar; measured ratios are in
   the comment on each rule (verified over all 29 pages with Playwright +
   backdrop sampling; see docs/a11y/contrast-fix-comparison-20260813.html).
   Do not lighten a stop without re-running that check.
   ========================================================================== */
.gradient-text {
  /* grounds in use: #fafafa, #ffffff, #0b1220 (index .infra).
     #2563eb → 4.95 / 5.17 / 3.62   #537d16 → 4.67 / 4.87 / 3.85
     v1.17.5: green end was --asrock-hi #6ea51e (2.85:1 on #fafafa — under 3). */
  background: linear-gradient(135deg, var(--accent) 0%, var(--asrock-text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text-green {
  /* light grounds (#fafafa, #ffffff): #537d16 → 4.67 / 4.87, #5b8a18 → 3.95 / 4.12.
     v1.17.5: was --asrock-hi #6ea51e → --asrock #85c226, i.e. 2.85 and 2.07 —
     BOTH ends under 3:1, so the whole run failed, not just the light end.
     These two stops also clear 3:1 on the dark grounds (3.85 / 4.54), so a new
     dark section that forgets the override below is still accessible. */
  background: linear-gradient(135deg, var(--asrock-text) 0%, var(--asrock-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* ---- dark grounds keep the bright brand green ----
   One rule, both classes: deep green is what a light ground needs, and it is
   strictly worse on a dark one. Restoring --asrock-hi / --asrock over #0b1220
   buys 3.62 → instead of 3.40 for .gradient-text and 6.30 → instead of 3.85
   for .gradient-text-green, and leaves those sections looking as designed.

   Two mechanics worth knowing before editing:
   (a) background-image, not the `background` shorthand — the shorthand would
       reset background-clip back to border-box and un-clip the text.
   (b) sRGB interpolation is NOT luminance-monotonic. Blue→green mixes dip
       DARKER than either stop (#2563eb→#537d16 bottoms out at 3.40:1 on
       #0b1220 around t=0.4, below both its 3.62 and 3.85 ends), so on a dark
       ground you must sweep the whole ramp — checking the two stops is not
       enough. On a light ground the stops do bound it (x^2.4 is convex).

   Grounds enumerated: .infra-dark (ai-home.css, index ×4 langs), .svcs-hero +
   .svcs-next (ai-services.css), .product-cta.is-dark (ai-product.css, the four
   center pages ×4 langs), .bento-cell.is-dark (this file, below). A dark
   section missed here still clears 3:1 on the deep stops — it just looks
   duller than intended. */
.infra-dark .gradient-text {
  background-image: linear-gradient(135deg, var(--accent) 0%, var(--asrock-hi) 100%);
}
.svcs-hero .gradient-text-green,
.svcs-next .gradient-text-green,
.product-cta.is-dark .gradient-text-green,
.bento-cell.is-dark .gradient-text-green {
  background-image: linear-gradient(135deg, var(--asrock-hi) 0%, var(--asrock) 100%);
}
.gradient-text-amber {
  /* only ground in use: the #fff7d6 award card on index.
     #92400e → 6.59   #b45309 → 4.67
     v1.17.5: was #d97706 → #f59e0b, i.e. 2.96 and 2.00 — both ends under 3:1. */
  background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--asrock-text);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--asrock-tint);
  border: 1px solid rgba(133, 194, 38, 0.28);
  margin-bottom: var(--space-5);
}
.eyebrow-mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.wrap-wide { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 1.5rem; }
section { padding: var(--space-16) 0; }
@media (min-width: 768px) { section { padding: var(--space-20) 0; } }

/* accessibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---- .visually-hidden ----
   Removes an element from the visual page while keeping it in the accessibility
   tree, so screen readers and structural checkers (WAVE, axe) still see it.
   `display:none` / `visibility:hidden` / `width:0` would hide it from BOTH, which
   defeats the purpose. The clip-rect + clip-path pair is the standard belt-and-
   braces form: clip-path is the modern one, clip: rect() the fallback for older
   engines. white-space: nowrap keeps a long string from being laid out as a tall
   1px-wide column (some engines then report a huge scroll height).

   Current use: the workstation pages have no visible h1 — their hero headline is
   an h2 by design and promoting it would create an h2→h4 gap under it — so they
   carry a hidden h1 at the top of <main> that names the page. v1.17.7.
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- bento grid primitives ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-4);
  grid-auto-rows: minmax(120px, auto);
}
@media (min-width: 720px) { .bento { gap: var(--space-5); } }

.bento-cell {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  overflow: hidden;
  grid-column: span 12;
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base), box-shadow var(--dur-base);
}
.bento-cell:hover { border-color: var(--border-strong); }
.bento-cell.is-interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

@media (min-width: 720px) {
  .bento-cell { padding: var(--space-8); }
  .col-span-3  { grid-column: span 3; }
  .col-span-4  { grid-column: span 4; }
  .col-span-5  { grid-column: span 5; }
  .col-span-6  { grid-column: span 6; }
  .col-span-7  { grid-column: span 7; }
  .col-span-8  { grid-column: span 8; }
  .col-span-9  { grid-column: span 9; }
  .col-span-12 { grid-column: span 12; }
  .row-span-2  { grid-row: span 2; }
  .row-span-3  { grid-row: span 3; }
}

/* dark variants */
.bento-cell.is-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-color: var(--border-on-dark);
}
.bento-cell.is-dark h1,
.bento-cell.is-dark h2,
.bento-cell.is-dark h3,
.bento-cell.is-dark h4 { color: var(--text-on-dark); }
.bento-cell.is-dark p { color: var(--text-on-dark-dim); }
.bento-cell.is-blue { background: var(--accent); color: white; border-color: transparent; }
.bento-cell.is-blue h1, .bento-cell.is-blue h2, .bento-cell.is-blue h3, .bento-cell.is-blue h4 { color: white; }
.bento-cell.is-blue p { color: rgba(255, 255, 255, 0.85); }
.bento-cell.is-violet { background: var(--violet); color: white; border-color: transparent; }
.bento-cell.is-violet h1, .bento-cell.is-violet h2, .bento-cell.is-violet h3, .bento-cell.is-violet h4 { color: white; }
.bento-cell.is-violet p { color: rgba(255, 255, 255, 0.88); }
.bento-cell.is-tint-blue   { background: var(--bg-card-tint-blue); }
.bento-cell.is-tint-violet { background: var(--bg-card-tint-violet); }
.bento-cell.is-tint-amber  { background: var(--bg-card-tint-amber); }
.bento-cell.is-tint-emerald{ background: var(--bg-card-tint-emerald); }
.bento-cell.is-tint-green  { background: var(--bg-card-tint-green); border-color: rgba(133, 194, 38, 0.25); }
.bento-cell.is-green { background: var(--asrock); color: var(--bg-dark); border-color: transparent; }
.bento-cell.is-green h1, .bento-cell.is-green h2, .bento-cell.is-green h3, .bento-cell.is-green h4 { color: var(--bg-dark); }
.bento-cell.is-green p { color: rgba(15, 23, 42, 0.85); }
.bento-cell.is-alt { background: var(--bg-card-alt); }
