/* ==========================================================================
   Moisen — Embedded Systems Design
   Static stylesheet (no WordPress / no page builder)
   Palette and typography preserved from the original site.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  --c-purple:      #a170d9;              /* accent, unused decorative      */
  --c-ink:         #1c1c1c;              /* headings / body text           */
  --c-teal:        #05cab6;              /* primary accent                 */
  --c-teal-light:  #b8e6e1;              /* hero + card hover background   */
  --c-blush:       #f5d4d1;
  --c-grey-100:    #ebebeb;              /* contact labels                 */
  --c-grey-600:    #666;                 /* muted text, dark bands         */
  --c-white:       #fff;

  --font-head: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1170px;
  --gutter: 15px;
  --radius: 6px;
  --transition: .25s ease;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button { font: inherit; cursor: pointer; }

/* Visible focus for keyboard users only */
:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  padding: 12px 20px; background: var(--c-ink); color: var(--c-white);
}
.skip-link:focus { left: 0; }

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

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

.section { padding-block: 80px; }
.section--tight  { padding: 111px 0 50px; }
.section--projects { padding: 50px 0 150px; }

/* --- Header / navigation ------------------------------------------------ */
.site-header {
  padding: 39px 0 15px;
  background: var(--c-white);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* The mark is near-square (522 x 479), so it is sized by height, not width. */
.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  transition: opacity var(--transition);
}
.site-logo:hover { opacity: .78; }

.site-logo img {
  width: auto;
  height: 56px;
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-ink);
}
.nav-toggle svg { width: 26px; height: 26px; margin-inline: auto; }

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 34px;
}

.main-nav a {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--c-ink);
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--c-teal);
  border-bottom-color: var(--c-teal);
}

/* --- Hero --------------------------------------------------------------- */
.hero {
  background: var(--c-teal-light);
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 40px;
  min-height: 510px;
  padding-block: 40px;
}

.hero__text  { flex: 1 1 50%; }
.hero__media { flex: 1 1 50%; }
.hero__media img { margin-inline: auto; }

.hero__title {
  font-family: var(--font-head);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
  color: var(--c-ink);
}

.hero__subtitle {
  margin-top: 8px;
  font-size: 23px;
  font-weight: 500;
  line-height: 2;
  letter-spacing: .5px;
  color: var(--c-grey-600);
}

/* --- Page banner (inner pages) ------------------------------------------ */
.page-banner {
  background: var(--c-teal-light);
  padding-block: 70px;
  text-align: center;
}

.page-banner h1 {
  font-family: var(--font-head);
  font-size: 46px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
  color: var(--c-ink);
}

/* --- Section intro headings --------------------------------------------- */
.section-intro {
  font-size: 34px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: .5px;
  text-align: center;
  color: var(--c-ink);
  max-width: 900px;
  margin: 0 auto 55px;
}

.section-intro--projects {
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: 45px;
}

/* --- Service cards ------------------------------------------------------ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 25px 45px;
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-ink);
  text-align: center;
  transition: background var(--transition), transform var(--transition),
              box-shadow var(--transition);
}

.card:hover {
  background: var(--c-teal-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .09);
}

/* First card is the highlighted one (teal on the original site) */
.card--featured { background: var(--c-teal); color: var(--c-white); }
.card--featured:hover { background: var(--c-teal-light); color: var(--c-ink); }

/* On the teal card the badge is a translucent white disc with a white icon */
.card--featured .card__icon {
  background: rgba(255, 255, 255, .22);
  color: var(--c-white);
}
.card--featured:hover .card__icon {
  background: var(--c-white);
  color: var(--c-teal);
}

/* Icon sits in a circular badge */
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--c-teal-light);
  color: var(--c-teal);
  margin-bottom: 22px;
  transition: background var(--transition), color var(--transition);
}
.card__icon svg { width: 24px; height: 24px; }

/* On hover the card turns light teal, so the badge flips to white to keep
   the icon legible against it. */
.card:hover .card__icon {
  background: var(--c-white);
  color: var(--c-teal);
}

.card__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 14px;
}

.card__body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.9;
}
.card__body strong { font-weight: 600; }
.card__body p + p { margin-top: 10px; }

/* Whole card is clickable but the link stays accessible */
.card__link { position: absolute; inset: 0; }
.card { position: relative; }

/* --- Project showcase --------------------------------------------------- */
.projects__lead {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  color: var(--c-ink);
  max-width: 320px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  align-items: center;
}

.projects-grid figure { margin: 0; }
.projects-grid img {
  margin-inline: auto;
  border-radius: var(--radius);
}

/* --- Rich content rows (Services page) ---------------------------------- */
.content-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
  margin-bottom: 70px;
}
.content-row:last-child { margin-bottom: 0; }

.content-row__title {
  font-size: 34px;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: .5px;
  text-align: center;
  margin-bottom: 40px;
}

.content-row p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--c-grey-600);
}

.content-row img { border-radius: var(--radius); margin-inline: auto; }

/* --- Prose (About page) ------------------------------------------------- */
.prose {
  max-width: 900px;
  margin-inline: auto;
}
.prose p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--c-grey-600);
}
.prose p + p { margin-top: 22px; }

/* --- Contact band ------------------------------------------------------- */
.contact {
  background: var(--c-grey-600);
  color: var(--c-white);
  padding: 50px 0 40px;
}

.contact__title {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.9;
  letter-spacing: 1px;
  text-align: center;
  color: var(--c-white);
  margin-bottom: 30px;
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: start;
}

.contact__label {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .5px;
  color: var(--c-grey-100);
}

.contact__value {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .5px;
  color: var(--c-white);
  margin-bottom: 26px;
}
.contact__value a { transition: color var(--transition); }
.contact__value a:hover { color: var(--c-teal); }

.contact__value .flag {
  width: 26px; height: 26px;
  display: inline-block;
  vertical-align: -5px;
  margin-left: 4px;
}

/* --- Form --------------------------------------------------------------- */
.form { display: grid; gap: 16px; }

.form__field { display: flex; flex-direction: column; gap: 6px; }

.form label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--c-grey-100);
}

.form input,
.form textarea {
  width: 100%;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--c-ink);
  background: var(--c-white);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form textarea { min-height: 130px; resize: vertical; }

.form input:focus,
.form textarea:focus {
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(5, 202, 182, .25);
  outline: none;
}

.form input:user-invalid,
.form textarea:user-invalid { border-color: #e04b4b; }

/* Honeypot — hidden from people, visible to naive bots */
.form__hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--c-white);
  background: var(--c-teal);
  border: 2px solid var(--c-teal);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}
.btn:hover { background: transparent; color: var(--c-teal); }
.btn svg { width: 18px; height: 18px; }

.btn--self-start { justify-self: start; }


/* --- Company details (Contact page) ------------------------------------- */
.details { display: grid; gap: 8px; }
.details dt {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--c-teal);
}
.details dd {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.7;
  color: var(--c-ink);
}
.details dd a:hover { color: var(--c-teal); }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--c-grey-600);
  color: var(--c-white);
  padding: 15px 0;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-footer p { font-size: 15px; }

.social { display: flex; gap: 22px; }
.social a {
  font-size: 15px;
  transition: color var(--transition);
}
.social a:hover { color: var(--c-teal); }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 991px) {
  .card-grid,
  .projects-grid { grid-template-columns: repeat(2, 1fr); }

  .hero .container { flex-direction: column; text-align: center; min-height: 0; }
  .hero__title { font-size: 38px; }
  .content-row,
  .contact__grid { grid-template-columns: 1fr; gap: 34px; }
  .content-row--flip .content-row__media { order: -1; }
  .projects__lead { max-width: none; }
}

@media (max-width: 767px) {
  .section { padding-block: 55px; }
  .section--tight { padding: 60px 0 40px; }
  .section--projects { padding: 40px 0 70px; }

  .nav-toggle { display: block; }

  .main-nav {
    display: none;
    flex-basis: 100%;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 14px;
  }
  .main-nav a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--c-grey-100);
  }
  .main-nav a:hover,
  .main-nav a[aria-current="page"] { border-bottom-color: var(--c-teal); }

  .site-header { padding: 22px 0 12px; }
  .site-header .container { flex-wrap: wrap; }
  .site-logo img { height: 44px; }

  .card__icon { width: 58px; height: 58px; }
  .card__icon svg { width: 22px; height: 22px; }

  .card-grid,
  .projects-grid { grid-template-columns: 1fr; }

  .hero__title { font-size: 35px; }
  .hero__subtitle { font-size: 17px; line-height: 1.8; }
  .page-banner h1 { font-size: 35px; }

  .section-intro { font-size: 27px; margin-bottom: 38px; }
  .content-row__title { font-size: 27px; }
  .card__title { font-size: 24px; }
  .card__body { font-size: 17px; }

  .contact__title { font-size: 30px; line-height: 1.5; }
  .contact__label { font-size: 25px; }
  .contact__value { font-size: 24px; }

  .site-footer .container { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --- Form on a light background (Contact page) --------------------------- */
.form--light label { color: var(--c-grey-600); }
.form--light input,
.form--light textarea { border-color: #d8dade; }
