/* Unit circle study guide. Builds on blog.css (.blog-article, .blog-post-hero).
   Sine and cosine keep one color each across every figure, table and label. */
:root {
  --uc-sin: #d9480f;
  --uc-cos: #1c64d4;
  --uc-arc: #7c3aed;
  --uc-ink: #193d88;
  --uc-soft: #f4f8fd;
  --uc-line: #d6e6f5;
}

.uc-hero .blog-post-title em { font-style: italic; color: #d8f3ee; }
.uc-hero-sub {
  max-width: 640px; margin: 14px auto 0;
  font-family: Poppins, sans-serif; font-size: 19px; line-height: 1.6;
  color: rgba(255,255,255,0.92); text-transform: none; letter-spacing: normal;
}
.uc-hero-actions { display: flex; flex-wrap: wrap; gap: 14px 24px; justify-content: center; align-items: center; margin-top: 26px; }
.uc-hero-link { color: #fff; font-family: Poppins, sans-serif; font-weight: 600; text-transform: none; letter-spacing: normal; }

.uc-article { max-width: 880px; }
.uc-article h2 { scroll-margin-top: 90px; }
.uc-article .uc-h3, .uc-article h3.uc-h3 {
  font-family: Montserrat, sans-serif; font-size: 20px; font-weight: 800; color: var(--uc-ink);
  margin: 1.6em 0 0.4em; text-transform: none; letter-spacing: normal;
}
.uc-sin { color: var(--uc-sin); }
.uc-cos { color: var(--uc-cos); }
.uc-nowrap { white-space: nowrap; }
.uc-article b, .uc-article strong { color: inherit; }
.uc-article b.uc-sin, .uc-article th.uc-sin { color: var(--uc-sin); }
.uc-article b.uc-cos, .uc-article th.uc-cos { color: var(--uc-cos); }

/* The big idea box */
.uc-bigidea {
  border-radius: 18px; padding: 26px 28px; margin: 0 0 2em;
  background: linear-gradient(135deg, #f0f6fd, #eef9f6); border: 1px solid var(--uc-line);
  text-align: center;
}
.uc-bigidea-label {
  font-family: Poppins, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #3b79ac; margin-bottom: 6px;
}
.uc-article .uc-bigidea-text { font-family: Montserrat, sans-serif; font-size: 26px; font-weight: 700; color: var(--uc-ink); line-height: 1.4; margin: 0 0 10px; }
.uc-article .uc-bigidea-sub { margin: 0; font-size: 18px; }

/* Figures */
.uc-figure {
  margin: 1.2em 0 1.6em; padding: 14px; border-radius: 18px;
  background: #fff; border: 1px solid var(--uc-line); box-shadow: 0 6px 22px rgba(25,67,136,0.07);
}
.uc-canvas-wrap { position: relative; width: 100%; }
.uc-canvas-wrap canvas { display: block; width: 100%; touch-action: none; cursor: grab; }
.uc-canvas-wrap canvas.is-dragging { cursor: grabbing; }
.uc-figure figcaption {
  font-family: Poppins, sans-serif; font-size: 14px; line-height: 1.5; color: #6b7280;
  margin-top: 8px; text-transform: none; letter-spacing: normal;
}

.uc-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.uc-slider { flex: 1 1 180px; min-width: 140px; accent-color: var(--uc-arc); height: 28px; }
.uc-btn {
  font-family: Poppins, sans-serif; font-size: 15px; font-weight: 600;
  border: 0; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  background: var(--uc-ink); color: #fff; text-transform: none; letter-spacing: normal;
  min-height: 40px;
}
.uc-btn:hover { background: #2a5aa8; }
.uc-btn--alt { background: var(--uc-cos); }
.uc-btn--ghost { background: #eef4fb; color: var(--uc-ink); }
.uc-btn--ghost:hover { background: #dde9f7; }
.uc-btn:focus-visible, .uc-unit:focus-visible, .uc-opt:focus-visible { outline: 3px solid #f59f00; outline-offset: 2px; }
.uc-check { font-family: Poppins, sans-serif; font-size: 14px; color: #374151; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-transform: none; letter-spacing: normal; margin: 0; font-weight: 500; }
.uc-check input { width: 17px; height: 17px; accent-color: var(--uc-ink); margin: 0; }
.uc-units { display: inline-flex; border-radius: 999px; background: #eef4fb; padding: 3px; }
.uc-unit {
  border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-family: Poppins, sans-serif; font-size: 13px; font-weight: 600; color: #4b5563;
}
.uc-unit.is-on { background: #fff; color: var(--uc-ink); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.uc-readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px;
}
.uc-readout div {
  background: var(--uc-soft); border-radius: 12px; padding: 8px 12px;
  font-family: Poppins, sans-serif; font-size: 13px; color: #6b7280; line-height: 1.35;
}
.uc-readout b { display: block; font-size: 19px; color: var(--uc-ink); font-weight: 700; }
.uc-readout .is-sin b { color: var(--uc-sin); }
.uc-readout .is-cos b { color: var(--uc-cos); }
.uc-readout .is-arc b { color: var(--uc-arc); }

.uc-callouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 1.4em; }
.uc-callouts div {
  background: var(--uc-soft); border-radius: 14px; padding: 14px 16px;
  font-family: Poppins, sans-serif; font-size: 15px; line-height: 1.55; color: #374151;
}
.uc-callouts b { display: block; color: var(--uc-ink); margin-bottom: 4px; }

/* Key points table */
.uc-table-wrap { overflow-x: auto; margin: 0 0 1em; border-radius: 14px; border: 1px solid var(--uc-line); }
.uc-table { width: 100%; border-collapse: collapse; font-family: Poppins, sans-serif; font-size: 15px; min-width: 560px; }
.uc-table th, .uc-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #e8eef6; text-transform: none; letter-spacing: normal; }
.uc-table th { background: var(--uc-soft); color: var(--uc-ink); font-weight: 700; }
.uc-table tr:last-child td { border-bottom: 0; }
.uc-table td:nth-child(3) { color: var(--uc-cos); font-weight: 700; }
.uc-table td:nth-child(4) { color: var(--uc-sin); font-weight: 700; }

/* Full chart */
.uc-chart-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 0 0 10px; }
.uc-chart-tools .uc-print { margin-left: auto; }
.uc-chart-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.uc-chart { background: #fff; border: 1px solid var(--uc-line); border-radius: 18px; padding: 6px; }
.uc-chart svg { display: block; width: 100%; height: auto; }
.uc-chart text { font-family: Poppins, sans-serif; }
.uc-chart .uc-rad, .uc-chart .uc-deg { paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.uc-chart .uc-pt { cursor: pointer; }
.uc-chart .uc-pt circle.hit { fill: transparent; }
.uc-chart .uc-pt circle.dot { fill: #fff; stroke: var(--uc-ink); stroke-width: 3; transition: r 0.15s; }
.uc-chart .uc-pt:hover circle.dot, .uc-chart .uc-pt:focus circle.dot { fill: #e8f0fb; }
.uc-chart .uc-pt.is-on circle.dot { fill: var(--uc-arc); stroke: var(--uc-arc); }
.uc-chart .uc-pt:focus { outline: none; }
.uc-chart .uc-pt:focus-visible circle.dot { stroke: #f59f00; stroke-width: 5; }
.uc-chart.hide-deg .uc-deg, .uc-chart.hide-rad .uc-rad, .uc-chart.hide-coord .uc-coord { visibility: hidden; }

.uc-detail {
  position: sticky; top: 90px;
  background: var(--uc-soft); border-radius: 18px; padding: 16px 18px;
  font-family: Poppins, sans-serif; font-size: 15px; color: #374151;
}
.uc-article .uc-detail p { font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
.uc-article .uc-detail-empty { color: #6b7280; text-align: center; padding: 40px 0; }
.uc-detail h3 { font-family: Montserrat, sans-serif; font-size: 24px; font-weight: 800; color: var(--uc-ink); margin: 0 0 2px; text-transform: none; letter-spacing: normal; }
.uc-detail .uc-detail-sub { color: #6b7280; font-size: 14px; margin-bottom: 10px; }
.uc-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 12px; }
.uc-detail dt { color: #6b7280; }
.uc-detail dd { margin: 0; font-weight: 700; color: var(--uc-ink); }
.uc-detail dd.uc-sin { color: var(--uc-sin); }
.uc-detail dd.uc-cos { color: var(--uc-cos); }
.uc-detail canvas { display: block; width: 100%; background: #fff; border-radius: 12px; }

/* Patterns */
.uc-pattern { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1em; }
.uc-pattern div {
  flex: 1 1 140px; text-align: center; padding: 12px; border-radius: 14px;
  background: #fff5f0; border: 1px solid #ffd8c7; font-family: Poppins, sans-serif; font-size: 15px; color: #6b7280;
}
.uc-pattern span { display: block; font-weight: 700; color: var(--uc-ink); }
.uc-pattern b { display: block; font-size: 24px; color: var(--uc-sin); }
.uc-quads { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 460px; margin: 0 auto 1em; }
.uc-quads div {
  padding: 14px; border-radius: 14px; text-align: center; background: var(--uc-soft);
  font-family: Poppins, sans-serif; font-size: 18px; color: var(--uc-ink);
}
.uc-quads b { display: block; font-size: 13px; letter-spacing: 1px; color: #3b79ac; }
.uc-quads small { display: block; font-size: 13px; color: #6b7280; }
.uc-quads .q1 { background: #e9f7f3; }
.uc-article .uc-tip { background: #fff8e6; border-left: 4px solid #f59f00; padding: 10px 14px; border-radius: 8px; font-size: 17px; }

/* Quiz */
.uc-quiz { background: #fff; border: 1px solid var(--uc-line); border-radius: 18px; padding: 20px; box-shadow: 0 6px 22px rgba(25,67,136,0.07); font-family: Poppins, sans-serif; }
.uc-quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: #6b7280; margin-bottom: 12px; }
.uc-quiz-bar { flex: 1; height: 8px; border-radius: 99px; background: #eef4fb; overflow: hidden; }
.uc-quiz-bar span { display: block; height: 100%; background: linear-gradient(90deg, #3b79ac, #57b9a8); transition: width 0.3s; }
.uc-quiz-body { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 18px; align-items: center; }
.uc-quiz-q { font-family: Montserrat, sans-serif; font-size: 26px; font-weight: 800; color: var(--uc-ink); margin: 0 0 14px; }
.uc-quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.uc-opt {
  font-family: Poppins, sans-serif; font-size: 19px; font-weight: 600; color: var(--uc-ink);
  background: var(--uc-soft); border: 2px solid transparent; border-radius: 14px; padding: 12px; cursor: pointer; min-height: 52px;
  text-transform: none; letter-spacing: normal;
}
.uc-opt:hover:not(:disabled) { border-color: #9cc0e6; }
.uc-opt.is-right { background: #e6f7ef; border-color: #2f9e6b; color: #1b6b47; }
.uc-opt.is-wrong { background: #fdecec; border-color: #d64545; color: #a32b2b; }
.uc-opt:disabled { cursor: default; }
.uc-quiz-fb { margin-top: 12px; font-size: 16px; line-height: 1.5; min-height: 1.5em; color: #374151; }
.uc-quiz-fb b { color: var(--uc-ink); }
.uc-quiz-fig svg { display: block; width: 100%; height: auto; }
.uc-quiz-next { margin-top: 12px; }
.uc-quiz-done { text-align: center; padding: 10px 0; }
.uc-quiz-done .uc-score { font-family: Montserrat, sans-serif; font-size: 44px; font-weight: 800; color: var(--uc-ink); }
.uc-article .uc-quiz-done p { font-size: 17px; }
.uc-quiz-done .hero-cta-button { margin: 6px 8px; }
.uc-article .uc-more { font-size: 16px; color: #6b7280; }

@media (max-width: 760px) {
  .uc-chart-layout { grid-template-columns: 1fr; }
  .uc-detail { position: static; }
  .uc-quiz-body { grid-template-columns: 1fr; }
  .uc-quiz-fig { max-width: 170px; margin: 0 auto; order: -1; }
  .uc-article .uc-bigidea-text { font-size: 21px; }
  .uc-figure { padding: 8px; }
}
@media (max-width: 560px) {
  .uc-chart .uc-coord, .uc-chart .uc-deg { display: none; }
  .uc-chart .uc-rad { font-size: 27px; }
  .uc-quiz { padding: 14px; }
  .uc-quiz-q { font-size: 22px; }
  .uc-quiz-opts { grid-template-columns: 1fr; }
  .uc-chart-tools .uc-print { margin-left: 0; }
}

/* Printing gives just the reference chart and the patterns, on one page. */
@media print {
  .navbar, .uc-hero, .mid-cta-section, .blog-inline-cta, .uc-controls, .uc-chart-tools,
  #see-it, #see-it ~ *:not(#chart):not(.uc-chart-layout):not(#patterns):not(.uc-h3):not(.uc-pattern):not(.uc-quads):not(.uc-tip):not(p),
  .uc-bigidea, .uc-article > p, .uc-detail, #quiz, .uc-quiz, .uc-more, #cosine, #key-points, .uc-table-wrap { display: none !important; }
  .uc-article #patterns ~ p { display: block !important; font-size: 12px; }
  .uc-chart-layout { display: block; }
  .uc-chart { border: 0; max-width: 560px; margin: 0 auto; }
  .uc-chart .uc-coord, .uc-chart .uc-deg { display: inline !important; visibility: visible !important; }
  .uc-chart .uc-rad { font-size: 17px !important; visibility: visible !important; }
  .uc-article { padding: 0; }
  .uc-article h2 { margin-top: 0.6em; }
}
