/* Renato Jamić — digital business card
   Design language: "Chart Datum 1992" from the dumi.hr redesign
   (deep-sea navy surfaces, chart grid, signal orange for actions, IBM Plex).
   Mobile-first, no framework, no JavaScript. */

/* ---- Fonts: same self-hosted IBM Plex subsets as dumi.hr -------------- */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-core.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 85% 100%;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+20AC, U+2190-2193, U+2212;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plex-sans-hr.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 85% 100%;
  font-display: swap;
  unicode-range: U+0106-0107, U+010C-010D, U+0110-0111, U+0160-0161, U+017D-017E;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400-core.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+20AC, U+2190-2193, U+2212;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400-hr.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0106-0107, U+010C-010D, U+0110-0111, U+0160-0161, U+017D-017E;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-500-core.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00AC, U+00AE-00FF, U+2013-2014, U+2018-201A, U+201C-201E, U+2022, U+2026, U+2032-2033, U+20AC, U+2190-2193, U+2212;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-500-hr.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0106-0107, U+010C-010D, U+0110-0111, U+0160-0161, U+017D-017E;
}

/* ---- Tokens (values from dumi.hr global.css) -------------------------- */
:root {
  --abyss: #07121f;
  --ink: #0b1d33;
  --deep: #11294a;
  --harbor: #1b3a63;
  --paper: #f5f3ee;
  --muted-dark: #9fb0c3;
  --line-dark: rgb(255 255 255 / 0.14);
  --signal: #ff5236;
  --signal-hi: #ff6a4f;

  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-card: 1.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  /* background lives on <html> so the grid and ring (z-index:-1) paint above it */
  background:
    radial-gradient(90% 45% at 85% 0%, rgb(27 58 99 / 0.5), transparent 70%),
    var(--abyss);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fine chart grid, fading out towards the bottom */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
}

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

a { color: inherit; text-decoration: none; }
p { margin: 0; text-wrap: pretty; }

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

/* ---- Layout ----------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: 31rem;
  margin: 0 auto;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1.75rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

@media (min-width: 40rem) {
  .wrap { padding-top: 4vh; }
}

.label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ---- Header ----------------------------------------------------------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3rem;
}
.brand { display: block; }
.logo { display: block; height: 2.1rem; width: auto; color: var(--paper); overflow: visible; }
.logo-light { fill: var(--abyss); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  transition: border-color 250ms var(--ease), background-color 250ms var(--ease);
}
@media (hover: hover) {
  .chip:hover { border-color: var(--paper); background: rgb(255 255 255 / 0.06); }
}

/* ---- Hero ------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 3.25rem 0 2.25rem;
}

/* Bearing ring behind the heading — the dumi.hr gyro-card motif.
   Lives in its own clipped layer so it can bleed off-screen without
   creating horizontal scroll. */
.ring-wrap {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto 0;
  height: 34rem;
  overflow: hidden;
  pointer-events: none;
}
.ring {
  position: absolute;
  top: 0;
  left: calc(50% - 6.5rem);
  width: 27rem;
  height: auto;
  color: var(--muted-dark);
  opacity: 0.32;
}
.ring-card { transform-origin: 280px 280px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted-dark);
}
.dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--signal);
  flex: none;
}

h1 {
  margin: 1.25rem 0 0;
  font-size: clamp(2.6rem, 1.5rem + 7.4vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.025em;
  font-weight: 620;
  font-stretch: 94%;
  text-wrap: balance;
}
.accent { display: block; color: var(--signal); margin-top: 0.12em; }

.lead {
  margin-top: 1.4rem;
  max-width: 28ch;
  font-size: clamp(1.125rem, 1.04rem + 0.38vw, 1.25rem);
  line-height: 1.5;
  color: var(--muted-dark);
}

/* ---- Buttons ---------------------------------------------------------- */
.actions {
  margin-top: 2.25rem;
  display: grid;
  gap: 0.75rem;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
  transition:
    color 250ms var(--ease),
    background-color 250ms var(--ease),
    border-color 250ms var(--ease),
    transform 250ms var(--ease),
    box-shadow 250ms var(--ease);
}
.btn-lead { display: inline-flex; align-items: center; gap: 0.75rem; }
.btn svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-arrow { transition: transform 300ms var(--ease); }

/* orange always carries dark ink text (white on #ff5236 is only 3.2:1) */
.btn-signal { background: var(--signal); color: var(--ink); }
.btn-paper { background: var(--paper); color: var(--ink); }
.btn-outline { border-color: rgb(255 255 255 / 0.32); color: var(--paper); }

@media (hover: hover) {
  .btn-signal:hover { background: var(--signal-hi); box-shadow: 0 12px 30px -12px rgb(255 82 54 / 0.65); }
  .btn-paper:hover { background: #fff; }
  .btn-outline:hover { border-color: var(--paper); background: rgb(255 255 255 / 0.06); }
  .btn:hover .btn-arrow { transform: translateX(3px); }
  .btn:hover .btn-down { transform: translateY(3px); }
}
.btn:active { transform: scale(0.98); }

/* ---- Contact card ----------------------------------------------------- */
.card {
  background: var(--ink);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.5rem 0.9rem;
}
.card-head h2 { color: var(--paper); }
.card-ref { color: var(--muted-dark); }

/* graduated chart-margin ticks */
.chart-ticks {
  height: 10px;
  color: var(--muted-dark);
  opacity: 0.6;
  background:
    repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 12px) bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, currentColor 0 1px, transparent 1px 60px) bottom / 100% 10px no-repeat;
}

dl { margin: 0; }
.row {
  padding: 1rem 1.5rem 1.1rem;
  border-top: 1px solid var(--line-dark);
}
.row:first-child { border-top: 0; }
dt { color: var(--muted-dark); }
dd {
  margin: 0.4rem 0 0;
  font-size: 1.1875rem;
  line-height: 1.35;
  font-weight: 500;
  overflow-wrap: anywhere;
}
dd.mono { font-family: var(--mono); font-size: 1.25rem; letter-spacing: 0.01em; }

dd a {
  display: inline-block;
  padding: 0.15rem 0;
  background: linear-gradient(var(--signal), var(--signal)) left bottom / 100% 1px no-repeat;
  transition: background-size 300ms var(--ease), color 250ms var(--ease);
}
@media (hover: hover) {
  dd a:hover { background-size: 100% 3px; }
}

/* ---- Footer ----------------------------------------------------------- */
.foot {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted-dark);
}
.flags { display: inline-flex; gap: 0.35rem; }
.flags svg {
  display: block;
  width: 1.75rem;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.25);
}

/* ---- Skip link -------------------------------------------------------- */
.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 600;
}
.skip:focus { top: 0.75rem; }

/* ---- Motion (decorative only; honours reduced motion) ----------------- */
@media (prefers-reduced-motion: no-preference) {
  .hero > *, .card, .foot {
    animation: rise 700ms var(--ease) both;
  }
  .hero > .eyebrow { animation-delay: 40ms; }
  .hero > h1 { animation-delay: 110ms; }
  .hero > .lead { animation-delay: 180ms; }
  .hero > .actions { animation-delay: 250ms; }
  .card { animation-delay: 330ms; }
  .foot { animation-delay: 400ms; }
  /* the ring settles once on load, then stays still (no endless motion) */
  .ring-card { animation: settle 1600ms var(--ease) backwards; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes settle {
  from { transform: rotate(-18deg); }
}

@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
}
