/* ALMA — hybrid skin (child playful + parent minimal)
   works on top of PicoCSS (loaded via CDN)

   design principles:
   - no gamification, no scores, no leaderboards
   - low cognitive load for neurodivergent users
   - large touch targets (min 44px)
   - clear visual hierarchy with color
   - reduced motion support
   - high contrast focus indicators
*/

/* ===== tokens ===== */
:root{
  --alma-radius-xl: 24px;
  --alma-radius-lg: 18px;
  --alma-radius-md: 14px;

  --alma-shadow: 0 10px 30px rgba(0,0,0,.08);

  /* inner (i feel) anchor families */
  --c-joy: #FFD54D;
  --c-sadness: #4D8DFF;
  --c-anger: #FF4D4D;
  --c-fear: #8F5BFF;
  --c-calm: #35C76A;
  --c-surprise: #FF9A3D;

  /* outer (i see) anchor families */
  --c-pleasant: #FFF1C2;
  --c-unpleasant: #9AA3AF;
  --c-excellence: #F6C945;
  --c-care: #2FB7A3;
  --c-tasteful: #FF6EC7;
  --c-untasteful: #8B5E3C;

  --alma-ink: #101828;
  --alma-muted: #667085;
  --alma-bg: #fafafa;

  /* focus ring */
  --alma-focus: #4D8DFF;
  --alma-focus-offset: 3px;
}

/* ===== base ===== */
body{
  background: var(--alma-bg);
}

/* ===== accessibility: focus ===== */
*:focus-visible{
  outline: 2px solid var(--alma-focus);
  outline-offset: var(--alma-focus-offset);
  border-radius: 4px;
}

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

/* ===== layout ===== */
.alma-container{
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
}

/* ===== topbar ===== */
.alma-topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--alma-radius-md);
  background: rgba(0,0,0,.03);
}

.alma-brand{
  display:flex;
  align-items:baseline;
  gap:.5rem;
  font-weight: 700;
  letter-spacing: .2px;
}
.alma-brand a{
  text-decoration: none;
  color: inherit;
}
.alma-brand small{
  font-weight: 500;
  color: var(--alma-muted);
}

/* nav pills */
.alma-mode{
  display:flex;
  gap:.35rem;
  align-items:center;
  flex-wrap: wrap;
}
.alma-mode a{
  text-decoration:none;
  font-weight: 600;
  padding: .45rem .7rem;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: white;
  color: var(--alma-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.alma-mode a.active{
  background: var(--alma-ink);
  color: white;
  border-color: var(--alma-ink);
}
.alma-mode a:hover:not(.active){
  background: rgba(0,0,0,.06);
}

/* ===== child picker ===== */
.alma-child-picker{
  display:flex;
  gap:.5rem;
  align-items:center;
  flex-wrap:wrap;
  padding: .5rem 0;
}
.picker-label{
  font-weight: 800;
  color: var(--alma-muted);
  margin-right: .25rem;
}
.picker-chip{
  text-decoration: none;
  font-weight: 800;
  padding: .5rem .85rem;
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.10);
  background: white;
  color: var(--alma-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: background 120ms ease, border-color 120ms ease;
}
.picker-chip:hover{
  background: rgba(0,0,0,.04);
}
.picker-chip.active{
  background: var(--alma-ink);
  color: white;
  border-color: var(--alma-ink);
}

/* ===== hero / content sections ===== */
.alma-hero{
  margin-top: 1rem;
  display:grid;
  gap: 1rem;
}

.alma-title{
  display:flex;
  flex-direction:column;
  gap:.25rem;
}
.alma-title h1{
  margin: 0;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
}
.alma-title p{
  margin: 0;
  color: var(--alma-muted);
}

/* ===== main tiles (i feel / i see) ===== */
.alma-tiles{
  display:grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px){
  .alma-tiles{
    grid-template-columns: 1fr 1fr;
  }
}

.alma-tile{
  border-radius: var(--alma-radius-xl);
  padding: 1.25rem;
  box-shadow: var(--alma-shadow);
  border: 1px solid rgba(0,0,0,.06);
  display:flex;
  flex-direction:column;
  gap:.75rem;
  text-decoration:none;
  color: var(--alma-ink);
  position:relative;
  overflow:hidden;
  min-height: 160px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.alma-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,.12);
}
.alma-tile:active{
  transform: scale(.98);
}

.alma-tile .kicker{
  font-size:.95rem;
  font-weight:700;
  opacity:.9;
}
.alma-tile .label{
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .2px;
  margin:0;
}
.alma-tile .hint{
  margin:0;
  color: rgba(0,0,0,.60);
  font-weight: 600;
}

/* soft mascot blob (pure CSS, decorative) */
.blob{
  position:absolute;
  right: 18px;
  top: 18px;
  width: 62px;
  height: 62px;
  border-radius: 22px;
  transform: rotate(8deg);
  opacity: .22;
  filter: saturate(1.1);
  pointer-events: none;
}

/* color utilities */
.bg-feel{ background: linear-gradient(135deg, rgba(77,141,255,.25), rgba(53,199,106,.15)); }
.bg-see{  background: linear-gradient(135deg, rgba(246,201,69,.25), rgba(255,110,199,.12)); }

.blob-feel{ background: var(--c-sadness); }
.blob-see{ background: var(--c-excellence); }

/* ===== lens grids (feel/see pages) ===== */
.lens-grid{
  display:grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
@media (min-width: 720px){
  .lens-grid{ grid-template-columns: 1fr 1fr; }
}

.lens-tile{
  border-radius: var(--alma-radius-xl);
  padding: 1.15rem;
  box-shadow: var(--alma-shadow);
  border: 1px solid rgba(0,0,0,.06);
  text-decoration:none;
  color: var(--alma-ink);
  position:relative;
  overflow:hidden;
  min-height: 120px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:.6rem;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.lens-tile:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,.12);
}
.lens-tile:active{
  transform: scale(.98);
}

.lens-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(0,0,0,.06);
  font-weight: 700;
}
.dot{
  width: 14px; height: 14px;
  border-radius: 999px;
  display:inline-block;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.lens-name{
  margin: 0;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: .2px;
}
.lens-hint{
  margin: 0;
  color: rgba(0,0,0,.60);
  font-weight: 600;
}

/* ===== buttons ===== */
.btn-row{
  display:flex;
  gap:.65rem;
  flex-wrap:wrap;
  margin-top: .85rem;
}
.btn-pill{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.7rem 1.1rem;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.10);
  font-weight:900;
  min-height: 44px;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}
.btn-pill:active{
  transform: scale(.97);
}
.btn-primary{
  background: var(--alma-ink);
  color: #fff;
  border-color: var(--alma-ink);
}
.btn-primary:hover{
  background: #1d2939;
}
.btn-secondary{
  background: rgba(0,0,0,.03);
  color: var(--alma-ink);
}
.btn-secondary:hover{
  background: rgba(0,0,0,.07);
}

/* ===== parent panels ===== */
.alma-panel{
  border-radius: var(--alma-radius-lg);
  padding: 1rem;
  border: 1px solid rgba(0,0,0,.08);
  background: white;
}

.alma-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: .75rem;
  flex-wrap: wrap;
}

.muted-label{
  color: var(--alma-muted);
  font-weight:700;
}

/* ===== save banner ===== */
.save-banner{
  margin-top: .75rem;
  padding: .75rem 1rem;
  border-radius: var(--alma-radius-md);
  background: color-mix(in srgb, var(--c-calm) 15%, white);
  border: 1px solid color-mix(in srgb, var(--c-calm) 30%, transparent);
}

/* ===== footer ===== */
.alma-footer{
  margin-top: 1.25rem;
  color: var(--alma-muted);
  font-size: .95rem;
}
.alma-footer a{
  color: var(--alma-ink);
  font-weight: 700;
}

/* ===== high contrast mode ===== */
@media (prefers-contrast: more){
  .alma-tile,
  .lens-tile,
  .picker-chip,
  .alma-mode a{
    border-width: 2px;
    border-color: var(--alma-ink);
  }
  .alma-mode a.active,
  .picker-chip.active{
    outline: 2px solid var(--alma-ink);
    outline-offset: 2px;
  }
  .chip, .dot{
    border: 1px solid rgba(0,0,0,.3);
  }
}
