/* Basic Reset / Box Sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  /* Body Setup */
  body {
    font-family: 'Nunito', sans-serif;
    background-color: #121212; /* Dark Background */
    color: #ffffff;           /* Light Text */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
  }

  body:not(.learning-page) {
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
  }

  body:not(.learning-page)::before,
  body:not(.learning-page)::after {
    content: "";
    position: fixed;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(90px);
    opacity: 0.2;
    z-index: -1;
    animation: ambientDrift 18s ease-in-out infinite alternate;
  }

  body:not(.learning-page)::before {
    top: -8rem;
    left: -5rem;
    background: rgba(0, 196, 180, 0.42);
  }

  body:not(.learning-page)::after {
    right: -8rem;
    bottom: 4rem;
    background: rgba(0, 124, 240, 0.32);
    animation-duration: 22s;
    animation-delay: -6s;
  }
  
  /* Hero Section */
  .hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6rem 1rem;
    width: 100%;
    position: relative;
    z-index: 1;
  }
  
  .app-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    animation: revealUp 0.65s ease-out both, logoFloat 6s ease-in-out 0.8s infinite;
  }
  
  .app-name {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: revealUp 0.65s ease-out 0.08s both;
  }
  
  .tagline {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0;
    animation: revealUp 0.65s ease-out 0.16s both;
  }
  
  /* CTA Button (using <a> styled like a button) */
  .cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-family: inherit;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    background-color: #00c4b4; /* Accent Color */
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 12px 30px rgba(0, 196, 180, 0.16);
  }
  
  .cta-button:hover {
    background-color: #00a89b;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 36px rgba(0, 196, 180, 0.24);
  }

  .cta-button.secondary {
    background-color: transparent;
    border: 1px solid #2f2f2f;
    color: #ffffff;
  }

  .cta-button.secondary:hover {
    background-color: #1f1f1f;
    transform: translateY(-2px);
  }

  .cta-button.danger-link {
    color: #ff7d7d;
    border-color: #5d2933;
  }

  .cta-button.danger-link:hover {
    background-color: #291318;
    color: #ff9d9d;
  }

  .hero-section .cta-button {
    opacity: 0;
    animation: revealUp 0.65s ease-out 0.24s both;
  }
  
  /* Features Section */
  .features-section {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
  }
  
  .features-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }
  
  .features-list li {
    font-size: 1rem;
    font-weight: 400;
    background: #1e1e1e;
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 16px; /* Rounded corners */
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
    opacity: 0;
    animation: revealUp 0.55s ease-out 0.32s both;
    transition: transform 0.2s ease-in-out, border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  }

  .features-list li:nth-child(2) {
    animation-delay: 0.4s;
  }

  .features-list li:nth-child(3) {
    animation-delay: 0.48s;
  }

  .features-list li:nth-child(4) {
    animation-delay: 0.56s;
  }

  .features-list li:nth-child(5) {
    animation-delay: 0.64s;
  }

  .features-list li:nth-child(6) {
    animation-delay: 0.72s;
  }

  .features-list li:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 196, 180, 0.28);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.24);
  }

  .feature-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    opacity: 0;
    animation: revealUp 0.6s ease-out 0.82s both;
  }

  .subscription-page {
    width: 100%;
  }

  .portal-section {
    width: 100%;
    max-width: 960px;
    padding: 0 1rem 4rem;
  }

  .portal-shell {
    display: grid;
    gap: 1.5rem;
  }

  .portal-shell > * {
    opacity: 0;
    animation: revealUp 0.55s ease-out both;
  }

  .portal-shell > *:nth-child(2) {
    animation-delay: 0.08s;
  }

  .portal-shell > *:nth-child(3) {
    animation-delay: 0.16s;
  }

  .portal-shell > *:nth-child(4) {
    animation-delay: 0.24s;
  }

  .portal-card {
    background: #1e1e1e;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    transition: transform 0.22s ease-in-out, border-color 0.22s ease-in-out, box-shadow 0.22s ease-in-out;
  }

  .portal-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 196, 180, 0.22);
    box-shadow: 0 26px 48px rgba(0, 0, 0, 0.26);
  }

  .portal-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.85rem;
  }

  .portal-card p {
    color: #cfd3d6;
    line-height: 1.7;
  }

  .portal-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.8rem;
    margin-bottom: 1rem;
    border-radius: 999px;
    background: rgba(0, 196, 180, 0.12);
    color: #80f0e6;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 1.25rem;
  }

  .apple-sign-in-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.75rem 1.35rem;
    border-radius: 999px;
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  .apple-sign-in-button:hover {
    background: #f5f5f7;
    transform: translateY(-1px);
  }

  .apple-sign-in-button__icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
    flex: 0 0 auto;
  }

  .apple-sign-in-button__label {
    white-space: nowrap;
  }

  .portal-message {
    border-radius: 16px;
    padding: 1rem 1.25rem;
    border: 1px solid #2f2f2f;
    line-height: 1.6;
  }

  .portal-message.info {
    background: #1e2627;
    color: #d8fbf7;
  }

  .portal-message.error {
    background: #30171d;
    border-color: #6f2535;
    color: #ffc9d5;
  }

  .portal-message.success {
    background: #152820;
    border-color: #1e6e59;
    color: #c9ffe8;
  }

  .portal-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
  }

  .portal-subsection {
    margin-top: 1.5rem;
    padding-top: 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .portal-disclosure {
    margin-top: 1.5rem;
    border: 1px solid rgba(83, 100, 106, 0.42);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(19, 24, 26, 0.82) 0%, rgba(13, 16, 17, 0.92) 100%);
    overflow: hidden;
  }

  .portal-disclosure-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9af4eb;
    list-style: none;
    user-select: none;
  }

  .portal-disclosure-summary::-webkit-details-marker {
    display: none;
  }

  .portal-disclosure-summary::after {
    content: "+";
    font-size: 1.1rem;
    line-height: 1;
    color: #dffaf7;
  }

  .portal-disclosure[open] .portal-disclosure-summary::after {
    content: "−";
  }

  .portal-disclosure-content {
    padding: 0 1.1rem 1.1rem;
  }

  .portal-disclosure-content .portal-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .portal-subsection-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }

  .portal-subsection-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
  }

  .portal-subsection-description {
    margin: 0 0 0.9rem;
    color: #b6bcc2;
  }

  .portal-meta-item {
    position: relative;
    background: linear-gradient(180deg, rgba(30, 35, 37, 0.92) 0%, rgba(17, 19, 20, 0.98) 100%);
    border: 1px solid rgba(87, 103, 109, 0.42);
    border-radius: 18px;
    padding: 1.05rem 1rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .portal-meta-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    border-radius: 18px 0 0 18px;
    background: linear-gradient(180deg, #00c4b4 0%, #69e0d6 100%);
  }

  .portal-meta-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #8f9499;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .portal-meta-value {
    display: block;
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.45;
    color: #ffffff;
    overflow-wrap: anywhere;
  }

  .portal-qr-block {
    display: grid;
    gap: 1rem;
    margin-top: 1.25rem;
  }

  .portal-qr-image {
    width: min(320px, 100%);
    padding: 0.75rem;
    border-radius: 18px;
    background: #ffffff;
  }

  .portal-payload {
    padding: 1rem;
    border-radius: 16px;
    background: #151515;
    border: 1px solid #2a2a2a;
    font-family: "SFMono-Regular", "Menlo", monospace;
    font-size: 0.88rem;
    overflow-wrap: anywhere;
  }

  .portal-json-section {
    position: relative;
  }

  .portal-json-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.25rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 196, 180, 0.28);
    background: rgba(0, 196, 180, 0.1);
    color: #9af4eb;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    flex-shrink: 0;
  }

  .portal-json-shell {
    margin-top: 0.95rem;
    border-radius: 20px;
    border: 1px solid rgba(77, 95, 101, 0.45);
    background:
      linear-gradient(180deg, rgba(20, 25, 27, 0.96) 0%, rgba(12, 15, 16, 0.98) 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.04),
      0 18px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
  }

  .portal-json-block {
    margin: 0;
    padding: 1.15rem 1.2rem 1.25rem;
    background:
      linear-gradient(90deg, rgba(0, 196, 180, 0.06) 0, rgba(0, 196, 180, 0.06) 1px, transparent 1px) 0 0 / 100% 100%,
      linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(255, 255, 255, 0) 100%);
    color: #dffaf7;
    font-family: "SFMono-Regular", "Menlo", monospace;
    font-size: 0.84rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .portal-form {
    display: inline-flex;
  }

  @media (max-width: 640px) {
    .portal-card {
      padding: 1.25rem;
    }

    .portal-subsection-heading {
      flex-direction: column;
      align-items: stretch;
    }

    .portal-actions,
    .portal-form {
      width: 100%;
    }

    .portal-actions .cta-button,
    .portal-actions .apple-sign-in-button,
    .portal-form .cta-button {
      width: 100%;
    }
  }
  
  /* Footer */
  .footer {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #777;
    opacity: 0;
    animation: revealUp 0.6s ease-out 0.9s both;
  }

  .footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.65rem;
    flex-wrap: wrap;
  }

  .footer-link {
    color: #00c4b4;
    text-decoration: none;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
  }

  .footer-link:hover {
    color: #80f0e6;
    transform: translateY(-1px);
  }

  @keyframes revealUp {
    from {
      opacity: 0;
      transform: translateY(18px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes logoFloat {
    0%,
    100% {
      transform: translateY(0);
    }

    50% {
      transform: translateY(-10px);
    }
  }

  @keyframes ambientDrift {
    from {
      transform: translate3d(0, 0, 0) scale(1);
    }

    to {
      transform: translate3d(2rem, 2.5rem, 0) scale(1.08);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
