@font-face {
  font-family: 'Anek Odia';
  src: url('assets/anek-odia-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Anek Odia';
  src: url('assets/anek-odia-medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper: #f4f1ea;
  --ink: #282b29;
  --nav-ink: #3c3c39;
  --accent: #ff158a;
  --accent-hover: #d9006c;
  --card: #f8f6f0;
  --muted: #77766f;
  --card-line: #c9c7c0;
  --line: #dddfd8;
  --gutter: clamp(48px, 10.166vw, 141px);
  --right-gutter: 48px;
  --font: 'Anek Odia', Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #ffd5e9;
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.page-shell p a {
  text-decoration-color: var(--card-line);
  transition: color .2s ease, text-decoration-color .2s ease;
}

.page-shell p a:hover,
.page-shell p a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

button { font: inherit; }

input { font: inherit; }

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 13px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus { transform: none; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  height: 160px;
  padding: 31px var(--gutter) 0;
  background: var(--paper);
}

.wordmark {
  display: inline-block;
  width: max-content;
  white-space: nowrap;
  color: var(--ink);
  font-size: 32px;
  font-weight: 500;
  line-height: 36px;
  letter-spacing: -1px;
  text-decoration: none;
}

.wordmark span { color: var(--accent); }

.site-header > .wordmark { margin-top: 21px; }

.site-nav {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  justify-content: space-between;
  row-gap: 2px;
  width: 338px;
}

.nav-group { display: contents; }

.nav-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--nav-ink);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -.08px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .22s ease;
}

.nav-link img { display: none; }

.nav-link::before {
  content: '';
  position: relative;
  top: -3px;
  display: block;
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url('assets/arrow-up-right.svg') center / contain no-repeat;
  mask: url('assets/arrow-up-right.svg') center / contain no-repeat;
  transition: transform .24s cubic-bezier(.2, .7, .2, 1);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link:active,
.nav-link[aria-current='page'] {
  color: var(--accent);
  font-weight: 500;
}

.nav-link:hover::before,
.nav-link:focus-visible::before,
.nav-link:active::before { transform: translate(2px, -2px); }

.menu-toggle { display: none; }

.page-shell {
  min-height: calc(100svh - 160px);
  padding: 0 var(--right-gutter) 80px var(--gutter);
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: min(440px, 100%);
  font-size: 20px;
  line-height: 1.7;
  letter-spacing: -.5px;
}

.about-copy p { margin: 0; }

.page-about .about-copy { width: min(650px, 100%); }

.page-about .latest-writing { width: min(440px, 100%); }

.latest-writing {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.latest-writing-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.latest-writing-list li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: baseline;
  column-gap: 24px;
  padding: 5px 0;
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -.25px;
}

.latest-writing-list time {
  color: var(--muted);
  font-size: 14px;
  line-height: inherit;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.latest-writing-list a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease;
}

.latest-writing-list a:hover,
.latest-writing-list a:focus-visible {
  color: var(--accent);
}

.latest-writing-list .writing-status {
  color: var(--muted);
  font-size: 15px;
}

.page-career,
.page-investing { padding-right: max(var(--right-gutter), calc(100vw - var(--gutter) - 650px)); }

.page-career .chapter,
.page-investing .chapter { width: min(650px, 100%); }

.chapter { margin: 0; }

.first-chapter {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

h2 {
  max-width: 650px;
  margin: 0;
  font-size: 36px;
  font-weight: 400;
  line-height: 57.12px;
  letter-spacing: -1.17px;
}

.page-career p,
.page-investing p {
  margin: 0;
  font-size: 20px;
  line-height: 33.3px;
  letter-spacing: -.5px;
}

.timeline-chapter {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 96px;
}

.timeline { margin: 0; }

.timeline > div {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  transition: border-color .2s ease, transform .2s ease;
}

.timeline > div + div { border-top: 1px solid var(--line); }

.timeline > div:hover {
  border-color: var(--accent);
  transform: translateX(3px);
}

dt {
  color: var(--accent);
  font-size: 14px;
  font-weight: 400;
  line-height: 25.2px;
  font-variant-numeric: tabular-nums;
}

dd {
  margin: 0;
  font-size: 18px;
  line-height: 30px;
}

.page-investing article { gap: 28px; }

.page-press { padding-bottom: 120px; }

.page-press .sources-chapter {
  width: min(687px, 100%);
  gap: 0;
}

.sources-chapter > h2 {
  width: min(640px, 100%);
  line-height: 44px;
}

.sources-chapter > p {
  margin: 0;
  font-size: 18px;
  line-height: 33.3px;
  letter-spacing: normal;
}

.sources {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
}

.sources li {
  padding: 27px 0;
  border-top: 1px solid var(--line);
  font-size: 17px;
  line-height: 30px;
}

.sources strong { font-weight: 400; }

.sources li a {
  color: var(--accent);
  text-decoration: none;
  transition: color .2s ease;
}

.sources li a:hover { color: var(--ink); }

/* Private access */
.access-page {
  min-height: 100svh;
  overflow-x: hidden;
}

.access-header {
  height: 160px;
  padding: 31px var(--gutter) 0;
}

.access-main {
  display: flex;
  justify-content: center;
  padding: 110px 24px 64px;
}

.access-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 326px;
  min-height: 326px;
  padding: 32px;
  gap: 48px;
  border: 1px solid var(--card-line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(40, 43, 41, .08);
  animation: access-in .65s cubic-bezier(.2, .65, .25, 1) both;
}

.access-title {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 400;
  line-height: 48px;
  letter-spacing: -1.1px;
  text-align: center;
}

.access-form {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.password-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding-top: 6px;
  border-bottom: 1px solid var(--card-line);
  transition: border-color .2s ease;
}

.password-input-wrap:focus-within { border-color: var(--accent); }

.password-input {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
}

.password-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

/* Keeps browser autofill from painting a coloured box behind the text. */
.password-input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px var(--card) inset;
  -webkit-text-fill-color: var(--ink);
}

.password-visibility {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  transition: color .2s ease;
}

.password-visibility:hover { color: var(--accent); }

/* The top padding offsets Anek Odia sitting high in its line box, so the label looks centred. */
.access-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  padding: 6px 22px 0;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.access-submit:hover {
  background: #171918;
  box-shadow: 0 8px 18px rgba(40, 43, 41, .2);
  transform: translateY(-1px);
}

.access-submit:active { transform: translateY(0); }

.access-submit:disabled {
  cursor: wait;
  opacity: .72;
}

/* The negative margins fit one line of message into the gap above the button, so the button only moves when a message wraps. */
.form-message {
  min-height: 18px;
  margin: -25px 0;
  color: var(--accent);
  font-size: 12px;
  line-height: 18px;
}

.access-form.is-invalid .password-input-wrap {
  border-color: var(--accent);
  animation: field-shake .32s ease;
}

@keyframes access-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

@keyframes nav-fade {
  from { opacity: 0; }
}

@keyframes nav-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
}

body.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .65, .25, 1);
}

@media (max-width: 900px) {
  :root { --gutter: 56px; }

  .site-nav { width: 330px; }
}

@media (max-width: 760px) {
  :root {
    --gutter: 24px;
    --right-gutter: 24px;
  }

  .site-header {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    height: auto;
    min-height: 100px;
    padding: 22px var(--gutter) 20px;
    border-bottom: 1px solid transparent;
    background: rgba(244, 241, 234, .95);
    backdrop-filter: blur(14px);
    transition: border-color .2s ease;
  }

  .site-header:has(.site-nav.open) { border-bottom-color: var(--line); }
  body.is-scrolled .site-header { border-bottom-color: var(--line); }
  body.menu-open { overflow: hidden; }

  .wordmark {
    font-size: 28px;
    line-height: 30px;
    letter-spacing: -.8px;
  }

  .site-header > .wordmark { margin-top: 18px; }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 7px 0 7px 9px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    line-height: 24px;
    cursor: pointer;
  }

  .menu-icon {
    position: relative;
    top: -3px;
    display: block;
    width: 17px;
    height: 17px;
  }

  .menu-icon::before,
  .menu-icon::after {
    content: '';
    position: absolute;
    left: 1px;
    top: 8px;
    width: 15px;
    height: 1px;
    background: currentColor;
    transition: transform .22s ease;
  }

  .menu-icon::after { transform: rotate(90deg); }

  .menu-toggle[aria-expanded='true'] .menu-icon::before { transform: rotate(45deg); }
  .menu-toggle[aria-expanded='true'] .menu-icon::after { transform: rotate(-45deg); }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    width: auto;
    height: calc(100vh - 100px);
    height: calc(100dvh - 100px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 36px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    background: var(--paper);
  }

  .site-nav.open {
    display: flex;
    animation: nav-fade .25s ease both;
  }

  .nav-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .nav-group:last-child {
    gap: 2px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
  }

  .nav-link {
    font-size: 36px;
    font-weight: 500;
    line-height: 48px;
    letter-spacing: -1px;
  }

  .nav-group:first-child .nav-link::before { display: none; }

  .nav-group:last-child .nav-link::before { top: -4px; }

  .nav-group:last-child .nav-link {
    flex-direction: row-reverse;
    gap: 8px;
    font-size: 19px;
    font-weight: 400;
    line-height: 34px;
    letter-spacing: 0;
  }

  .site-nav.open .nav-group:first-child .nav-link,
  .site-nav.open .nav-group:last-child {
    animation: nav-rise .5s cubic-bezier(.2, .65, .25, 1) both;
  }

  .site-nav.open .nav-group:first-child .nav-link:nth-child(2) { animation-delay: 40ms; }
  .site-nav.open .nav-group:first-child .nav-link:nth-child(3) { animation-delay: 80ms; }
  .site-nav.open .nav-group:first-child .nav-link:nth-child(4) { animation-delay: 120ms; }
  .site-nav.open .nav-group:last-child { animation-delay: 180ms; }

  .page-shell {
    min-height: calc(100svh - 100px);
    padding: 38px var(--right-gutter) 64px var(--gutter);
  }

  .about-copy {
    gap: 26px;
    font-size: 19px;
    line-height: 1.65;
    letter-spacing: -.35px;
  }

  .latest-writing { margin-top: 10px; }

  .latest-writing-list li {
    grid-template-columns: 52px minmax(0, 1fr);
    column-gap: 18px;
    padding-block: 4px;
    font-size: 20px;
  }


  .page-career,
  .page-investing { padding-right: var(--right-gutter); }

  .first-chapter { gap: 54px; }

  article { gap: 18px; }

  h2 {
    font-size: 32px;
    line-height: 1.28;
    letter-spacing: -.9px;
  }

  .page-career p,
  .page-investing p {
    font-size: 18px;
    line-height: 1.66;
    letter-spacing: -.3px;
  }

  .timeline-chapter {
    gap: 18px;
    margin-top: 72px;
  }

  .timeline > div {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    padding: 21px 0;
  }

  .timeline > div:hover { transform: none; }

  dt {
    font-size: 13px;
    line-height: 22px;
  }

  dd {
    font-size: 16px;
    line-height: 1.65;
  }

  .page-investing article { gap: 24px; }

  .sources-chapter > p {
    margin-top: 0;
    font-size: 18px;
    line-height: 1.65;
  }

  .sources-chapter > h2 { line-height: 1.28; }

  .sources { margin-top: 34px; }

  .sources li {
    padding: 22px 0;
    font-size: 16px;
    line-height: 1.65;
  }

  .access-header {
    height: 100px;
    padding: 22px var(--gutter) 0;
  }

  .access-main {
    align-items: flex-start;
    min-height: calc(100svh - 100px);
    padding: clamp(72px, 17svh, 130px) 24px 48px;
  }
}

@media (max-width: 420px) {
  .timeline > div {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px;
  }

  .access-main { padding-inline: 20px; }

  .access-card {
    width: 100%;
    max-width: 326px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  .site-nav.open,
  .site-nav.open .nav-group,
  .site-nav.open .nav-link { animation: none !important; }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
