/* GEMSA — site styles. Plain CSS, no build step. */

/* ---------- Fonts (self-hosted, latin subset, variable weight) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/playfair-display-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --navy: #0a2342;
  --navy-light: #1d3461;
  --gold: #d4af37;
  --gold-light: #f9f295;
  --gold-ink: #8b6914;   /* gold darkened for small text on white (WCAG AA) */
  --slate: #2c3e50;
  --gray: #e5e5e5;
  --tint: #f7f7f7;
  --faint: #fcfcfc;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --radius: 4px;
  --radius-btn: 6px;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);

  --gutter: 1rem;
  --section-y: 5rem;
}
@media (min-width: 768px) {
  :root { --gutter: 1.5rem; --section-y: 7rem; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--slate);
  background: #fff;
  overflow-x: hidden;
}
h1, h2, h3, p, ul { margin: 0; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; color: var(--navy); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.icon {
  width: 1em; height: 1em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon--lg { width: 2.5rem; height: 2.5rem; color: var(--gold); }

.container { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 100;
  background: var(--gold); color: var(--navy); padding: .5rem 1rem; border-radius: var(--radius-btn);
}
.skip-link:focus { top: 1rem; }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  padding-block: 1.25rem;
  background: rgb(0 0 0 / .5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: padding .3s ease-in-out, background-color .3s ease-in-out, box-shadow .3s ease-in-out;
}
.site-nav.is-scrolled {
  padding-block: .5rem;
  background: rgb(0 0 0 / .7);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xl);
}
.nav-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 1rem; }
.nav-logo img { height: 2.5rem; width: auto; }
.nav-links { display: flex; flex-wrap: wrap; column-gap: 2rem; row-gap: .5rem; list-style: none; padding: 0; }
.nav-links a {
  font-size: .875rem; line-height: 1.25rem; font-weight: 500; text-transform: uppercase;
  color: #fff; transition: color .15s;
}
.nav-links a:hover { color: var(--gold); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; padding: 0; border: 0; border-radius: var(--radius-btn);
  background: transparent; color: #fff; font-size: 1.5rem; cursor: pointer;
}
.nav-toggle .icon-close,
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 767.98px) {
  .nav-links { column-gap: 1.25rem; }
  /* With JS available, collapse links behind the menu button */
  .js .nav-toggle { display: inline-flex; }
  .js .nav-links { display: none; flex-basis: 100%; flex-direction: column; padding-block: .5rem; }
  .js .site-nav.is-open { background: rgb(0 0 0 / .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .js .site-nav.is-open .nav-links { display: flex; }
  .js .nav-links a { display: block; padding-block: .625rem; }
}
@media (min-width: 768px) {
  .nav-logo img { height: 3.5rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  min-height: 100vh; min-height: 100svh;
  background: var(--navy); color: #fff;
}
.hero-bg {
  position: absolute; inset: -10% 0 auto; height: 120%;
  background:
    linear-gradient(rgb(10 35 66 / .85), rgb(10 35 66 / .85)),
    url("../img/hero.webp") center / cover var(--navy);
  will-change: transform;
}
.hero-content { position: relative; padding-block: 8.5rem 4.5rem; }
.hero-inner { max-width: 48rem; }
.hero .eyebrow { color: var(--gold); margin-bottom: .75rem; }
.hero h1 {
  color: #fff; font-size: 2.25rem; line-height: 1.25; margin-bottom: 1.5rem;
}
.hero-lead { max-width: 42rem; margin-bottom: 2rem; color: rgb(255 255 255 / .8); }
.hero-actions { display: flex; flex-direction: column; gap: 1rem; }
.gold-gradient {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-scroll {
  position: absolute; bottom: 2.5rem; left: 50%; translate: -50% 0;
  font-size: 2rem; color: rgb(255 255 255 / .6); transition: color .15s;
}
.hero-scroll:hover { color: #fff; }

@media (min-width: 640px) {
  .hero-actions { flex-direction: row; }
}
@media (min-width: 768px) {
  .hero .eyebrow { font-size: 1rem; line-height: 1.5rem; margin-bottom: 1.25rem; }
  .hero h1 { font-size: 3rem; }
  .hero-lead { font-size: 1.125rem; line-height: 1.75rem; }
}
@media (min-width: 1024px) {
  .hero h1 { font-size: 3.75rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .75rem 1.5rem; border-radius: var(--radius-btn);
  font-size: .875rem; line-height: 1.25rem; font-weight: 500;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  transition: background-color .15s, color .15s;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: rgb(212 175 55 / .9); }
.btn-ghost { border: 1px solid rgb(255 255 255 / .2); color: #fff; }
.btn-ghost:hover { background: rgb(255 255 255 / .05); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section--tint { background: var(--tint); }
.section--faint { background: var(--faint); }
.section--compact { padding-block: 3rem; }
.section--navy { background: var(--navy); color: rgb(255 255 255 / .8); }
@media (min-width: 768px) {
  .section--compact { padding-block: 4rem; }
}

.eyebrow {
  font-size: .875rem; line-height: 1.25rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--navy); margin-bottom: .5rem;
}
.section--navy .eyebrow { color: var(--gold); }
.section-title { font-size: 1.875rem; line-height: 2.25rem; margin-bottom: 1.5rem; }
.section--navy .section-title { color: #fff; }
@media (min-width: 768px) {
  .section-title { font-size: 2.25rem; line-height: 2.5rem; }
}
.underlined { position: relative; }
.underlined::after {
  content: ""; position: absolute; bottom: -10px; left: 0;
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.section-head { max-width: 48rem; margin: 0 auto 4rem; text-align: center; }
.section-head--tight { margin-bottom: 3rem; }
.section-head .underlined::after { left: 50%; translate: -50% 0; }
.body-text { margin-bottom: 1.5rem; }

.grid { display: grid; gap: 1.5rem; }
.grid--wide-gap { gap: 2rem; }
@media (min-width: 768px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- About ---------- */
.about-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}
.about-media { position: relative; }
.about-media::before,
.about-media::after {
  content: ""; position: absolute; width: 10rem; height: 10rem; border-radius: var(--radius);
}
.about-media::before { top: -1rem; left: -1rem; background: rgb(212 175 55 / .1); }
.about-media::after { bottom: -1rem; right: -1rem; background: rgb(10 35 66 / .1); }
.about-media img {
  position: relative; z-index: 1; width: 100%;
  border-radius: var(--radius); box-shadow: var(--shadow-xl);
}

/* ---------- Cards (portfolio + patents) ---------- */
.card {
  overflow: hidden; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.card--pad { padding: 1.5rem; }
.card-media { height: 12rem; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.1); }
.card-body { padding: 1.5rem; }
.card-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .5rem; font-size: .75rem; line-height: 1rem;
}
.card-industry { color: var(--gold-ink); font-weight: 500; }
.card-year { color: rgb(44 62 80 / .7); }
.card-title {
  position: relative; padding-bottom: .5rem; margin-bottom: .5rem;
  font-size: 1.25rem; line-height: 1.75rem;
}
.card-title::after {
  content: ""; position: absolute; bottom: -2px; left: 0; width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}
.card-text { margin-top: .75rem; font-size: .875rem; line-height: 1.25rem; }
.card-link {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.25rem; margin-top: 1rem;
  border: 1px solid rgb(212 175 55 / .3); border-radius: var(--radius-btn);
  font-size: .875rem; font-weight: 500; color: var(--gold-ink);
  transition: background-color .15s, border-color .15s;
}
.card-link:hover { background: rgb(212 175 55 / .1); border-color: var(--gold); }
.card-link .icon { font-size: 14px; }

.patent-head { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 .75rem; }
.patent-head h3 { font-size: 1.25rem; line-height: 1.75rem; }
.patent-head + .card-text { margin-top: 0; }
.badge {
  padding: .25rem .5rem; border-radius: var(--radius); white-space: nowrap;
  background: rgb(212 175 55 / .2); color: var(--navy);
  font-size: .75rem; line-height: 1rem; font-weight: 500;
}

/* ---------- Services ---------- */
.service { padding: 2rem; border-radius: var(--radius); background: rgb(29 52 97 / .4); }
.service .icon { margin-bottom: 1.25rem; }
.service h3 { color: #fff; font-size: 1.25rem; line-height: 1.75rem; margin-bottom: 1rem; }

/* ---------- Contact ---------- */
.contact { position: relative; isolation: isolate; }
.contact::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .05;
  background: url("../img/hero.webp") center / cover;
}
@media (hover: hover) and (min-width: 1024px) {
  .contact::before { background-attachment: fixed; }
}
.contact-lead { max-width: 32rem; margin-inline: auto; }
.contact-action { display: flex; justify-content: center; }
.contact-action .btn { gap: .625rem; padding: 1rem 2rem; font-size: 1rem; line-height: 1.5rem; box-shadow: var(--shadow-lg); }
.contact-action .icon { font-size: 1.25rem; }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 2rem; border-top: 1px solid #e5e7eb;
  font-size: .875rem; line-height: 1.25rem; text-align: center;
}
@media (min-width: 768px) {
  .site-footer { text-align: left; }
}

/* ---------- 404 ---------- */
.not-found {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-content: center; justify-items: center; gap: 1.5rem;
  padding: var(--gutter); text-align: center;
  background: var(--navy); color: rgb(255 255 255 / .8);
}
.not-found img { width: 14rem; }
.not-found h1 { color: #fff; font-size: 2.25rem; }

/* ---------- Motion ---------- */
/* Stagger children of .stagger by 100ms each */
.stagger > :nth-child(2) { --delay: .1s; }
.stagger > :nth-child(3) { --delay: .2s; }
.stagger > :nth-child(4) { --delay: .3s; }
.stagger > :nth-child(5) { --delay: .4s; }
.stagger > :nth-child(6) { --delay: .5s; }
.about-media { --delay: .3s; }

.reveal {
  transition: opacity .7s ease-out var(--delay, 0s), translate .7s ease-out var(--delay, 0s);
}
.card--lift {
  transition: opacity .7s ease-out var(--delay, 0s), translate .7s ease-out var(--delay, 0s), transform .3s;
}

@keyframes fade-in-up {
  from { opacity: 0; translate: 0 20px; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: fade-in-up .7s ease-out var(--delay, 0s) both; }
  .hero-scroll { animation: bounce 1s infinite; }
  .card--lift:hover { transform: translateY(-.5rem); }

  /* Scroll reveals: only hidden when JS is running to reveal them again */
  .js .reveal:not(.is-visible) { opacity: 0; translate: 0 20px; }
  .js .reveal.fade-only:not(.is-visible) { translate: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .site-nav, .hero-scroll { display: none; }
  .reveal { opacity: 1 !important; translate: none !important; }
}
