/* =========================================================
   DREAMVERSE DISCOVER
   Clean Web3 design | Responsive | No external dependencies
   ========================================================= */

/* ---------- 1. Design tokens ---------- */

:root {
  color-scheme: dark;

  --dv-bg: #080b16;
  --dv-bg-soft: #0d1222;
  --dv-surface: rgba(18, 25, 46, 0.82);
  --dv-surface-hover: rgba(25, 34, 60, 0.96);

  --dv-text: #f5f7ff;
  --dv-muted: #a5aec7;
  --dv-subtle: #77829e;

  --dv-primary: #9a8cff;
  --dv-secondary: #55d8ff;
  --dv-border: rgba(174, 188, 255, 0.14);

  --dv-radius-sm: 12px;
  --dv-radius-md: 20px;
  --dv-radius-lg: 28px;

  --dv-container: 1180px;
  --dv-transition: 220ms ease;
}

/* ---------- 2. Reset ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--dv-bg);
  color: var(--dv-text);
  font-family:
    Inter,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 12% 12%,
      rgba(104, 78, 255, 0.13),
      transparent 38%
    ),
    radial-gradient(
      ellipse at 88% 34%,
      rgba(38, 160, 255, 0.09),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      #080b16 0%,
      #0a0e1c 50%,
      #080b16 100%
    );
  content: "";
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--dv-secondary);
  outline-offset: 5px;
}

::selection {
  background: rgba(154, 140, 255, 0.35);
  color: #fff;
}

/* ---------- 3. Shared layout ---------- */

.container {
  width: min(
    var(--dv-container),
    calc(100% - 48px)
  );
  margin-inline: auto;
}

.site-header,
.discover-hero,
.discover-section,
.discover-note,
.site-footer {
  position: relative;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--dv-secondary);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.17em;
  line-height: 1.5;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin-top: 0;
  color: var(--dv-text);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.65rem);
  font-weight: 750;
}

p {
  color: var(--dv-muted);
}

/* ---------- 4. Header and navigation ---------- */

.site-header {
  z-index: 10;
  border-bottom: 1px solid var(--dv-border);
  background: rgba(8, 11, 22, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.brand img,
.footer-brand img {
  width: 132px;
  height: 42px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(16px, 2.4vw, 32px);
}

.main-nav a {
  position: relative;
  padding: 10px 0;
  color: var(--dv-muted);
  font-size: 0.9rem;
  font-weight: 550;
  transition: color var(--dv-transition);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--dv-text);
}

.main-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--dv-primary),
    var(--dv-secondary)
  );
  content: "";
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 10px;
  border: 1px solid var(--dv-border);
  border-radius: 12px;
  background: var(--dv-surface);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  border-radius: 99px;
  background: var(--dv-text);
}

/* ---------- 5. Discover hero ---------- */

.discover-hero {
  isolation: isolate;
  overflow: hidden;
  padding: clamp(90px, 13vw, 156px) 0
    clamp(76px, 10vw, 120px);
  text-align: center;
}

.discover-hero::before {
  position: absolute;
  z-index: -1;
  top: 0;
  left: 50%;
  width: min(850px, 100%);
  height: 100%;
  transform: translateX(-50%);
  background:
    radial-gradient(
      ellipse at 50% 18%,
      rgba(116, 91, 255, 0.18),
      transparent 54%
    ),
    radial-gradient(
      ellipse at 72% 54%,
      rgba(54, 185, 255, 0.08),
      transparent 42%
    );
  content: "";
  pointer-events: none;
}

.discover-hero .container {
  max-width: 900px;
}

.discover-hero .eyebrow {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(154, 140, 255, 0.22);
  border-radius: 99px;
  background: rgba(154, 140, 255, 0.07);
}

.discover-hero h1 {
  max-width: 850px;
  margin: 18px auto 24px;
  background: linear-gradient(
    110deg,
    #ffffff 12%,
    #c9c0ff 52%,
    #80e4ff 92%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  max-width: 650px;
  margin: 0 auto;
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.9;
}

/* ---------- 6. Featured projects section ---------- */

.discover-section {
  padding: 24px 0 clamp(80px, 10vw, 128px);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.section-heading h2 {
  margin-bottom: 12px;
}

.section-heading p:not(.eyebrow) {
  max-width: 600px;
  margin: 0;
  line-height: 1.8;
}

/* Project cards are rendered inside this grid. */

.discover-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}

/*
  These styles are ready for the project-card elements
  that will be created in discover.js.
*/

.project-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--dv-border);
  border-radius: var(--dv-radius-md);
  background: var(--dv-surface);
  transition:
    transform var(--dv-transition),
    border-color var(--dv-transition),
    background var(--dv-transition),
    box-shadow var(--dv-transition);
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(154, 140, 255, 0.48);
  background: var(--dv-surface-hover);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.project-card-link {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  color: inherit;
}

.project-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(
      circle at 50% 35%,
      rgba(112, 93, 255, 0.2),
      transparent 60%
    ),
    #11172a;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.045);
}

/* Optional image overlay for readable labels. */

.project-card-image::after {
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(5, 8, 19, 0.76)
  );
  content: "";
  pointer-events: none;
}

.project-card-overlay {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 18px;
  left: 18px;
  color: #fff;
}

.project-card-overlay h3 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.project-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px;
}

.project-card-content h3 {
  margin: 0 0 10px;
  color: var(--dv-text);
  font-size: 1.15rem;
  line-height: 1.4;
}

.project-card-content p {
  margin: 0 0 22px;
  font-size: 0.94rem;
  line-height: 1.75;
}

.project-card-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--dv-secondary);
  font-size: 0.9rem;
  font-weight: 700;
}

.project-card-action::after {
  content: "→";
  transition: transform var(--dv-transition);
}

.project-card:hover .project-card-action::after {
  transform: translateX(4px);
}

/* ---------- 7. Future-ready project details ---------- */

/*
  These classes can be reused by project.html when that
  page is created. They do not add login or points features.
*/

.project-details {
  width: min(900px, calc(100% - 48px));
  margin-inline: auto;
  padding: 72px 0 100px;
}

.project-details-panel {
  overflow: hidden;
  border: 1px solid var(--dv-border);
  border-radius: var(--dv-radius-lg);
  background: var(--dv-surface);
}

.project-details-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--dv-bg-soft);
}

.project-details-content {
  padding: clamp(24px, 5vw, 44px);
}

.project-details-content h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Optional reusable button styles for project.html. */

.project-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(
    110deg,
    #8874ff,
    #58cfff
  );
  color: #080b16;
  font-weight: 750;
  text-align: center;
  transition:
    transform var(--dv-transition),
    filter var(--dv-transition);
}

.project-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.project-button.secondary {
  border-color: var(--dv-border);
  background: transparent;
  color: var(--dv-text);
}

/* ---------- 8. Closing section ---------- */

.discover-note {
  overflow: hidden;
  padding: clamp(56px, 8vw, 90px) 0;
  border-top: 1px solid var(--dv-border);
  border-bottom: 1px solid var(--dv-border);
  background:
    radial-gradient(
      ellipse at 10% 100%,
      rgba(112, 85, 255, 0.1),
      transparent 48%
    ),
    radial-gradient(
      ellipse at 90% 0%,
      rgba(48, 190, 255, 0.08),
      transparent 45%
    ),
    rgba(12, 17, 32, 0.56);
  text-align: center;
}

.discover-note .container {
  max-width: 760px;
}

.discover-note h2 {
  margin-bottom: 16px;
}

.discover-note p {
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.9;
}

/* ---------- 9. Footer ---------- */

.site-footer {
  padding: 36px 0 24px;
  background: rgba(6, 9, 18, 0.7);
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--dv-border);
}

.footer-bottom p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.7;
}

/* ---------- 10. Tablet ---------- */

@media (max-width: 900px) {
  .header-inner {
    gap: 20px;
  }

  .main-nav {
    gap: 17px;
  }

  .main-nav a {
    font-size: 0.84rem;
  }

  .discover-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

/* ---------- 11. Mobile navigation ---------- */

@media (max-width: 700px) {
  .container {
    width: calc(100% - 36px);
  }

  .header-inner {
    min-height: 72px;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 18px 18px;
    border-bottom: 1px solid var(--dv-border);
    background: rgba(8, 11, 22, 0.98);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.22);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 13px 4px;
    font-size: 0.95rem;
  }

  .main-nav a[aria-current="page"]::after {
    right: auto;
    bottom: 5px;
    width: 34px;
  }

  .discover-hero {
    padding: 82px 0 72px;
  }

  .discover-section {
    padding-top: 16px;
  }

  .section-heading {
    margin-bottom: 26px;
  }

  .discover-grid {
    gap: 16px;
  }

  .project-card-content {
    padding: 17px;
  }

  .project-card-content p {
    font-size: 0.88rem;
  }

  .project-details {
    width: calc(100% - 36px);
    padding: 44px 0 72px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

/* ---------- 12. Small mobile ---------- */

@media (max-width: 420px) {
  .container {
    width: calc(100% - 28px);
  }

  .brand img,
  .footer-brand img {
    width: 116px;
    height: auto;
  }

  .discover-hero {
    padding: 68px 0 60px;
  }

  .discover-hero h1 {
    font-size: clamp(2.25rem, 11vw, 3rem);
  }

  .discover-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .project-card-image {
    aspect-ratio: 1 / 1;
  }

  .project-card-content {
    padding: 20px;
  }

  .project-card-content h3 {
    font-size: 1.15rem;
  }

  .project-actions {
    flex-direction: column;
  }

  .project-button {
    width: 100%;
  }

  .footer-bottom p {
    font-size: 0.78rem;
  }
}

/* ---------- 13. Reduced motion accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  }
.project-card[hidden] {
  display: none !important;
}
