/*
 * Open Questions
 * Layout: a poster. Full-bleed rows ruled in ink, questions set large in a
 * condensed display face, and one tomato field at a time marking what is open.
 */

/* Typefaces, served from this site (OFL). Latin and Latin Extended only. */

/* Bricolage Grotesque, latin-ext */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/bricolage-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Bricolage Grotesque, latin */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("/fonts/bricolage-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Hanken Grotesk, latin-ext */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/hanken-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Hanken Grotesk, latin */
@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/hanken-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colour */
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5a5a5a;
  --tomato: #f05a36;
  --tomato-text: #c73a1a; /* tomato dark enough for small text on paper */
  --on-tomato: #111111; /* text and rules on a tomato field, in both schemes */
  --on-tomato-inv: #ffffff;
  --inv-bg: #111111;
  --inv-fg: #ffffff;
  --inv-muted: #d6d6d6;

  /* Type */
  --display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --t-hero: clamp(4.2rem, 13.2vw, 12.25rem);
  --t-case: clamp(3.2rem, 9.4vw, 9rem);
  --t-question: clamp(2.1rem, 5.4vw, 5rem);
  --t-sub: clamp(1.9rem, 3.4vw, 3.1rem);
  --t-lead: clamp(1.25rem, 1.7vw, 1.44rem);
  --t-body: 1.19rem;
  --t-small: 0.94rem;

  /* Space */
  --gutter: clamp(1.25rem, 2.8vw, 2.5rem);
  --rule: 2px;
  --thumb: 3.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121212;
    --ink: #f3f2ee;
    --muted: #b4b2ac;
    --tomato-text: #ff7d5c;
    --inv-bg: #f3f2ee;
    --inv-fg: #111111;
    --inv-muted: #3d3d3d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #121212;
  --ink: #f3f2ee;
  --muted: #b4b2ac;
  --tomato-text: #ff7d5c;
  --inv-bg: #f3f2ee;
  --inv-fg: #111111;
  --inv-muted: #3d3d3d;
  color-scheme: dark;
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  interpolate-size: allow-keywords;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--t-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: inherit;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--tomato-text);
}

:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.skip:focus {
  top: 0.5rem;
  color: var(--paper);
}

.arrow {
  flex: none;
}

.label {
  font-size: var(--t-small);
  font-weight: 700;
}

/* Top bar */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  padding: 0.9rem var(--gutter);
}

.top__name {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 700;
  text-decoration: none;
}

.top__role {
  color: var(--muted);
  font-size: var(--t-small);
}

.top__nav {
  display: flex;
  gap: 1.75rem;
  font-weight: 600;
}

.top__nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  text-decoration: none;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--gutter) clamp(3rem, 5vw, 4.5rem);
}

.hero__for {
  align-self: flex-start;
  padding: 0.35rem 0.85rem;
  background: var(--tomato);
  color: var(--on-tomato);
  font-size: var(--t-small);
  font-weight: 700;
}

.hero__title,
.ask__line {
  font-family: var(--display);
  font-stretch: 75%;
  font-size: var(--t-hero);
  font-weight: 800;
  line-height: 0.84;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.dot {
  color: var(--tomato);
}

.hero__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.75rem 4rem;
}

.hero__hint {
  font-size: var(--t-small);
  font-weight: 600;
}

.hero__intro {
  flex: 0 1 38.75rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: var(--t-lead);
  line-height: 1.42;
  letter-spacing: -0.005em;
}

.hero__note {
  flex: 0 1 30rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.9rem;
  border-top: var(--rule) solid var(--ink);
  font-size: 1.06rem;
  line-height: 1.48;
}

/* Questions */

.questions {
  border-bottom: var(--rule) solid var(--ink);
}

.q {
  border-top: var(--rule) solid var(--ink);
}

.q[open] {
  background: var(--tomato);
  color: var(--on-tomato);
}

.q__head {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 12rem 3.5rem;
  align-items: start;
  gap: 0.75rem 2rem;
  padding: 1.6rem var(--gutter) 2rem;
  cursor: pointer;
  list-style: none;
}

.q__head::-webkit-details-marker {
  display: none;
}

.q__head:focus-visible {
  outline-offset: -6px;
}

.q__n {
  padding-top: 0.9rem;
  font-size: var(--t-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.q__title,
.next__title {
  font-family: var(--display);
  font-stretch: 80%;
  font-size: var(--t-question);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.q__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0.85rem;
  font-size: var(--t-small);
  line-height: 1.45;
}

.q__flag {
  margin-bottom: 0.4rem;
  padding: 0.1rem 0.55rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.82rem;
  font-weight: 700;
}

.q__topic {
  font-weight: 600;
}

.q__topic--built {
  color: var(--tomato-text);
}

.q__status {
  color: var(--muted);
}

.q[open] .q__flag {
  background: var(--on-tomato);
  color: var(--on-tomato-inv);
}

.q[open] .q__topic--built,
.q[open] .q__status {
  color: var(--on-tomato);
}

.q__toggle {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
  border: var(--rule) solid currentColor;
  border-radius: 50%;
}

.q__toggle::before,
.q__toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.2rem;
  height: 0.16rem;
  margin: -0.08rem 0 0 -0.6rem;
  border-radius: 1px;
  background: currentColor;
}

.q__toggle::after {
  transform: rotate(90deg);
}

.q[open] .q__toggle {
  background: var(--on-tomato);
  border-color: var(--on-tomato);
  color: var(--on-tomato-inv);
}

.q[open] .q__toggle::after {
  transform: rotate(0deg);
}

.q:not([open]) .q__head:hover .q__toggle {
  background: var(--ink);
  color: var(--paper);
}

.q__body {
  display: grid;
  gap: 2.75rem;
  padding: 0.75rem var(--gutter) 2.75rem calc(var(--gutter) + 5.5rem);
}

.q__beats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 2.25rem 3rem;
}

.beat {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: var(--rule) solid var(--on-tomato);
}

.beat h3 {
  font-size: var(--t-small);
  font-weight: 700;
}

.beat p {
  line-height: 1.48;
}

.q__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 1.25rem 2.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 3.5rem;
  padding: 0 1.75rem;
  border-radius: 999px;
  background: var(--on-tomato);
  color: var(--on-tomato-inv);
  font-weight: 600;
  text-decoration: none;
}

/* Hover and keyboard focus invert the pill: white field, ink text and arrow. */
.button:hover,
.button:focus-visible {
  background: var(--on-tomato-inv);
  color: var(--on-tomato);
  text-decoration: none;
}

/* Habits */

.habits {
  display: grid;
  gap: 3.5rem;
  padding: clamp(4rem, 6vw, 6rem) var(--gutter);
  background: var(--inv-bg);
  color: var(--inv-fg);
}

.habits__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(27.5rem, 100%), 1fr));
  gap: 3.5rem 4rem;
}

.habit {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.habit__title,
.row__q {
  font-family: var(--display);
  font-stretch: 80%;
  font-size: var(--t-sub);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.habit__text {
  max-width: 30rem;
  color: var(--inv-muted);
  font-size: 1.12rem;
}

/* About, and open questions */

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem 4rem;
  padding: clamp(4rem, 6vw, 6rem) var(--gutter);
}

.strip__col {
  flex: 1 1 24rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.strip__lead {
  max-width: 38rem;
  font-size: clamp(1.3rem, 1.9vw, 1.62rem);
  line-height: 1.34;
  letter-spacing: -0.01em;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-block: 0.6rem;
  font-weight: 600;
}

.open {
  align-self: stretch;
}

.open li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 0;
  border-top: var(--rule) solid var(--ink);
}

.open li:last-child {
  border-bottom: var(--rule) solid var(--ink);
}

.open__q {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.open__text {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

/* Case pages */

.case__hero {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3.25rem);
  padding: 1.75rem var(--gutter) clamp(2.5rem, 4vw, 3.5rem);
  background: var(--tomato);
  color: var(--on-tomato);
}

.case__hero a:hover {
  color: var(--on-tomato);
  text-decoration-thickness: 0.16em;
}

.case__crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.75rem;
  font-size: var(--t-small);
  font-weight: 600;
}

.case__crumb a,
.case__crumb span {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.case__crumb a {
  justify-content: center;
  min-width: 2.75rem;
}

.case__title {
  font-family: var(--display);
  font-stretch: 75%;
  font-size: var(--t-case);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.033em;
  text-wrap: balance;
}

.case__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 4rem;
}

.case__status {
  font-size: var(--t-small);
  font-weight: 600;
  line-height: 1.45;
}

.case__summary {
  flex: 0 1 38.75rem;
  min-width: 0;
  font-size: var(--t-lead);
  line-height: 1.42;
}

/* Question-and-answer rows, shared by case pages and About */

.row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1.5rem 4rem;
  padding: 3rem var(--gutter) 3.5rem;
  border-top: var(--rule) solid var(--ink);
}

.case .rows .row:first-child {
  border-top: 0;
}

.row__a {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 40rem;
  min-width: 0;
  font-size: 1.25rem;
  line-height: 1.5;
}

.mine__item {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 0.95rem 0;
  border-top: 1px solid var(--ink);
}

.mine__item:first-child {
  padding-top: 0;
  border-top: 0;
}

.mine dt {
  padding-top: 0.3rem;
  font-size: var(--t-small);
  font-weight: 700;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tags li {
  padding: 0.3rem 0.85rem;
  border: var(--rule) solid var(--ink);
  border-radius: 999px;
  font-size: var(--t-small);
  font-weight: 600;
}

.plain {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.draft {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 1.25rem;
  border: var(--rule) dashed var(--tomato-text);
  font-size: 1.06rem;
}

.draft__label {
  color: var(--tomato-text);
  font-size: var(--t-small);
  font-weight: 700;
}

.next {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.75rem 2rem;
  padding: 1.75rem var(--gutter) 2.25rem;
  border-top: var(--rule) solid var(--ink);
  text-decoration: none;
}

.next__label {
  padding-top: 0.9rem;
  font-size: var(--t-small);
  font-weight: 700;
}

.next .arrow {
  width: 3rem;
  height: 3rem;
  margin-top: 0.4rem;
}

.next:hover {
  background: var(--ink);
  color: var(--paper);
}

/* About */

.job {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.1rem 0 1.4rem;
  border-top: var(--rule) solid var(--ink);
}

.job:first-child {
  padding-top: 0;
  border-top: 0;
}

.job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.15rem 1.5rem;
}

.job__company {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.job__period,
.job__dates {
  color: var(--muted);
  font-size: var(--t-small);
}

.job__roles {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.job__roles li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.1rem 1.5rem;
  font-size: 1.12rem;
}

.job__note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 1rem;
}

/* Footer: the invitation */

.ask {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
  padding: clamp(3.5rem, 5vw, 4.5rem) var(--gutter) 2.5rem;
  background: var(--tomato);
  color: var(--on-tomato);
}

.ask a:hover,
.q[open] a:hover {
  color: var(--on-tomato);
  text-decoration-thickness: 0.16em;
}

.q[open] .button:hover,
.q[open] .button:focus-visible {
  color: var(--on-tomato);
}

.ask__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 4rem;
}

.ask__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 2.5rem;
  font-size: clamp(1.15rem, 1.6vw, 1.38rem);
  font-weight: 600;
}

.ask__links a {
  display: inline-block;
  padding-block: 0.7rem;
  overflow-wrap: anywhere;
}

.ask__meta {
  font-size: var(--t-small);
}

/* Thumb bar: the navigation on small screens, within reach */

.thumb {
  display: none;
}

/* Pointer label, added by site.js on devices with a fine pointer */

.pointer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 15;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--paper);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
}

.pointer.is-on {
  opacity: 1;
}

/* Cursor: a larger tomato arrow, and a tomato hand on anything that acts on
   a click, including the whole of an open question. Fine pointers only, and
   never in forced-colors mode, where the system cursor must stay. */

@media (hover: hover) and (pointer: fine) and (forced-colors: none) {
  html {
    cursor: url("/cursor.svg") 3 3, default;
  }

  a,
  button,
  summary,
  .q__head,
  .q[open] {
    cursor: url("/cursor-hand.svg") 13 3, pointer;
  }
}

/* Motion */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .q::details-content {
    block-size: 0;
    overflow: clip;
    transition:
      block-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
      content-visibility 0.4s allow-discrete;
  }

  .q[open]::details-content {
    block-size: auto;
  }

  .q__toggle,
  .q__toggle::after {
    transition:
      transform 0.25s ease,
      background-color 0.15s ease;
  }

  .button {
    transition:
      background-color 0.15s ease,
      color 0.15s ease;
  }

  .pointer {
    transition: opacity 0.15s ease;
  }
}

/* Small screens */

@media (max-width: 45rem) {
  body {
    padding-bottom: calc(var(--thumb) + env(safe-area-inset-bottom, 0px));
  }

  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding-block: 0.6rem 0.9rem;
  }

  .top__name {
    padding-block: 0.5rem 0.1rem;
  }

  .top__nav {
    display: none;
  }

  .hero__row,
  .case__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .q__head {
    grid-template-columns: 1.75rem minmax(0, 1fr) 2.75rem;
    grid-template-areas:
      "n title toggle"
      ". meta meta";
    gap: 0.6rem 0.75rem;
    padding-block: 1.25rem 1.5rem;
  }

  .q__n {
    grid-area: n;
    padding-top: 0.35rem;
  }

  .q__title {
    grid-area: title;
  }

  .q__meta {
    grid-area: meta;
    padding-top: 0;
  }

  .q__toggle {
    grid-area: toggle;
    width: 2.75rem;
    height: 2.75rem;
  }

  .q__body {
    gap: 2rem;
    padding: 0.5rem var(--gutter) 2rem;
  }

  .button {
    width: 100%;
    justify-content: space-between;
  }

  .row {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 2.25rem 2.5rem;
  }

  .row__a {
    font-size: 1.12rem;
  }

  .mine__item {
    grid-template-columns: minmax(0, 1fr);
  }

  .mine dt {
    padding-top: 0;
  }

  .job__roles li {
    grid-template-columns: minmax(0, 1fr);
  }

  .next {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .next__label {
    grid-column: 1 / -1;
    padding-top: 0;
  }

  .next .arrow {
    width: 2.25rem;
    height: 2.25rem;
  }

  .ask__links {
    flex-direction: column;
  }

  .thumb {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* A paper rule keeps the bar distinct over the inverted habits band. */
    border-top: var(--rule) solid var(--paper);
    background: var(--inv-bg);
    color: var(--inv-fg);
  }

  /* Keep focused and linked-to elements clear of the fixed thumb bar. */
  html {
    scroll-padding-bottom: calc(var(--thumb) + var(--rule) + env(safe-area-inset-bottom, 0px) + 0.5rem);
  }

  /* Dates always sit under the company name, however long the name is. */
  .job__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .thumb a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--thumb);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
  }

  .thumb a + a {
    border-left: 1px solid var(--inv-muted);
  }

  .thumb a:hover {
    color: var(--tomato);
  }
}
