@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap");

:root {
  --navy: #102a43;
  --dark-navy: #081c2c;
  --blue: #2c7da0;
  --light-blue: #e8f3f8;
  --cream: #fffaf2;
  --white: #ffffff;
  --text: #243b53;
  --muted-text: #627d98;
  --border: #d9e2ec;
  --shadow: 0 14px 34px rgba(16, 42, 67, 0.11);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--cream);
  color: var(--text);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.navbar {
  align-items: center;
  background-color: rgba(255, 250, 242, 0.96);
  border-bottom: 1px solid rgba(217, 226, 236, 0.8);
  display: flex;
  justify-content: space-between;
  padding: 20px 7%;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  color: var(--navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--muted-text);
  font-size: 0.94rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--blue);
}

.login-button {
  background: transparent;
  border: 1px solid var(--navy);
  border-radius: 8px;
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 18px;
  transition: all 0.2s ease;
}

.login-button:hover {
  background-color: var(--navy);
  color: var(--white);
}

.hero {
  background:
    radial-gradient(circle at 84% 22%, rgba(113, 194, 213, 0.3), transparent 25%),
    linear-gradient(135deg, #fffaf2 0%, #eaf5f8 100%);
  min-height: 560px;
  padding: 115px 7% 95px;
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  color: var(--blue);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: 15px;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--navy);
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.16;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  max-width: 730px;
}

.hero-text {
  color: var(--muted-text);
  font-size: 1.08rem;
  margin-top: 25px;
  max-width: 620px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.primary-button,
.secondary-button {
  border-radius: 8px;
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 13px 21px;
  transition: all 0.2s ease;
}

.primary-button {
  background-color: var(--navy);
  border: 1px solid var(--navy);
  color: var(--white);
}

.primary-button:hover {
  background-color: var(--blue);
  border-color: var(--blue);
  transform: translateY(-2px);
}

.secondary-button {
  background-color: transparent;
  border: 1px solid var(--navy);
  color: var(--navy);
}

.secondary-button:hover {
  background-color: var(--white);
}

.values-section {
  display: grid;
  gap: 23px;
  grid-template-columns: repeat(3, 1fr);
  margin: -42px auto 0;
  max-width: 1120px;
  padding: 0 25px;
  position: relative;
  z-index: 2;
}

.value-card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 30px;
}

.value-icon {
  font-size: 1.7rem;
  margin-bottom: 15px;
}

.value-card h2 {
  font-size: 1.55rem;
  margin-bottom: 10px;
}

.value-card p,
.story-section p {
  color: var(--muted-text);
}

.story-section {
  margin: 0 auto;
  max-width: 780px;
  padding: 125px 25px;
  text-align: center;
}

.story-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 18px;
}

.story-section p {
  margin: 0 auto 28px;
  max-width: 610px;
}

.story-section .primary-button {
  border: none;
}

footer {
  background-color: var(--dark-navy);
  color: #d9e2ec;
  font-size: 0.9rem;
  padding: 28px 7%;
  text-align: center;
}

@media (max-width: 760px) {
  .navbar {
    padding: 17px 5%;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 85px 7% 105px;
  }

  .values-section {
    grid-template-columns: 1fr;
    margin-top: -52px;
  }

  .value-card {
    padding: 25px;
  }

  .story-section {
    padding: 90px 25px;
  }
}
.modal {
  align-items: center;
  background-color: rgba(8, 28, 44, 0.62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 100;
}

.hidden {
  display: none;
}

.modal-box {
  background-color: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(8, 28, 44, 0.28);
  max-width: 440px;
  padding: 42px 36px 34px;
  position: relative;
  width: 100%;
}

.close-button {
  background: transparent;
  border: none;
  color: var(--muted-text);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  position: absolute;
  right: 18px;
  top: 14px;
}

.close-button:hover {
  color: var(--navy);
}

.modal-box h2 {
  font-size: 2.15rem;
  margin-bottom: 26px;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#authForm label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 8px;
}

#authForm input {
  background-color: #f8fbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  padding: 13px;
}

#authForm input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.16);
}

.auth-submit-button {
  border: none;
  margin-top: 12px;
  width: 100%;
}

.form-message {
  color: #c0392b;
  font-size: 0.9rem;
  min-height: 22px;
  padding-top: 5px;
}

.form-message.success {
  color: #16803c;
}

.auth-switch-text {
  color: var(--muted-text);
  font-size: 0.92rem;
  margin-top: 24px;
  text-align: center;
}

.text-button {
  background: transparent;
  border: none;
  color: var(--blue);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  padding: 0;
}

.text-button:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .modal-box {
    padding: 38px 24px 28px;
  }
}
.resend-button {
  background: transparent;
  border: none;
  color: var(--muted-text);
  cursor: pointer;
  display: block;
  font-family: inherit;
  font-size: 0.82rem;
  margin: 14px auto 0;
  padding: 4px;
}

.resend-button:hover {
  color: var(--blue);
  text-decoration: underline;
}

.story-intro,
.explore-intro {
  margin: 14px auto 34px;
  max-width: 620px;
}

.story-form {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  max-width: 760px;
  padding: 34px;
  text-align: left;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.form-field label,
.name-field label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.name-field label span {
  color: var(--muted-text);
  font-weight: 400;
}

.story-form input,
.story-form textarea {
  background-color: #f8fbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  padding: 13px;
  width: 100%;
}

.story-form textarea {
  line-height: 1.6;
  min-height: 190px;
  resize: vertical;
}

.story-form input:focus,
.story-form textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.16);
}

.character-count {
  color: var(--muted-text);
  font-size: 0.8rem;
  text-align: right;
}

.story-options {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 23px;
}

.checkbox-label {
  align-items: center;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 0.93rem;
  font-weight: 600;
  gap: 10px;
}

.checkbox-label input {
  accent-color: var(--blue);
  height: 17px;
  width: 17px;
}

.name-field {
  margin-top: 18px;
}

.story-message {
  color: #c0392b;
  font-size: 0.92rem;
  margin-top: 20px;
  min-height: 22px;
}

.story-message.success {
  color: #16803c;
}

.publish-button {
  border: none;
  margin-top: 12px;
}

.explore-section {
  background-color: var(--light-blue);
  padding: 100px 7%;
  text-align: center;
}

.explore-section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.stories-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, 1fr);
  margin: 42px auto 0;
  max-width: 1120px;
  text-align: left;
}

.story-card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 26px;
}

.story-card h3 {
  color: var(--navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.42rem;
  line-height: 1.25;
  margin-bottom: 13px;
}

.story-card-content {
  color: var(--muted-text);
  flex-grow: 1;
  font-size: 0.94rem;
  white-space: pre-line;
}

.story-card-meta {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 22px;
}

.loading-stories,
.empty-stories {
  color: var(--muted-text);
  grid-column: 1 / -1;
  text-align: center;
}

@media (max-width: 760px) {
  .story-form {
    padding: 25px 20px;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }

  .explore-section {
    padding: 82px 7%;
  }
}