/* =========================================================================
   IDEA Holding – design system
   1. Tokens (colours, type, spacing) – change the brand here
   2. Base / reset
   3. Layout helpers
   4. Typography & prose (Markdown content)
   5. Shared UI: buttons, eyebrow, cards, forms
   6. Motion
   Component styles: css/components.css
   ========================================================================= */

/* Self-hosted variable fonts (no Google Fonts requests). Latin + Latin Extended (Č, Ć, Đ, Š, Ž). */
@font-face {
  font-family: 'Sora Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(../fonts/sora-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Sora Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(../fonts/sora-latin-wght-normal.woff2) format('woff2-variations');
  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: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  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;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  /* Brand – taken from the IDEA logo */
  --brand-blue: #4188ff;
  --brand-red: #d2232e;
  --brand-green: #7ba83a;
  --brand-black: #0b1220; /* dark parts of the logo – same navy as the dark sections */

  /* Neutrals */
  --ink: #0b1220;
  --ink-2: #1c2636;
  --text: #2b3443;
  --muted: #5b6474;
  --line: #e3e7ee;
  --line-strong: #cfd6e1;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #eaeef4;

  /* Roles */
  --accent: var(--brand-blue);
  --accent-rgb: 65 136 255; /* same colour as --brand-blue, for transparent tints */
  --accent-hover: #2f6fe0;
  --accent-soft: #ebf2ff;
  --accent-light: #9dc1ff; /* blue text on dark backgrounds */
  --accent-text: #2f6fe0; /* small blue text on white (links, labels) – meets WCAG AA contrast */
  --accent-text-hover: #2459b8;
  --focus: #4188ff;
  --success: #1f7a3f;
  --error: #b42318;

  /* Dark sections */
  --dark-bg: #0b1220;
  --dark-bg-2: #121b2c;
  --dark-text: #c9d2df;
  --dark-line: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-display: 'Sora Variable', 'Sora', system-ui, sans-serif;
  --font-body: 'Inter Variable', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.08rem + 0.35vw, 1.3rem);
  --step-2: clamp(1.35rem, 1.22rem + 0.65vw, 1.7rem);
  --step-3: clamp(1.6rem, 1.38rem + 1.1vw, 2.25rem);
  --step-4: clamp(1.95rem, 1.55rem + 2vw, 3.1rem);
  --step-5: clamp(2.3rem, 1.7rem + 3vw, 3.9rem);

  /* Spacing & shape */
  --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  /* Vertical space above/below each section – change this one value to make the whole site tighter or airier */
  --section: clamp(2.5rem, 1.9rem + 2.4vw, 4.25rem);
  --container: 1240px;
  --container-narrow: 760px;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 16px;
  --shadow-s: 0 1px 2px rgba(11, 18, 32, 0.06), 0 1px 3px rgba(11, 18, 32, 0.06);
  --shadow: 0 10px 30px -12px rgba(11, 18, 32, 0.18);
  --shadow-l: 0 24px 60px -24px rgba(11, 18, 32, 0.35);
  --header-h: 72px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-5);
  letter-spacing: -0.03em;
}
h2 {
  font-size: var(--step-4);
}
h3 {
  font-size: var(--step-2);
}
h4 {
  font-size: var(--step-1);
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

a {
  color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-text-hover);
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-s);
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
  padding-block: var(--section);
}

.section--tight {
  padding-block: calc(var(--section) * 0.6);
}

.section--alt {
  background: var(--surface-2);
}

.section--dark {
  position: relative;
  background: var(--dark-bg);
  color: var(--dark-text);
  isolation: isolate;
}

/* Engineering-drawing grid behind dark sections */
.section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--dark-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--dark-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 70% 20%, #000 0%, transparent 70%);
  opacity: 0.5;
  pointer-events: none;
}

.section--dark :is(h1, h2, h3, h4) {
  color: #fff;
}

.section--dark a:not(.btn) {
  color: var(--accent-light);
}

.grid {
  display: grid;
  gap: clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* At most 3 columns, never narrower than 17.5rem */
.grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 17.5rem), calc((100% - 2 * 1.75rem) / 3)), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}

.split {
  display: grid;
  gap: clamp(2rem, 1rem + 4vw, 5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
  .split--wide-text {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.stack > * + * {
  margin-top: var(--stack, 1rem);
}

/* 4. Typography ------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section--dark .eyebrow {
  color: var(--accent-light);
}

.lead {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

.section--dark .lead {
  color: var(--dark-text);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .lead {
  margin-inline: auto;
}

.section-head h2 {
  margin-bottom: 0.4em;
}

.section-head__row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
}

.section-head__row .section-head {
  margin-bottom: 0;
}

/* Markdown content */
.prose {
  max-width: 72ch;
  color: var(--text);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: var(--step-3);
  padding-top: 0.2em;
}

.prose h3 {
  margin-top: 1.8em;
  font-size: var(--step-2);
}

.prose h4 {
  margin-top: 1.5em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25em;
  padding-left: 1.3em;
}

.prose li {
  margin-bottom: 0.4em;
  padding-left: 0.25em;
}

.prose ul > li::marker {
  color: var(--accent-text);
}

.prose ol > li::marker {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 600;
}

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

.prose img {
  margin: 2rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-s);
}

.prose table {
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: var(--step--1);
  display: block;
  overflow-x: auto;
}

.prose th,
.prose td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
}

.prose blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem 0;
}

/* 5. Shared UI ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-border: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-s);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.btn:hover {
  --btn-bg: var(--accent-hover);
  color: var(--btn-fg);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.2s var(--ease);
}

.btn:hover svg.icon-arrow {
  transform: translateX(3px);
}

.btn--secondary {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  --btn-border: var(--line-strong);
}

.btn--secondary:hover {
  --btn-bg: var(--surface-2);
  --btn-border: var(--ink);
  --btn-fg: var(--ink);
}

.section--dark .btn--secondary,
.btn--on-dark {
  --btn-fg: #fff;
  --btn-border: rgba(255, 255, 255, 0.35);
}

.section--dark .btn--secondary:hover,
.btn--on-dark:hover {
  --btn-bg: rgba(255, 255, 255, 0.08);
  --btn-border: #fff;
  --btn-fg: #fff;
}

.btn--small {
  min-height: 40px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.link-arrow svg {
  width: 1em;
  height: 1em;
  transition: transform 0.2s var(--ease);
}

.link-arrow:hover svg {
  transform: translateX(3px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.card--link:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Whole card clickable via the title link */
.card--link .card__link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.card__media {
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.card--link:hover .card__media img {
  transform: scale(1.04);
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: clamp(1.1rem, 0.9rem + 0.8vw, 1.5rem);
}

.card__body h3 {
  font-size: var(--step-1);
  margin: 0;
}

.card__body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.card__body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card__meta {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card__footer {
  margin-top: auto;
  padding-top: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Forms */
.form {
  display: grid;
  gap: 1.1rem;
}

.form__row {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .form__row--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label,
.field .label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.field .req {
  color: var(--brand-red);
}

.field input:not([type='checkbox']):not([type='file']),
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.field textarea {
  min-height: 140px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / 0.15);
}

.field [aria-invalid='true'] {
  border-color: var(--error) !important;
}

.field__hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.field__error {
  font-size: 0.82rem;
  color: var(--error);
  font-weight: 500;
}

.check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.92rem;
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  flex: none;
  accent-color: var(--accent);
}

.file-drop {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.25rem;
  padding: 1.4rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: center;
  font-size: 0.92rem;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.file-drop:hover,
.file-drop:focus-within {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.file-drop input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop strong {
  color: var(--accent-text);
}

/* Spam trap – hidden from people, visible to naive bots */
.hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-s);
  font-size: 0.95rem;
  font-weight: 500;
}

.form-status:empty {
  display: none;
}

.form-status[data-state='success'] {
  background: #e7f6ec;
  color: var(--success);
}

.form-status[data-state='error'] {
  background: #fdecea;
  color: var(--error);
}

.form-status[data-state='pending'] {
  background: var(--surface-2);
  color: var(--muted);
}

/* 6. Motion ---------------------------------------------------------------- */
/* Only hide-then-reveal when scripts run, so content is never lost without JS. */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.7s var(--ease),
      transform 0.7s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }

  [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .no-print {
    display: none !important;
  }
}
