/* Study home: hero, tide chart, vitals chips, and the logbook.
   Brand tokens come from theme.css. */

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

.study-hero {
  padding-top: 0.5rem;
}

.study-eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.study-headline {
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.01em;
  margin: 0.35rem 0 0.4rem;
}

.study-due {
  color: var(--accent-deep);
}

.study-lede {
  color: var(--muted);
  max-width: 34rem;
  margin-bottom: 1.25rem;
}

.study-lede b {
  color: var(--ink);
  font-weight: 600;
}

.study-cta {
  padding-inline: 1.4rem;
}

/* ---------- the tide ---------- */

.study-tide {
  margin-top: 2rem;
}

.study-tide-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.study-section-title {
  font-size: 1.05rem;
  margin: 0;
}

.study-tide-sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.study-tide-sub strong {
  color: var(--ink);
  font-weight: 600;
}

.study-tide-chart {
  position: relative;
}

.study-tide-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.study-tide-line {
  transition: stroke-dashoffset 1.4s ease-out;
}

.study-tide-tip {
  position: absolute;
  transform: translate(-50%, -130%);
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.study-tide-tip.is-visible {
  opacity: 1;
}

.study-tide-days {
  display: flex;
}

.study-tide-days span {
  flex: 1;
  font-size: 0.7rem;
  color: var(--muted);
}

/* ---------- vitals chips ---------- */

.study-chips {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 1.25rem 0 0.35rem;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.study-chips::-webkit-scrollbar {
  display: none;
}

.study-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

a.study-chip:hover {
  background: color-mix(in srgb, var(--wash) 42%, var(--card));
  color: inherit;
}

.study-chip-v {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
}

.study-chip-k {
  font-size: 0.78rem;
  color: var(--muted);
}

.study-chip-week {
  display: flex;
  gap: 0.18rem;
}

.study-chip-week i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--wash);
}

.study-chip-week i.is-hit {
  background: var(--accent);
}

.study-chip-week i.is-today {
  box-shadow: 0 0 0 1.5px var(--card), 0 0 0 3px var(--accent);
}

/* ---------- the logbook ---------- */

.study-journal {
  margin-top: 1.5rem;
}

.study-journal .study-section-title {
  margin-bottom: 0.75rem;
}

.study-entry {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}

.study-entry:hover {
  background: color-mix(in srgb, var(--wash) 42%, var(--card));
  color: inherit;
}

.study-entry.is-live {
  border-color: color-mix(in srgb, var(--moss) 45%, var(--line));
}

.study-entry-top {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.study-entry-focus {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-out {
  flex-shrink: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.76rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
}

.study-out-clear {
  color: var(--moss);
  background: var(--moss-wash);
}

.study-out-limit {
  color: var(--accent-deep);
  background: var(--wash);
}

.study-out-time {
  color: var(--sea);
  background: var(--sea-wash);
}

.study-out-early {
  color: var(--muted);
  background: color-mix(in srgb, var(--wash) 55%, transparent);
}

.study-out-live {
  color: var(--moss);
  background: var(--moss-wash);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.study-pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--moss);
  animation: study-pulse 1.6s ease-in-out infinite;
}

@keyframes study-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Every review in the session, one dot, in the order they landed:
   moss set in stone, gold solidifying, rose still absorbing. */
.study-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0.55rem 0 0.35rem;
}

.study-dots i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--wash);
}

.study-dots i.study-dot-q3 {
  background: var(--moss);
}

.study-dots i.study-dot-q2 {
  background: var(--gold);
}

.study-dots i.study-dot-q1 {
  background: var(--rose);
}

.study-dots i.study-dot-pending {
  background: transparent;
  border: 1.5px dashed var(--line);
}

.study-entry-meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.study-empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 0;
}

@media (prefers-reduced-motion: reduce) {
  .study-pulse {
    animation: none;
  }

  .study-tide-line {
    transition: none;
    stroke-dashoffset: 0 !important;
  }

  .study-tide-tip {
    transition: none;
  }
}
