*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: hsl(240 10% 4%);
    color: hsl(210 20% 95%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

header {
    background: hsla(220 20% 6% 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid hsl(220, 15%, 20%);
    
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column; /* For very small screen sizes */
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 350px) {
    header {
        flex-direction: row;
    }
}

.site-logo {
  text-decoration: none;
}

.site-logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: hsl(190 100% 50%);
}

.site-logo-icon:hover {
    color: hsl(210 20% 95%);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.site-nav-link {
  padding: 0.7rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: hsl(210 20% 95%);
  font-size: 0.875rem;

  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.site-nav-link:hover {
  background: hsl(220, 15%, 18%);
}

@media (min-width: 900px) {
  .site-nav-link {
    font-size: 18px;
  }
}

/* FOOTER STYLING */
footer {
  background: hsl(220, 18%, 10%);
  border-top: 1px solid hsl(220, 15%, 20%);
  padding: 3rem 1.5rem 2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.site-footer-inner {
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

@media (min-width: 640px) {
  .site-footer-inner {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: hsl(210, 20%, 95%);
  text-decoration: none;
}

.footer-brand-logo svg {
  width: 2rem;
  height: 2rem;
  color: hsl(190, 100%, 50%);
}

.footer-brand-logo span {
  font-size: 1rem;
  font-weight: 700;
}

.footer-brand p {
  color: hsl(215, 15%, 55%);
  font-size: 0.875rem;
  line-height: 1.6;
}

.footer-column h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(210, 20%, 95%);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: hsl(215, 15%, 55%);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: hsl(190, 100%, 50%);
}

.footer-bottom {
  max-width: 72rem;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(220, 15%, 20%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-bottom p {
  color: hsl(215, 15%, 55%);
  font-size: 0.75rem;
}

/* H1 & PARAGRAPH STYLING */
h1 {
    text-align: center;
    color: #e0e0e0;
    margin: 1.5rem auto 0.5rem auto;

    /* font-size: 2rem;
    line-height: 1.3; */

    font-size: 40px;
    line-height: 40px;
}

h1+p {
    text-align: center;
    color: hsl(215, 15%, 55%);
    margin: 0 auto 0.5rem auto;
    padding: 0 0.5rem;

    font-size: 1rem;
    font-size: 16px;
}

/* APP STYLING */
.app {
    width: 96%;
    max-width: 950px;
    margin: 2rem auto 1rem auto;
    min-height: 300px;
    padding: 1.5rem;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    border-radius: 1rem;
    border: 2px dashed hsla(215, 15%, 55%, 0.3);
    background: hsl(240, 10%, 6%);
}

@media (min-width: 600px) {
  .app, h1, h1+p {
    width: 70%;
    margin-left: 1rem;
  } 
}

@media (min-width: 900px) {
    .app, h1, h1+p {
        width: 65%; 
        margin-left: auto;
    }

    h1+p{
        font-size: 18px;
    }
  
    h1{
        font-size: 2.5rem;
        line-height: 1.3;

        font-size: 56px;
        line-height: 56px;
    }
}

.time-display {
    font-family: 'sans-serif', monospace;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #e0e0e0;
    margin-bottom: 2rem;
}

.time-ms{
    color: hsl(240 5% 55%);
    font-size: 1.875rem;
}

@media (min-width: 450px) {
    .time-display {
        font-size: 4.5rem;
    }
}

@media (min-width: 900px) {
    .time-display {
        font-size: 6rem;
    }

    .time-ms {
        font-size: 3rem;
    }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .controls {
    gap: 1rem;
  }
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;

  padding: 1rem 1.5rem;
  min-width: 80px;
}

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

@media (min-width: 640px) {
  .btn {
    font-size: 1.125rem;
    padding: 1.25rem 1.5rem;
    min-width: 100px;
  }
}

.btn-start {
    background-color: hsl(190 100% 50%);
    color: hsl(240 10% 4%);

    box-shadow: 0 0 20px hsl(190 100% 50% / 0.3),
    inset 0 1px 0 hsl(0 0% 100% / 0.1);
}

.btn-stop {
    background-color: hsl(0 72% 51%);
    color: hsl(0 0% 98%);
}

.btn-lap {
    background-color: hsl(240 10% 15%);
    color: hsl(0 0% 98%);
    border: 1px solid hsl(240 10% 18%);
}

.btn-lap:hover:not(:disabled) {
    background-color: hsl(240 10% 15% / 0.8);
}

.btn-reset {
    background-color: hsl(240 10% 12%);
    color: hsl(0 0% 98%);
    border: 1px solid hsl(240 10% 18%);
}

.btn-reset:hover:not(:disabled) {
    background-color: hsl(240 10% 12% / 0.8);
}

/* LAPS SECTION STYLING */
.laps-section{
    border: 1px solid hsl(240 10% 18% / 0.5);
    display: block;
    min-height: auto;
  
    margin-top: 1.5rem;
    background-color: hsl(240, 10%, 6%);
    border-radius: 1rem;
    padding: 1rem;
}

.laps-section h2 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;

    font-weight: 600;
    color: hsl(0 0% 98%);
    margin-bottom: 1rem;
}

#laps {
    list-style: none;
}

#laps li {
    width: 96%;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    /* display: list-item; */
    /* text-align: match-parent; */

    padding: 0.75rem;
    border-radius: 0.5rem;

    background: hsl(240 10% 13% / 0.5);

    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

#laps li:hover {
    background: hsl(240 10% 20% / 0.5);
}

.no-laps {
    text-align: center;
    opacity: 0.6;
    font-size: 1rem;
    margin-top: 1rem;
    color: hsl(240, 5%, 55%);
}

.no-laps.hidden {
    display: none;
}

/* ARTICLE STYLING */
.stopwatch-article {
    margin: auto;
    width: 96%;
    margin-block-start: 1em;
    width: 95%;
}

.stopwatch-article section:nth-child(odd) {
    padding: 1em;
    border-radius: 1em;
    overflow-x: auto;
}

.stopwatch-article section:nth-child(even) {
    background-color: #121212;
    padding: 1em;
    border-radius: 1em;
    overflow-x: auto;
}

.stopwatch-article p {
    font-size: 1rem;
    line-height: 1.6;
    margin-block-end: 1rem;
}

h2 {
    text-align: center;
    color: #e0e0e0;
    margin-block-end: 1rem;

    font-size: 1.5rem;
    line-height: 1.4;

    font-size: 32px;
    line-height: 40px;
}

section ol, section ul {
    width: 90%;
    margin: auto;
    margin-block: 1rem;
}

section li {
    font-size: 1rem;
    line-height: 1.6;
    margin-block: 0.5rem;
}

@media (min-width: 600px) {
    .stopwatch-article {
        width: 70%;
        margin: 0.5em;
        margin-block-start: 2rem;
    }
}

@media (min-width: 900px) {
    .stopwatch-article {
        width: 64%;
        margin: auto;
        margin-block-start: 2rem;
    }

    h2{
        margin-block-end: 1.5rem;

        font-size: 2rem;
        line-height: 1.3;

        font-size: 40px;
        line-height: 48px;
    }

    .stopwatch-article p, section li  {
        font-size: 1.125rem;
        line-height: 1.7;
    }
}

.content-section h3 {
    font-weight: 500;
    color: hsl(210, 20%, 95%);
    margin-top: 1rem;
    margin-bottom: 0.5rem;

    font-size: 1.3rem;
    line-height: 1.4;

    font-size: 24px;
    line-height: 32px;
}

@media (min-width: 900px) {
  .content-section h3{
    font-size: 1.3rem;
    line-height: 1.4;

    font-size: 32px;
    line-height: 40px;
  }
}