/* 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 (the hero), so scoping to h1 needs no hero-class enumeration.

   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 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--asrock-hi) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text-green {
  background: linear-gradient(135deg, var(--asrock-hi) 0%, var(--asrock) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.gradient-text-amber {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 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-dark);
  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; }
@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); }
