:root {
  --nav-offset: 140px;
  --quote-height: 58px;
  --hero-gap: 140px;
}

* {
  margin: 0;
  padding: 0;
  font-weight: lighter;
  box-sizing: border-box;
}

html {
  scroll-padding-top: var(--nav-offset);
  scroll-behavior: smooth;
}

#mission,
#about,
#contact,
#dashboard {
  scroll-margin-top: calc(var(--nav-offset) - 60px);
}

body {
  color: black;
  display: flex;
  flex-wrap: wrap;
  padding: var(--nav-offset) 0 80px 0;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}

.scroll-spacer {
  height: calc(var(--nav-offset) + var(--quote-height) + 125px);
}

ul {
  text-align: right;
  list-style-type: none;
}

li {
  cursor: pointer;
  margin-left: 15px;
}

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

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;

  display: flex;
  justify-content: space-between;
  padding: 30px 40px;
  font-size: 50px;

  background: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);

  z-index: 10001;
  align-items: center;
}

nav ul {
  display: flex;
}

nav ul a {
  padding-bottom: 10px;
}

nav ul li a {
  color: #000000;
}

header#quote {
  width: 100%;
  height: 58px;
  padding: 20px 0;
  margin: 125px 150px 60px 100px;

  overflow: hidden;
  text-align: center;
  white-space: nowrap;

  border-top: 1px solid black;
  border-bottom: 1px solid black;
}

h1 {
  width: 100%;
  text-align: center;
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.5px;
  padding: 55px 100px 45px 100px;
}

#image-section {
  width: 100%;
  display: flex;
  padding: 0;

  height: calc(
    100vh - var(--nav-offset) - var(--quote-height) - var(--hero-gap)
  );
  min-height: 270px;
  max-height: 450px;
}

#image-section img {
  width: calc(100% / 3);
  height: 100%;
  object-fit: cover;
  display: block;
}

section {
  display: flex;
  padding: 100px;
}

section:nth-of-type(1) {
  padding: 0;
  width: 100%;
}

section:nth-of-type(2) {
  width: 100%;
  flex-direction: column;
  background-color: #f5f6f8;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

section:nth-of-type(3) {
  width: 50%;
  flex-direction: column;
  background-color: #eef0f3;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

section:nth-of-type(4) {
  width: 50%;
  min-height: 450px;
  flex-direction: column;
  background-color: #f2f3f1;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

section:nth-of-type(5) {
  width: 100%;
  flex-direction: column;
}

section:nth-of-type(5) h2 {
  color: black;
}

h2 {
  color: #111827;
  font-size: 40px;
  margin-bottom: 30px;
}

input {
  width: 100%;
  border: none;
  outline: none;
  padding: 10px;
  margin-top: 25px;
  border-radius: 0;
  font-family: sans-serif;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

input::placeholder {
  color: rgba(0, 0, 0, 0.3);
  font-size: medium;
}

button {
  outline: none;
  cursor: pointer;
  margin-top: 20px;
  padding: 8px 20px;
  border-radius: 20px;
  color: rgba(50, 50, 50);
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.4);
  font-size: medium;
}

section:nth-of-type(4) button {
  align-self: flex-end;
}

footer {
  width: 100%;
  display: flex;
  padding: 30px 0;
  line-height: 25px;
  border-top: 1px solid grey;
  margin: 120px 100px 0 100px;
  justify-content: space-between;
  font-size: large;
}

footer ul {
  display: flex;
  align-self: flex-end;
  flex-direction: column;
  text-decoration: underline;
}

.row-reverse {
  flex-direction: row-reverse;
}

p {
  font-size: larger;
}

#dashboard {
  color: #111827;
  font-size: 40px;
  margin-bottom: 50px;
}

.card {
  border: 1px solid #dadada;
  flex: 1;
  border-radius: 4px;
  padding: 18px 18px 14px;
  font-size: 0.9rem;
  line-height: 1.3;
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.1);
  background-color: #fff;
}
.card button {
  background-color: #4b2e2e;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 0px;
  cursor: pointer;
}
.card-container {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  justify-content: center;
  flex-wrap: wrap; /* wrap on small screens */
}

.card {
  box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.1);
  width: 25%;
  padding: 20px;
  text-align: left;
}

.card h2 {
  color: #4b2e2e; /* Deep Brown */
  margin-bottom: 10px;
}

.card span {
  color: lightslategray;
}

.card p {
  margin-bottom: 15px;
  font-size: larger;
  line-height: 30px;
  padding: 20px;
  padding-left: 0px;
}

.card button {
  background-color: #4b2e2e; /* Deep brown */
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.card button:hover {
  background-color: #372525;
}

.card:hover {
  border-color: #372525;
}

.paletime {
  color: #e0e0e0;
  font-size: medium;
}

body.no-scroll {
  overflow: hidden;
}

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  overflow: auto;
}

/* Modal Box */
.modal-content {
  background: white;
  width: 50%;
  max-width: 600px;
  padding: 30px;
  border-radius: 6px;
  position: relative;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Title inside modal */
.modal-content h2 {
  color: #4b2e2e;
  margin-bottom: 5px;
  text-align: center;
}

/* Subheader inside modal */
#modal-span {
  display: block;
  margin-bottom: 18px;
  color: lightslategray;
  font-size: 0.9rem;
  text-align: center;
}

/* Close Button */
.close-btn {
  position: fixed;
  top: 125px;
  right: 50%;
  transform: translateX(50%); /* center horizontally above modal */
  padding: 8px 24px;
  border-radius: 50px;
  border: 1px solid black;
  background-color: white;
  color: black;
  cursor: pointer;
  font-weight: bold;
  z-index: 10000; /* above modal but below navbar */
}

.close-btn:hover {
  background-color: #f0f0f0;
}

body.modal-open nav ul {
  display: none;
}

/* Fixes for mobile UI */

/* Tablet */
@media (max-width: 900px) {
  :root {
    --nav-offset: 110px;
    --hero-gap: 80px;
  }

  nav {
    font-size: 28px;
    padding: 18px 16px;
  }

  header#quote {
    margin: 20px 16px 0 16px;
  }

  h1 {
    font-size: 36px;
    padding: 28px 16px 24px 16px;
  }

  section {
    padding: 60px 16px;
  }

  footer {
    margin: 60px 16px 0 16px;
  }

  .card {
    width: 100%;
  }
}

/* Phone */
@media (max-width: 600px) {
  :root {
    --nav-offset: 100px;
    --hero-gap: 32px;
    --quote-height: auto;
  }

  body {
    padding-top: var(--nav-offset);
  }

  nav {
    font-size: 24px;
    padding: 14px 14px;
  }

  nav ul {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  nav ul li {
    margin-left: 0;
  }

  nav ul a {
    font-size: 16px;
    padding-bottom: 0;
  }

  /* Quote fixes */
  header#quote {
    white-space: normal;
    height: auto;
    line-height: 1.2;
    padding: 12px 0;
    margin: 12px 16px 0 16px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  h2 {
    font-size: 28px;
    margin-bottom: 18px;
  }

  section:nth-of-type(3),
  section:nth-of-type(4) {
    width: 100%;
    min-height: auto;
  }

  #image-section {
    max-height: 320px;
  }

  .card-container {
    gap: 16px;
  }

  footer {
    flex-direction: column;
    gap: 20px;
  }

  footer ul {
    align-self: flex-start;
  }
}
