/* Container for radio buttons and circle */
.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 4rem;
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.circle-container {
  --base-rotation: -90deg;
  --full-circle: 360deg;
  
  --items: 25;
  --radius: 30vw;
  --size: calc(var(--radius) * 2);
  --labels-offset: calc(var(--radius) + 1rem);
  /* Total number of items */

  position: relative;
  width: var(--size);
  height: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #ddd;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease-in-out;
}
@media (max-width: 800px) {
  .circle-container {
    --radius: 40vw;
  }
}
@media (min-width: 1200px) {
  .circle-container {
    --radius: 20vw;
  }
}
/*
.wrapper::after{
  content: '';
  position: absolute;
  inset: 40% 0 0 0;
  outline: 1px dashed red;
  background-image: linear-gradient(transparent, var(--clr-bg));
}
*/
.years {
  position: absolute;
  margin: 0;
  padding: 0;
  list-style: none;
  width: 100%;
  height: 100%;
}

.years li {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: 0 0;
  transform: rotate(calc(var(--i) * 360deg / var(--items)))
    translateX(var(--labels-offset));
}
.years li > * {
  transform: rotate(90deg);
  transform-origin: center;
  position: absolute;
}
.years li > label {
  cursor: pointer;
  color: var(--label-color, #fff); font-weight:900; 
  /*outline: 1px dashed red;*/
}
.years li > div {
  width: 300px;
  top: -45px; text-align:center;
  right: 50px;
  /*outline: 1px dotted red;*/
  font-size: 0.9rem;
  transition: 0ms ease-in-out;
  pointer-events: none;
  opacity: var(--item-opacity, 0);
  translate: var(--item-x, -10px) 0;
}

.years li > label::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  translate: -50% 45px;
  width: 2px;
  height: var(--line-height, 0px);
  background-color: #006730;
  transition: height 300ms ease-in-out;
}
.years li > label::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: var(--dot-color, #ccc);
  border-radius: 50%;
  top: 2.35rem;
  left: 50%;
  translate: -50% 0;
  transition: background-color 300ms ease-in-out;
}
.years li > label:hover::after {
  --dot-color: #006730;
}


/* Hide radio buttons */
input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
input:checked ~ label {
  --dot-color: #006730;
  --label-color: #006730;
}
input:checked ~ label::before {
  --line-height: 60px;
  transition-delay: 300ms;
  transition-duration: 300ms;
}

/* texts */
input:checked ~ div {
  --item-opacity: 1;
  --item-x: 0;
  transition-delay: 600ms;
  transition-duration: 300ms;
}

.circle-container:has(input:checked) {
  transform: rotate(calc(var(--base-rotation) - (var(--index) * var(--full-circle) / var(--items))));
}
/*
this would be so much simpler if we could use counter values as custom property values
*/
.circle-container:has(input#event-2000:checked) { --index: 0; }
.circle-container:has(input#event-2001:checked) { --index: 1; }
.circle-container:has(input#event-2002:checked) { --index: 2; }
.circle-container:has(input#event-2003:checked) { --index: 3; }
.circle-container:has(input#event-2004:checked) { --index: 4; }
.circle-container:has(input#event-2005:checked) { --index: 5; }
.circle-container:has(input#event-2006:checked) { --index: 6; }
.circle-container:has(input#event-2007:checked) { --index: 7; }
.circle-container:has(input#event-2008:checked) { --index: 8; }
.circle-container:has(input#event-2009:checked) { --index: 9; }
.circle-container:has(input#event-2010:checked) { --index: 10; }
.circle-container:has(input#event-2011:checked) { --index: 11; }
.circle-container:has(input#event-2012:checked) { --index: 12; }
.circle-container:has(input#event-2013:checked) { --index: 13; }
.circle-container:has(input#event-2014:checked) { --index: 14; }
.circle-container:has(input#event-2015:checked) { --index: 15; }
.circle-container:has(input#event-2016:checked) { --index: 16; }
.circle-container:has(input#event-2017:checked) { --index: 17; }
.circle-container:has(input#event-2018:checked) { --index: 18; }
.circle-container:has(input#event-2019:checked) { --index: 19; }
.circle-container:has(input#event-2020:checked) { --index: 20; }
.circle-container:has(input#event-2021:checked) { --index: 21; }
.circle-container:has(input#event-2022:checked) { --index: 22; }
.circle-container:has(input#event-2023:checked) { --index: 23; }
.circle-container:has(input#event-2024:checked) { --index: 24; }
.circle-container:has(input#event-2025:checked) { --index: 25; }
.circle-container:has(input#event-2026:checked) { --index: 26; }
.circle-container:has(input#event-2027:checked) { --index: 27; }
.circle-container:has(input#event-2028:checked) { --index: 28; }
.circle-container:has(input#event-2029:checked) { --index: 12; }


/* general styling */
*,
::before,
::after {
  box-sizing: border-box;
}
:root {
  --clr-bg: #222;
  --clr-primary: #f5f5f5;
  --clr-secondary: #075985;
}
html {
 /* background-color: var(--clr-bg);*/
  font-family: system-ui;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  line-height: 1.4;
  color: var(--clr-primary);
  padding: 1rem;
  margin: 0; background:none;
 /* background-image: radial-gradient(
    circle,
    rgba(175, 208, 84, 0.25) 1px,
    rgba(0, 0, 0, 0) 1px
  );
  background-size: 40px 40px;
  background-attachment: fixed;*/
}
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}
h1 {
  font-size: clamp(1rem, 2.5vw + 0.25rem, 1.2rem);
  font-weight: 500;
  line-height: 1.6;
}
code,
pre {
  display: inline-block;
  color: #38bdf8;
  border: 1px solid hsl(from var(--clr-primary) h s 50% / 0.5);
  padding: 0.5rem 1rem;
  border-radius: 5px;
}
pre {
  white-space: pre-wrap;
}
em {
  font-size: 0.8rem;
}
