/* =============================================================================
   G4 Service — styles
   Colours are taken from the logo. Change them in one place, below.
   ============================================================================= */

:root {
  /* Logo background colour — header and footer match it so the logo blends in */
  --logo-bg: #031021;
  --navy-900: #07182f;
  --navy-800: #0e2547;

  --blue-700: #1553b0;
  --blue-600: #1a66d6;
  --blue-400: #4aa3ff;
  --blue-300: #8cc4ff;
  --blue-50: #e8f1fd;

  --ink: #0f1a2d;
  --ink-muted: #4a5a70;
  --on-dark: #ffffff;
  --on-dark-muted: #d3dded;

  --surface: #f3f6fa;
  --card: #ffffff;
  --border: #d9e1ec;
  --field-border: #6b7a90;

  --error: #b42318;
  --error-bg: #fff4f3;
  --success: #17703f;
  --success-bg: #effaf3;

  --radius: 12px;
  --focus: var(--blue-700);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  /* Keeps the footer at the bottom of short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

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

h1,
h2,
h3 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

a {
  color: var(--blue-700);
}

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

main:focus {
  outline: none;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

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

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

.nowrap {
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Dark areas use a light focus ring so it stays visible */
.site-header,
.hero,
.cta,
.page-intro,
.site-footer {
  --focus: var(--blue-300);
}

/* ---------- Buttons ---------- */

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  background: var(--blue-600);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue-700);
}

.button--secondary {
  border-color: rgba(255, 255, 255, 0.6);
  background: transparent;
  color: #fff;
}

.button--secondary:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.button[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  .site-nav a {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  }

  .service-card--link {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
}

/* Small icon inside a button or link, e.g. the "external website" arrow */
.icon--inline {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  margin-left: 0.45em;
}

.button-row--center {
  justify-content: center;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--logo-bg);
  color: var(--on-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5rem;
}

.brand {
  display: block;
  flex: none;
  border-radius: 4px;
}

/*
 * The logo image has wide empty margins in the same colour as the header.
 * These boxes hide some of that empty margin so the logo itself appears larger.
 * The image file is not changed or stretched. If you use a different logo,
 * adjust (or remove) the margin values.
 */
.brand__logo,
.footer__logo {
  display: block;
  overflow: hidden;
}

.brand__logo img,
.footer__logo img {
  display: block;
  width: auto;
  max-width: none;
}

/* Header logo, about 10% larger than the original 64px so it stands out */
.brand__logo {
  height: 70px;
}

.brand__logo img {
  height: 132px;
  margin: -30px -13px 0 -11px;
}

.logo-placeholder {
  height: auto;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

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

.site-nav a {
  display: block;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  color: var(--on-dark-muted);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-nav a[aria-current="page"] {
  color: #fff;
  box-shadow: inset 0 -3px 0 var(--blue-400);
}

@media (max-width: 639px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding-block: 0.5rem 0;
  }

  .brand {
    align-self: center;
  }

  .brand__logo {
    height: 62px;
  }

  .brand__logo img {
    height: 116px;
    margin: -26px -11px 0 -10px;
  }

  .site-nav ul {
    justify-content: space-around;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .site-nav a {
    padding: 0.75rem 1rem;
    border-radius: 0;
  }
}

/* ---------- Homepage hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--navy-900);
  color: var(--on-dark);
}

.hero__media,
.hero__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__media {
  z-index: -2;
}

.hero__media img {
  object-fit: cover;
  object-position: 40% center;
}

/* Dark overlay so the text is easy to read */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    90deg,
    rgba(3, 16, 33, 0.94) 0%,
    rgba(3, 16, 33, 0.84) 45%,
    rgba(3, 16, 33, 0.6) 100%
  );
}

.hero__content {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.hero__title {
  max-width: 21ch;
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.5rem);
}

.hero__text {
  max-width: 36rem;
  margin: 0 0 2rem;
  color: var(--on-dark-muted);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
}

@media (max-width: 719px) {
  .hero::before {
    background: rgba(3, 16, 33, 0.86);
  }
}

@media (max-width: 479px) {
  .hero .button,
  .cta .button-row .button {
    flex: 1 1 100%;
  }
}

/* ---------- Kervora Cloud page hero ---------- */

/* A bluer overlay gives the cloud page its own feel while matching the rest of the site */
.hero--cloud::before {
  background: linear-gradient(
    100deg,
    rgba(3, 16, 33, 0.95) 0%,
    rgba(3, 30, 70, 0.88) 50%,
    rgba(3, 72, 160, 0.62) 100%
  );
}

.hero--cloud .hero__media img {
  object-position: 70% center;
}

@media (max-width: 719px) {
  .hero--cloud::before {
    background: linear-gradient(180deg, rgba(3, 16, 33, 0.9), rgba(3, 32, 76, 0.88));
  }
}

.hero--cloud .hero__content {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0;
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-inline: 0.6rem;
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb a {
  color: var(--on-dark-muted);
}

.breadcrumb a:hover {
  color: #fff;
}

.breadcrumb [aria-current="page"] {
  color: #fff;
  font-weight: 600;
}

.cloud-hero__logo {
  display: block;
  width: clamp(56px, 8vw, 76px);
  height: auto;
  margin-bottom: 1.25rem;
}

.external-note {
  margin: 0.85rem 0 0;
  color: var(--on-dark-muted);
  font-size: 0.95rem;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(3rem, 7vw, 5rem);
}

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

.section__title {
  margin: 0 0 clamp(1.5rem, 4vw, 2.5rem);
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.4rem);
  text-align: center;
}

/* ---------- Services ---------- */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.service-card__icon,
.contact-detail__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 10px;
  background: var(--blue-50);
  color: var(--blue-600);
}

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

.service-card__title {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}

.service-card__text {
  margin: 0;
  color: var(--ink-muted);
}

/* A service card that links to its own page: the whole card is clickable */
.service-card--link {
  position: relative;
  border-color: #b9cde8;
}

.service-card--link:hover {
  border-color: var(--blue-600);
  box-shadow: 0 6px 18px rgba(15, 26, 45, 0.08);
}

.service-card__link {
  color: inherit;
  text-decoration: none;
}

.service-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.service-card__more {
  display: inline-flex;
  align-items: center;
  margin-top: 0.6rem;
  color: var(--blue-700);
  font-weight: 600;
}

.service-card--link:hover .service-card__more {
  text-decoration: underline;
}

/* Show the keyboard focus ring around the whole card rather than just the title */
@supports selector(:has(a)) {
  .service-card__link:focus-visible {
    outline: none;
  }

  .service-card--link:has(.service-card__link:focus-visible) {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
  }
}

@media (max-width: 599px) {
  .service-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 1.1rem 1.25rem;
  }

  .service-card__icon {
    width: 2.75rem;
    height: 2.75rem;
  }

  .service-card__icon .icon {
    width: 24px;
    height: 24px;
  }
}

/* ---------- About G4 Service ---------- */

.about {
  border-top: 1px solid var(--border);
  background: var(--card);
}

.about__inner {
  max-width: 48rem;
  padding-block: clamp(2.75rem, 6vw, 4rem);
  text-align: center;
}

.about__title {
  margin-bottom: 1.25rem;
}

.about__text {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-size: 1.0625rem;
}

/* On phones the paragraphs wrap to many lines, which read more easily left-aligned */
@media (max-width: 599px) {
  .about__text {
    text-align: left;
  }
}

/* The closing line, set apart as a short, strong statement */
.about__statement {
  margin: 1.75rem 0 0;
  color: var(--ink);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.about__statement::before {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0 auto 1.25rem;
  border-radius: 2px;
  background: var(--blue-600);
}

/* ---------- Closing call to action ---------- */

.cta {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--on-dark);
  text-align: center;
}

.cta__inner {
  padding-block: clamp(3rem, 7vw, 4.5rem);
}

.cta__title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 1.3rem + 1.3vw, 2.2rem);
}

.cta__text {
  max-width: 36rem;
  margin: 0 auto 1.75rem;
  color: var(--on-dark-muted);
  font-size: 1.125rem;
}

/* ---------- Page intro (Contact, Not found) ---------- */

.page-intro {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--on-dark);
}

.page-intro .container {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.page-intro--tall .container {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.page-intro__title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}

.page-intro__text {
  margin: 0;
  color: var(--on-dark-muted);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
}

.page-intro__text + .button-row {
  margin-top: 2rem;
}

/* ---------- Contact page ---------- */

.contact-layout {
  display: grid;
  align-items: start;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.9fr);
    gap: 2rem;
  }
}

.contact-details,
.form-card {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.contact-details__title,
.form-card__title {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
}

.contact-details__list {
  display: grid;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-detail {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.contact-detail__icon {
  width: 2.75rem;
  height: 2.75rem;
}

.contact-detail__label {
  display: block;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.contact-detail__value {
  font-size: 1.125rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-detail__missing {
  color: var(--ink-muted);
  font-style: italic;
}

/* ---------- Form ---------- */

.form-card__hint {
  margin: -0.75rem 0 1.25rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.enquiry-form {
  display: grid;
  gap: 1.25rem;
}

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

.field label {
  font-weight: 600;
}

.field__optional {
  color: var(--ink-muted);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--field-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.field textarea {
  min-height: 9rem;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--blue-700);
}

.field [aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.field__error {
  margin: 0;
  color: var(--error);
  font-size: 0.95rem;
  font-weight: 600;
}

.field__error:empty,
[data-form-alerts]:empty {
  display: none;
}

/* Spam trap: hidden from people, but automated bots often fill it in */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button--submit {
  justify-self: start;
  min-width: 12rem;
}

@media (max-width: 599px) {
  .button--submit {
    justify-self: stretch;
  }
}

.error-summary,
.form-alert,
.form-success {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 2px solid;
  border-left-width: 6px;
  border-radius: 8px;
}

.error-summary {
  border-color: var(--error);
  background: var(--error-bg);
}

.error-summary:focus-visible {
  outline-offset: 2px;
}

.error-summary__title {
  margin: 0 0 0.4rem;
  color: var(--error);
  font-size: 1.05rem;
}

.error-summary ul {
  margin: 0;
  padding-left: 1.2rem;
}

.error-summary a {
  color: var(--error);
  font-weight: 600;
}

.form-alert--error {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
  font-weight: 600;
}

.form-alert--info {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--ink);
}

.form-success {
  border-color: var(--success);
  background: var(--success-bg);
}

.form-success__title {
  margin: 0 0 0.35rem;
  color: var(--success);
  font-size: 1.2rem;
}

.form-success p {
  margin: 0;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--logo-bg);
  color: var(--on-dark-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
}

.footer__logo {
  height: 44px;
}

.footer__logo img {
  height: 84px;
  margin: -20px -8px 0 -7px;
}

.footer__logo.logo-placeholder {
  height: auto;
  font-size: 1.2rem;
}

.footer__copy {
  margin: 0;
}

.site-footer a {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 599px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}
