/* Highline Controls Inc. — site styles
   Colors, fonts and spacing are defined once here as variables. */

:root {
  /* Brand palette */
  --navy: #003a52;
  --steel: #8396a8;
  --tint: #eef2f5;
  --pale-steel: #c9d5de;
  --white: #ffffff;
  --ink: #1d2b36;

  /* Fonts */
  --font-head: "Jost", "Century Gothic", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --radius: 4px;
  --page-pad: clamp(0.5rem, 2vw, 1.5rem);
}

*, *::before, *::after { box-sizing: border-box; }

/* Large monitors: scale everything (all sizes are in rem) with screen width.
   1080p = 18px, 1440p = 24px, 4K = 36px. Laptops and below stay at 16px. */
html {
  /* Also limited by height so wide, short windows still fit one screen */
  font-size: max(100%, min(0.9375vw, 1.6667vh));
  /* Reserve scrollbar space on every page so the layout never shifts between pages */
  scrollbar-gutter: stable;
  background: var(--navy);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--navy);
}

img, svg { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.1;
  margin: 0 0 var(--space-2);
  font-weight: 500;
}
p { margin: 0 0 var(--space-2); }
a { color: var(--navy); }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }

.skip-link {
  position: absolute;
  left: var(--space-1);
  top: -4rem;
  background: var(--white);
  color: var(--navy);
  padding: var(--space-1) var(--space-2);
  z-index: 100;
}
.skip-link:focus { top: var(--space-1); }

/* ---------- Placeholders (must stay clearly visible) ---------- */
.placeholder {
  display: inline-block;
  font-family: ui-monospace, "Consolas", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.05em 0.5em;
  border: 2px dashed currentColor;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--navy);
  margin-block: 0.15rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  background: var(--navy);
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--white); color: var(--navy); }
.btn--ghost { background: transparent; color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: var(--white); }

/* ---------- Single-screen page: navy page, framed light card ---------- */
body.home { min-height: 100vh; min-height: 100svh; padding: var(--page-pad); }

.frame {
  min-height: calc(100svh - 2 * var(--page-pad));
  border: 1px solid var(--steel);
  border-radius: 16px;
  padding: 8px;
  display: flex;
}

.card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--tint);
  border-radius: 10px;
  padding: clamp(1rem, 3vw, 2.5rem);
  padding-top: calc(var(--space-2) * 1.25); /* 1.25:1 against the space under the logo */
  gap: var(--space-2);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

/* Logo PNG has white padding and an opaque white background: crop and blend it */
.logo {
  display: block;
  width: 10.5rem;
  aspect-ratio: 1189 / 281; /* logo ink plus ~12px safety margin on every side */
  overflow: hidden;
}
.logo img {
  width: 107.4%;
  height: auto;
  max-width: none;
  margin-left: -1.85%;
  margin-top: -3.62%;
  mix-blend-mode: multiply;
}

.menu-toggle {
  display: none;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 500;
  color: var(--navy);
  background: transparent;
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  min-height: 2.75rem; /* comfortable tap target */
  cursor: pointer;
}
.js .menu-toggle { display: inline-block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--navy);
  padding: 0.7rem 0;
  position: relative;
}
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
/* Current page: short bar under the link, like the logo's line */
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.35rem;
  width: 1.2rem;
  height: 3px;
  background: var(--navy);
}

/* Mobile: dropdown (only when JS is available) */
.site-nav {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 58, 82, 0.2);
  padding: var(--space-1) var(--space-2);
}
.js .site-nav { display: none; }
.js .site-nav.is-open { display: block; }
.site-header {
  position: relative;
  padding-bottom: var(--space-2);
}
/* Separator line runs slightly past the logo (left) and the last nav link (right) */
.site-header::after {
  content: "";
  position: absolute;
  left: -0.9rem;
  right: -0.9rem;
  bottom: 0;
  height: 1px;
  background: var(--steel);
}

/* ---------- Hero ---------- */
.hero {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-3);
}

.eyebrow {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--navy);
  margin: 0 0 var(--space-1);
}


/* Signature motif: long navy bar + shorter steel bar */
.motif {
  display: block;
  width: 3.5rem;
  height: 4px;
  background: var(--navy);
  position: relative;
  margin: 14px 0 var(--space-2);
}

.hero h1 {
  font-size: clamp(2rem, min(4.6vw, 7vh), 3.5rem);
  font-weight: 600;
  max-width: 17ch;
  margin-bottom: var(--space-2);
}

.lead { font-size: 1.05rem; max-width: 30rem; margin-bottom: var(--space-3); }

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* The one strong image: the logo mark on a navy panel */
.hero-mark {
  /* Logo mark sits directly on the page: no navy box, original navy colour */
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
  min-height: 0;
}
.hero-mark svg { width: min(calc((100% - 2 * clamp(1rem, 4vw, 3rem)) * 1.2), 31.2rem); height: auto; max-height: 100%; }

/* ---------- Inner pages (scroll normally) ---------- */
body.page { min-height: 100svh; padding: var(--page-pad); }

.page-main { flex: 1; padding-block: var(--space-1) 0; } /* header-line gap matches the home page */
.page-intro { margin-bottom: var(--space-3); }
.page-intro h1 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 600; margin-bottom: var(--space-1); }
.page-intro .lead { max-width: 40rem; margin: 0; }

.services {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3) var(--space-4);
}
.services li { padding-top: var(--space-2); border-top: 1px solid var(--steel); }
.services h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.services p { margin: 0; }
.services .services-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-1);
}
.services .services-cta h2 { margin: 0; }
.services .services-cta .btn { padding: 0.5rem 1rem; font-size: 0.95rem; }

/* About */
.about-grid { display: grid; gap: var(--space-3); }
.about-text .page-intro { margin-bottom: var(--space-2); }
.about-text .page-intro .lead { max-width: 36rem; }
.about-points { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
.about-points li { padding-top: 0.6rem; border-top: 1px solid var(--steel); }
.about-points h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.about-points p { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.about-people .eyebrow { margin-bottom: var(--space-2); }
.office { display: grid; gap: var(--space-2); }
.office .photo {
  aspect-ratio: 16 / 9;
  background: var(--pale-steel);
  display: grid;
  place-items: center;
  padding: var(--space-1);
  text-align: center;
}
.about-text .placeholder { font-size: 0.75rem; }
@media (min-width: 40rem) { .office { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) {
  body.page .page-main:has(.about-grid) { display: flex; flex-direction: column; padding-bottom: var(--space-1); }
  /* Same column split and gap as the home page hero */
  .about-grid { flex: 1; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 5rem); min-height: 0; }
  .about-text, .about-people { display: flex; flex-direction: column; min-height: 0; }
  .about-points { flex: 1; align-content: space-evenly; }
  .office { flex: 1; min-height: 0; grid-template-columns: 1fr; grid-template-rows: 3fr 2fr; }
  .office .photo { aspect-ratio: auto; min-height: 2.5rem; }
}

/* Contact */
.mark-panel {
  /* Same as the home page: logo mark directly on the page, no box */
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--navy);
  aspect-ratio: 16 / 9;
}
.mark-panel svg { width: min(calc((100% - 2 * clamp(1rem, 4vw, 3rem)) * 1.2), 31.2rem); height: auto; }
@media (min-width: 64rem) {
  .mark-panel { flex: 1; aspect-ratio: auto; min-height: 0; }
  .mark-panel svg { max-height: 100%; }
}

/* Projects */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}
.projects li { padding-top: var(--space-2); border-top: 1px solid var(--steel); }
.projects .meta {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  color: var(--navy);
  margin: 0 0 0.25rem;
}
.projects .meta { line-height: 1.3; min-height: 1.3em; }
.projects .meta .placeholder { font-size: 0.68rem; padding: 0 0.4em; border-width: 1px; text-transform: none; letter-spacing: 0; line-height: 1.3; }
.projects h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.projects p { margin: 0; }
.projects li > p:last-child { font-size: 0.95rem; line-height: 1.5; min-height: 3em; }
@media (min-width: 40rem) { .projects { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) {
  body.page .page-main:has(.projects) { display: flex; flex-direction: column; padding-bottom: var(--space-1); }
  .projects { flex: 1; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: var(--space-2) var(--space-3); }
  .projects li { display: flex; flex-direction: column; min-height: 0; }
  .projects h2 { font-size: clamp(1.15rem, 2.2vh, 1.6rem); }
  .projects li > p:last-child { font-size: clamp(0.95rem, 1.9vh, 1.2rem); }
}
/* Tall screens: quiet index number, same as Services */
@media (min-width: 64rem) and (min-height: 58rem) {
  .projects { counter-reset: prj; }
  .projects li { counter-increment: prj; }
  .projects li::before {
    content: "0" counter(prj);
    display: block;
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vh, 3.5rem);
    line-height: 1;
    color: var(--navy);
    margin-bottom: var(--space-1);
  }
}

@media (min-width: 40rem) {
  .services { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  body.page .page-main:has(.services) { display: flex; flex-direction: column; padding-bottom: var(--space-1); }
  .services { flex: 1; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: var(--space-2) var(--space-3); counter-reset: svc; }
  .services h2 { font-size: clamp(1.15rem, 2.2vh, 1.6rem); }
  .services { font-size: clamp(0.95rem, 1.9vh, 1.2rem); line-height: 1.5; }
}
/* Tall screens: fill the height with fluid type and a quiet index number */
@media (min-width: 64rem) and (min-height: 58rem) {
  .services li:not(.services-cta) { counter-increment: svc; }
  .services li:not(.services-cta)::before {
    content: "0" counter(svc);
    display: block;
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vh, 3.5rem);
    line-height: 1;
    color: var(--navy);
    margin-bottom: var(--space-1);
  }
  .services li { padding-top: var(--space-2); }
  .page-intro { margin-bottom: var(--space-4); }
  .page-intro h1 { font-size: clamp(2.5rem, 5.5vh, 3.75rem); margin-bottom: var(--space-2); }
  .page-intro .lead { font-size: clamp(1.05rem, 2.1vh, 1.35rem); max-width: 44rem; }
  .services .services-cta .btn { padding: 0.7rem 1.3rem; font-size: 1rem; }
}

/* ---------- Footer row ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  font-size: 0.9rem;
  color: var(--navy);
}
.footer-note { font-family: var(--font-head); font-weight: 500; }
.footer-line { flex: 1; height: 1px; background: var(--navy); min-width: 2rem; opacity: 0.5; }

/* ---------- Desktop ---------- */
@media (min-width: 56rem) {
  .menu-toggle, .js .menu-toggle { display: none; }

  .site-nav, .js .site-nav {
    display: block;
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }
  .site-nav ul { display: flex; gap: calc(var(--space-4) * 1.2); }
  .site-nav a { padding: 0.5rem 0; font-size: 1.26rem; }
  .site-nav a[aria-current="page"]::after { width: 1.44rem; }

  .logo { width: 14.4rem; }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); /* same split as About and Contact */
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
  }
  .hero-mark { align-self: stretch; margin-block: var(--space-1); }
}
/* Tall enough to spare it: sit the text slightly above centre (no layout change) */
@media (min-width: 56rem) and (min-height: 46rem) {
  .hero-text { transform: translateY(-1.25rem); }
}

/* Phone */
@media (max-width: 55.99rem) {
  .hero-mark { flex: 1 1 auto; min-height: 8rem; padding: 0.25rem 0; overflow: hidden; }
  .hero-mark svg { height: 100%; width: auto; }
  .lead { font-size: 1rem; margin-bottom: var(--space-2); }
  .hero-actions .btn { padding: 0.65rem 1.1rem; font-size: 0.95rem; }
  .footer-line { display: none; }
  /* Footer on phones: note on its own row, phone and email together on one line */
  .site-footer { gap: 0.4rem 0.5rem; flex-wrap: wrap; }
  .site-footer .footer-note { flex-basis: 100%; }
  .site-footer .placeholder { font-size: min(0.62rem, 2.9vw); white-space: nowrap; border-width: 1px; padding: 0.05em 0.35em; margin-block: 0; }
}

/* Phone: keep the logo and menu button in view while scrolling long pages */
@media (max-width: 55.99rem) and (min-height: 34rem) {
  .card { padding-top: 0; }
  .site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--tint);
    padding-top: clamp(1rem, 3vw, 1.25rem); /* moved here from the card so it stays when stuck */
  }
}

/* Home fits exactly one screen whenever the window is tall enough.
   In short windows (e.g. a phone held sideways) it scrolls normally instead of clipping. */
@media (min-height: 34rem) {
  body.home { height: 100svh; overflow: hidden; }
  body.home .frame { height: calc(100svh - 2 * var(--page-pad)); min-height: 0; }
}
@media (max-width: 55.99rem) and (min-height: 34rem) {
  .hero-mark { flex: 1 1 0; min-height: 0; }
}

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Contact links (phone and email) */
.contact-link { color: var(--navy); text-underline-offset: 3px; }
.contact-link:hover { text-decoration-thickness: 2px; }
@media (max-width: 55.99rem) {
  .site-footer .contact-link { font-size: min(0.9rem, 3.7vw); white-space: nowrap; }
}
/* Footer links use the same font as "Formerly JP Certified" */
.site-footer .contact-link { font-family: var(--font-head); font-weight: 500; }

/* Contact page: readable values that match the headings' font */
.contact-list p, .contact-list address p { color: var(--ink); font-family: var(--font-head); font-weight: 500; font-size: 1.15rem; line-height: 1.35; }
.contact-list address { font-style: normal; }
.contact-list p.contact-sub { color: var(--ink); font-family: var(--font-head); font-size: 1.15rem; font-weight: 500; margin-top: 0.15rem; }
.contact-list .contact-link { font-family: inherit; font-weight: inherit; color: var(--ink); }
.contact-list .placeholder { font-size: 0.8rem; }
@media (min-width: 64rem) and (max-height: 46rem) {
  .contact-list p, .contact-list address p { font-size: 1.02rem; line-height: 1.3; }
  .contact-list p.contact-sub { font-size: 1.02rem; margin-top: 0; }
  .contact-list h2 { margin-bottom: 0.1rem; }
}
.contact-label { display: inline-block; min-width: 3.6em; }

/* About, desktop only: office photos removed, rows use the full width */
.about-grid--wide .about-people { display: none; } /* office photos removed on every screen size */
@media (min-width: 64rem) {
  .about-grid--wide { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 64rem) {
  .about-grid--wide .page-intro .lead { max-width: 60rem; }
}
@media (min-width: 64rem) and (max-height: 52rem) {
  .about-grid--wide .page-intro h1 { font-size: 2rem; margin-bottom: 0.25rem; }
  .about-grid--wide .about-text .page-intro { margin-bottom: 0.5rem; }
  .about-grid--wide .about-points { gap: 0.25rem; }
  .about-grid--wide .about-points li { padding-top: 0.4rem; }
  .about-grid--wide .about-points p { line-height: 1.4; }
}
@media (min-width: 64rem) and (max-height: 42rem) {
  .about-grid--wide .page-intro h1 { font-size: 1.7rem; }
  .about-grid--wide .page-intro .lead { font-size: 0.95rem; line-height: 1.4; }
  .about-grid--wide .about-points h2 { font-size: 1.05rem; margin-bottom: 0.1rem; }
  .about-grid--wide .about-points p { font-size: 0.9rem; line-height: 1.35; }
  .about-grid--wide .about-points li { padding-top: 0.3rem; }
  .about-grid--wide .about-points { gap: 0.15rem; }
}
