* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
:root {
    /* Mid‑Century Modern Minimalism palette */
    --cream: #F5F1E8;
    --paper: #FFFCF6;
    --warm-gray: #5E5A54;
    --dark-brown: #2C2416;
    --amber: #C98A48;
    --burnt-orange: #C7522A;
    --olive: #5D6D4D;
    --light-gray: #E8E4DB;
    --line: #DDD6C9;
  }
  
body {
    /* UI in humanist/system sans, titles will override to serif */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
    background-color: var(--cream);
    color: var(--dark-brown);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* top accent stripe */
  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--burnt-orange), var(--amber) 55%, var(--olive));
    z-index: 10;
  }
  
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 20px;
  }
  
header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }
  
h1 {
    /* Subtle serif for title */
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 2.4rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--dark-brown);
    margin-bottom: 6px;
  }
  
.subtitle {
    color: var(--warm-gray);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
  }

  /* mid-century geometric motif */
  .motif {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 8px;
    margin-top: 10px;
  }
  .motif .circle {
    width: 12px; height: 12px;
    border-radius: 50%;
    display: inline-block;
  }
  .motif .c1 { background: var(--burnt-orange); }
  .motif .c2 { background: var(--amber); }
  .motif .c3 { background: var(--olive); }
  
nav {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 20px 0 10px;
    border-bottom: 1px solid var(--line);
  }
  
.tab-button {
    background: none;
    border: none;
    padding: 12px 22px;
    font-size: 0.88rem;
    color: var(--warm-gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    letter-spacing: 0.06em;
    font-weight: 500;
    text-transform: uppercase;
  }
  
  .tab-button:hover {
    color: var(--dark-brown);
  }
  
  .tab-button.active {
    color: var(--dark-brown);
    border-bottom-color: var(--burnt-orange);
  }

  .tab-button.active::after {
    content: '';
    display: block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--burnt-orange);
    margin: 6px auto -9px;
  }

  .tab-button:focus-visible {
    outline: 2px solid var(--burnt-orange);
    outline-offset: 2px;
  }
  
.tab-content {
    display: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px 16px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
    background-image: radial-gradient(rgba(44, 36, 22, 0.04) 1px, transparent 1px);
    background-size: 14px 14px;
  }

  .tab-desc {
    font-size: 0.78rem;
    color: var(--warm-gray);
    letter-spacing: 0.02em;
    margin-bottom: 10px;
    text-align: center;
  }
  
  .tab-content.active {
    display: block;
  }
  
  /* subtle dot pattern applied directly via background-image */
  
  .movie-list {
    list-style: none;
  }

  /* Year divider row for All list */
  .year-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 6px;
    color: var(--warm-gray);
  }
  .year-divider .line {
    height: 1px;
    background: var(--line);
    flex: 1;
  }
  .year-divider .label {
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--dark-brown);
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
  }

  .year-divider.current .label {
    background: var(--burnt-orange);
    color: #fff;
    border-color: var(--burnt-orange);
  }
  
.movie-item {
    display: flex;
    align-items: center;
    padding: 10px 2px;
    border-bottom: 1px solid var(--light-gray);
    transition: background-color 0.15s ease;
  }
  
  .movie-item:hover {
    background-color: rgba(199, 82, 42, 0.04);
  }

  .movie-list .movie-item:last-child {
    border-bottom: none;
  }

  /* prevent borders hugging a year divider too tightly */
  .year-divider + .movie-item {
    border-top: 1px solid var(--light-gray);
  }
  
.checkbox {
    width: 16px;
    height: 16px;
    border-radius: 2px; /* geometric */
    border: 2px solid var(--warm-gray);
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .checkbox.watched {
    background-color: var(--burnt-orange);
    border-color: var(--burnt-orange);
  }
  
  .checkbox.watched::after {
    content: '✓';
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
  }
  
.movie-title {
    flex: 1;
    font-size: 1rem;
    color: var(--dark-brown);
    letter-spacing: 0.01em;
  }
  
.rating {
    font-weight: 600;
    color: var(--warm-gray);
    margin-left: 10px;
    font-size: 0.84rem;
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
  }
  
/* Mid-century rating bands (Option B: Olive → Amber → Burnt) */
/* Band fills are muted; border/text use the band color */
  .rating.rating-lt6 {
    color: #869277; /* muted olive mist */
    border-color: rgba(134, 146, 119, 0.5);
    background: rgba(134, 146, 119, 0.08);
  }
  .rating.rating-6 {
    color: #5D6D4D; /* olive */
    border-color: rgba(93, 109, 77, 0.5);
    background: rgba(93, 109, 77, 0.08);
  }
  .rating.rating-7 {
    color: #A38A59; /* olive-amber bridge */
    border-color: rgba(163, 138, 89, 0.5);
    background: rgba(163, 138, 89, 0.08);
  }
  .rating.rating-8 {
    color: var(--amber);
    border-color: rgba(201, 138, 72, 0.5);
    background: rgba(201, 138, 72, 0.08);
  }
  .rating.rating-9 {
    color: #BD6739; /* deep amber-rust */
    border-color: rgba(189, 103, 57, 0.5);
    background: rgba(189, 103, 57, 0.08);
  }
  .rating.rating-10 {
    color: var(--burnt-orange);
    border-color: rgba(199, 82, 42, 0.5);
    background: rgba(199, 82, 42, 0.08);
  }
  
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
  }
  
.stat-card {
    background: var(--paper);
    padding: 18px 16px;
    border-radius: 6px;
    border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  }
  
.stat-value {
    font-size: 2rem;
    font-weight: 500;
    color: var(--burnt-orange);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
  }
  
.stat-label {
    font-size: 0.72rem;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  
  .top-movies { margin-top: 28px; }
  
.top-movies h2 {
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }
  
  .distribution-chart {
    margin-top: 28px;
  }
  
.distribution-chart h2 {
    font-family: ui-serif, Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
    font-weight: 600;
    color: var(--dark-brown);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
  }
  
  .chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
  }
  
.bar-label {
    width: 84px;
    font-size: 0.8rem;
    color: var(--warm-gray);
    letter-spacing: 0.04em;
  }
  
.bar-container {
    flex: 1;
    height: 18px;
    background-color: var(--light-gray);
    border-radius: 3px;
    /* Allow tiny bars to show their count even if it overflows */
    overflow: visible;
    position: relative;
    border: 1px solid var(--line);
  }
  
.bar-fill {
    height: 100%;
    background-color: var(--burnt-orange);
    transition: width 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
  }
  
.bar-count {
    color: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.04em;
  }
  
  @media (max-width: 600px) {
    .container {
      padding: 20px 14px;
    }
  
    h1 {
      font-size: 2rem;
    }
  
    .tab-button {
      padding: 10px 14px;
      font-size: 0.78rem;
    }
  
    .stats-grid {
      grid-template-columns: 1fr;
    }
  
    .movie-title {
      font-size: 0.96rem;
    }
  
    .rating {
      font-size: 0.8rem;
    }
  }
