/* =========================================================
   CAR PARKING LOT BARRIER CONTROLLER
   Professional gray and blue technology theme
   ========================================================= */

/* ---------- Design system ---------- */

:root {
  --background: #b8bec5;
  --background-deep: #9fa6ad;

  --surface: #d8dde2;
  --surface-soft: #cbd1d7;
  --surface-light: #e5e8eb;

  --surface-dark: #26313c;
  --surface-darker: #18222c;

  --primary: #1565c0;
  --primary-light: #42a5f5;
  --primary-dark: #0d47a1;
  --accent: #00a8e8;

  --text: #18232d;
  --text-soft: #465563;
  --text-light: #f3f7fa;
  --text-muted-light: #bdc9d3;

  --success: #158b63;
  --warning: #e29b00;
  --danger: #d94155;

  --border: #8f979f;
  --border-light: #b8bec5;
  --border-dark: rgba(255, 255, 255, 0.14);

  --shadow-small: 0 8px 24px rgba(20, 27, 34, 0.12);
  --shadow-medium: 0 16px 40px rgba(20, 27, 34, 0.18);
  --shadow-large: 0 28px 70px rgba(12, 18, 24, 0.28);

  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;

  --content-width: 1200px;
}

/* ---------- Reset ---------- */

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--background-deep);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(
      circle at top right,
      rgba(21, 101, 192, 0.16),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #cbd0d5 0%,
      var(--background) 45%,
      var(--background-deep) 100%
    );
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

main {
  min-height: 100vh;
  background: transparent;
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

code {
  color: #005da8;
  font-family:
    "SFMono-Regular",
    Consolas,
    "Liberation Mono",
    monospace;
}

/* ---------- Shared layout ---------- */

.section {
  width: min(var(--content-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 92px 0;
}

.section-alt {
  position: relative;
  padding-right: 32px;
  padding-left: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background:
    linear-gradient(
      145deg,
      rgba(221, 225, 229, 0.97),
      rgba(190, 197, 203, 0.97)
    );
  box-shadow: var(--shadow-medium);
}

.section-heading {
  max-width: 800px;
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.section-heading h2,
.split-section h2,
.repository-section h2 {
  margin: 0;
  color: #102335;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-heading > p:last-child,
.repository-section > div > p:last-child {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 1.08rem;
}

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

.site-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1260px, calc(100% - 32px));
  margin: 14px auto 0;
  padding: 14px 18px;
  border: 1px solid #818990;
  border-radius: 18px;
  background: rgba(194, 199, 204, 0.95);
  box-shadow: var(--shadow-small);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-mark {
  display: grid;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 17px;
  background:
    linear-gradient(
      135deg,
      var(--primary-light),
      var(--primary-dark)
    );
  box-shadow:
    0 10px 24px rgba(21, 101, 192, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: white;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: #10283d;
  font-size: 1.08rem;
  line-height: 1.2;
}

.brand small {
  margin-top: 4px;
  color: #495968;
  font-size: 0.8rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 10px 13px;
  border-radius: 10px;
  color: #35495c;
  font-size: 0.9rem;
  font-weight: 800;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  background: #d7e5f3;
  color: var(--primary-dark);
}

.site-nav .nav-cta {
  margin-left: 6px;
  background: var(--primary);
  color: white;
}

.site-nav .nav-cta:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 9px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 2px;
  background: var(--primary-dark);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  align-items: center;
  gap: 64px;
  min-height: calc(100vh - 100px);
  padding-top: 68px;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  color: #0d2133;
  font-size: clamp(3.15rem, 7vw, 6.4rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-lead {
  max-width: 700px;
  margin: 28px 0 0;
  color: #3e4f5e;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
}

.hero-actions,
.repository-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 850;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background:
    linear-gradient(
      135deg,
      var(--primary-light),
      var(--primary-dark)
    );
  box-shadow: 0 10px 24px rgba(21, 101, 192, 0.25);
  color: white;
}

.button.primary:hover {
  box-shadow: 0 14px 30px rgba(21, 101, 192, 0.36);
}

.button.secondary {
  border-color: #7f8b96;
  background: rgba(218, 223, 228, 0.92);
  color: #183148;
}

.button.secondary:hover {
  background: #e4e8ec;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 42px;
}

.hero-stats article {
  padding: 17px;
  border: 1px solid #929aa2;
  border-radius: 15px;
  background: rgba(210, 215, 220, 0.92);
  box-shadow: var(--shadow-small);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  color: var(--primary-dark);
  font-size: 1.5rem;
}

.hero-stats span {
  margin-top: 3px;
  color: #485868;
  font-size: 0.8rem;
}

.hero-panel {
  overflow: hidden;
  border: 1px solid #737d86;
  border-radius: 24px;
  background: var(--surface-dark);
  box-shadow: var(--shadow-large);
  transform: rotate(0.6deg);
}

.hero-panel img {
  width: 100%;
  height: 430px;
  object-fit: contain;
  object-position: center;
  padding: 14px;
  background:
    linear-gradient(
      180deg,
      #253747,
      #111d28
    );
}

.hero-panel-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  color: var(--text-light);
}

.hero-panel-caption span {
  color: #70c6ff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

/* ---------- Feature cards ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  gap: 18px;
}

.feature-card {
  min-height: 270px;
  padding: 26px;
  border: 1px solid #929ba3;
  border-radius: var(--radius-medium);
  background:
    linear-gradient(
      180deg,
      #dce0e4,
      #c5cbd1
    );
  box-shadow: var(--shadow-small);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.feature-number {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: #bcd7ef;
  color: var(--primary-dark);
  font-weight: 900;
}

.feature-card h3 {
  margin: 50px 0 10px;
  color: #122b41;
  font-size: 1.28rem;
}

.feature-card p {
  margin: 0;
  color: #465663;
}

/* ---------- Requirements ---------- */

.split-section {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 70px;
}

.requirements-list {
  overflow: hidden;
  border: 1px solid #8e969e;
  border-radius: var(--radius-medium);
  background: #ccd1d6;
  box-shadow: var(--shadow-small);
}

.requirements-list article {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid #aeb5bc;
}

.requirements-list article:last-child {
  border-bottom: 0;
}

.requirements-list article > span {
  color: var(--primary-dark);
  font-weight: 900;
}

.requirements-list h3,
.requirements-list p {
  margin: 0;
}

.requirements-list h3 {
  color: #173047;
}

.requirements-list p {
  margin-top: 6px;
  color: #465663;
}

/* ---------- Media and screenshots ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 22px;
}

.media-grid-large {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.test-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  margin: 0;
  border: 1px solid #737f89;
  border-radius: var(--radius-medium);
  background: var(--surface-dark);
  box-shadow: var(--shadow-medium);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.media-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-large);
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-darker);
  cursor: zoom-in;
}

.image-button img {
  width: 100%;
  height: 310px;
  object-fit: contain;
  object-position: center;
  padding: 14px;
  background:
    linear-gradient(
      180deg,
      #223647,
      #101b25
    );
}

.media-grid-large .image-button img {
  height: 390px;
}

.test-card .image-button img {
  height: 295px;
}

.media-card figcaption {
  display: flex;
  min-height: 164px;
  flex: 1;
  flex-direction: column;
  padding: 19px 21px 22px;
  color: var(--text-light);
}

.media-card figcaption span,
.media-card figcaption strong,
.media-card figcaption p {
  display: block;
}

.media-card figcaption span {
  color: #70c6ff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.media-card figcaption strong {
  margin-top: 6px;
  color: white;
  font-size: 1.08rem;
}

.media-card figcaption p {
  margin: 9px 0 0;
  color: var(--text-muted-light);
  font-size: 0.91rem;
}

/* ---------- Logic callout ---------- */

.logic-callout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 30px;
  margin-top: 24px;
  padding: 28px;
  border: 1px solid #6f8ca5;
  border-radius: var(--radius-medium);
  background:
    linear-gradient(
      135deg,
      #c2d6e7,
      #b8c4cf
    );
  box-shadow: var(--shadow-small);
}

.logic-callout code {
  display: block;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 9px;
  background: #10283c;
  color: #8dd5ff;
  font-size: clamp(0.9rem, 2vw, 1.12rem);
  white-space: nowrap;
}

.logic-callout > p {
  margin: 0;
  color: #344b5e;
}

/* ---------- Screenshot filters ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-button {
  padding: 10px 16px;
  border: 1px solid #7d8790;
  border-radius: 999px;
  background: #ced3d8;
  color: #354a5c;
  cursor: pointer;
  font-weight: 850;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.test-card.hidden {
  display: none;
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid #858e96;
  border-radius: var(--radius-medium);
  background: #d0d5da;
  box-shadow: var(--shadow-small);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 20px;
  border-bottom: 1px solid #aab1b8;
  text-align: left;
}

th {
  background:
    linear-gradient(
      180deg,
      #263d52,
      #152838
    );
  color: #eef7ff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #293d4e;
}

tbody tr:nth-child(odd) {
  background: #dce0e3;
}

tbody tr:nth-child(even) {
  background: #c7cdd2;
}

tbody tr:hover {
  background: #b9d1e5;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- Roadmap ---------- */

.roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.roadmap-card {
  padding: 30px;
  border: 1px solid #8b949c;
  border-radius: var(--radius-medium);
  background:
    linear-gradient(
      180deg,
      #d8dde1,
      #c2c8ce
    );
  box-shadow: var(--shadow-small);
}

.roadmap-card.current {
  border-color: rgba(21, 139, 99, 0.65);
  background:
    linear-gradient(
      180deg,
      #cbe1d8,
      #b8cbc2
    );
}

.roadmap-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #52616e;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.roadmap-topline strong {
  color: var(--primary-dark);
}

.roadmap-card.current .roadmap-topline strong {
  color: var(--success);
}

.roadmap-card h3 {
  margin: 24px 0 14px;
  color: #163149;
  font-size: 1.5rem;
}

.roadmap-card ul {
  margin: 0;
  padding-left: 20px;
  color: #465663;
}

.roadmap-card li + li {
  margin-top: 8px;
}

/* ---------- Repository section ---------- */

.repository-section {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  padding: 54px;
  border: 1px solid #5e7e99;
  border-radius: var(--radius-large);
  background:
    linear-gradient(
      135deg,
      #263f56,
      #111f2d
    );
  box-shadow: var(--shadow-large);
}

.repository-section h2 {
  color: white;
}

.repository-section .eyebrow {
  color: #73c9ff;
}

.repository-section > div > p:last-child {
  color: #bad0e1;
}

.repository-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.repository-section .button.secondary {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.repository-section .button.secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(var(--content-width), calc(100% - 48px));
  margin: 24px auto 0;
  padding: 34px 0 46px;
  border-top: 1px solid #838b93;
  color: #3f4e5b;
  font-size: 0.88rem;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  color: #173149;
}

/* ---------- Image modal ---------- */

.image-modal {
  width: min(1180px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid #738391;
  border-radius: 18px;
  background: #0b1825;
  color: white;
  box-shadow: var(--shadow-large);
}

.image-modal::backdrop {
  background: rgba(4, 13, 23, 0.88);
  backdrop-filter: blur(6px);
}

.image-modal img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
  padding: 14px;
  background: #10253a;
}

.image-modal p {
  margin: 0;
  padding: 15px 20px 19px;
  color: #b8ccdc;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(5, 20, 34, 0.88);
  color: white;
  font-size: 1.55rem;
  cursor: pointer;
}

/* ---------- Responsive layout ---------- */

@media (max-width: 1020px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    max-width: 820px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split-section,
  .repository-section,
  .logic-callout {
    grid-template-columns: 1fr;
  }

  .test-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repository-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .site-header {
    flex-wrap: wrap;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .nav-cta {
    margin-left: 0;
    text-align: center;
  }

  .section {
    width: min(100% - 28px, var(--content-width));
    padding: 72px 0;
  }

  .section-alt {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero {
    padding-top: 54px;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

  .hero-stats,
  .feature-grid,
  .media-grid,
  .media-grid-large,
  .test-grid,
  .roadmap-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: auto;
  }

  .feature-card h3 {
    margin-top: 30px;
  }

  .image-button img,
  .test-card .image-button img,
  .media-grid-large .image-button img {
    height: 330px;
  }

  .repository-section {
    padding: 32px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 0.9rem;
  }

  .brand small {
    display: none;
  }

  .hero-actions,
  .repository-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .hero-stats {
    gap: 8px;
  }

  .hero-stats article {
    padding: 13px;
  }

  .hero-panel img {
    height: 300px;
  }

  .image-button img,
  .test-card .image-button img,
  .media-grid-large .image-button img {
    height: 250px;
  }

  th,
  td {
    padding: 15px;
  }
}
