/* projects.css
   Page-specific styles for /pages/projects.html
   Relies on vars + fonts from styles.css (:root, Quicksand, Public Sans) */

:root {
  --nh-phone-border: rgba(0, 0, 0, 0.85); /* light mode: near-black */
  --nh-accent-orange: #eda84fe7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nh-phone-border: rgba(229, 231, 235, 0.75); /* dark mode: light gray */
  }
}

/* Wider container for Projects page (override global .nh-hero-content max-width) */
.nh-hero-content-wide {
  max-width: min(85vw, 1200px);
}

@media (min-width: 1400px) {
  .nh-hero-content-wide {
    max-width: min(85vw, 1400px);
  }
}

/* ----- Page header (Projects) ----- */

.nh-page-kicker {
  margin-top: 2px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  opacity: 0.95;
}

.nh-page-divider {
  margin-top: 10px;
  height: 2px;
  width: min(920px, 100%);
  background: color-mix(in srgb, var(--text) 55%, transparent);
  opacity: 0.45;
}

/* ----- Project block (repeatable) ----- */

.nh-project {
  margin-top: 22px;
  width: 100%;

  display: grid;
  grid-template-columns: 3fr 1fr;
  column-gap: 56px;
  align-items: start;
}

.nh-project-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Grid placement: text left, preview right */
.nh-project-header,
.nh-project-secondary,
.nh-cta-stack,
.nh-project-cta {
  grid-column: 1;
  justify-self: start;
  text-align: left;
}

/* ----- CTA + badges stack ----- */
.nh-cta-stack {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
}

/* When the stack exists, remove extra top margin from inner cta */
.nh-cta-stack .nh-project-cta {
  margin-top: 0;
}

.nh-project-preview {
  grid-column: 2;
  grid-row: 1 / span 3; /* align with top of header and span down beside text */
  justify-self: end;    /* trailing within the visible content width */
  align-self: start;
  margin-top: 0;        /* remove vertical offset in two-column layout */
}

/* Project title (shared across MilkyGrid, MilkTune, etc.) */
.nh-project-title {
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-weight: 500;
  font-size: clamp(2.6rem, 4.5vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--text);
  margin: 0;
}

/* ----- Project status badge ----- */
.nh-project-status {
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* ~1/3 of project title visual weight */
  font-size: 0.33em; /* exactly ~1/3 of project title */
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: var(--nh-accent-orange);               /* NordHat orange */
  border: 1.5px solid var(--nh-accent-orange);  /* same orange outline */
  background: transparent;                      /* keep it crisp */
  border-radius: 999px;

  padding: 6px 14px;
  width: fit-content;

  opacity: 0.95;
}

.nh-project-one-liner {
  font-size: 1.18rem;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.88;
  margin: 0;
  max-width: 78ch;
}

/* ----- App preview (single screenshot) ----- */

.nh-preview {
  margin: 0;
}

.nh-preview-frame {
  width: clamp(170px, 18vw, 240px);
  aspect-ratio: 9 / 19.5;

  border-radius: 24px;
  overflow: hidden;
  background: transparent;

  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.10);
  position: relative;
  isolation: isolate;
  padding-top: 6px; /* simulate iPhone top glass / safe area */
  box-sizing: border-box;
}

.nh-preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.35pt solid var(--nh-phone-border);
  pointer-events: none;
  z-index: 2;
}

.nh-preview-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  /* subtle inner edge to emulate device glass */
  box-shadow: inset 0 0 0 0.6px color-mix(in srgb, var(--nh-phone-border) 45%, transparent);
  pointer-events: none;
  z-index: 1;
}

.nh-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;

  /* Reduce aggressive zoom and keep Dynamic Island inside frame */
  transform: scale(1.015);
  transform-origin: center;

  /* Shift crop slightly downward to respect iPhone safe area */
  object-position: center 58%;

  border: 0;
  background: transparent;
  position: relative;
  z-index: 0;
}

/* Dark mode: boost shadow */
@media (prefers-color-scheme: dark) {
  .nh-preview-frame {
    box-shadow:
      0 36px 80px rgba(0, 0, 0, 0.55),
      0 14px 30px rgba(0, 0, 0, 0.35);
  }
}

/* Responsive */
@media (max-width: 900px) {
  .nh-project {
    grid-template-columns: 1fr;
    row-gap: 18px;
  }

  .nh-project-preview {
    grid-column: 1;
    grid-row: auto;
    justify-self: start; /* align leading when stacked */
    margin-top: 6px;
  }

  .nh-preview-frame {
    width: clamp(210px, 58vw, 260px);
  }
}

/* ----- Secondary block (text under preview) ----- */

.nh-project-secondary {
  margin-top: 16px;
  max-width: 78ch;
}

.nh-secondary-kicker {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--navy);
  opacity: 0.85;
  margin-bottom: 10px;
}

.nh-secondary-title {
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.05rem, 1.6vw, 1.38rem); /* slightly smaller */
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 10px;
}

.nh-secondary-text {
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--text);
  opacity: 0.9;
  margin: 0;
}

/* ----- Store badges (App Store / Google Play) ----- */

.nh-store-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  opacity: 0.92; /* slightly secondary vs primary CTA */
}

.nh-store-badge {
  height: 40px;   /* a bit smaller than the CTA button */
  width: auto;
  display: block;
  user-select: none;
}

/* ----- Next projects separator ----- */

.nh-project-divider {
  margin-top: 34px;
  width: 100%;
  height: 1px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
  opacity: 0.5;
}

/* ----- Responsive tweaks (match your site spacing) ----- */

@media (max-width: 768px) {
  /* keep things from feeling cramped */
  .nh-project-one-liner,
  .nh-secondary-text {
    font-size: 1.08rem;
  }

  .nh-secondary-title {
    font-size: clamp(1.25rem, 3.0vw, 1.65rem);
  }
}