/* ============================================================
   PORTFOLIO – profile hero, learnings, experience, app cards
   ============================================================ */

/* ---------- Generic reveal (joins the inner cascade) ---------- */

.snap-page .page-content .reveal {
  opacity: 0;
  transform: translateY(15px);
  transition:
    opacity 450ms cubic-bezier(0.16, 0.84, 0.22, 1),
    transform 450ms cubic-bezier(0.16, 0.84, 0.22, 1);
}

.snap-page.is-visible .page-content .reveal {
  opacity: 1;
  transform: translateY(0);
  transition-delay: var(--d, 300ms);
}

/* ---------- Sidebar avatar ---------- */

.brand-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line-mid);
  box-shadow: var(--glow-c);
}

/* ---------- Profile hero ---------- */

.hero.hero--profile {
  width: min(1240px, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  align-content: center;
  gap: clamp(32px, 5vw, 72px);
  text-align: left;
}

.profile-avatar {
  position: relative;
  width: clamp(240px, 27vw, 400px);
  aspect-ratio: 1;
  /* Frameless: the transparent image sits directly on the page.
     Glow lives here so the logo mask doesn't clip it. */
  filter: drop-shadow(0 0 22px rgba(0, 229, 255, 0.45));
}

/* The "screen" */
.profile-avatar .avatar-clip {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* Soft edges so the TV effects never draw a visible square */
  /* TV effects only render on the logo itself, never as a square */
  -webkit-mask: url("../assets/img/pulse-scanner-alpha.webp") center / contain no-repeat;
  mask: url("../assets/img/pulse-scanner-alpha.webp") center / contain no-repeat;
  animation: tvFlicker 7s steps(1, end) infinite;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  animation: tvGlitch 7s steps(1, end) infinite;
}

/* Scanlines */
.profile-avatar .avatar-clip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.18) 0 1px,
      transparent 1px 3px
    );
}

/* Rolling interference band (transform only, GPU-cheap) */
.profile-avatar .avatar-clip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgba(0, 229, 255, 0.1) 45%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(0, 229, 255, 0.1) 55%,
    transparent
  );
  transform: translateY(-100%);
  animation: tvRoll 5.5s linear infinite;
}

/* Screen brightness drops, like a bad signal */
@keyframes tvFlicker {
  0%   { opacity: 1; }
  80%  { opacity: 0.55; }
  81%  { opacity: 1; }
  82%  { opacity: 0.3; }
  83%  { opacity: 1; }
  92%  { opacity: 0.7; }
  93%  { opacity: 1; }
}

/* Image tears horizontally for a few frames */
@keyframes tvGlitch {
  0%   { transform: none; }
  80%  { transform: translateX(-7px) skewX(6deg); }
  81%  { transform: translateX(5px); }
  82%  { transform: scale(1.04, 0.96) translateX(-3px); }
  83%  { transform: none; }
  92%  { transform: translateY(4px); }
  93%  { transform: none; }
}

@keyframes tvRoll {
  to { transform: translateY(560%); }
}

.profile-copy {
  min-width: 0;
}

.hero.hero--profile h1 {
  margin: 20px 0 22px;
  width: auto;
  max-width: 100%;
  font-size: clamp(2.6rem, 6.4vw, 5.8rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-align: left;
  white-space: normal;
}

.hero.hero--profile .hero-description {
  max-width: 54ch;
  margin: 0;
  font-size: clamp(1.05rem, 1.35vw, 1.3rem);
  line-height: 1.65;
}

/* ---------- Chips ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.chip-row li {
  padding: 6px 12px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  background: rgba(0, 229, 255, 0.04);
  color: var(--text-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.hero--profile .hero-actions {
  margin-top: 30px;
}

/* ---------- Ghost button ---------- */

.btn-ghost {
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--line-mid);
}

.btn-ghost:hover {
  color: var(--mint);
  border-color: rgba(0, 255, 157, 0.45);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.2);
}

/* ---------- Dense sections ---------- */

.section-free > .section-label {
  align-self: flex-start;
}

.section-free--dense {
  width: min(1240px, 100%);
  padding-top: clamp(84px, 11vh, 128px);
  padding-bottom: 48px;
}

.section-free--dense h2 {
  max-width: none;
  margin: 18px 0 16px;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.section-free--dense .section-lead {
  max-width: 60ch;
  font-size: clamp(1.05rem, 1.4vw, 1.3rem);
  color: var(--text-soft);
}

/* ---------- Shared card surface ---------- */

.lesson-card,
.app-card,
.xp-list li {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: linear-gradient(
    160deg,
    rgba(0, 229, 255, 0.05),
    rgba(5, 8, 13, 0.6) 60%
  );
  transition:
    border-color var(--dur-fast),
    transform var(--dur-fast),
    box-shadow var(--dur-fast);
}

.lesson-card:hover,
.app-card:hover,
.xp-list li:hover {
  border-color: var(--line-mid);
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.lesson-card h3,
.app-card h3,
.xp-list h3 {
  margin: 0 0 8px;
  color: var(--heading);
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.95rem, 1.1vw, 1.08rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.lesson-card p,
.app-card p,
.xp-list p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.65;
}

code {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.92em;
  color: var(--mint);
}

/* ---------- Lessons ---------- */

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.lesson-card {
  padding: 22px 24px 24px;
}

.lesson-index {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* ---------- Experience ---------- */

.xp-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px 32px;
  padding-bottom: 18px;
  margin-top: 6px;
  border-bottom: 1px solid var(--line-soft);
}

.xp-role {
  margin: 0;
  color: var(--heading);
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 700;
}

.xp-org {
  margin: 6px 0 0;
  color: var(--cyan);
  font-size: 1rem;
}

.xp-meta {
  margin: 0;
  color: var(--text-muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-align: right;
  line-height: 1.6;
}

.xp-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.xp-list li {
  padding: 20px 22px 22px 26px;
}

.xp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--mint), var(--violet));
}

.xp-list li:first-child {
  grid-column: 1 / -1;
  border-color: rgba(0, 255, 157, 0.22);
}

/* ---------- Apps ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.5;
  filter: blur(40px);
}

.app-card--pulse::before {
  background: rgba(0, 229, 255, 0.22);
}

.app-card--folzena::before {
  background: rgba(255, 45, 110, 0.22);
}

.app-card--folzena:hover {
  border-color: rgba(255, 45, 110, 0.35);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 18px;
}

.app-icon {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 22px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line-mid);
}

.app-card--folzena .app-icon {
  border-color: rgba(255, 45, 110, 0.35);
}

.app-card h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.5rem);
  margin-bottom: 6px;
}

.app-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 0.82rem !important;
  letter-spacing: 0.05em;
  color: var(--text-muted) !important;
}

.app-card .app-note {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.app-features {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  align-self: start;
  gap: 6px;
  margin: -4px 0 0;
  padding: 0;
  list-style: none;
}

.app-features li {
  padding: 4px 10px;
  border: 1px solid rgba(255, 45, 110, 0.22);
  border-radius: var(--r-pill);
  color: var(--text-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.76rem;
}

.app-card--pulse .app-features li {
  border-color: rgba(0, 229, 255, 0.22);
}

.app-status {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 45, 110, 0.45);
  border-radius: var(--r-pill);
  background: rgba(255, 45, 110, 0.1);
  color: var(--pink);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.app-links .btn {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.72rem;
}

/* Folzena step buttons: same pill shape as the rest, pink accent */
.btn-step {
  color: #ff7aa3;
  background: rgba(255, 45, 110, 0.08);
  border: 1px solid rgba(255, 45, 110, 0.4);
}

.btn-step:hover {
  color: #fff;
  border-color: var(--pink);
  box-shadow: 0 0 22px rgba(255, 45, 110, 0.3);
}

/* Symmetric cards: both share the same 5 rows
   (top · desc · features · note · links) */
@media (min-width: 901px) {
  .app-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 18px;
    align-content: start;
  }

  .app-card .app-links {
    margin-top: 0;
    align-self: start;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero.hero--profile {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 28px;
    padding-top: 72px;
  }

  .hero.hero--profile h1 {
    text-align: center;
    margin-inline: auto;
  }

  .hero.hero--profile .hero-description {
    margin-inline: auto;
  }

  .profile-copy .chip-row,
  .hero--profile .hero-actions {
    justify-content: center;
  }

  .profile-avatar {
    width: clamp(200px, 46vw, 280px);
  }

  .xp-list,
  .app-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .section-free.section-free--dense h2 {
    font-size: clamp(2.1rem, 10vw, 3rem);
    line-height: 1.02;
  }

  .hero.hero--profile .hero-description {
    font-size: 1rem;
  }

  .profile-avatar {
    width: clamp(190px, 50vw, 250px);
  }
}

@media (max-width: 560px) {
  .eyebrow {
    height: auto;
    min-height: 32px;
    padding: 6px 13px;
    line-height: 1.4;
    font-size: 0.68rem;
  }

  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .lesson-card,
  .xp-list li {
    padding: 16px 18px;
  }

  .lesson-index {
    margin-bottom: 4px;
  }

  .xp-meta {
    text-align: left;
  }

  .app-card {
    padding: 20px;
  }

  .app-icon {
    width: 68px;
    height: 68px;
    border-radius: 17px;
  }

  .app-status {
    position: static;
    align-self: flex-start;
  }

  .app-card--pulse .app-features {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .snap-page .page-content .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .profile-avatar .avatar-clip,
  .profile-avatar .avatar-clip::after,
  .profile-avatar img {
    animation: none;
  }
}

/* ============================================================
   NAVIGATION HINTS – section dots + scroll cue
   ============================================================ */

.page-dots {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-50%);
}

.page-dots a {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

/* the dot itself */
.page-dots a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.55);
  background: transparent;
  transition:
    transform var(--dur-fast),
    background var(--dur-fast),
    box-shadow var(--dur-fast);
}

.page-dots a:hover::before,
.page-dots a:focus-visible::before {
  background: rgba(0, 229, 255, 0.4);
  transform: scale(1.25);
}

.page-dots a.active::before {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.8);
  transform: scale(1.35);
}

.page-dots a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 50%;
}

.page-dot-label {
  position: absolute;
  right: 34px;
  top: 50%;
  padding: 4px 10px;
  border: 1px solid var(--line-mid);
  border-radius: var(--r-pill);
  background: rgba(5, 8, 13, 0.85);
  color: var(--cyan);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(6px, -50%);
  transition:
    opacity var(--dur-fast),
    transform var(--dur-fast);
}

.page-dots a:hover .page-dot-label,
.page-dots a:focus-visible .page-dot-label {
  opacity: 1;
  transform: translate(0, -50%);
}

body.nav-open .page-dots {
  opacity: 0;
  pointer-events: none;
}

/* Scroll cue (home only) */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--text-soft);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0;
  transition:
    opacity 600ms ease 1.2s,
    color var(--dur-fast);
}

.snap-page.is-visible .scroll-cue {
  opacity: 0.85;
}

.scroll-cue:hover {
  color: var(--cyan);
}

.scroll-cue-arrow {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan);
  transform: rotate(45deg);
  animation: cueBounce 1.8s ease-in-out infinite;
}

@keyframes cueBounce {
  0%, 100% { transform: translateY(0) rotate(45deg); opacity: 1; }
  50%      { transform: translateY(6px) rotate(45deg); opacity: 0.5; }
}

/* Phones: dots become a slim, non-interactive progress indicator at the
   very edge (no overlap with text); the scroll cue would cover the
   buttons, and swiping is already the natural gesture there. */
@media (max-width: 760px) {
  .page-dots {
    right: 3px;
    gap: 7px;
    pointer-events: none;
  }

  .page-dots a {
    width: 6px;
    height: 6px;
  }

  .page-dots a::before {
    width: 5px;
    height: 5px;
  }

  .page-dot-label,
  .scroll-cue {
    display: none;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue-arrow {
    animation: none;
  }
}

/* ---------- Short desktop screens (laptops ~720–820px tall) ----------
   Keep every section inside one screen so nothing gets cut. */
@media (min-width: 901px) and (max-height: 820px) {
  .section-free--dense {
    padding-top: 64px;
    padding-bottom: 20px;
  }

  .section-free--dense h2 {
    margin: 12px 0 8px;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
  }

  .lesson-grid,
  .app-grid {
    margin-top: 20px;
  }

  .xp-list {
    margin-top: 16px;
  }

  .app-card {
    padding: 20px 22px;
    row-gap: 14px;
  }

  .app-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }
}

/* ---------- Phones in landscape: logo beside the text ---------- */
@media (max-height: 540px) and (orientation: landscape) {
  .hero.hero--profile {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    gap: 28px;
    padding-top: 64px;
  }

  .profile-avatar {
    width: clamp(130px, 22vw, 190px);
  }

  .hero.hero--profile h1 {
    text-align: left;
    margin: 12px 0 10px;
    font-size: clamp(1.9rem, 5vw, 2.8rem);
  }

  .hero.hero--profile .hero-description {
    margin-inline: 0;
  }

  .profile-copy .chip-row,
  .hero--profile .hero-actions {
    justify-content: flex-start;
  }

  .hero--profile .hero-actions {
    flex-direction: row;
  }

  .hero--profile .hero-actions .btn {
    width: auto;
  }
}
