:root {
    --primary-color: #007BFF;
    --background-color: #ffffff;
    --foreground-color: #f4f4f6;
    --text-color: #21222c;
    --container-width: 1024px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif
}

/* Header */
.site-header {
    background-color: var(--background-color);
    border-bottom: 1px solid #e5e7eb;
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    min-width: 0;
    flex: 0 1 auto;
}

.brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-links-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: end;
    margin-right: 2rem
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0
}

.nav-item {
    position: relative
}

.nav-button {
    background: #fff0;
    border: none;
    font-size: 1rem;
    font-family: inherit
}

.nav-button::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease
}

.nav-item:hover .nav-button::after {
    transform: rotate(-135deg)
}

.nav-link,
.nav-button {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0;
    cursor: pointer
}

.nav-link:hover {
    color: var(--primary-color)
}

.submenu {
    position: absolute;
    top: 100%;
    left: 50%;
    background: var(--background-color);
    box-shadow: 0 5px 42px 0 #00000014;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
    list-style: none;
    min-width: 220px;
    margin-top: 1rem;
    padding: 10px;
    z-index: 1
}

.submenu::before {
    content: '';
    position: absolute;
    top: -1rem;
    width: 100%;
    height: 1rem
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0)
}

.submenu-link {
    color: var(--text-color);
    padding: .4rem .6rem;
    display: block;
    font-weight: 500;
    text-decoration: none
}

.submenu-link:hover {
    color: var(--primary-color)
}

.nav-button-group {
    order: 3
}

.cta-button {
    padding: .5rem 1.25rem;
    font-weight: 500;
    font-size: .9rem;
    border-radius: .5rem;
    text-decoration: none;
    background-color: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 1px 2px 0 rgb(37 99 235 / .3)
}

.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0;
}

.menu-toggle .icon-bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    position: relative
}

.menu-toggle .icon-bar::before,
.menu-toggle .icon-bar::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
}

.menu-toggle .icon-bar::before {
    top: -6px
}

.menu-toggle .icon-bar::after {
    top: 6px
}

@media (max-width:768px) {
    .nav-container {
        justify-content: space-between;
        gap: .5rem;
    }

    .nav-button-group {
        display: flex;
        align-items: center;
        gap: .5rem
    }

    .menu-toggle {
        display: flex;
        justify-content: flex-end;
    }

    .nav-links-wrapper {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 300px;
        margin: 0;
        background: var(--background-color);
        transform: translateX(300px);
        transition: transform 0.3s ease
    }

    .nav-links-wrapper.is-open {
        transform: translateX(0)
    }

    .site-header::before {
        content: "";
        position: fixed;
        inset: 0;
        background-color: #fff0;
        backdrop-filter: blur(0);
        pointer-events: none;
        transition: background-color 0.3s ease, backdrop-filter 0.3s ease
    }

    .site-header:has(.nav-links-wrapper.is-open)::before {
        background-color: rgba(0, 0, 0, .2);
        backdrop-filter: blur(5px);
    }

    body:has(.nav-links-wrapper.is-open) {
        overflow: hidden
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        padding: 0;
        gap: .75rem
    }

    .nav-item {
        padding: .5rem .5rem .5rem 2rem;
    }

    .nav-list::before {
        content: "NAVIGATION";
        letter-spacing: 5px;
        font-weight: 700;
        background: var(--foreground-color);
        text-align: center;
        padding: 2rem 0;
        color: #6b7280;
    }

    .submenu {
        margin-top: 0;
    }

    .site-header::before,
    .nav-links-wrapper {
        z-index: 999;
    }
}

/* PWA & iOS Toast */
.ios-pwa-toast {
    position: fixed;
    bottom: -110%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 25px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transition: bottom 0.5s cubic-bezier(0.32, 1, 0.23, 1);
    text-align: center;
}

.ios-pwa-toast.active {
    bottom: 0;
}

.toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 9999;
    transition: 0.3s;
}

.toast-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ios-icon {
    height: 24px;
    vertical-align: middle;
    margin: 0 4px;
}

body.toast-open {
    overflow: hidden;
}

#pwa-install-btn {
    cursor: pointer;
    border: none;
}



/* Footer Container */
.site-footer {
    background-color: var(--background-color);
    border-top: 1px solid #e5e7eb;
}

.footer-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.footer-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.copyright {
    color: var(--text-color);
    font-size: 0.875rem;
}

.copyright-brand {
    font-weight: 500;
    text-decoration: none;
}

.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
    display: inline-block;
    padding: 0.5rem 0;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

@media (max-width:768px) {
    .footer-content {
        flex-direction: column-reverse;
    }

    .footer-nav {
        justify-content: center;
    }

    .copyright {
        margin-bottom: .5rem;
    }
}

/*Train Speed Test Style*/
@font-face {
  font-family: 'Speedometer';
  src: url('speedometer.woff2') format('woff2');
}

.speedometer {
  line-height: 1;
  font-size: .875rem;

}


[class*=__container] {
  max-width: 75rem;
  margin: 0 auto;
}

.speedometer__col_2 {
  padding: 20px
}

@-webkit-keyframes growDown {
  0% {
    -webkit-transform: scaleY(0);
    transform: scaleY(0)
  }

  80% {
    -webkit-transform: scaleY(1.1);
    transform: scaleY(1.1)
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1)
  }
}

@keyframes growDown {
  0% {
    -webkit-transform: scaleY(0);
    transform: scaleY(0)
  }

  80% {
    -webkit-transform: scaleY(1.1);
    transform: scaleY(1.1)
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1)
  }
}

/* Start Button */
.speedometer-controls__start {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: fit-content;
  margin: 0 auto 20px;
  border: 5px solid #ffffffb5;
  border-radius: 15px;
  background: #001F3F;
  color: #fff;
  font-size: 1.375rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 15px 80px;
  transition: .3s;
  cursor: pointer
}


._active.speedometer-controls__start,
._tab-active.speedometer-controls__start,
.speedometer-controls__start:hover {
  background: #007BFF;
}


.dial,
.speedometer-tabs__title {
  border-radius: 50%;
  overflow: hidden
}

.speedometer {
  padding: 50px 20px;
  -webkit-tap-highlight-color: transparent;
}

/* Digital Speedometer */
.speedometer-digital {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 300px;
}

.speedometer-digital__title {
  font-family: Speedometer;
  color: #001F3F;
  font-size: 200px;
  font-style: normal;
  line-height: 90%;
  text-shadow: 5px 5px#38404b21
}

.speedometer-digital__subtitle {
  color: #565656;
  font-size: 1.875rem;
  font-style: normal;
  font-weight: 300;
  line-height: normal
}

/* Analog Speedometer */
.speedometer-analog {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-content: center;
  justify-content: center;
  position: relative
}

.speedometer-analog__title {
  font-family: Speedometer;
  color: #001F3F;
  font-style: normal;
  line-height: 100%;
  position: absolute;
  top: 65%;
  font-size: 70px;
  text-shadow: 2px 2px#38404b21
}

.speedometer-analog__subtitle {
  color: #565656;
  font-size: .875rem;
  font-style: normal;
  font-weight: 300;
  line-height: normal;
  position: absolute;
  top: calc(75% + 32px)
}

.speedometer-controls__btn,
.speedometer-tabs__title {
  -webkit-transition: .3s;
  -o-transition: .3s;
  color: #a5a6a9;
  line-height: normal;
  font-style: normal
}

.speedometer-controls__row {
  background: #e5e5e5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 4px;
  border-radius: 12px;
  position: relative;
}

.speedometer-controls__indicator {
  position: absolute;
  background: #fff;
  border-radius: 8px;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.speedometer-controls__btn {
  flex-grow: 1;
  font-size: 18px;
  padding: 5px;
  transition: color .3s;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.speedometer-controls__btn._active,
.speedometer-controls__btn:hover {
  color: #4a5578;
  font-weight: 600;
}


.speedometer-tabs__navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 30px
}

.speedometer-tabs__title {
  height: 100px;
  width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e5e5e5;
  transition: .3s;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
}

.dial-mark,
.dial__circle,
.header {
  background-color: #001F3F;
}

.speedometer-tabs__title._tab-active,
.speedometer-tabs__title:hover {
  background: #007BFF;
  color: #fff;
  border: 5px solid #ffffffb5;
}

.speedometer__row {
  display: grid;
  grid-template-columns: 140px 1fr 140px;
  grid-template-rows: auto;
  gap: 0 0;
  grid-template-areas: ". . .";
  justify-content: space-between;
  align-items: center;
  align-content: center;
  margin-bottom: 40px
}

.dial {
  min-width: 300px;
  width: 300px;
  height: 300px;
  max-width: 300px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 3px solid #001F3F;
}

.dial-mark_big,
.dial-mark_small,
.dial-value,
.dial__arrow,
.dial__circle {
  position: absolute
}

.dial__circle {
  top: 50%;
  left: 50%;
  display: block;
  width: 30px;
  height: 30px;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 50%;
  color: #eee;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .16), 0 3px 6px rgba(0, 0, 0, .23);
  z-index: 3
}

.dial__arrow {
  top: 50%;
  left: 50%;
  display: block;
  min-width: 5px;
  max-width: 5px;
  min-height: 140px;
  max-height: 140px;
  transform: translate3d(-50%, 0, 0);
  transform-origin: 50% 0;
  z-index: 2;
  transition: .3s;
  overflow: hidden;
  background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNSIgaGVpZ2h0PSIxMjYiIHZpZXdCb3g9IjAgMCA1IDEyNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTUuMDAwMDMgMC4yMzMyNTZMMi4yMzg3OCAxMjUuMTkyTDAuNTIyNTE0IDAuMDc2ODk1OUw1LjAwMDAzIDAuMjMzMjU2WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==);
  background-repeat: no-repeat;
  background-size: contain
}


.dial-mark_small {
  width: 3px;
  height: 7.5px;
  display: block
}

.dial-mark_small_1 {
  left: 51px;
  top: 250px;
  transform: translate3d(-50%, 0, 0) rotate(45deg)
}

.dial-mark_small_2 {
  left: 13px;
  top: 195px;
  transform: translate3d(-50%, 0, 0) rotate(67deg)
}

.dial-mark_small_3 {
  left: 5px;
  top: 124px;
  transform: translate3d(-50%, 0, 0) rotate(99deg)
}

.dial-mark_small_4 {
  left: 29px;
  top: 62px;
  transform: translate3d(-50%, 0, 0) rotate(128deg)
}

.dial-mark_small_5 {
  left: 81px;
  top: 16px;
  transform: translate3d(-50%, 0, 0) rotate(153deg)
}

.dial-mark_small_6 {
  left: 150px;
  top: 0;
  transform: translate3d(-50%, 0, 0) rotate(180deg)
}

.dial-mark_small_7 {
  left: 218px;
  top: 18px;
  transform: translate3d(-50%, 0, 0) rotate(207deg)
}

.dial-mark_small_8 {
  left: 267px;
  top: 63px;
  transform: translate3d(-50%, 0, 0) rotate(235deg)
}

.dial-mark_small_9 {
  left: 290px;
  top: 126px;
  transform: translate3d(-50%, 0, 0) rotate(263deg)
}

.dial-mark_small_10 {
  left: 282px;
  top: 192px;
  transform: translate3d(-50%, 0, 0) rotate(293deg)
}

.dial-mark_small_11 {
  left: 247px;
  top: 247px;
  transform: translate3d(-50%, 0, 0) rotate(322deg)
}

.dial-mark_big {
  width: 5px;
  height: 15px;
  display: block
}

.dial-mark_big_1 {
  left: 79px;
  top: 265px;
  transform: translate3d(-50%, 0, 0) rotate(213deg)
}

.dial-mark_big_2 {
  left: 31px;
  top: 219px;
  transform: translate3d(-50%, 0, 0) rotate(237deg)
}

.dial-mark_big_3 {
  left: 8px;
  top: 155px;
  transform: translate3d(-50%, 0, 0) rotate(265deg)
}

.dial-mark_big_4 {
  left: 17px;
  top: 88px;
  transform: translate3d(-50%, 0, 0) rotate(113deg)
}

.dial-mark_big_5 {
  left: 55px;
  top: 33px;
  transform: translate3d(-50%, 0, 0) rotate(140deg)
}

.dial-mark_big_6 {
  left: 116px;
  top: 3px;
  transform: translate3d(-50%, 0, 0) rotate(165deg)
}

.dial-mark_big_7 {
  left: 184px;
  top: 4px;
  transform: translate3d(-50%, 0, 0) rotate(12deg)
}

.dial-mark_big_8 {
  left: 243px;
  top: 35px;
  transform: translate3d(-50%, 0, 0) rotate(401deg)
}

.dial-mark_big_9 {
  left: 282px;
  top: 89px;
  transform: translate3d(-50%, 0, 0) rotate(247deg)
}

.dial-mark_big_10 {
  left: 292px;
  top: 156px;
  transform: translate3d(-50%, 0, 0) rotate(275deg)
}

.dial-mark_big_11 {
  left: 269px;
  top: 219px;
  transform: translate3d(-50%, 0, 0) rotate(301deg)
}

.dial-mark_big_12 {
  left: 219px;
  top: 266px;
  transform: translate3d(-50%, 0, 0) rotate(335deg)
}

.dial-value {
  color: #001F3F;
  font-size: 14px
}

.dial-value_1 {
  left: 84px;
  top: 251px
}

.dial-value_2 {
  left: 41px;
  top: 209px
}

.dial-value_3 {
  left: 20px;
  top: 152px
}

.dial-value_4 {
  left: 29px;
  top: 95px
}

.dial-value_5 {
  left: 60px;
  top: 51px
}

.dial-value_6 {
  left: 109px;
  top: 22px
}

.dial-value_7 {
  left: 170px;
  top: 22px
}

.dial-value_8 {
  left: 223px;
  top: 52px
}

.dial-value_9 {
  left: 249px;
  top: 97px
}

.dial-value_10 {
  left: 259px;
  top: 155px
}

.dial-value_11 {
  left: 237px;
  top: 211px
}

.dial-value_12 {
  left: 195px;
  top: 251px
}


@media (max-width:47.99875em) {
    .speedometer {padding: 20px;}
  .speedometer-controls__start {
    font-size: 1rem;
    padding: 15px 40px
  }

  .speedometer-digital__subtitle {
    font-size: 1.25rem
  }

  .speedometer-controls__row {
    flex-direction: row;
    gap: 4px;
  }

  .speedometer-tabs__navigation {
    flex-direction: row
  }

  .speedometer-tabs__title {
    width: 100%;
    height: auto;
    border-radius: 40px;
    padding: 10px 15px
  }

  .speedometer__row {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas: "col_2" "col_1" "col_3";
    gap: 30px;
    margin-bottom: 20px
  }

  .speedometer__col_1 {
    grid-area: col_1;
  }

  .speedometer__col_2 {
    grid-area: col_2;
  }

  .speedometer__col_3 {
    grid-area: col_3;
  }
}

/* Progress Bar Styles */
.progress-bar {
  max-width: 600px;
  margin: 40px auto;
  text-align: center;
}

.progress-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 30px;
}

.progress-container::before {
  content: "";
  background-color: #e0e0e0;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  width: 100%;
}

.progress {
  background-color: #3498db;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

.circle {
  background-color: #fff;
  color: #999;
  border-radius: 50%;
  border: 4px solid #e0e0e0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease;
  z-index: 1;
}

.circle.active {
  border-color: #3498db;
  background: #3498db;
  color: #fff;
}
