/* ==========================================================================
   OMK Santo Yakobus — base: fonts, design tokens, reset, typography, utilities
   Palette comes straight from the logo: blue M · lime K · flame orange/red · crimson cross · plum text.
   Style: "sticker" neo-brutalism — thick ink borders, hard offset shadows, bouncy motion.
   ========================================================================== */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jakarta";
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* brand */
  --blue: #1f98d1;
  --blue-deep: #0b6a99;
  --lime: #a8c628;
  --lime-deep: #5f7a00;
  --orange: #f79b22;
  --sun: #ffd23f;
  --red: #e8392a;
  --crimson: #b8001e;
  --plum: #971958;
  --pink: #ff7ab6;
  --green: #19a974;

  --blue-soft: #d6eefb;
  --lime-soft: #eef6c8;
  --orange-soft: #ffe7c2;
  --red-soft: #ffd9d4;
  --plum-soft: #f6d6e6;
  --sun-soft: #fff1b8;
  --green-soft: #cdf3e3;

  /* neutrals */
  --ink: #16120f;
  --ink-2: #51463c;
  --ink-3: #8b7f72;
  --paper: #fff7e8;
  --paper-2: #ffedcc;
  --white: #fff;
  --line-soft: #e7dcc6;

  /* shape */
  --bw: 3px;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-pill: 999px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);

  /* type */
  --font-display: "Bricolage", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* layout */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 68px;
  --topbar-h: 60px;
  --app-w: 560px;

  /* motion */
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

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

html {
  scroll-padding-bottom: calc(var(--tabbar-h) + 110px); /* focus / scrollIntoView clears the fixed tab bar (+ CTA bars) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(22, 18, 15, .08) 1.3px, transparent 1.4px);
  background-size: 20px 20px;
  font: 500 1rem/1.5 var(--font-body);
  overflow-x: clip; /* animations that overshoot never cause sideways scrolling */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(1.85rem, 6.5vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.75rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0; }
small, .small { font-size: .875rem; }
.xs { font-size: .75rem; }
strong, b, .bold { font-weight: 800; }

a { color: var(--blue-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--plum); }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 2px dashed var(--ink); opacity: .25; margin: 20px 0; }

::selection { background: var(--sun); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 800;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* icons (sprite in assets/img/icons.svg) */
.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--sm { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; } /* small icons sit in the text line (svg is block by default) */
.icon--lg { width: 1.6em; height: 1.6em; }
.icon--xl { width: 2.4em; height: 2.4em; }

/* ----------------------------------------------------------------- utilities */
.stack > * + * { margin-top: var(--gap, 14px); }
.stack-sm { --gap: 8px; }
.stack-lg { --gap: 22px; }
.row { display: flex; align-items: center; gap: var(--gap, 12px); }
.row--start { align-items: flex-start; }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--center { justify-content: center; }
.grow { flex: 1 1 0; min-width: 0; }
.shrink-0 { flex: none; }
.grid { display: grid; gap: var(--gap, 14px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.center { text-align: center; }
.right { text-align: right; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.display { font-family: var(--font-display); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0 !important; }
/* short labels keep their words whole: with overflow-wrap:anywhere on <body> a flex item (e.g. the "Rp" prefix) could shrink to a single letter */
.btn, .chip, .badge, .status, .sticker, .seg__item, .tab, .input-group__addon { overflow-wrap: normal; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
.only-desktop { display: none !important; }
@media (min-width: 960px) {
  .only-desktop { display: revert !important; }
  .only-mobile { display: none !important; }
}

/* ----------------------------------------------------------------- motion */
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slide-up { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slide-down { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-10px) rotate(calc(var(--rot, 0deg) + 4deg)); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring { 0% { transform: scale(.9); opacity: .55; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes shine { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
@keyframes stamp-slam {
  0% { transform: scale(2.6) rotate(-24deg); opacity: 0; }
  55% { transform: scale(.92) rotate(var(--rot, -6deg)); opacity: 1; }
  75% { transform: scale(1.06) rotate(var(--rot, -6deg)); }
  100% { transform: scale(1) rotate(var(--rot, -6deg)); opacity: 1; }
}

/* staggered entrance for lists: <div class="stagger"> children slide up one after another */
.stagger > * { animation: slide-up .5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
.stagger > *:nth-child(1) { --i: 0; } .stagger > *:nth-child(2) { --i: 1; } .stagger > *:nth-child(3) { --i: 2; }
.stagger > *:nth-child(4) { --i: 3; } .stagger > *:nth-child(5) { --i: 4; } .stagger > *:nth-child(6) { --i: 5; }
.stagger > *:nth-child(7) { --i: 6; } .stagger > *:nth-child(8) { --i: 7; } .stagger > *:nth-child(n+9) { --i: 8; }
.pop-in { animation: pop .5s var(--ease-pop) both; }

/* scroll-driven reveal where supported (compositor-only, zero JS); everything stays visible elsewhere */
@supports (animation-timeline: view()) {
  .reveal { animation: slide-up linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
}

/* smooth page-to-page transitions (multi-page view transitions, progressive enhancement) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 160ms ease-out both fade-out; }
::view-transition-new(root) { animation: 240ms var(--ease-out) both slide-up-soft; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes slide-up-soft { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { animation: none !important; }
}
