/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Darker Grotesque', sans-serif;
}

/* Typography */
.nav-logo,
.landing-logo {
  font-family: 'Brittany Signature', cursive;
}

.landing-tagline {
  font-family: 'Edu SA Beginner', cursive;
}

/* Page system */
.page {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}

.page.active {
  display: block;
}

/* ========== LANDING PAGE ========== */
.landing-page {
  background: #fff;
}

.landing-bg {
  position: absolute;
  inset: 0;
}

.landing-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 85vw);
  aspect-ratio: 690 / 428;
  border-radius: 12px;
  overflow: hidden;
}

.landing-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.landing-card-overlay {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.landing-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  text-align: center;
}

.landing-logo {
  font-size: clamp(40px, 8vw, 72px);
  color: #000;
  line-height: 1;
  margin-bottom: 8px;
}

.landing-tagline {
  font-size: clamp(12px, 2.2vw, 18px);
  color: #000;
  margin-bottom: 24px;
  line-height: 1.4;
}

.landing-btn {
  font-family: 'Darker Grotesque', sans-serif;
  font-size: clamp(16px, 2.5vw, 24px);
  color: #000;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border: none;
  border-radius: 30px;
  padding: 10px 36px;
  cursor: pointer;
  box-shadow:
    inset 10.78px -10.78px 10.78px rgba(182, 182, 182, 0.44),
    inset -10.78px 10.78px 10.78px rgba(255, 255, 255, 0.44);
  transition: transform 0.2s, box-shadow 0.2s;
}

.landing-btn:hover {
  transform: scale(1.05);
  box-shadow:
    inset 10.78px -10.78px 10.78px rgba(182, 182, 182, 0.55),
    inset -10.78px 10.78px 10.78px rgba(255, 255, 255, 0.55);
}

/* ========== APP PAGES ========== */
.app-page {
  display: none;
  position: fixed;
  inset: 0;
}

.app-page.active {
  display: flex;
  flex-direction: column;
}

/* Background image */
.app-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.app-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Glassmorphic overlay */
.app-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(217, 217, 217, 0.12);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow:
    inset 10.78px -10.78px 10.78px rgba(182, 182, 182, 0.44),
    inset -10.78px 10.78px 10.78px rgba(255, 255, 255, 0.44);
}

/* Navigation */
.app-nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 16px 24px;
  gap: 16px;
}

.nav-logo {
  font-size: clamp(24px, 4vw, 40px);
  color: #000;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 4px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-link {
  font-family: 'Darker Grotesque', sans-serif;
  font-size: clamp(14px, 2.2vw, 24px);
  font-weight: 400;
  color: #000;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s, font-weight 0.2s;
  white-space: nowrap;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.25);
}

.nav-link.active {
  font-weight: 600;
}

/* App Card */
.app-card {
  position: relative;
  z-index: 10;
  flex: 1;
  margin: 0 auto 24px;
  width: calc(100% - 48px);
  max-width: 900px;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow:
    inset 6px -6px 8px rgba(182, 182, 182, 0.3),
    inset -6px 6px 8px rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.app-card-title {
  position: relative;
  z-index: 1;
  font-family: 'Darker Grotesque', sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 5vw, 56px);
  color: #050000;
  text-align: center;
  padding: 32px 24px 16px;
}

.app-card-body {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 0 24px 24px;
}

/* Centered title variant (My Day) */
.app-card--centered .app-card-title {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.app-card--centered .app-card-body {
  display: none;
}

/* ========== SUMMARY PAGE ========== */
.summary-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.summary-textarea-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

.summary-textarea {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Darker Grotesque', sans-serif;
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 2em;
  padding: 0 12px;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(2em - 1px),
    rgba(0, 0, 0, 0.08) calc(2em - 1px),
    rgba(0, 0, 0, 0.08) 2em
  );
  background-size: 100% 2em;
  color: #050000;
}

.summary-textarea::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.summary-textarea[readonly] {
  cursor: default;
}

.summary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 12px;
}

.summary-btn {
  font-family: 'Darker Grotesque', sans-serif;
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 500;
  border: none;
  border-radius: 20px;
  padding: 8px 28px;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.summary-btn:hover {
  transform: scale(1.05);
}

.summary-btn--edit {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  color: #000;
  box-shadow:
    inset 6px -6px 6px rgba(182, 182, 182, 0.3),
    inset -6px 6px 6px rgba(255, 255, 255, 0.3);
}

.summary-btn--reset {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  color: #000;
  box-shadow:
    inset 6px -6px 6px rgba(182, 182, 182, 0.3),
    inset -6px 6px 6px rgba(255, 255, 255, 0.3);
}

.summary-btn--save {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

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

/* ========== TRANSITIONS ========== */
.page {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.page.active {
  opacity: 1;
}

/* ========== RESPONSIVE ========== */

/* Mobile */
@media (max-width: 600px) {
  .app-nav {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
    gap: 8px;
  }

  .nav-links {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 2px;
  }

  .nav-link {
    padding: 4px 8px;
  }

  .app-card {
    width: calc(100% - 24px);
    margin-bottom: 12px;
  }

  .app-card-title {
    padding: 20px 16px 12px;
  }

  .landing-card {
    width: min(380px, 90vw);
  }
}

/* Tablet */
@media (min-width: 601px) and (max-width: 1024px) {
  .app-card {
    max-width: 700px;
  }
}
