/*
  Thinkorr
  Everything is drawn from the logo: a large circle (the system) and a small
  circle (you, outside it). Hairline strokes, fog-grey ground, one typeface.
*/

:root {
  --fog: #e6eaea;
  --ink: #14222b;
  --slate: #5a6a72;
  --hair: #bcc6c8;

  --font: "Jost", "Futura", "Avenir Next", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --prose: 38rem;
  --wide: 56rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fog: #0f171c;
    --ink: #dde5e7;
    --slate: #8c9ba3;
    --hair: #33434b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

main { flex: 1; }

a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--fog);
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

/* ---------- Header and footer ---------- */

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: 1.5rem var(--gutter);
  font-size: 0.95rem;
}

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.1rem 1.1rem;
}

.name {
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
}

.tagline { margin: 0; color: var(--slate); }

.nav a {
  font-size: 1.05rem;
  text-decoration: none;
}
.nav a:hover,
.nav a[aria-current="page"] { text-decoration: underline; }

.bar small { font-size: inherit; color: var(--slate); }

/* ---------- Home: the logo as the page ---------- */

.hero {
  --D: min(50vh, 74vw, 30rem);      /* large circle */
  --s: calc(var(--D) * 0.1915);     /* small circle (13.5 / 70.5 in the logo) */
  --g: calc(var(--D) * 0.117);      /* gap between them (8.25 / 70.5) */

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 3vh, 2rem) var(--gutter) clamp(3rem, 8vh, 5rem);
}

.hero svg { display: block; overflow: visible; }

.hero circle {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.34;
  stroke-linecap: round;
}

.hero .system {
  width: var(--D);
  height: var(--D);
  transform: rotate(90deg);   /* the line starts and finishes nearest you */
}

.observer {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr var(--s) 1fr;
  grid-template-rows: var(--s);     /* the text may overhang this row */
  margin-top: var(--g);
}

.hero .you {
  grid-column: 2;
  width: var(--s);
  height: var(--s);
}

.hero h1 {
  grid-column: 3;
  align-self: start;
  max-width: 17ch;
  margin: 0 0 0 clamp(1rem, 2.5vw, 2rem);
  font-weight: 300;
  font-size: clamp(1.6rem, 1rem + 2.1vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  text-wrap: balance;
  /* centre the text block on the small circle without moving the circles */
  transform: translateY(calc(var(--s) / 2)) translateY(-50%);
}

@media (max-width: 720px) {
  .observer { grid-template-columns: 1fr; grid-template-rows: auto; justify-items: center; }
  .hero .you { grid-column: 1; }
  .hero h1 {
    grid-column: 1;
    margin: 1.75rem auto 0;
    font-size: clamp(1.8rem, 1rem + 4vw, 2.4rem);
    text-align: center;
    transform: none;
  }
  .hero { padding-bottom: 3rem; }
}

/* ---------- Explore page ---------- */

.page {
  width: 100%;
  max-width: 66rem;
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem clamp(2rem, 5vw, 4rem);
  padding: clamp(1rem, 5vh, 3rem) 0 clamp(2rem, 7vh, 4.5rem);
}

.kicker { margin: 0 0 0.9rem; color: var(--slate); }
.kicker a { text-decoration: none; }
.kicker a:hover { text-decoration: underline; }

.page h1 {
  margin: 0 0 1.4rem;
  font-weight: 300;
  font-size: clamp(2.6rem, 1.3rem + 4.2vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.lede {
  max-width: 24ch;
  margin: 0 0 1.4rem;
  font-weight: 300;
  font-size: clamp(1.3rem, 1rem + 0.9vw, 1.65rem);
  line-height: 1.35;
}

.read-time { margin: 0; color: var(--slate); font-size: 0.95rem; }

.prose {
  max-width: var(--prose);
  margin: 0 auto;
  font-size: 1.125rem;
  line-height: 1.7;
}
.prose p { margin: 0 0 1.15rem; }

.prose h2 {
  margin: 3.75rem 0 1rem;
  font-weight: 400;
  font-size: clamp(1.65rem, 1.2rem + 1.5vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Bullets are small circles, like the one in the logo */
.circles { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.circles li { position: relative; margin-bottom: 0.8rem; padding-left: 1.8rem; }
.circles li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.55em;
  width: 0.65rem;
  height: 0.65rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

/* ---------- Opening drawing: the system, and you outside it ---------- */

.standpoint { width: 100%; max-width: 17rem; justify-self: center; overflow: visible; }
.standpoint circle { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; }
.standpoint text { font-family: var(--font); font-size: 16px; fill: var(--slate); }

@media (prefers-reduced-motion: no-preference) {
  .standpoint circle { stroke-dasharray: 1.02; stroke-dashoffset: 1.02; }
  .standpoint .sys     { animation: draw 1.7s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards; }
  .standpoint .me      { animation: draw 0.6s ease-out 1.8s forwards; }
  .standpoint .me-core { animation: draw 0.5s ease-out 2.25s forwards; }
  .standpoint text     { opacity: 0; animation: appear 0.8s ease 2.6s forwards; }
}

/* ---------- The inversion explorer ---------- */

.explorer {
  max-width: var(--wide);
  margin: 1.5rem auto 1rem;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border: 1px solid var(--hair);
  border-radius: 28px;
}

.explorer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 5vw, 3.5rem);
  align-items: start;
}

.explorer h3 {
  margin: 0 0 0.9rem;
  font-weight: 500;
  font-size: 1.15rem;
}
.explorer h3 + p { margin: -0.5rem 0 1.75rem; color: var(--slate); font-size: 0.95rem; }


.group h3 { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 0.9rem; font-weight: 500; font-size: 1rem; }

.choice { border: 0; margin: 0 0 0.9rem; padding: 0; min-width: 0; }
.choice legend { padding: 0; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--slate); }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 2px;
}
.seg label { position: relative; }
.seg input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seg span {
  display: block;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.98rem;
  line-height: 1.25;
  white-space: nowrap;
}
.seg input:checked + span { background: var(--ink); color: var(--fog); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }



/* A person: a centre (born with) inside a ring (how they were raised).
   A thicker line means different from you; a thin line means the same.
   The outer ring is drawn as an inset shadow so thickening it never
   changes the size of the centre. */
.glyph {
  --size: 2.75rem;
  --line: 1.5px;
  --heavy: max(3px, calc(var(--size) * 0.085));
  --ring-w: var(--line);
  --ring-c: var(--ink);
  --core-w: var(--line);
  --core-c: var(--ink);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--fog);
  box-shadow: inset 0 0 0 var(--ring-w) var(--ring-c);
}
.glyph .core {
  width: 50%;
  aspect-ratio: 1;
  border: var(--core-w) solid var(--core-c);
  border-radius: 50%;
}
.glyph.raised-diff { --ring-w: var(--heavy); }
.glyph.born-diff   { --core-w: var(--heavy); }

.glyph.sm { --size: 1.35rem; --line: 1.2px; --heavy: 3px; }
.glyph.md { --size: 2.4rem; }
.glyph.lg { --size: 3.4rem; }
.glyph.xl { --size: var(--xl, 11rem); }

/* Beside a trait, fade the part of the picture that isn't being described */
.glyph.focus-born   { --ring-c: var(--hair); --ring-w: var(--line); }
.glyph.focus-raised { --core-c: var(--hair); --core-w: var(--line); }

/* The circle: the system, with the four people around it */
.orbit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem 3rem;
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--hair);
}
.orbit-fig {
  position: relative;
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 1;
  justify-self: center;
}
.orbit-fig svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-fig circle { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.orbit-fig .reach { stroke: var(--slate); stroke-width: 1.2; stroke-dasharray: 3 5; }
.orbit-fig .person {
  position: absolute;
  width: 14.8%;
  padding: 0;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.orbit-fig .person::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
/* Selection: the chosen person and you stay bright, the others step back,
   and the chosen name is underlined. */
.orbit-fig .person { --size: 3.4rem; }
.orbit-fig .person,
.orbit-fig .nm { transition: opacity 0.25s ease, color 0.25s ease; }
.orbit-fig .is-dim { opacity: 0.35; }
.orbit-fig .person.is-dim:hover { opacity: 0.75; }
.orbit-fig .nm.is-on { color: var(--ink); font-weight: 500; }
.orbit-fig .nm::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4em;
  height: 1.5px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.orbit-fig .nm.is-on::after { transform: scaleX(1); }
.orbit-fig .person:focus-visible { outline: 2px solid var(--ink); outline-offset: 9px; }
.orbit-fig .nm { position: absolute; color: var(--slate); font-size: 0.95rem; line-height: 1; pointer-events: none; }
.orbit-fig .nm.you     { left: 60.2%; top: 91.67%; transform: translateY(-50%); }
.orbit-fig .nm.charlie { left: 60.2%; top: 8.33%;  transform: translateY(-50%); }
.orbit-fig .nm.alex    { left: 8.33%; top: 62%; transform: translateX(-50%); }
.orbit-fig .nm.bobby   { left: 91.67%; top: 62%; transform: translateX(-50%); }

/* The selected person, spelled out */
.who-big { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.who-big .name { margin: 0; font-size: 1.45rem; font-weight: 500; line-height: 1.2; }
.who-big .summary { margin: 0.15rem 0 0; color: var(--slate); }

.trait-line {
  display: grid;
  grid-template-columns: auto 4.2rem minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.7rem;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}
.trait-line .glyph { align-self: center; }
.trait-line .k { color: var(--slate); }
.trait-line.same .v { color: var(--slate); }

@media (max-width: 640px) {
  .orbit { grid-template-columns: minmax(0, 1fr); }
  .trait-line { grid-template-columns: auto minmax(0, 1fr); }
  .trait-line .v { grid-column: 2; }
}


/* ---------- Two layers: the picture, labelled ---------- */

.layers {
  --xl: 11rem;
  --gap: 2.25rem;
  max-width: var(--wide);
  margin: 2rem auto 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--xl) minmax(0, 1fr);
  align-items: center;
  column-gap: var(--gap);
}
.layer-label { position: relative; font-size: 1rem; line-height: 1.5; }
.layer-label p { margin: 0; color: var(--slate); }
.layer-label .layer-name { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.35rem; color: var(--ink); font-weight: 500; }
.layer-label.born { text-align: right; }
.layer-label.born .layer-name { justify-content: flex-end; }
/* leader lines: one runs to the edge of the centre, the other into the ring */
.layer-label::after,
.layer-label::before { content: ""; position: absolute; top: 50%; }
.layer-label::after { border-top: 1px dashed var(--slate); }
.layer-label::before { width: 7px; height: 7px; margin-top: -3px; border-radius: 50%; background: var(--ink); }
.layer-label.born::after  { left: calc(100% + 0.6rem); width: calc(var(--gap) - 0.6rem + var(--xl) * 0.25); }
.layer-label.born::before { left: calc(100% + var(--gap) + var(--xl) * 0.25 - 3px); }
.layer-label.raised::after  { right: calc(100% + 0.6rem); width: calc(var(--gap) - 0.6rem + var(--xl) * 0.125); }
.layer-label.raised::before { right: calc(100% + var(--gap) + var(--xl) * 0.125 - 4px); }

/* ---------- The four people ---------- */

.four {
  list-style: none;
  max-width: var(--wide);
  margin: 2rem auto 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.75rem;
}
.four li { display: grid; justify-items: start; align-content: start; gap: 0.2rem; }
.four .glyph { margin-bottom: 0.7rem; }
.four .name { margin: 0; color: var(--ink); font-size: 1.2rem; font-weight: 500; }
.four p { margin: 0; color: var(--slate); line-height: 1.45; }

/* ---------- Worked example ---------- */

.example {
  max-width: var(--wide);
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.example .q { padding: 1.5rem 1.75rem 1rem; }
.example .q.you   { border-right: 1px solid var(--hair); border-bottom: 1px solid var(--hair); padding-left: 0; }
.example .q.alex  { border-bottom: 1px solid var(--hair); }
.example .q.bobby { border-right: 1px solid var(--hair); padding-left: 0; }
.example .who { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.9rem; font-size: 1.15rem; font-weight: 500; }
.example .circles { margin: 0; }
.example .circles li { font-size: 1.02rem; line-height: 1.5; }
/* open circles mean "same as you" on this page, so the questions get a plain dash */
.example .circles li::before { width: 0.65rem; height: 0; top: 0.78em; border: 0; border-top: 1.5px solid var(--slate); border-radius: 0; }

.aside { margin-top: 2.25rem; color: var(--slate); }

@media (max-width: 760px) {
  .layers { --xl: 9rem; grid-template-columns: minmax(0, 1fr); row-gap: 1.5rem; }
  .layers > .glyph { order: -1; justify-self: center; }
  .layer-label.born { text-align: left; }
  .layer-label.born .layer-name { justify-content: flex-start; }
  .layer-label::after, .layer-label::before { display: none; }
  .four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .example { grid-template-columns: minmax(0, 1fr); }
  .example .q, .example .q.you, .example .q.alex, .example .q.bobby {
    border-right: 0; border-bottom: 0; border-top: 1px solid var(--hair); padding: 1.25rem 0 0.75rem;
  }
}

/* ---------- Note and call to action ---------- */

.note {
  max-width: var(--prose);
  margin: 3.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
  font-size: 1.05rem;
  line-height: 1.65;
}
.note h2 { margin: 0 0 0.6rem; font-weight: 500; font-size: 1.15rem; }
.note p { margin: 0; }

.onward {
  max-width: var(--wide);
  margin: 3.5rem auto 0;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.25rem 2.5rem;
  border: 1px solid var(--hair);
  border-radius: 28px;
}
.onward h2 {
  margin: 0 0 0.6rem;
  font-weight: 400;
  font-size: clamp(1.65rem, 1.2rem + 1.5vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.onward p { margin: 0; color: var(--slate); font-size: 1.125rem; }
.big-link {
  font-weight: 300;
  font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.14em;
  white-space: nowrap;
}
.big-link:hover { text-decoration-thickness: 3px; }

@media (max-width: 640px) {
  .onward { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .intro,
  .explorer-top { grid-template-columns: minmax(0, 1fr); }
  .intro .standpoint { max-width: 11rem; order: -1; justify-self: start; }
  .explorer-top .group + .group { padding-top: 1.75rem; border-top: 1px solid var(--hair); }
}

/* ---------- Motion on the home page ---------- */

@media (prefers-reduced-motion: no-preference) {
  .hero .system circle,
  .hero .you circle {
    stroke-dasharray: 1.02;   /* a touch over the full length so no seam is left */
    stroke-dashoffset: 1.02;
  }
  .hero .system circle { animation: draw 1.9s cubic-bezier(0.65, 0, 0.35, 1) 0.2s forwards; }
  .hero .you circle    { animation: draw 0.7s cubic-bezier(0.33, 0, 0.2, 1) 1.95s forwards; }
  .hero h1       { opacity: 0; animation: appear 1s ease 2.4s forwards; }
}

@keyframes draw   { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
