/* ========================================
   FONT DEFINITIONS
   ======================================== */

.instrument-sans-medium {
  font-family: "Inria Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-variation-settings:
    "width" 100;
}

.instrument-sans-bold {
  font-family: "Inria Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
  font-variation-settings:
    "width" 100;
}

.instrument-sans-regular {
  font-family: "Inria Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings:
    "width" 100;
}

.inria-sans-light {
  font-family: "Inria Sans", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.inria-sans-regular {
  font-family: "Inria Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.inria-sans-bold {
  font-family: "Inria Sans", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.inria-sans-light-italic {
  font-family: "Inria Sans", sans-serif;
  font-weight: 300;
  font-style: italic;
}

.inria-sans-regular-italic {
  font-family: "Inria Sans", sans-serif;
  font-weight: 400;
  font-style: italic;
}

.inria-sans-bold-italic {
  font-family: "Inria Sans", sans-serif;
  font-weight: 700;
  font-style: italic;
}

.inria-serif-light {
  font-family: "Inria Serif", serif;
  font-weight: 300;
  font-style: normal;
}

.inria-serif-regular {
  font-family: "Inria Serif", serif;
  font-weight: 400;
  font-style: normal;
}

.inria-serif-bold {
  font-family: "Inria Serif", serif;
  font-weight: 700;
  font-style: normal;
}

.inria-serif-light-italic {
  font-family: "Inria Serif", serif;
  font-weight: 300;
  font-style: italic;
}

.inria-serif-regular-italic {
  font-family: "Inria Serif", serif;
  font-weight: 400;
  font-style: italic;
}

.inria-serif-bold-italic {
  font-family: "Inria Serif", serif;
  font-weight: 700;
  font-style: italic;
}

.gaegu-regular {
  font-family: "Gaegu", sans-serif;
  font-weight: 400;
  font-style: normal;
}


/* ========================================
   GLOBAL STYLES
   ======================================== */

body {
  color: black;
  /* background-color: oklch(0.99 0.02 100.59); */
  /* padding: 3rem 15rem; */
  max-width: 800px;
  margin: auto;
  /* padding-top: 5rem; */
  padding: 2rem 2rem 3rem;
  --grid-size: 30px;
  --grid-strength: 1px;
  --grid-dash: 10px;
  --grid-gap: 5px;
  --grid-color: oklch(0.94 0.01 100.59);
  --paper-color: oklch(0.97 0.01 100.59);
  background-attachment: fixed;
  background-color: var(--paper-color);
  background-size: var(--grid-dash) var(--grid-dash), var(--grid-size) var(--grid-size);
  background-image:
    linear-gradient(to bottom, transparent var(--grid-gap), var(--paper-color) var(--grid-gap)),
    linear-gradient(to right, var(--grid-color) var(--grid-strength), transparent var(--grid-strength)),
    linear-gradient(to right, transparent var(--grid-gap), var(--paper-color) var(--grid-gap)),
    linear-gradient(to bottom, var(--grid-color) var(--grid-strength), transparent var(--grid-strength));
}

.circle {
  display: inline-block;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-left: 0.5rem;
}

h1 {
  view-transition-name: header;
}

h2 {
  font-size: clamp(1.5rem, 3vw + 0.75rem, 2.75rem);
  line-height: 1.2;
}

/* ========================================
   MAIN SECTION LAYOUT
   ======================================== */

.description-box {
  background: oklch(0.94 0.02 100.59);
  color: #333;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.5rem;
  width: fit-content;
  font-size: 1rem;
  margin-bottom: 3rem;
}

.main-section-entry {
  display: inline-flex;
  gap: 1rem;
  margin-bottom: 5rem;
  flex-direction: row;
}

.main-section-entry h2 {
  padding-right: 4rem;
  margin: 0;
  width: 30%;
  min-width: 30%;
  text-align: right;
  padding-bottom: 1rem;
}

/* ========================================
   WORK & EDUCATION SECTION
   ======================================== */

.bullet {
  width: 40px;
  height: 40px;
  background-color: oklch(0.877 0.0231 78.2);
  border-radius: 50%;
  flex-shrink: 0;
  background-image: url("/static/images/briefcase-2.png");
  background-size: 20px;
  background-repeat: no-repeat;
  background-position: center;
}

.education {
  background-image: url("/static/images/education.png");
}

.main-section-work {
  display: flex;
  gap: 1rem;
}

.bullet-part {
  display: flex;
  flex-direction: column;
  align-items: center;
}

div.vertical-line {
  width: 1px;
  background-color: rgba(0, 0, 0, 0.15);
  height: 100%;
  float: left;
}

.main-section-work-content-description {
  padding-bottom: 3rem;
}

.main-section-work-content a {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

/* ========================================
   AWARDS & CERTIFICATES SECTION
   ======================================== */

.main-section-awards {
  display: flex;
  gap: 2rem;
  flex-direction: column;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
}

.main-section-award {
  width: 40%;
  background-color: oklch(0.877 0.0231 78.2);
  padding: 0.5rem 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: baseline;
}

.main-section-award a {
  margin-bottom: 1rem;
  margin-top: auto;
  left: 10px;
  bottom: 10px;
}

.active .main-section-award-description {
  margin-bottom: 4rem;
}

.inactive {
  background-color: oklch(0.897 0.0031 78.2);
  color: oklch(0.407 0.0031 78.2);
}

/* ========================================
   VOLUNTEER SECTION
   ======================================== */

.main-section-volunteer-entry {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid lightgray;
  padding-bottom: 2rem;
  flex-direction: row-reverse;
  gap: 3rem;
}

.main-section-volunteer-entry-description {
  max-width: 60%;
}

.main-section-volunteer-entry-right {
  text-align: left;
}

/* ========================================
   GENERAL COMPONENTS
   ======================================== */

.btn {
  background-color: black;
  cursor: pointer;
  box-shadow: rgba(0, 0, 0, 0.24) 3px 3px;
  transition: all .2s ease-in-out;
  color: white;
  text-decoration: none;
  padding: 0.5rem;
}

.btn:hover {
  transform: scale(1.1);
}

.btn-navigation {
  color: black;
  background-color: oklch(0.97 0.01 100.59);
}

.navigation-cont {
  view-transition-name: navigation;
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
}

.link-btn {
  max-width: 30px;
  max-height: 30px;
  border-radius: 5rem;
}

.description-box-cont {
  display: inline-flex;
  gap: 2rem;
  flex-direction: row;
}

.footer {
  border-top: 1px solid oklch(0 0 0 / 10%);
  padding-top: 1rem;
  color: oklch(0 0 0 / 30%);
}

.footer a {
  color: oklch(0 0 0 / 40%);
  view-transition-name: footer;
}

@view-transition {
  navigation: auto;
}

/* ========================================
   FOOTER
   ======================================== */

.footer-floating {
  position: fixed;
  bottom: 0;
  right: 80;
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 1rem;
  view-transition-name: footer-floating;
}

.footer-floating .email {
  color: black;
}

/* ========================================
   MEDIA QUERIES
   ======================================== */

@media (max-width: 768px) {
  .main-section-entry {
    flex-direction: column;
    gap: 2rem;
  }

  .main-section-entry h2 {
    text-align: left;
    width: 100%;
    padding-right: 0;
  }

  .main-section-awards .active {
    flex-direction: column;
  }

  .main-section-award {
    min-width: 100%;
    padding: 0;
  }

  .main-section-award p {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .main-section-award a {
    margin-left: 1rem;
    margin-right: 1rem;
  }

  .active .main-section-award-description {
    margin-bottom: 5rem;
  }

  .footer-floating {
    position: fixed;
    bottom: 189px;
    right: 8;
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 1rem;
  }

  .footer-floating .email {
    color: #ababab;
    transform: rotate(90deg);
    position: absolute;
    left: 23px;
    bottom: -22;
    right: 80;
  }

  .description-box-cont {
    flex-direction: column;
  }
}

/* ==========================================================================
   Sport selector — top-level toggle between Premier League and ATP Tennis
   ========================================================================== */

.sport-selector {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 1.5rem 1.5rem 0;
}

.sport-selector__btn {
  font-family: 'Inria Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 1.4rem;
  border: 2px solid oklch(0.82 0.02 100);
  background: transparent;
  color: oklch(0.45 0.02 100);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.sport-selector__btn:hover {
  border-color: oklch(0.55 0.03 100);
  color: oklch(0.2 0.01 100);
}

.sport-selector__btn--active {
  background: oklch(0.15 0.01 100);
  border-color: oklch(0.15 0.01 100);
  color: oklch(0.99 0.005 100);
}

.sport-selector__btn--active:hover {
  background: oklch(0.25 0.01 100);
  border-color: oklch(0.25 0.01 100);
  color: oklch(0.99 0.005 100);
}

/* ==========================================================================
   Premier League Points Visualiser — App Shell
   ========================================================================== */

.app-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1rem;
  text-align: center;
}

.app-title {
  font-family: 'Inria Sans', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
  color: oklch(0.15 0.01 100);
}

.app-subtitle {
  font-family: 'Inria Sans', sans-serif;
  font-size: 0.95rem;
  color: oklch(0.45 0.02 100);
  margin: 0;
}

.app-main {
  padding: 1.5rem 0 3rem;
}

/* ==========================================================================
   Chart toggle control
   ========================================================================== */

.chart-controls {
  display: flex;
  justify-content: center;
  padding: 0 1.5rem 1rem;
}

.chart-toggle {
  display: inline-flex;
  background: oklch(0.91 0.01 100);
  padding: 3px;
  gap: 2px;
}

.chart-toggle__btn {
  font-family: 'Inria Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.35rem 1rem;
  border: none;
  background: transparent;
  color: oklch(0.45 0.02 100);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.chart-toggle__btn:hover {
  color: oklch(0.2 0.01 100);
}

.chart-toggle__btn--active {
  background: oklch(0.99 0.005 100);
  color: oklch(0.15 0.01 100);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Chart — Full-width breakout from constrained body
   ========================================================================== */

.chart-container {
  /* Escape the body max-width so the chart can use the full viewport */
  width: 96vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  height: clamp(100vh, 55vh, 620px);
  padding: 0 0.5vh;
  box-sizing: border-box;
}

.chart-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ==========================================================================
   Loading state
   ========================================================================== */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1.5rem;
  color: oklch(0.45 0.02 100);
  font-family: 'Inria Sans', sans-serif;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid oklch(0.9 0.01 100);
  border-top-color: oklch(0.4 0.02 100);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Error state
   ========================================================================== */

.error-state {
  max-width: 560px;
  margin: 3rem auto;
  padding: 1.5rem 2rem;
  background: oklch(0.97 0.015 20);
  border: 1px solid oklch(0.88 0.03 20);
  border-radius: 8px;
  text-align: center;
  font-family: 'Inria Sans', sans-serif;
}

.error-state #error-message {
  font-weight: 500;
  color: oklch(0.35 0.06 20);
  margin: 0 0 0.5rem;
}

.error-hint {
  font-size: 0.875rem;
  color: oklch(0.5 0.03 20);
  margin: 0;
}

.error-hint a {
  color: oklch(0.4 0.08 250);
}

.error-hint code {
  font-size: 0.8em;
  background: oklch(0.93 0.01 100);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.hidden {
  display: none !important;
}

/* ==========================================================================
   Custom Chart Tooltip
   ========================================================================== */

.chart-tooltip {
  /* fixed keeps the tooltip inside the viewport on any device/orientation */
  position: fixed;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: oklch(0.12 0.01 100 / 0.93);
  color: oklch(0.97 0.005 100);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  min-width: 260px;
  /* dvh accounts for mobile browser chrome (address bar) shrinking the viewport */
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  font-family: 'Inria Sans', sans-serif;
  font-size: 0.78rem;
  line-height: 1.4;
  /* thin visible scrollbar so users know more content exists */
  scrollbar-width: thin;
  scrollbar-color: oklch(0.4 0.01 100) transparent;
}

.chart-tooltip::-webkit-scrollbar {
  width: 4px;
}

.chart-tooltip::-webkit-scrollbar-thumb {
  background: oklch(0.4 0.01 100);
}

.chart-tooltip__header {
  padding: 0.5rem 0.75rem 0.4rem;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid oklch(0.3 0.01 100 / 0.5);
  color: oklch(0.75 0.01 100);
}

.chart-tooltip__body {
  padding: 0.35rem 0;
}

.chart-tooltip__row {
  display: grid;
  grid-template-columns: 1.4rem 0.55rem 2.8rem 2.8rem 1fr;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.75rem;
  transition: background 0.1s;
}

.chart-tooltip__row:hover {
  background: oklch(0.2 0.01 100 / 0.5);
}

.chart-tooltip__row--active {
  background: oklch(0.22 0.01 100);
  /* inset left bar in the team's color — uses no layout space */
  box-shadow: inset 3px 0 0 var(--team-color, oklch(0.7 0 0));
}

.chart-tooltip__row--active .chart-tooltip__tla {
  color: oklch(1 0 0);
}

.chart-tooltip__row--active .chart-tooltip__pts {
  color: oklch(1 0 0);
}

.chart-tooltip__pos {
  font-size: 0.7rem;
  color: oklch(0.55 0.01 100);
  text-align: right;
}

.chart-tooltip__dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.chart-tooltip__tla {
  font-weight: 600;
  font-size: 0.78rem;
  color: oklch(0.95 0.005 100);
  letter-spacing: 0.02em;
}

.chart-tooltip__pts {
  font-weight: 700;
  color: oklch(0.98 0.005 100);
  font-size: 0.82rem;
  text-align: right;
}

.chart-tooltip__pts small {
  font-weight: 400;
  font-size: 0.68rem;
  color: oklch(0.6 0.01 100);
  margin-left: 1px;
}

.chart-tooltip__fixture {
  color: oklch(0.72 0.01 100);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-tooltip__fixture strong {
  color: oklch(0.95 0.005 100);
}