/* Hill Systems Ltd — Public site styles */

/* MARK: Design Tokens */
/* Brand palette aligned with logo.svg: navy #002147, accent #007BFF */
:root {
  color-scheme: light;
  --navy: #002147;
  --accent: #007bff;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --surface-muted: #eef3f8;
  --surface-muted-hover: #e4ebf3;
  --text: var(--navy);
  --muted: #4a6278;
  --border: #d9e2ec;
  --input-bg: #ffffff;
  --accent-soft: rgba(0, 123, 255, 0.12);
  --accent-border: rgba(0, 123, 255, 0.35);
  --navy-soft: rgba(0, 33, 71, 0.06);
  --shadow-soft: 0 1px 2px rgba(0, 33, 71, 0.05), 0 10px 28px rgba(0, 33, 71, 0.07);
  --shadow: 0 1px 0 var(--border);
  --shadow-hover: 0 1px 2px rgba(0, 33, 71, 0.06), 0 14px 32px rgba(0, 33, 71, 0.09);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1040px;
  --gutter: clamp(1rem, 4vw, 1.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.15s;
  --duration-med: 0.35s;
  --duration-slow: 0.8s;
  --header-height: 4.25rem;
  --nav-indicator-inset: 6px;
}

/* MARK: Base Styles */
/* Core element defaults */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
  scroll-padding-top: var(--header-height);
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

::selection {
  background: rgba(0, 123, 255, 0.22);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy);
}

p {
  margin: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 0.6rem 1rem;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* MARK: Page Layout */
/* Container, sections, and cards */
.container {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

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

.section--contact {
  padding-bottom: clamp(3.5rem, 9vw, 5rem);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.section__header {
  max-width: 38rem;
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.section__header h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
}

.section__header h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), var(--accent));
}

.section__header--center h2::after {
  margin-inline: auto;
}

.section__header--light h2,
.section__header--light .section__header p {
  color: #fff;
}

.section__header--light h2::after {
  background: linear-gradient(90deg, #fff, var(--accent));
}

.section__header--light p {
  color: rgba(255, 255, 255, 0.78);
}

.section__header p {
  color: var(--muted);
  font-size: clamp(0.98rem, 2.2vw, 1.05rem);
}

.section__subheader {
  margin: clamp(2rem, 5vw, 2.75rem) 0 1.25rem;
}

.section__title-sm {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.section__label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* MARK: Site Header */
/* Brand mark and navigation */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transform: translate3d(0, -100%, 0);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.38s var(--ease-smooth),
    opacity 0.32s ease,
    background var(--duration-fast) ease,
    border-color var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease;
  padding-top: env(safe-area-inset-top);
}

.site-header.is-scrolled {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  pointer-events: auto;
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px var(--navy-soft);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  text-decoration: none;
  opacity: 0;
  transform: translate3d(0, -4px, 0);
  transition:
    opacity 0.32s ease 0.06s,
    transform 0.38s var(--ease-smooth) 0.06s;
}

.site-header.is-scrolled .brand {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.brand:hover {
  opacity: 0.88;
}

.brand__logo {
  display: block;
  width: min(168px, 40vw);
  height: auto;
  transition: transform var(--duration-med) var(--ease-out);
}

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

.site-nav {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-left: auto;
  padding-bottom: 0.35rem;
  opacity: 0;
  transform: translate3d(0, -4px, 0);
  transition:
    opacity 0.32s ease 0.1s,
    transform 0.38s var(--ease-smooth) 0.1s;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-header.is-scrolled .site-nav {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.site-nav__indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  background: linear-gradient(90deg, var(--navy) 15%, var(--accent) 85%);
  transition:
    transform 0.32s var(--ease-smooth),
    width 0.32s var(--ease-smooth),
    opacity 0.2s ease;
}

.site-nav__indicator.is-visible {
  opacity: 1;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.2rem 0;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--navy);
  text-decoration: none;
}

.site-nav a.is-active {
  color: var(--navy);
  text-decoration: none;
}

/* MARK: Hero */
.hero {
  position: relative;
  padding-block: clamp(2.75rem, 10vw, 5rem) 0;
  overflow: hidden;
}

.hero__backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 40% at 75% 25%, rgba(0, 123, 255, 0.1), transparent 60%),
    linear-gradient(165deg, var(--bg) 40%, color-mix(in srgb, var(--surface-muted) 50%, var(--bg)) 100%);
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1.1fr 0.75fr;
    gap: 1rem 2.5rem;
  }
}

.hero__copy {
  max-width: 36rem;
}

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 10rem;
}

.hero__logo {
  display: block;
  width: min(100%, 22rem);
  height: auto;
}

.hero__kicker {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
}

.hero__lead {
  margin: 0 0 1.75rem;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
}

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

.hero__actions .btn {
  min-width: min(100%, 12rem);
}

.hero__rail {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-block: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy);
}

.hero__rail-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* MARK: Trace List */
/* Circuit-node timeline for about section */
.trace-list {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.75rem;
  list-style: none;
}

.trace-list::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 0.6rem;
  bottom: 0.6rem;
  width: 2px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--accent) 100%);
  border-radius: 999px;
}

.trace-list__item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 1.25rem;
  padding-bottom: 1.75rem;
}

.trace-list__item:last-child {
  padding-bottom: 0;
}

.trace-list__node {
  position: absolute;
  left: -1.75rem;
  top: 0.35rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

.trace-list__title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
  font-weight: 600;
}

.trace-list__content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* MARK: Scope Rail */
/* Numbered service rows with horizontal rules */
.section--services {
  background:
    linear-gradient(180deg, transparent 0%, color-mix(in srgb, var(--surface-muted) 35%, transparent) 100%);
}

.scope-rail {
  margin: 0;
  padding: 0;
  list-style: none;
}

.scope-rail__row {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0 1.25rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.scope-rail__row:first-child {
  border-top: 1px solid var(--border);
}

.scope-rail__num {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding-top: 0.2rem;
}

.scope-rail__body {
  display: grid;
  gap: 0.2rem;
}

.scope-rail__title {
  font-weight: 600;
  color: var(--navy);
  font-size: 1rem;
}

.scope-rail__desc {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.boundaries-note {
  margin: 2rem 0 0;
  max-width: 38rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  opacity: 0.82;
}

/* MARK: Service Split */
/* Full-bleed navy / light monthly service panes */
.section--split {
  padding: 0;
}

.service-split {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .service-split {
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 22rem;
  }
}

.service-split__pane {
  padding-block: clamp(3rem, 8vw, 4.5rem);
}

.service-split__pane--navy {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.88);
}

.service-split__pane--light {
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
}

@media (min-width: 768px) {
  .service-split__pane--light {
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}

.service-split__inner {
  width: min(32rem, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 768px) {
  .service-split__pane--navy .service-split__inner {
    margin-inline: 0 auto 0;
    padding-inline: var(--gutter) clamp(1.5rem, 4vw, 2.5rem);
  }

  .service-split__pane--light .service-split__inner {
    margin-inline: 0 0 auto;
    padding-inline: clamp(1.5rem, 4vw, 2.5rem) var(--gutter);
  }
}

.service-split__label {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.service-split__pane--navy .service-split__label {
  color: #fff;
}

.service-split__pane--light .service-split__label {
  color: var(--navy);
}

.service-split__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.service-split__list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.service-split__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
}

.service-split__text,
.service-split__note {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
}

.service-split__pane--light .service-split__text {
  color: var(--muted);
}

.service-split__note {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.service-split__pane--navy .section__header {
  margin-bottom: 1.75rem;
}

/* MARK: UI Components */
/* Buttons and form controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition:
    filter var(--duration-fast) ease,
    background var(--duration-fast) ease,
    transform var(--duration-fast) ease,
    box-shadow var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

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

.btn--primary:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: var(--panel);
  border-color: var(--accent-border);
  text-decoration: none;
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

button.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .brand__logo,
  .site-nav a,
  .site-nav__indicator,
  .site-header,
  .brand,
  .site-nav {
    transition: none;
  }

  .site-header:not(.is-scrolled) {
    transform: none;
    opacity: 0;
    pointer-events: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

.contact-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-form {
  width: min(100%, 30rem);
  margin-inline: auto;
  padding-top: 0.5rem;
  display: grid;
  gap: 1.1rem;
  border-top: 1px solid var(--border);
}

.contact-form .btn--primary {
  width: 100%;
  margin-top: 0.25rem;
}

.contact-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color var(--duration-fast) ease;
}

.contact-form input:hover,
.contact-form textarea:hover {
  border-bottom-color: color-mix(in srgb, var(--accent) 50%, var(--border));
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  border-bottom-color: var(--accent);
  outline: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 6rem;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.captcha-container {
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.form-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
}

.form-status[data-state="error"] {
  color: #c53030;
}

.form-status[data-state="ok"] {
  color: #2f855a;
}

/* MARK: Motion */
/* Scroll reveal and entrance animations */
.reveal {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity var(--duration-slow) var(--ease-smooth),
    transform var(--duration-slow) var(--ease-smooth);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal--hero {
  transform: translate3d(0, 18px, 0);
  transition-duration: 0.7s;
}

/* MARK: Site Footer */
/* Company credit */
.site-footer {
  padding-block: 2.5rem  calc(3rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-credit {
  margin: 0;
  font-weight: 600;
  color: var(--navy);
}

.site-footer__tag {
  margin: 0;
  font-size: clamp(0.82rem, 2vw, 0.9rem);
  color: var(--muted);
  line-height: 1.5;
}

/* MARK: Maintenance */
/* Standalone maintenance page */
.maintenance-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.maintenance-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  max-width: 28rem;
}

.maintenance-card .brand__logo {
  width: min(180px, 70vw);
}

.maintenance-card h1 {
  margin: 0;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
}

.maintenance-card p {
  color: var(--muted);
}

/* MARK: Updates Modal */
/* Deployment changelog dialog (admin / template reuse) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 33, 71, 0.45);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: min(540px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.btn-close {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.btn-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-body {
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
}

.updates-feed {
  min-height: 180px;
}

.updates-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}

.updates-state-sub {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.update-entry {
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.65rem;
  background: rgba(0, 123, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.update-entry:last-child {
  margin-bottom: 0;
}

.update-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

.update-date {
  font-weight: 700;
  color: var(--accent);
}

.update-time {
  color: var(--muted);
}

.update-message {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.update-commit {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--surface-muted);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

/* MARK: Responsive */
/* Mobile-first touch and layout refinements */
@media (max-width: 480px) {
  .site-nav {
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 0.25rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    min-width: 0;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-width: 640px) {
  .brand__logo {
    width: min(168px, 44vw);
  }

  .hero__rail {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .hero__rail-dot {
    display: none;
  }

  .scope-rail__row {
    grid-template-columns: 2.25rem 1fr;
    gap: 0 0.85rem;
  }
}
