/* =========================================================
   AUTO SERVIS MILANČE
   Modern design system · 2027
   Desktop · Tablet · Mobile
   ========================================================= */

/* ---------- 1. Design tokens ---------- */

:root {
  color-scheme: light;

  /* Refined 2027 palette – high contrast, perceptual oklch where helpful */
  --color-dark: oklch(0.22 0.025 255);
  --color-dark-soft: oklch(0.28 0.03 255);
  --color-text: oklch(0% 0 0);
  --color-muted: oklch(0% 0 0);
  --color-background: oklch(1 0 0);
  --color-surface: oklch(0.975 0.005 255);
  --color-surface-strong: oklch(0.955 0.008 255);
  --color-border: oklch(27.295% 0.0757 254.852);

  --color-accent: oklch(0.58 0.22 25);
  --color-accent-hover: oklch(0.50 0.20 25);
  --color-accent-soft: oklch(0.97 0.02 25);

  --color-viber: oklch(0.48 0.22 290);
  --color-viber-hover: oklch(0.42 0.20 290);
  --color-whatsapp: oklch(0.48 0.14 150);
  --color-whatsapp-hover: oklch(0.42 0.13 150);

  --content-width: 1160px;
  --content-narrow: 820px;

  --space-1: 0.375rem;
  --space-2: 0.625rem;
  --space-3: 0.875rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --radius-sm: 0.75rem;
  --radius-md: 1.125rem;
  --radius-lg: 1.5rem;
  --radius-pill: 999px;

  /* Soft, layered, low-cost shadows */
  --shadow-sm: 0 1px 3px oklch(0.22 0.025 255 / 0.04),
               0 4px 12px oklch(0.22 0.025 255 / 0.03);
  --shadow-md: 0 4px 16px oklch(0.22 0.025 255 / 0.06),
               0 12px 32px oklch(0.22 0.025 255 / 0.04);
  --shadow-lg: 0 8px 24px oklch(0.22 0.025 255 / 0.08),
               0 20px 48px oklch(0.22 0.025 255 / 0.06);

  --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-normal: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. Reset and global defaults ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid oklch(0.82 0.16 85);
  outline-offset: 3px;
}

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

#main-content {
  min-height: 55vh;
}

section[id] {
  scroll-margin-top: 1.5rem;
}

/* ---------- 3. Typography ---------- */

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--color-dark);
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.2rem, 5.2vw, 4.1rem);
  letter-spacing: -0.045em;
}

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.55rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: clamp(1.18rem, 2.1vw, 1.42rem);
  letter-spacing: -0.02em;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.4rem;
}

/* ---------- 4. Shared layout ---------- */

.container {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin-inline: auto;
}

main > section {
  position: relative;
}

/* ---------- 5. Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  color: #fff;
  background: var(--color-dark);
  border-bottom: 3px solid var(--color-accent);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  width: min(calc(100% - 2.5rem), var(--content-width));
  min-height: 88px;
  margin-inline: auto;
}

.site-brand {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
  line-height: 1.3;
}

.brand-name {
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-location {
  margin-top: 0.3rem;
  color: oklch(0.78 0.02 255);
  font-size: 0.84rem;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 46px;
  padding: 0.7rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.contact-call {
  background: var(--color-accent);
}

.contact-call:hover {
  background: var(--color-accent-hover);
}

.contact-viber {
  background: var(--color-viber);
}

.contact-viber:hover {
  background: var(--color-viber-hover);
}

.contact-whatsapp {
  background: var(--color-whatsapp);
}

.contact-whatsapp:hover {
  background: var(--color-whatsapp-hover);
}

/* ---------- 6. Buttons ---------- */

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 52px;
  padding: 0.9rem 1.55rem;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--color-accent);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 14px oklch(0.58 0.22 25 / 0.22);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.primary-button:hover {
  border-color: var(--color-accent-hover);
  background: var(--color-accent-hover);
  box-shadow: 0 8px 22px oklch(0.58 0.22 25 / 0.28);
  transform: translateY(-2px);
}

.primary-button:active,
.contact-button:active {
  transform: translateY(0);
}

/* ---------- 7. Small section labels ---------- */

.eyebrow {
  margin-bottom: 1rem;
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* ---------- 8. Homepage hero ---------- */

.home-hero {
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7.5rem) 0;
  background:
    radial-gradient(
      ellipse 80% 55% at 50% -10%,
      oklch(0.58 0.22 25 / 0.08),
      transparent 70%
    ),
    linear-gradient(180deg, oklch(0.98 0.005 255) 0%, #fff 100%);
  text-align: center;
}

.home-hero .container {
  max-width: 920px;
}

.home-hero h1 {
  max-width: 850px;
  margin: 0 auto 1.5rem;
}

.hero-description {
  max-width: 680px;
  margin: 0 auto 2rem;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.85;
}

/* ---------- 9. Homepage services ---------- */

.services-section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
  background: var(--color-background);
}

.section-heading {
  max-width: 700px;
  margin: 0 auto 3rem;
  text-align: center;
}

.section-heading h2 {
  margin-bottom: 1rem;
}

.section-heading > p:last-child {
  margin-bottom: 0;
  color: var(--color-muted);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 270px;
  padding: 1.7rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition:
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-normal),
    background-color var(--transition-normal);
}

.service-card:hover {
  border-color: oklch(0.58 0.22 25 / 0.35);
  background: oklch(0.995 0.01 25);
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
}

.service-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  border: 1px solid oklch(0.58 0.22 25 / 0.12);
  border-radius: 1rem;
  background: var(--color-accent-soft);
  font-size: 3rem;
}

.service-card h3 {
  margin-bottom: 0.85rem;
  font-size: 1.2rem;
  line-height: 1.35;
}

.service-card p {
  margin-bottom: 1.5rem;
  color: var(--color-muted);
  font-size: 0.94rem;
  line-height: 1.75;
}

.service-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 800;
}

.service-card-link span {
  transition: transform var(--transition-fast);
}

.service-card:hover .service-card-link span {
  transform: translateX(4px);
}

.service-card:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

/* ---------- 10. Homepage contact section ---------- */

.home-contact {
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
  color: #fff;
  background:
    radial-gradient(
      ellipse 70% 50% at 50% -15%,
      oklch(1 0 0 / 0.07),
      transparent 70%
    ),
    var(--color-dark);
  text-align: center;
}

.home-contact .container {
  max-width: 780px;
}

.home-contact h2 {
  margin-bottom: 1rem;
  color: #fff;
}

.home-contact p {
  margin: 0 auto 1.75rem;
  color: oklch(96.067% 0.00182 249.209);
  line-height: 1.8;
}

/* ---------- 11. Service landing-page hero ---------- */

.service-hero {
  overflow: hidden;
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
  background:
    radial-gradient(
      ellipse 80% 55% at 50% -10%,
      oklch(0.58 0.22 25 / 0.08),
      transparent 70%
    ),
    linear-gradient(180deg, oklch(0.98 0.005 255) 0%, #fff 100%);
  text-align: center;
}

.service-hero .container {
  max-width: 920px;
}

.service-hero h1 {
  max-width: 900px;
  margin: 0 auto 1.5rem;
}

.service-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  color: var(--color-muted);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  line-height: 1.85;
}

/* ---------- 12. Service-page content ---------- */

.service-content {
  padding: clamp(3rem, 6vw, 5.5rem) 0;
  background: #fff;
}

.service-content-inner {
  max-width: var(--content-narrow);
}

.service-content h2 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
}

.service-content h2:first-child {
  margin-top: 0;
}

.service-content p,
.service-content li {
  color: oklch(0.42 0.025 255);
  font-size: 1.02rem;
  line-height: 1.9;
}

.service-content ul,
.service-content ol {
  margin-block: 1.25rem 1.75rem;
  padding-left: 1.5rem;
}

.service-content li {
  padding-left: 0.2rem;
  margin-bottom: 0.65rem;
}

.service-contact-panel {
  margin-top: 3.5rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(
      ellipse 60% 50% at 100% 0%,
      oklch(0.58 0.22 25 / 0.07),
      transparent 70%
    ),
    var(--color-surface);
  text-align: center;
}

.service-contact-panel h2 {
  margin-top: 0;
}

.service-contact-panel p {
  margin-bottom: 1.5rem;
}

.back-to-services {
  margin-top: 2.5rem;
}

.back-to-services a {
  display: inline-block;
  color: var(--color-accent);
  font-weight: 800;
  text-decoration: none;
}

.back-to-services a:hover {
  text-decoration: underline;
}

/* ---------- 13. Footer ---------- */

.site-footer {
  padding: 3.5rem 1.25rem 1.5rem;
  border-top: 1px solid oklch(1 0 0 / 0.08);
  color: oklch(0.82 0.02 255);
  background: var(--color-dark);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, var(--content-width));
  margin-inline: auto;
}

.footer-brand {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.footer-inner p {
  max-width: 650px;
  margin-bottom: 1rem;
  text-align: center;
}

.footer-contact a {
  color: #fff;
  font-weight: 800;
  text-decoration-color: oklch(1 0 0 / 0.4);
}

.footer-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin: 1rem 0 1.5rem;
}

.footer-navigation a {
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-navigation a:hover {
  color: oklch(0.78 0.12 25);
}

.footer-copyright {
  width: 100%;
  margin-top: 1.25rem;
  margin-bottom: 0 !important;
  padding-top: 1.25rem;
  border-top: 1px solid oklch(0.35 0.02 255);
  color: oklch(0.70 0.02 255);
  font-size: 0.84rem;
}

/* ---------- 14. Tablet ---------- */

@media (max-width: 1050px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }

  .service-card {
    padding: 1.4rem;
  }

  .header-inner {
    gap: 1.25rem;
  }
}

/* ---------- 15. Small tablet and mobile ---------- */

@media (max-width: 760px) {
  .container {
    width: min(calc(100% - 2rem), var(--content-width));
  }

  .header-inner {
    width: min(calc(100% - 1.75rem), var(--content-width));
    min-height: 0;
    padding-block: 1.15rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .site-brand {
    align-items: center;
    text-align: center;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .contact-button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 0.65rem 0.35rem;
    gap: 0.3rem;
    font-size: 0.82rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .service-card {
    min-height: 250px;
    padding: 1.25rem;
  }

  .service-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 1.15rem;
    border-radius: 0.875rem;
    font-size: 3rem;
  }

  .section-heading {
    margin-bottom: 2rem;
  }
}

/* ---------- 16. Small mobile ---------- */

@media (max-width: 480px) {
  body {
    font-size: 0.97rem;
  }

  .container {
    width: calc(100% - 2rem);
  }

  .brand-name {
    font-size: 1.6rem;
  }

  .brand-location {
    font-size: 1.25rem;
  }

  .contact-button {
    font-size: 0.75rem;
    padding-inline: 0.2rem;
  }

  .home-hero,
  .service-hero {
    padding-block: 3.5rem;
  }

  .hero-description,
  .service-intro {
    font-size: 1rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .service-card {
    min-height: 0;
    padding: 1.4rem;
  }

  .service-card p {
    margin-bottom: 1.25rem;
  }

  .services-section,
  .service-content {
    padding-block: 3.25rem;
  }

  .home-contact {
    padding-block: 3.25rem;
  }

  .primary-button {
    width: 100%;
    max-width: 360px;
    min-height: 50px;
    padding-inline: 1rem;
  }

  .service-contact-panel {
    padding: 1.5rem 1.1rem;
  }

  .site-footer {
    padding: 2.75rem 1rem 1.25rem;
  }

  .footer-navigation {
    gap: 0.8rem 1.3rem;
  }
}

/* ---------- 17. Reduced motion accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}