/* InfraHub v2 design tokens — Direction C "Tapak", light only.
   Source of truth for colour, type and shape. public/tw-config.js mirrors the colour and font values
   so Tailwind classes (bg-paper, text-ink, font-display, …) resolve to the same tokens. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url('/fonts/BricolageGrotesque-Variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/AtkinsonHyperlegibleNext-Variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('/fonts/AtkinsonHyperlegibleNext-Italic-Variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Neutrals: warm survey paper, never cool slate. */
  --ih-paper: #F7F5EF;
  --ih-paper-deep: #EFEBE1;
  --ih-surface: #FFFFFF;
  --ih-ink: #14211F;
  --ih-ink-soft: #2A3936;
  --ih-muted: #5B6B68;
  --ih-faint: #8A9794;
  --ih-line: #E3DFD3;
  --ih-line-strong: #CEC8B6;

  /* System and action. */
  --ih-emerald: #059669;
  --ih-emerald-bright: #10B981;
  --ih-emerald-deep: #047857;
  --ih-emerald-tint: #E6F4EC;
  --ih-teal: #14B8A6;
  --ih-teal-deep: #0F766E;
  --ih-teal-tint: #E3F4F1;

  /* MPS purple: anything that IS a contract / sebutharga / rate book. */
  --ih-kontrak: #3B2E8C;
  --ih-kontrak-soft: #5B4DB0;
  --ih-kontrak-tint: #EEEBF8;
  --ih-kontrak-line: #CFC8EC;

  /* Warning (stale rate) and destructive (missing). */
  --ih-amber: #B45309;
  --ih-amber-tint: #FDF4E4;
  --ih-amber-line: #EBC98E;
  --ih-danger: #B42318;
  --ih-danger-tint: #FCEBE8;
  --ih-danger-line: #EFB8B0;

  --ih-font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --ih-font-sans: 'Atkinson Hyperlegible Next', ui-sans-serif, system-ui, sans-serif;

  --ih-radius-sm: 8px;
  --ih-radius-md: 12px;
  --ih-radius-lg: 18px;
  --ih-radius-xl: 24px;

  --ih-tap: 44px;
  --ih-topbar: 56px;
  --ih-tabbar: 64px;
}

html {
  color-scheme: light;
  background: var(--ih-paper);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ih-font-sans);
  color: var(--ih-ink);
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--ih-font-display);
  font-optical-sizing: auto;
  letter-spacing: -0.015em;
}

::selection {
  background: #BFE8D4;
  color: var(--ih-ink);
}

:focus-visible {
  outline: 2px solid var(--ih-emerald);
  outline-offset: 2px;
}

/* Small helpers that Tailwind cannot express cleanly. */
.ih-num {
  font-variant-numeric: tabular-nums;
}

.ih-eyebrow {
  font-family: var(--ih-font-sans);
  font-size: 12px;
  line-height: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Diagonal hatch = "not live yet" (DRAF contract, planned step). Same mark as the concept's draft contract. */
.ih-hatch {
  background-image: repeating-linear-gradient(135deg, rgba(59, 46, 140, 0.10) 0 6px, transparent 6px 12px);
}

/* Survey-grid paper behind the desktop shell header: the "tapak" sheet the field officer writes on. */
.ih-grid-paper {
  background-image:
    linear-gradient(to right, rgba(20, 33, 31, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 33, 31, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.ih-fade-down {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 100%);
}

@media (max-width: 767px) {
  input, select, textarea {
    font-size: max(16px, 1em);
  }
}
