/* ==================================================== */
/* Smart-CV Home (Next.js) — page-specific styles.        */
/* Redesigned as a light, product-dashboard-style surface  */
/* (rounded cards, soft elevation, layered depth) while     */
/* keeping the shared shell (masthead/footer/tokens) in     */
/* swiss-base.css untouched — this file is scoped under     */
/* .home-view so every other page keeps its own look.       */
/* Structure is unchanged: hero -> template cards -> history */
/* band. Only the visual language is replaced.               */
/* ==================================================== */

.home-view {
  /* Local overrides, scoped so /login, /history, /resume etc. are
     unaffected — swiss-base.css's :root tokens stay untouched. */
  /* White page background (not the tinted --home-bg the blue draft used) —
     the brand's deep emerald carries the page on its own without a grey
     wash behind it. */
  --home-bg: #ffffff;
  --home-surface: #ffffff;
  --home-surface-2: #f4f8f6;
  --home-ink: #131a2a;
  --home-ink-2: #5b6472;
  --home-ink-3: #8991a0;
  --home-line: #e3ebe7;
  /* Primary accent matches the brand's emerald (swiss-base.css's
     --sw-accent) — brighter/more saturated than the original muted
     tone, kept text-safe; the CTA button alone reaches for the fully
     fluorescent --sw-accent-bright instead of this token. */
  --home-green: #0c9959;
  --home-green-deep: #073f30;
  --home-green-soft: #d9f5ea;
  /* Step-badge accents no longer include mint (too close to the new
     emerald primary) — sky blue and violet instead, so the 3-step
     sequence stays visually distinct from the primary color. */
  --home-mint: #2f6fed;
  --home-mint-soft: #e8effe;
  --home-amber: #7c5cd6;
  --home-amber-soft: #efe9fb;
  --home-radius-lg: 28px;
  --home-radius-md: 20px;
  --home-radius-sm: 14px;
  --home-shadow-1: 0 1px 2px rgba(19, 26, 42, 0.04), 0 8px 24px -12px rgba(19, 26, 42, 0.10);
  --home-shadow-2: 0 4px 10px rgba(19, 26, 42, 0.05), 0 24px 48px -20px rgba(19, 26, 42, 0.18);
  background: var(--home-bg);
}

.home-view .sw-main {
  background: var(--home-bg);
}

/* Masthead/footer keep the shared component, but read correctly against
   the new lighter page background. */
.home-view .sw-masthead,
.home-view .sw-footer {
  background: var(--home-bg);
  border-color: var(--home-line);
}

/* ---------------- HERO ---------------- */
.home-hero {
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* A soft, layered "app shell" panel instead of a flat brand-color
   rectangle — depth comes from stacked surfaces and blur, the way the
   reference dashboard builds its card panel, not from a gradient fill. */
/* The whole card is the link (like the template cards below) — the
   glow is a real promise now, not just atmosphere: anywhere on this
   card takes you to /auto-generate. Only the template fallback lives
   outside it, since it goes somewhere else. */
.home-hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-lg);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  box-shadow: var(--home-shadow-2);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--sw-dur) var(--sw-ease), border-color var(--sw-dur) var(--sw-ease);
}

.home-hero-panel:hover,
.home-hero-panel:focus-visible {
  border-color: rgba(0, 226, 138, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 226, 138, 0.16),
              0 24px 48px -20px rgba(0, 226, 138, 0.24),
              var(--home-shadow-2);
}

.home-hero-panel:focus-visible {
  outline: 2px solid var(--home-green-deep);
  outline-offset: 4px;
}

/* Faint radial glow, top-right — a single quiet atmosphere cue rather
   than a loud gradient background, echoing the soft blob lighting in
   the reference dashboards without copying their dark palette. */
.home-hero-panel::before {
  content: "";
  position: absolute;
  top: -140px;
  right: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(0, 226, 138, 0.12), transparent 70%);
  pointer-events: none;
}

.home-hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-eyebrow {
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-green-deep);
  background: var(--home-green-soft);
  border-radius: 999px;
  padding: 0.4rem 0.85rem 0.4rem 0.7rem;
}

.home-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--home-green);
}

.home-hero-title {
  margin: 0;
  font-family: var(--sw-font-serif);
  font-weight: 700;
  font-size: clamp(2rem, 1.5rem + 1.8vw, 2.9rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  color: var(--home-ink);
  word-break: keep-all;
}

.home-hero-lead {
  margin: 1.1rem 0 0;
  font-size: 1rem;
  color: var(--home-ink-2);
  max-width: 42ch;
  line-height: 1.75;
}

.home-hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

/* Primary CTA pill: a visual label now, not its own link — the whole
   card (.home-hero-panel) is the actual link, so this <span> just
   needs to look and react like a button while the card does the
   navigating. Still the one fluorescent moment on the page: every
   other green accent (eyebrow, underlines, badges) stays moderate;
   dark text on the bright fill (not white) since a bright fill can't
   hold contrast for light text. */
.home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 164px;
  min-height: 50px;
  font-family: var(--sw-font-sans);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: #48d1b6;
  border: 1px solid #48d1b6;
  border-radius: 999px;
  padding: 0.9rem 2.05rem;
  white-space: nowrap;
  box-shadow: 0 10px 18px -10px rgba(72, 209, 182, 0.85);
  transition: background var(--sw-dur) var(--sw-ease),
              box-shadow var(--sw-dur) var(--sw-ease),
              transform 140ms var(--sw-ease);
}

.home-cta .sw-arrow { color: #fff; }

.home-hero-panel:hover .home-cta,
.home-hero-panel:focus-visible .home-cta {
  background: #3fc4ac;
  border-color: #3fc4ac;
  box-shadow: 0 10px 18px -10px rgba(63, 196, 172, 0.55);
  transform: scale(1.015);
}
.home-hero-panel:hover .home-cta .sw-arrow,
.home-hero-panel:focus-visible .home-cta .sw-arrow { transform: translateX(4px); }
.home-hero-panel:active .home-cta { transform: scale(0.97); }

.home-hero-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--home-ink-3);
}

/* Now a sibling below the card, not nested inside it — an <a> can't
   contain another <a>, and this needed its own destination (an
   in-page anchor) separate from the card's /auto-generate link. */
.home-hero-alt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--home-ink-2);
  padding-bottom: 2px;
  background-image: linear-gradient(var(--home-green), var(--home-green));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size var(--sw-dur) var(--sw-ease), color var(--sw-dur) var(--sw-ease);
}
.home-hero-alt:hover { background-size: 100% 1px; color: var(--home-ink); }
.home-hero-alt:focus-visible {
  outline: 2px solid var(--home-green);
  outline-offset: 3px;
}
.home-hero-alt .sw-arrow { color: var(--home-green); font-size: 0.95em; }
.home-hero-alt:hover .sw-arrow { transform: translateY(3px); }

/* Right side of the hero: a stacked "progress card" echoing the
   reference dashboards' floating card-on-card composition (My Card /
   schedule list), used here to explain the 3-step mechanism instead of
   decorative chrome. */
.home-hero-steps-panel {
  position: relative;
  background: var(--home-surface-2);
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-hero-steps-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-ink-3);
}

.home-hero-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-hero-step {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-sm);
  padding: 0.9rem 1rem;
  transition: border-color var(--sw-dur) var(--sw-ease), box-shadow var(--sw-dur) var(--sw-ease), transform var(--sw-dur) var(--sw-ease);
}

.home-hero-step:hover {
  border-color: var(--home-green);
  box-shadow: var(--home-shadow-1);
  transform: translateY(-2px);
}

.home-hero-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  background: var(--home-green-soft);
  color: var(--home-green-deep);
  font-family: var(--sw-font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.home-hero-step:nth-child(2) .home-hero-step-num {
  background: var(--home-mint-soft);
  color: var(--home-mint);
}

.home-hero-step:nth-child(3) .home-hero-step-num {
  background: var(--home-amber-soft);
  color: var(--home-amber);
}

.home-hero-step-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--home-ink);
}

.home-hero-step-desc {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--home-ink-2);
  line-height: 1.6;
}

/* One-time entrance choreography, unchanged in spirit from the previous
   version — targets the new class names. */
.sw-motion .home-hero-copy[data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}
.sw-motion .home-hero-copy > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--sw-ease), transform 0.65s var(--sw-ease);
}
.sw-motion .home-hero-copy.in > * { opacity: 1; transform: none; }
.sw-motion .home-hero-copy.in > *:nth-child(1) { transition-delay: 0ms; }
.sw-motion .home-hero-copy.in > *:nth-child(2) { transition-delay: 100ms; }
.sw-motion .home-hero-copy.in > *:nth-child(3) { transition-delay: 210ms; }
.sw-motion .home-hero-copy.in > *:nth-child(4) { transition-delay: 320ms; }

.sw-motion .home-hero-steps-panel[data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
}
.sw-motion .home-hero-steps-panel .home-hero-step {
  opacity: 0;
  transform: translateY(14px);
}
.sw-motion .home-hero-steps-panel.in .home-hero-step {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--sw-ease), transform 0.5s var(--sw-ease), border-color var(--sw-dur) var(--sw-ease), box-shadow var(--sw-dur) var(--sw-ease), transform var(--sw-dur) var(--sw-ease);
}
.sw-motion .home-hero-steps-panel.in .home-hero-step:nth-child(1) { transition-delay: 260ms; }
.sw-motion .home-hero-steps-panel.in .home-hero-step:nth-child(2) { transition-delay: 340ms; }
.sw-motion .home-hero-steps-panel.in .home-hero-step:nth-child(3) { transition-delay: 420ms; }

/* ---------------- Templates section ---------------- */
.home-section {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  flex-wrap: wrap;
}

.home-section-title {
  margin: 0;
  font-family: var(--sw-font-serif);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem);
  color: var(--home-ink);
}

.home-section-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--home-ink-3);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 1.75rem);
}

/* Cards: rounded, generously padded, soft rest shadow — the reference
   dashboards' card language (rounded corners + layered elevation)
   rather than the previous hairline-bordered flat rectangle. */
.home-doc {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--home-surface);
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-md);
  overflow: hidden;
  box-shadow: var(--home-shadow-1);
  transition: box-shadow var(--sw-dur) var(--sw-ease),
              transform var(--sw-dur) var(--sw-ease),
              border-color var(--sw-dur) var(--sw-ease);
}

/* A real glow, not just a slightly stronger neutral elevation shadow —
   a crisp bright ring plus a big soft neon bloom underneath, so
   hovering a template card feels like it lights up, not just lifts. */
.home-doc:hover {
  border-color: rgba(0, 226, 138, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 226, 138, 0.16),
              0 20px 40px -16px rgba(0, 226, 138, 0.24),
              var(--home-shadow-2);
  transform: translateY(-4px);
}

.sw-motion .home-doc[data-reveal] {
  transition: opacity 0.65s var(--sw-ease),
              transform 380ms var(--sw-ease),
              border-color var(--sw-dur) var(--sw-ease),
              box-shadow var(--sw-dur) var(--sw-ease);
}

.home-doc-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--home-surface-2);
}

.home-doc-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 600ms var(--sw-ease);
}

.home-doc:hover .home-doc-media img { transform: scale(1.04); }

.home-doc-kicker-chip {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--home-green-deep);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  backdrop-filter: blur(6px);
}

.home-doc-body {
  padding: clamp(1.25rem, 3vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.home-doc-title {
  margin: 0;
  font-family: var(--sw-font-serif);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--home-ink);
}

.home-doc-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--home-ink-2);
  flex: 1;
  line-height: 1.65;
}

.home-doc-action {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--home-green-deep);
  align-self: flex-start;
}

.home-doc-action .sw-arrow { color: var(--home-green); transition: transform var(--sw-dur) var(--sw-ease); }
.home-doc:hover .home-doc-action .sw-arrow { transform: translateX(5px); }

.home-doc:focus-visible {
  outline: 2px solid var(--home-green);
  outline-offset: 3px;
}

.home-grid .home-doc:not(.in):nth-child(2) { transition-delay: 90ms; }

/* ---------------- History band ---------------- */
/* A quieter "recent activity" strip — rounded surface, soft shadow,
   pill-shaped call-to-action on the right (echoing the reference
   dashboards' "View All" chips) instead of an underlined text link. */
.home-history {
  position: relative;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 3vw, 2.1rem) clamp(1.5rem, 3vw, 2.1rem);
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-md);
  background: var(--home-surface);
  box-shadow: var(--home-shadow-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  cursor: pointer;
  transition: box-shadow var(--sw-dur) var(--sw-ease), border-color var(--sw-dur) var(--sw-ease);
}

/* Same glow intensity as the template cards (.home-doc:hover) — this
   is a single real link like they are, so it earns the same emphasis. */
.home-history:hover,
.home-history:focus-visible {
  border-color: rgba(0, 226, 138, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 226, 138, 0.16),
              0 20px 40px -16px rgba(0, 226, 138, 0.24),
              var(--home-shadow-2);
}

.home-history:focus-visible {
  outline: 2px solid var(--home-green);
  outline-offset: 3px;
}

.sw-motion .home-history[data-reveal] {
  transition: opacity 0.7s var(--sw-ease),
              transform 0.7s var(--sw-ease),
              border-color var(--sw-dur) var(--sw-ease),
              box-shadow var(--sw-dur) var(--sw-ease);
}

.home-history-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--home-green-soft);
  color: var(--home-green-deep);
}

.home-history-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 220px;
}

.home-history-title {
  margin: 0;
  font-family: var(--sw-font-serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--home-ink);
}

.home-history-desc { margin: 0; font-size: 0.88rem; color: var(--home-ink-2); max-width: 46ch; }

/* A text link with a distinct circular icon-button as its full stop,
   not a bordered pill — the pill read as a generic "chip" default.
   The circle is the one bright accent in the row; the text stays
   plain ink with a hover underline. Layout wrapper only — the
   underline lives on .home-history-link-text alone, so it doesn't
   draw itself under the circle too. */
.home-history-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.home-history-link-text {
  padding-bottom: 2px;
  background-image: linear-gradient(#2cddb4, #2cddb4);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1.5px;
  color: var(--home-ink);
  transition: background-size var(--sw-dur) var(--sw-ease), color var(--sw-dur) var(--sw-ease);
}
.home-history:hover .home-history-link-text,
.home-history:focus-visible .home-history-link-text {
  background-size: 100% 1.5px;
  color: var(--home-green-deep);
}

.home-history-link-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  color: var(--home-green);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform var(--sw-dur) var(--sw-ease);
}
.home-history-link-icon .sw-arrow { color: var(--home-green); }
.home-history:hover .home-history-link-icon,
.home-history:focus-visible .home-history-link-icon {
  transform: translateX(4px);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .home-hero-panel { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-hero-title { line-height: 1.34; }
  .home-history { align-items: flex-start; flex-direction: column; gap: 1.1rem; }
}
