/* ==========================================================================
   Bernhofer IT – Stylesheet
   --------------------------------------------------------------------------
   Plain CSS, no build step. Colors, fonts and spacing are defined as
   variables below – change them here and the whole site follows.
   ========================================================================== */

/* ---------- Fonts (self-hosted, no external requests) ---------- */
@font-face {
  font-family: "Kanit";
  src: url("../fonts/Kanit-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Oxygen";
  src: url("../fonts/Oxygen-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Brand colors – taken directly from the logo */
  --brand-orange: #f15a24;
  --brand-gray: #808080;

  /* Derived colors */
  --orange-text: #c8461b;         /* darker orange for readable text links */
  --orange-soft: #fdeee8;         /* light orange tint for backgrounds */
  --gray-900: #2b2b2b;
  --gray-700: #4a4a4a;
  --gray-500: #6e6e6e;
  --gray-300: #d9d9d9;
  --gray-100: #f3f3f2;

  /* Semantic colors (these are what the components use) */
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: #e6e6e4;
  --link: var(--orange-text);
  --header-bg: rgba(251, 251, 250, 0.85);
  --contact-bg: #2f2f2f;
  --contact-text: #f3f3f2;

  /* Typography */
  --font-heading: "Kanit", system-ui, sans-serif;
  --font-body: "Oxygen", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --container: 1120px;
  --radius: 14px;
  --radius-small: 8px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --header-height: 68px;
}

/* Dark mode follows the visitor's system setting */
@media (prefers-color-scheme: dark) {
  :root {
    --orange-text: #ff7a4a;
    --orange-soft: rgba(241, 90, 36, 0.14);
    --bg: #1b1b1b;
    --surface: #242424;
    --text: #ececec;
    --text-muted: #a8a8a8;
    --border: #353535;
    --header-bg: rgba(27, 27, 27, 0.85);
    --contact-bg: #121212;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  /* Keeps the footer at the bottom on short pages */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}

h3 {
  font-size: 1.375rem;
}

p {
  margin: 0 0 1em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

/* Content that only makes sense when JavaScript runs (e.g. contact details) */
html:not(.js) .js-only {
  display: none;
}

/* Hidden container for the SVG icon definitions */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 100;
}

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

.icon {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

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

.btn-primary {
  background: var(--brand-orange);
  color: #fff;
}

.btn-primary:hover {
  background: #d94c1a;
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}

.btn-secondary:hover {
  border-color: var(--brand-gray);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--brand-gray);
}

.brand img {
  height: 38px;
  width: auto;
}

.brand span {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.main-nav ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-heading);
}

.main-nav a:hover {
  background: var(--orange-soft);
  color: var(--orange-text);
}

.main-nav a.nav-cta {
  background: var(--brand-orange);
  color: #fff;
  margin-left: 0.5rem;
}

.main-nav a.nav-cta:hover {
  background: #d94c1a;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  color: var(--text);
  cursor: pointer;
}

.nav-toggle .icon {
  width: 28px;
  height: 28px;
}

/* Mobile navigation (only collapsed when JavaScript is available) */
@media (max-width: 820px) {
  .js .nav-toggle {
    display: block;
  }

  .brand span {
    display: none;
  }

  .js .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }

  .js .main-nav.is-open {
    display: block;
  }

  .js .main-nav ul {
    flex-direction: column;
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .js .main-nav a {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-small);
  }

  .js .main-nav a.nav-cta {
    margin: 0.5rem 0 0;
    text-align: center;
  }

  html:not(.js) .main-nav ul {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(4rem, 9vw, 7rem);
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 680px;
  margin-bottom: 3rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* Small spaced-out label, inspired by the "B E R N H O F E R  I T" lettering of the logo */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brand-gray);
}

.eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-orange);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3.5rem, 9vw, 7rem);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3rem;
}

.hero h1 .highlight {
  color: var(--brand-orange);
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

/* Soft circle + dotted pattern behind the logo */
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--border) 1.5px, transparent 1.6px) 0 0 / 22px 22px,
    var(--surface);
  border: 1px solid var(--border);
}

.hero-visual img {
  position: relative;
  width: 62%;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2.5rem;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hero-badges li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-badges .icon {
  color: var(--brand-orange);
}

@media (max-width: 820px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
    width: min(200px, 55%);
    margin-inline: auto;
  }
}

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 1.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.service-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--brand-orange);
}

.service-icon .icon {
  width: 28px;
  height: 28px;
}

.service-card h3 {
  margin-bottom: 0.25rem;
}

.service-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.check-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.5rem;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.45em;
  width: 0.55rem;
  height: 0.9rem;
  border: solid var(--brand-orange);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.service-card .more {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- References ---------- */
.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 2rem;
}

.reference {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.reference:hover {
  transform: translateY(-3px);
}

.reference-image {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--gray-100);
}

.reference-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.reference-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.5rem 1.75rem 1.75rem;
}

.reference-body p {
  color: var(--text-muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.8rem;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange-text);
}

.reference-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  font-family: var(--font-heading);
  text-decoration: none;
}

.reference-link:hover {
  text-decoration: underline;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.about-photo {
  position: relative;
  max-width: 380px;
}

/* Orange offset frame behind the photo */
.about-photo::before {
  content: "";
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 3px solid var(--brand-orange);
  border-radius: var(--radius);
}

.about-photo img {
  position: relative;
  border-radius: var(--radius);
  width: 100%;
}

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-photo {
    max-width: 280px;
  }
}

/* ---------- Contact ---------- */
.contact {
  background: var(--contact-bg);
  color: var(--contact-text);
}

.contact .eyebrow {
  color: #b5b5b5;
}

.contact .section-head p {
  color: #c4c4c4;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}

.contact-card:hover {
  background: rgba(241, 90, 36, 0.12);
  border-color: var(--brand-orange);
}

.contact-card .icon {
  width: 28px;
  height: 28px;
  color: var(--brand-orange);
}

.contact-card small {
  display: block;
  font-size: 0.85rem;
  color: #b5b5b5;
}

.contact-card strong {
  font-weight: 400;
  word-break: break-word;
}

.contact-address {
  margin-top: 2.5rem;
  color: #b5b5b5;
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2rem;
  background: var(--contact-bg);
  color: #a8a8a8;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: #d4d4d4;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

/* ---------- Legal pages (Impressum, Datenschutz, 404) ---------- */
.legal {
  max-width: 760px;
  padding-block: clamp(3rem, 7vw, 5rem);
}

.legal h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
}

.legal h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
}

.legal h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

.legal ul {
  padding-left: 1.25rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

.legal .meta {
  color: var(--text-muted);
}
