:root{
  --bg: #f6f0ff;
  --panel: rgba(255,255,255,0.86);
  --panelSolid: #ffffff;

  --text: #1f1430;
  --muted: rgba(31,20,48,0.70);

  --purple: #4b1b7a;
  --purple2: #6b2aa6;

  --green: #66d16e;
  --cream: #fff3d6;

  --border: rgba(31,20,48,0.12);
  --shadow: 0 18px 55px rgba(31,20,48,0.14);

  --r: 18px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin:0;
  font-family: 'Comfortaa', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #ffffff 0%, var(--bg) 55%, #ffffff 120%);
}

/* Top bar */
.top-bar{
  height: 26px;
  background: linear-gradient(90deg, var(--purple), var(--purple2));
}

/* Header */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246,240,255,0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
}

.frog{
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(31,20,48,0.10);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.frog-img{
  width: 34px;
  height: 34px;
  cursor: pointer;
  transform: translateZ(0);
  transition: transform 0.25s ease;
  user-select: none;
}

.frog-img.flip{
  transform: scaleX(-1);
}

.brand-text h1{
  margin:0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.subhead{
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 300;
}

/* Nav */
.nav{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

.pill{
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.pill:hover{
  transform: translateY(-1px);
  border-color: rgba(75,27,122,0.30);
  background: rgba(255,255,255,0.85);
}

.pill.ghost{
  background: transparent;
}

/* Layout */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 24px;
}

/* Hero */
.hero{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.hero-left{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero-kicker{
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
}

.hero-price{
  margin-top: 10px;
  display:flex;
  align-items:baseline;
  gap: 6px;
}

.hero-price span{
  font-size: 3.8rem;
  font-weight: 700;
  color: var(--purple);
  line-height: 1;
}

.hero-unit{
  font-size: 1.35rem;
  font-weight: 700;
  color: rgba(75,27,122,0.75);
}

.hero-delta{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}

.delta-pill{
  display:inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(102,209,110,0.16);
  border: 1px solid rgba(102,209,110,0.28);
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}

.hero-muted{
  color: var(--muted);
  font-weight: 300;
}

.hero-meta{
  margin-top: 14px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.meta-item{
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(31,20,48,0.10);
  border-radius: 16px;
  padding: 10px 12px;
}

.meta-label{
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
}

.meta-value{
  margin-top: 6px;
  font-size: 1.05rem;
  font-weight: 700;
}

.hero-note{
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
}

.hero-right .callout{
  height: 100%;
  background:
    radial-gradient(circle at top left, rgba(102,209,110,0.14), transparent 60%),
    radial-gradient(circle at bottom right, rgba(107,42,166,0.12), transparent 60%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 18px;
}

.callout-title{
  font-weight: 700;
  color: var(--text);
  font-size: 1rem;
}

.callout-list{
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
}

.callout-list strong{
  color: var(--text);
  font-weight: 700;
}

.callout-foot{
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
}

/* Cards */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.card h2{
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.muted{
  color: var(--muted);
  font-weight: 300;
}

/* Card head + controls */
.card-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.controls{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}

.btn{
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.62);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(75,27,122,0.30);
  background: rgba(255,255,255,0.90);
}

.btn.ghost{
  background: transparent;
}

/* Select */
.select{
  display:flex;
  align-items:center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.62);
}

.select-label{
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
}

select{
  border: none;
  background: transparent;
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  color: var(--text);
  outline: none;
}

/* Chart */
.chart-card{
  background:
    radial-gradient(circle at top left, rgba(102,209,110,0.16), transparent 60%),
    radial-gradient(circle at bottom right, rgba(107,42,166,0.14), transparent 60%),
    var(--panel);
}

.chart-wrap{
  position: relative;
  border: 1px solid rgba(31,20,48,0.10);
  background: rgba(255,255,255,0.65);
  border-radius: 16px;
  padding: 10px;
  overflow: hidden;
}

#freddoChart{
  width: 100%;
  height: 380px;
  display:block;
}

/* Custom tooltip */
.chart-tooltip{
  position:absolute;
  pointer-events:none;
  opacity: 0;
  transform: translate(-50%, -14px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(75,27,122,0.22);
  border-radius: 14px;
  box-shadow: 0 16px 42px rgba(31,20,48,0.18);
  padding: 10px 12px;
  min-width: 150px;
}

.chart-tooltip.visible{
  opacity: 1;
  transform: translate(-50%, -18px);
}

.tooltip-year{
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
}

.tooltip-price{
  margin-top: 4px;
  display:flex;
  align-items:center;
  gap: 8px;
  font-weight: 700;
  color: var(--purple);
  font-size: 1.15rem;
}

.tooltip-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  border: 2px solid var(--purple);
}

/* Legend row */
.legend-row{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.85rem;
}

.legend-item{
  display:flex;
  align-items:center;
  gap: 8px;
}

.dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display:inline-block;
}

.dot-hi{ background: rgba(102,209,110,0.85); }
.dot-med{ background: rgba(107,42,166,0.50); }
.dot-lo{ background: rgba(31,20,48,0.22); }

/* Two column grid below graph */
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Timeline */
.timeline{
  margin-top: 12px;
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.t-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(31,20,48,0.10);
}

.t-left{
  display:flex;
  flex-direction: column;
  gap: 4px;
}

.t-year{
  font-weight: 700;
}

.t-note{
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
}

.t-right{
  font-weight: 700;
  color: var(--purple);
}

/* Score */
.score{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items:center;
}

.score-ring{
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background:
    conic-gradient(var(--green) 0deg, rgba(102,209,110,0.22) 0deg);
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(31,20,48,0.10);
}

.score-inner{
  width: 118px;
  height: 118px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(31,20,48,0.10);
}

.score-num{
  font-weight: 700;
  font-size: 2rem;
  color: var(--purple);
}

.score-label{
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 300;
}

.score-list{
  display:flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
}

.score-item strong{
  color: var(--text);
  font-weight: 700;
}

/* Table */
.table-wrap{
  overflow:auto;
  border-radius: 16px;
  border: 1px solid rgba(31,20,48,0.10);
  background: rgba(255,255,255,0.62);
}

.data-table{
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th, .data-table td{
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(31,20,48,0.08);
  font-size: 0.92rem;
}

.data-table th{
  font-weight: 700;
  color: var(--text);
  background: rgba(255,255,255,0.78);
}

.tag{
  display:inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid rgba(31,20,48,0.12);
}

.tag.high{ background: rgba(102,209,110,0.16); }
.tag.medium{ background: rgba(107,42,166,0.12); }
.tag.low{ background: rgba(31,20,48,0.08); }

/* Details */
.details{
  border: 1px solid rgba(31,20,48,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.62);
  padding: 10px 12px;
  margin-top: 10px;
}

.details summary{
  cursor: pointer;
  font-weight: 700;
}

.details-body{
  margin-top: 10px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
}

.details-body ul{
  margin: 10px 0 0;
  padding-left: 18px;
}

/* Fun card */
.fun-card{
  background:
    radial-gradient(circle at top left, rgba(255,243,214,0.75), transparent 55%),
    radial-gradient(circle at bottom right, rgba(102,209,110,0.12), transparent 55%),
    var(--panel);
}

.fun-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.fun-body{
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(31,20,48,0.10);
  background: rgba(255,255,255,0.62);
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
}

/* Footer */
.footer{
  margin-top: 14px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.50);
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-title{
  font-weight: 700;
}

.footer-sub{
  margin-top: 6px;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.9rem;
}

.link{
  color: var(--purple2);
  text-decoration: underline;
  font-weight: 700;
}

.sep{
  padding: 0 8px;
  opacity: 0.6;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 900px){
  .hero{
    grid-template-columns: 1fr;
  }
  .hero-meta{
    grid-template-columns: 1fr;
  }
  .grid-2{
    grid-template-columns: 1fr;
  }
  .score{
    grid-template-columns: 1fr;
  }
  #freddoChart{
    height: 320px;
  }
}
