:root{
    /* ---- Claymorphism token system (Light + Clay defaults) ---- */
    --bg: #F6F5F3;
    --bg-deep: #EFEDE9;
    --clay: #F3F1EE;
    --clay-hi: #FFFFFF;
    --clay-lo: #E2DFDA;
    --lavender: #C9BFE8;
    --lavender-deep: #A997D6;
    --lavender-ink: #6C5B94;
    --ink: #3A3642;
    --ink-soft: #6E6878;
    --ink-faint: #9C97A4;

    --shadow-light: rgba(255,255,255,0.85);
    --shadow-dark: rgba(163,152,178,0.38);
    --shadow-dark-strong: rgba(140,128,158,0.48);

    /* Theme-adaptive decorative tokens */
    --blob-a1: #FDFCFB;
    --blob-a2: #E7E3DD;
    --blob-b1: #E4DDF6;
    --blob-b2: #C9BAEA;
    --veil-hot: rgba(255,255,255,0.9);
    --veil-mid: rgba(255,255,255,0.35);
    --logo-grad-1: #FCFBFA;
    --logo-grad-2: #E9E5E0;
    --btn-primary-1: var(--lavender-deep);
    --btn-primary-2: #8E78C4;
    --particle-color: var(--lavender);
    --paper-opacity: 0.5;

    /* Style-adaptive surface tokens (default = clay, overridden for glass) */
    --surface-bg: var(--clay);
    --surface-blur: none;
    --surface-border: 1px solid transparent;
    --surface-shadow-1: -10px -10px 22px var(--shadow-light);
    --surface-shadow-2: 14px 14px 30px var(--shadow-dark);

    --radius-xl: 40px;
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;

    --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease: cubic-bezier(.22,1,.36,1);
    --theme-speed: 320ms;
  }

  /* ---------------- Dark theme ---------------- */
  :root[data-theme="dark"]{
    --bg: #17151C;
    --bg-deep: #100E14;
    --clay: #221F29;
    --clay-hi: #2C2833;
    --clay-lo: #1B1820;
    --lavender: #9C8FD1;
    --lavender-deep: #B7A6E8;
    --lavender-ink: #C9BFEA;
    --ink: #F1EEF6;
    --ink-soft: #B9B3C7;
    --ink-faint: #79738A;

    --shadow-light: rgba(255,255,255,0.06);
    --shadow-dark: rgba(0,0,0,0.55);
    --shadow-dark-strong: rgba(0,0,0,0.65);

    --blob-a1: #2A2733;
    --blob-a2: #1C1922;
    --blob-b1: #3A3350;
    --blob-b2: #2A2440;
    --veil-hot: rgba(255,255,255,0.08);
    --veil-mid: rgba(255,255,255,0.03);
    --logo-grad-1: #EDE9F5;
    --logo-grad-2: #C9BFE8;
    --btn-primary-2: #7C68B8;
    --particle-color: var(--lavender-deep);
    --paper-opacity: 0.18;
  }

  /* ---------------- Liquid Glass style ---------------- */
  :root[data-style="glass"]{
    --surface-bg: rgba(255,255,255,0.35);
    --surface-blur: blur(18px) saturate(160%);
    --surface-border: 1px solid rgba(255,255,255,0.45);
    --surface-shadow-1: 0 8px 32px rgba(163,152,178,0.25);
    --surface-shadow-2: inset 0 1px 0 rgba(255,255,255,0.4);
  }
  :root[data-theme="dark"][data-style="glass"]{
    --surface-bg: rgba(255,255,255,0.06);
    --surface-border: 1px solid rgba(255,255,255,0.12);
    --surface-shadow-1: 0 8px 32px rgba(0,0,0,0.45);
    --surface-shadow-2: inset 0 1px 0 rgba(255,255,255,0.08);
  }

  *{ margin:0; padding:0; box-sizing:border-box; }

  /* Smooth, theme-wide transitions (300ms) — explicit component transitions
     elsewhere (hover/press states) win via higher specificity. */
  *, *::before, *::after{
    transition: background-color var(--theme-speed) ease,
                border-color var(--theme-speed) ease,
                color var(--theme-speed) ease,
                box-shadow var(--theme-speed) ease;
  }

  html{ scroll-behavior:smooth; }

  body{
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
  }

  /* ---------------- Background: paper texture + radial light + blobs ---------------- */

  .paper-texture{
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: var(--paper-opacity);
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  }

  .light-veil{
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(
      circle at calc(20% + var(--mx, 0) * 1px) calc(15% + var(--my, 0) * 1px),
      var(--veil-hot) 0%,
      var(--veil-mid) 22%,
      rgba(246,245,243,0) 55%
    );
    transition: background-position 0.4s var(--ease);
  }

  .blob-field{
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .blob{
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--blob-a1), var(--blob-a2));
    box-shadow:
      -18px -18px 40px var(--shadow-light),
      22px 22px 50px var(--shadow-dark);
    opacity: 0.65;
    filter: blur(1px);
  }
  .blob--lav{
    background: linear-gradient(145deg, var(--blob-b1), var(--blob-b2));
  }

  .blob-1{ width: 420px; height: 420px; top: -140px; left: -120px; animation: float1 22s ease-in-out infinite; }
  .blob-2{ width: 260px; height: 260px; top: 55%; left: -80px; animation: float2 26s ease-in-out infinite; }
  .blob-3{ width: 340px; height: 340px; top: -80px; right: -140px; animation: float3 24s ease-in-out infinite; }
  .blob-4{ width: 220px; height: 220px; bottom: -100px; right: 8%; animation: float1 19s ease-in-out infinite reverse; }
  .blob-5{ width: 160px; height: 160px; bottom: 12%; left: 12%; animation: float2 30s ease-in-out infinite; }

  @keyframes float1{
    0%,100%{ transform: translate(0,0) scale(1); }
    50%{ transform: translate(30px,40px) scale(1.05); }
  }
  @keyframes float2{
    0%,100%{ transform: translate(0,0) scale(1); }
    50%{ transform: translate(-25px,-30px) scale(0.96); }
  }
  @keyframes float3{
    0%,100%{ transform: translate(0,0) scale(1); }
    50%{ transform: translate(-30px,25px) scale(1.04); }
  }

  .particle{
    position: absolute;
    border-radius: 50%;
    background: var(--particle-color);
    opacity: 0.5;
    box-shadow: 0 0 12px 2px rgba(201,191,232,0.6);
    animation: drift 12s ease-in-out infinite;
  }
  @keyframes drift{
    0%,100%{ transform: translateY(0); opacity: 0.35; }
    50%{ transform: translateY(-22px); opacity: 0.75; }
  }

  /* ---------------- Layout shell ---------------- */

  main{
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* ---------------- Floating theme controls ---------------- */



  .theme-controls{
    position: fixed;
    top: 150px;
    right: 28px;           
    z-index: 50;
    display: flex;
    flex-direction: column;   
    gap: 12px;
}

  .theme-btn{
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: var(--surface-border);
    background: var(--surface-bg);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
                background-color var(--theme-speed) ease, color var(--theme-speed) ease;
  }
  .theme-btn:hover{ transform: translateY(-2px); color: var(--lavender-ink); }
  .theme-btn:active{
    transform: translateY(1px) scale(0.94);
    box-shadow: inset -3px -3px 8px var(--shadow-light), inset 3px 3px 8px var(--shadow-dark);
  }
  .theme-btn[aria-pressed="true"]{ color: var(--lavender-ink); }
  .theme-btn svg{ width: 19px; height: 19px; }

  .icon-moon{ display: none; }
  :root[data-theme="dark"] .icon-sun{ display: none; }
  :root[data-theme="dark"] .icon-moon{ display: block; }

  @media (max-width: 640px){
    .theme-controls{ top: 42px; right: 18px; }
    .theme-btn{ width: 40px; height: 40px; }
  }

  /* Entrance animation is pure CSS, triggered on page load — never
     gated behind JavaScript. Content is guaranteed visible even if
     script.js fails to load, throws, or is served from a stale cache. */
  section{
    animation: sectionIn 0.9s var(--ease) both;
  }
  .features{ animation-delay: 0.1s; }

  @keyframes sectionIn{
    from{ opacity: 0; transform: translateY(28px); }
    to{ opacity: 1; transform: translateY(0); }
  }

  /* ---------------- Hero ---------------- */

  .hero{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 140px 0 100px;
  }

  .icon{ width: 1em; height: 1em; flex-shrink: 0; }

  .badge{
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    color: var(--lavender-ink);
    background: var(--surface-bg);
    border: var(--surface-border);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    padding: 11px 22px;
    border-radius: 999px;
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
    margin-bottom: 44px;
    animation: pulseGlow 4s ease-in-out infinite;
  }
  .badge svg{ width: 15px; height: 15px; }
  @keyframes pulseGlow{
    0%,100%{ box-shadow: var(--surface-shadow-1), var(--surface-shadow-2); }
    50%{ box-shadow: -6px -6px 16px var(--shadow-light), 8px 8px 26px rgba(169,151,214,0.32); }
  }

  .logo{
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(64px, 12vw, 148px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--ink); /* fallback: solid, always-visible color */
    text-shadow:
      -3px -3px 6px rgba(255,255,255,0.9),
      4px 6px 10px rgba(163,152,178,0.35);
    margin-bottom: 22px;
    position: relative;
    filter: drop-shadow(0 14px 22px rgba(163,152,178,0.28));
  }
  /* Only apply the transparent gradient-fill treatment where it's actually supported */
  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .logo{
      background: linear-gradient(160deg, var(--logo-grad-1), var(--logo-grad-2));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
  }

  .subtitle{
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(19px, 2.6vw, 28px);
    line-height: 1.4;
    color: var(--ink);
    margin-bottom: 26px;
  }
  .subtitle span{ color: var(--lavender-ink); }

  .description{
    max-width: 620px;
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink-soft);
    font-weight: 400;
    margin-bottom: 46px;
  }

  .cta-group{
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn{
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.01em;
    border: none;
    cursor: pointer;
    padding: 17px 36px;
    border-radius: var(--radius-md);
    transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  }

  .btn-primary{
    color: #FBFAF9;
    background: linear-gradient(155deg, var(--btn-primary-1), var(--btn-primary-2));
    box-shadow:
      -6px -6px 14px rgba(255,255,255,0.55),
      8px 10px 22px rgba(140,120,180,0.45);
  }
  .btn-primary:hover{ transform: translateY(-2px); box-shadow: -6px -6px 16px rgba(255,255,255,0.6), 10px 14px 28px rgba(140,120,180,0.5); }
  .btn-primary:active{
    transform: translateY(1px) scale(0.98);
    box-shadow: inset -4px -4px 10px rgba(255,255,255,0.25), inset 4px 4px 10px rgba(70,55,105,0.4);
  }

  .btn-secondary{
    color: var(--ink);
    background: var(--surface-bg);
    border: var(--surface-border);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
  }
  .btn-secondary:hover{ transform: translateY(-2px); }
  .btn-secondary:active{
    transform: translateY(1px) scale(0.98);
    box-shadow: inset -4px -4px 10px var(--shadow-light), inset 4px 4px 10px var(--shadow-dark);
  }

  .tagline{
    font-size: 14px;
    color: var(--ink-faint);
    line-height: 1.7;
    letter-spacing: 0.01em;
  }

  /* ---------------- Features ---------------- */

  .features{
    padding: 40px 0 140px;
  }

  .features-head{
    text-align: center;
    margin-bottom: 56px;
  }
  .features-eyebrow{
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lavender-ink);
    margin-bottom: 12px;
  }
  .features-title{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 4vw, 38px);
    color: var(--ink);
  }

  .feature-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
  }

  .feature-card{
    background: var(--surface-bg);
    border: var(--surface-border);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    border-radius: var(--radius-lg);
    padding: 38px 26px;
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
    text-align: left;
    animation: cardFloat 7s ease-in-out infinite;
    transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease),
                background-color var(--theme-speed) ease, border-color var(--theme-speed) ease;
  }
  .feature-card:hover{
    transform: translateY(-6px);
    box-shadow: -10px -10px 24px var(--shadow-light), 18px 20px 36px var(--shadow-dark-strong);
  }
  .feature-card:nth-child(1){ animation-delay: 0s; }
  .feature-card:nth-child(2){ animation-delay: 1.4s; }
  .feature-card:nth-child(3){ animation-delay: 2.8s; }
  .feature-card:nth-child(4){ animation-delay: 4.2s; }

  @keyframes cardFloat{
    0%,100%{ transform: translateY(0); }
    50%{ transform: translateY(-9px); }
  }

  .feature-icon{
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: linear-gradient(150deg, var(--blob-a1), var(--blob-a2));
    box-shadow:
      -5px -5px 10px var(--shadow-light),
      6px 6px 14px var(--shadow-dark);
    margin-bottom: 22px;
    color: var(--lavender-ink);
  }
  .feature-icon svg{ width: 24px; height: 24px; }

  .feature-card h3{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--ink);
  }
  .feature-card p{
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--ink-soft);
  }

  /* ---------------- Footer ---------------- */

  .site-footer{
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 64px 32px 40px;
  }

  .footer-grid{
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
  }

  .footer-brand-desc{
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-soft);
    max-width: 320px;
    margin-top: 16px;
  }

  .footer-col h4{
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 18px;
  }

  .footer-links{
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .footer-links a{
    font-size: 14.5px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s var(--ease);
  }
  .footer-links a:hover{ color: var(--lavender-ink); }

  .footer-contact{
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .footer-contact-item{
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14.5px;
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s var(--ease);
  }
  .footer-contact-item:hover{ color: var(--lavender-ink); }
  .footer-contact-item svg{ width: 16px; height: 16px; flex-shrink: 0; color: var(--lavender-ink); }

  /* Clickable "Developed by" block */
  .brand-mark{
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 10px 14px 10px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color var(--theme-speed) ease;
  }
  .brand-mark:hover{
    transform: translateY(-2px);
    background: var(--surface-bg);
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
  }
  .brand-mark-glyph{
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(150deg, var(--blob-a1), var(--blob-b1));
    box-shadow:
      -4px -4px 9px var(--shadow-light),
      5px 5px 12px var(--shadow-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 13px;
    color: var(--lavender-ink);
    flex-shrink: 0;
  }
  .brand-mark-text{ line-height: 1.35; }
  .brand-mark-text .label{
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    display: block;
  }
  .brand-mark-text .name{
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-soft);
    display: block;
  }

  .footer-bottom{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 32px;
    border-top: 1px solid var(--clay-lo);
  }

  .social-row{
    display: flex;
    gap: 14px;
  }
  .social-btn{
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface-bg);
    border: var(--surface-border);
    backdrop-filter: var(--surface-blur);
    -webkit-backdrop-filter: var(--surface-blur);
    box-shadow: var(--surface-shadow-1), var(--surface-shadow-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), color 0.2s var(--ease);
  }
  .social-btn:hover{ transform: translateY(-3px); color: var(--lavender-ink); }
  .social-btn:active{
    transform: translateY(1px) scale(0.95);
    box-shadow: inset -3px -3px 8px var(--shadow-light), inset 3px 3px 8px var(--shadow-dark);
  }
  .social-btn svg{ width: 18px; height: 18px; }

  .copyright{
    text-align: right;
    font-size: 12.5px;
    color: var(--ink-faint);
    line-height: 1.7;
  }

  @media (max-width: 860px){
    .footer-grid{ grid-template-columns: 1fr 1fr; }
  }

  /* ---------------- Focus states ---------------- */
  a:focus-visible, button:focus-visible{
    outline: 2.5px solid var(--lavender-deep);
    outline-offset: 3px;
  }

  /* ---------------- Responsive ---------------- */

  @media (max-width: 980px){
    .feature-grid{ grid-template-columns: repeat(2, 1fr); }
  }

  @media (max-width: 640px){
    main{ padding: 0 20px; }
    .hero{ padding: 110px 0 80px; }
    .logo{ font-size: clamp(52px, 18vw, 90px); }
    .description{ font-size: 15.5px; }
    .feature-grid{ grid-template-columns: 1fr; }
    .site-footer{ padding: 56px 20px 32px; }
    .footer-grid{ grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom{ flex-direction: column; align-items: center; text-align: center; }
    .social-row{ justify-content: center; }
    .copyright{ text-align: center; }
  }

  @media (prefers-reduced-motion: reduce){
    *{ animation: none !important; transition: none !important; }
    section{ opacity: 1; transform: none; }
  }