/* =====================================================================
   v2.css — layout for the v2 case study pages (pilot: dynasty-v2.html)
   Loaded AFTER styles.css. Uses the same tokens (colors, fonts) from
   the top of styles.css. Everything here starts with "v2-" or lives
   inside .v2-page so it can't affect the other pages.
   ===================================================================== */

.v2-page {
  --dim: #5f636c;          /* sidebar links that aren't active */
  --line: #262a31;         /* thin dividers (same as --border) */
  --con: #f58b8b;          /* thumbs-down red */
  --toc-w: 150px;          /* width of the Contents sidebar */
  --max: 1280px;           /* wider page than styles.css (1080px) so images can be bigger */
}

/* ----- Text: muted gray body, highlighted phrases in bright white ----- */
.v2-page p { color: var(--muted); }
.v2-page p strong,
.v2-page li strong { color: var(--text); font-weight: inherit; }

/* ----- Top of page ----- */
.v2-hero { padding: 88px 0 40px; border-bottom: none; }
.v2-hero h1 { margin-bottom: .3em; }
.v2-hero .v2-sub { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ----- Two-column page: content + sticky Contents sidebar ----- */
.v2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 56px;
  align-items: start;
}

.v2-toc { position: sticky; top: 104px; padding-top: 8px; }
.v2-toc .v2-toc-label {
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 1rem;
}
.v2-toc ol { list-style: none; margin: 0; padding: 0; }
.v2-toc a {
  display: block; padding: 5px 0 5px 12px; font-size: .88rem;
  color: var(--dim); border-left: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.v2-toc a:hover { color: var(--text); text-decoration: none; }
.v2-toc a.active { color: var(--text); border-left-color: var(--accent); }

/* ----- Sections ----- */
.v2-section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;          /* so the sticky header doesn't cover the top */
}
.v2-section:last-child { border-bottom: none; }

/* small "02  Highlights" label above each section */
.v2-eyebrow {
  display: flex; gap: 10px; align-items: baseline;
  font-size: .75rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1.75rem;
}
.v2-eyebrow span { color: var(--dim); }

/* headline on the left, 2–3 sentences on the right */
.v2-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 48px;
  margin-bottom: 2.5rem;
}
.v2-head h2, .v2-head h3 {
  font-size: clamp(1.4rem, 2.3vw, 1.85rem);
  font-weight: 500; line-height: 1.25; margin: 0;
}
.v2-head p:last-child { margin-bottom: 0; }
.v2-head + .v2-head { margin-top: 3.5rem; }

/* sub-steps inside Testing and Key Decisions (5a, 6a…) */
.v2-step { font-size: .75rem; letter-spacing: .12em; color: var(--accent); display: block; margin-bottom: .6rem; font-family: var(--font-head); }

.v2-lead { font-size: 1.15rem; max-width: 52ch; margin-bottom: 3rem; }

/* ----- Overview block (role / built with / timeline | overview) ----- */
.v2-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 48px;
}
.v2-facts { margin: 0; }
.v2-facts dt { font-family: var(--font-head); font-weight: 500; color: var(--text); font-size: 1.05rem; margin-bottom: .4rem; }
.v2-facts dd { margin: 0 0 2rem; color: var(--muted); }
.v2-facts dd:last-child { margin-bottom: 0; }
.v2-facts dd strong { color: var(--text); font-weight: inherit; }
.v2-overview h2 { font-size: 1.05rem; font-weight: 500; font-family: var(--font-head); margin: 0 0 .4rem; }

/* ----- Figures ----- */
.v2-fig { margin: 0; }
.v2-fig + .v2-head, .v2-fig + .v2-options, .v2-options + .v2-head { margin-top: 4rem; }
.v2-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
}
.v2-panel img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.v2-panel a.zoom { cursor: zoom-in; position: relative; display: block; }

/* "Click to enlarge" cue: a small expand icon in the image's top-right corner.
   Shows on hover with a mouse; always visible on touch screens (no hover there). */
.v2-panel a.zoom::after {
  content: "⤢ Enlarge";
  position: absolute; top: 10px; right: 10px;
  font: 600 .72rem/1 var(--font-body); letter-spacing: .04em;
  color: var(--text); background: rgba(13, 14, 16, .78);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 10px;
  opacity: 0; transition: opacity .2s; pointer-events: none;
}
.v2-panel a.zoom:hover::after, .v2-panel a.zoom:focus-visible::after { opacity: 1; }
@media (hover: none) { .v2-panel a.zoom::after { opacity: .9; content: "⤢"; padding: 6px 8px; } }

/* caption: "1.0  The version I drafted with.  [IMAGE]" — right-aligned */
.v2-fig figcaption {
  margin-top: .9rem; font-size: .88rem; line-height: 1.6; color: var(--muted); text-align: right;
}
.v2-fig figcaption b { color: var(--text); font-weight: 500; margin-right: 6px; }
.v2-tag {
  display: inline-block; margin-left: 8px; vertical-align: 1px; line-height: 1.5;
  font-family: var(--font-head); font-size: .66rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px;
}

/* two figures side by side */
.v2-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.v2-pair .v2-panel { padding: 18px; }

/* =====================================================================
   Annotated images
   Each callout is a box drawn over the image, numbered, with a line
   running right to its label. Positions are percentages of the image:
     --x, --y  = top-left corner of the box
     --w, --h  = box width and height
     --ly      = height where the line (and label) sits
   To move a callout, change those numbers in the HTML.
   ===================================================================== */
.v2-annot { position: relative; --stage: 60; --label-left: 64; }
.v2-annot-stage { position: relative; width: calc(var(--stage) * 1%); }

.v2-mark {
  position: absolute;
  left: calc(var(--x) * 1%);  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%); height: calc(var(--h) * 1%);
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(13, 14, 16, .45);
  pointer-events: none;
}
/* number badge on the box */
.v2-mark::before {
  content: attr(data-n);
  position: absolute; top: -10px; left: -10px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #0d0e10;
  font: 700 11px/1 var(--font-body);
}
/* add class "v2-mark--badge-right" to put the number on the box's right side
   (use it when two boxes sit close and their numbers would overlap) */
.v2-mark--badge-right::before { left: auto; right: -10px; }
/* line from the box's right edge to the label column */
.v2-mark::after {
  content: "";
  position: absolute; left: 100%;
  top: calc((var(--ly) - var(--y)) / var(--h) * 100%);
  /* reach = where labels start, measured in image widths */
  width: calc(((var(--label-left) / var(--stage) * 100) - 1.5 - var(--x) - var(--w)) / var(--w) * 100%);
  border-top: 1.5px solid var(--accent);
}

.v2-annot-labels {
  list-style: none; margin: 0; padding: 0;
  position: absolute; top: 0; bottom: 0; right: 0;
  left: calc(var(--label-left) * 1%);
}
.v2-annot-labels li {
  position: absolute; left: 0; right: 0;
  top: calc(var(--ly) * 1%);
  transform: translateY(-11px);    /* lines up the label name with the line */
  font-size: .82rem; line-height: 1.4; color: var(--muted);
}
.v2-annot-labels .n {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px;
  border-radius: 50%; background: var(--accent); color: #0d0e10;
  font: 700 10px/1 var(--font-body); vertical-align: 1px;
}
.v2-annot-labels b { font-family: var(--font-head); font-weight: 500; color: var(--accent); font-size: .92rem; }
.v2-annot-labels span.note { display: block; padding-left: 24px; }

/* "list" version: image full width, labels in a numbered list below.
   Used for images inside a side-by-side pair, and for all annotated
   images on smaller screens. */
.v2-annot--list .v2-annot-stage { width: 100%; }
.v2-annot--list .v2-mark::after { display: none; }
.v2-annot--list .v2-annot-labels {
  position: static; margin-top: 18px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px;
}
.v2-annot--list .v2-annot-labels li { position: static; transform: none; }

/* ----- Pros / cons cards (options considered) ----- */
.v2-options { margin-top: 0; }
.v2-options-title { font-family: var(--font-head); font-size: 1.05rem; color: var(--text) !important; margin-bottom: 1.25rem; }
.v2-opt { display: block; width: 100%; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.v2-pc em { display: block; font-style: normal; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.v2-options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.v2-option h4 {
  font-family: var(--font-head); font-weight: 500; font-size: 1rem; color: var(--text);
  margin: 0 0 .75rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.v2-chosen {
  font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 8px;
}
.v2-pc {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 8px;
  color: var(--text); font-size: .98rem; line-height: 1.5;
}
.v2-pc svg { flex: none; width: 24px; height: 24px; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: -1px; }
.v2-pc.pro svg { stroke: var(--accent); }
.v2-pc.con svg { stroke: var(--con); }
.v2-option.is-chosen .v2-pc { border-color: rgba(110, 231, 183, .35); }

/* ----- Draft night results ----- */
.v2-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; }
.v2-stats > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.v2-stats dt { font-family: var(--font-head); font-size: 1.7rem; font-weight: 500; color: var(--text); line-height: 1.1; }
.v2-stats dd { margin: .35rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.v2-source { font-size: .85rem; color: var(--dim) !important; margin-top: .9rem; text-align: right; }

.v2-head--spaced { margin-top: 4rem; }

/* ----- Week 8 table ----- */
.v2-table-wrap { overflow-x: auto; }
.v2-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.v2-table caption { text-align: left; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-bottom: .9rem; }
.v2-table th, .v2-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.v2-table thead th { font-weight: 500; font-size: .8rem; color: var(--muted); }
.v2-table tbody th { font-weight: 500; color: var(--text); }
.v2-table td { color: var(--muted); font-variant-numeric: tabular-nums; }
.v2-table tr.is-total th, .v2-table tr.is-total td { color: var(--text); background: var(--surface); }
.v2-table tr.is-key td:first-of-type { color: var(--accent); }
.v2-note { font-size: .75rem; color: var(--accent); margin-left: 6px; letter-spacing: .04em; }

/* ----- "Try the tool" link (top) and card (bottom) ----- */
.v2-try { margin-top: 1.5rem; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.v2-try-note { font-size: .88rem; color: var(--muted); }
.v2-try-card {
  margin-top: 3rem; display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid rgba(110, 231, 183, .35); border-radius: 18px; padding: 28px 32px;
}
.v2-try-card > div { flex: 1 1 320px; }
.v2-try-card h3 { font-size: 1.3rem; font-weight: 500; margin: 0 0 .4rem; }
.v2-try-card p { margin: 0; }
.v2-try-card .btn { flex: none; }

/* ----- Smaller figure beside/under text (e.g. an old homepage) ----- */
.v2-fig--inline { max-width: 340px; margin-top: 1.75rem; }
.v2-fig--inline .v2-panel { padding: 14px; }
.v2-fig--inline figcaption { text-align: left; }
.v2-fig--after-options { margin-top: 2.5rem; }
.v2-fig--inline-wide { max-width: 480px; }          /* small landscape screenshot */
.v2-fig--before { margin: 0 0 2rem; }
.v2-fig--stacked { margin-top: 2.5rem; }
.v2-fig .labels { margin-top: .75rem; }
.v2-fig .labels + figcaption { margin-top: .4rem; }

/* ----- Text with a phone screenshot beside it ----- */
.v2-with-phone { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 32px; align-items: start; }
.v2-with-phone .phone figcaption { text-align: left; font-size: .8rem; }

/* ----- Narrower figure for tall screenshots (keeps them from filling the screen) ----- */
.v2-fig--narrow { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ----- Flow diagram: boxes in a row with arrows between them ----- */
.v2-flow {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 28px;
}
.v2-flow li {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px;
}
.v2-flow b { font-family: var(--font-head); font-weight: 500; color: var(--text); }
.v2-flow span { font-size: .85rem; line-height: 1.4; color: var(--muted); }
.v2-flow li + li::before {        /* the arrow */
  content: "→"; position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 1.1rem;
}
@media (max-width: 900px) {
  .v2-flow { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .v2-flow li + li::before { content: "↓"; left: 50%; top: -24px; transform: translateX(-50%); }
}

/* ----- Grid of page templates ----- */
.v2-templates { margin: 0 0 3rem; }
.v2-templates ol {
  list-style: none; counter-reset: tpl; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.v2-templates li {
  counter-increment: tpl; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.v2-templates li::before { content: "0" counter(tpl); font-family: var(--font-head); font-size: .8rem; color: var(--accent); }
.v2-templates b { font-family: var(--font-head); font-weight: 500; color: var(--text); }
.v2-templates span { font-size: .85rem; line-height: 1.45; color: var(--muted); }
@media (max-width: 1100px) { .v2-templates ol { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ----- Before / after table ----- */
.v2-before-after { margin-top: 3rem; }
.v2-before-after td { width: 40%; vertical-align: top; }
.v2-before-after td.is-after { color: var(--accent); }

/* ----- Testimonial inside a v2 section ----- */
.v2-quote { padding: 56px 0 0; border-bottom: none; }
.v2-quote figure { margin: 0; max-width: none; }
.v2-quote figcaption { text-align: left; }

/* ----- Retrospective takeaways ----- */
.v2-takeaways { list-style: none; counter-reset: tk; margin: 0 0 2.5rem; padding: 0; display: grid; gap: 12px; }
.v2-takeaways li {
  counter-increment: tk; display: grid; grid-template-columns: 44px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px;
  color: var(--muted);
}
.v2-takeaways li::before { content: "0" counter(tk); font-family: var(--font-head); color: var(--accent); font-size: .9rem; padding-top: 2px; }
.v2-next { border-left: 2px solid var(--accent); padding-left: 16px; }

/* =====================================================================
   Smaller screens
   ===================================================================== */

/* under 1100px: callouts switch to the numbered list under the image */
@media (max-width: 1100px) {
  .v2-annot .v2-annot-stage { width: 100%; }
  .v2-annot .v2-mark::after { display: none; }
  .v2-annot .v2-annot-labels {
    position: static; margin-top: 18px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px;
  }
  .v2-annot .v2-annot-labels li { position: static; transform: none; }
}

/* under 960px: hide the sidebar, one column */
@media (max-width: 960px) {
  .v2-layout { grid-template-columns: minmax(0, 1fr); }
  .v2-toc { display: none; }
}

/* phone width */
@media (max-width: 720px) {
  .v2-hero { padding: 64px 0 24px; }
  .v2-section { padding: 52px 0; }
  .v2-overview, .v2-head { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .v2-overview { gap: 40px; }
  .v2-head + .v2-head { margin-top: 2.75rem; }
  .v2-panel { padding: 14px; border-radius: 14px; }
  .v2-pair, .v2-options-grid { grid-template-columns: minmax(0, 1fr); }
  .v2-options-grid { gap: 20px; }
  .v2-annot .v2-annot-labels,
  .v2-annot--list .v2-annot-labels { grid-template-columns: minmax(0, 1fr); }
  .v2-stats { grid-template-columns: 1fr 1fr; }
  .v2-with-phone { grid-template-columns: minmax(0, 1fr); }
  .v2-with-phone .phone { max-width: 220px; }
  .v2-fig figcaption { text-align: left; }
  .v2-source { text-align: left; }
}
