/* =========================================================================
   HMI Studio — base.css
   Design tokens, reset, base elements & utilities
   ========================================================================= */

:root {
  /* Brand palette — industrial tech (blue/cyan) + energy accent (amber) */
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  --accent-300: #fcd34d;
  --accent-400: #fbbf24;
  --accent-500: #f59e0b;
  --accent-600: #d97706;

  --ink-900: #0b1220;
  --ink-800: #111a2e;
  --ink-700: #1e293b;
  --ink-600: #334155;
  --ink-500: #475569;
  --ink-400: #64748b;
  --ink-300: #94a3b8;
  --ink-200: #cbd5e1;
  --ink-100: #e2e8f0;
  --ink-50:  #f1f5f9;

  --surface:   #ffffff;
  --bg:        #f7f9fc;
  --bg-alt:    #eef3f9;

  --success:   #16a34a;
  --danger:    #dc2626;

  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --shadow-md: 0 6px 18px -6px rgba(15,23,42,.18);
  --shadow-lg: 0 24px 50px -18px rgba(15,23,42,.30);

  --container: 1180px;
  --header-h: 68px;

  --font: "Segoe UI", system-ui, -apple-system, "Microsoft YaHei", "PingFang SC",
          "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "Consolas", "SFMono-Regular",
               "Menlo", monospace;

  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink-700);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--ink-900);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

a { color: var(--brand-600); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--brand-700); }

img, svg { max-width: 100%; display: block; }

ul { margin: 0; padding: 0; list-style: none; }

code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--ink-900);
  color: #e2e8f0;
  padding: .15em .45em;
  border-radius: 6px;
}

strong { color: var(--ink-900); font-weight: 600; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--alt { background: var(--bg-alt); }

.section-head { max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); text-align: center; }
.section-head .eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: .6rem;
}
.section-head p { color: var(--ink-500); font-size: 1.08rem; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 920px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.text-gradient {
  background: linear-gradient(100deg, var(--brand-500), var(--brand-700) 55%, var(--accent-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--ink-500); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
