/* Every page behind the landing page: sections, articles, signing in and the writing desk.
   One rule for all of them: the painting, type and hairlines. No panels, no capsules, no icons.
   Whatever can be pressed is a word in small Clarendon capitals; whatever is read is in Charter. */
:root {
  --ink: #07060c;
  --line: rgba(255, 255, 255, .18);
  --soft: rgba(255, 255, 255, .80);
  --dim: rgba(255, 255, 255, .58);
  --edge: 28px;
  /* Titles in a bold Clarendon, the face of the THIEL wordmark; reading text in Charter. */
  --display: Superclarendon, Clarendon, "Clarendon BT", "Clarendon LT Std", Besley, Rockwell, "Roboto Slab", Georgia, serif;
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* hidden means hidden, whatever display an element is otherwise given */
[hidden] { display: none !important; }

html {
  background: var(--ink);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #fff;
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Shown to a signed-in author only, or to everyone else only. */
.for-author { display: none !important; }

.author .for-author { display: revert !important; }

.author .for-guest { display: none !important; }

/* ------------------------------------------------------------ words you can press */

.mast a,
.mast button,
.link,
.button,
.seg span,
.post__section,
.claim dt,
.claim--edit span {
  font-family: var(--display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
}

.link {
  flex: none;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--soft);
  cursor: pointer;
  transition: color .2s ease;
}

.link:hover { color: #fff; }

.link--danger { color: rgb(255, 150, 138); }

.link--danger:hover { color: rgb(255, 190, 182); }

/* the one thing a page is for: white, square, black lettering */
.button {
  flex: none;
  padding: 14px 20px 13px;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: #0a0a12;
  cursor: pointer;
  transition: background .2s ease;
}

.button:hover { background: rgba(255, 255, 255, .84); }

.button--wide {
  width: 100%;
  margin-top: 10px;
  padding: 18px 20px 17px;
  font-size: 13px;
}

/* ------------------------------------------------------------ the picture behind the page */

/* The sky the landing flight ends in, held still behind the page. */
.sky {
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  background:
    linear-gradient(rgba(7, 6, 12, .46), rgba(7, 6, 12, .80)),
    var(--ink) url(/frames/720/f0640.webp) center / cover no-repeat;
}

/* A section's painting fills the page. It is clear at the head, where the name stands, and
   falls into the dark below, where the text is. Reading on, the whole picture recedes:
   --deep runs from 0 to 1 over the first stretch of scrolling. */
.backdrop {
  position: fixed;
  z-index: -1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: var(--ink);
}

.backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: calc(1 - var(--deep, 0) * .76);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(7, 6, 12, .50) 0%, rgba(7, 6, 12, .16) 17%, rgba(7, 6, 12, .30) 30%,
    rgba(7, 6, 12, .80) 50%, rgba(7, 6, 12, .93) 70%, rgba(7, 6, 12, .96) 100%);
}

/* an article: the title stands on the painting, the text starts in the dark */
.backdrop--reading::after {
  background: linear-gradient(to bottom,
    rgba(7, 6, 12, .58) 0%, rgba(7, 6, 12, .50) 16%, rgba(7, 6, 12, .86) 40%, rgba(7, 6, 12, .95) 100%);
}

/* signing in and writing: the painting is a presence, no more */
.backdrop--desk::after {
  background: linear-gradient(to bottom, rgba(7, 6, 12, .62) 0%, rgba(7, 6, 12, .84) 34%, rgba(7, 6, 12, .93) 100%);
}

/* Opening a card grows its painting into this backdrop, and back. */
@view-transition { navigation: auto; }

::view-transition-group(*) {
  animation-duration: .55s;
  animation-timing-function: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ------------------------------------------------------------ top of the page */

/* The way back at the left, the sections in the middle, the way in at the right. All words. */
.mast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 48px;
  padding: max(18px, env(safe-area-inset-top)) max(var(--edge), env(safe-area-inset-right)) 0 max(var(--edge), env(safe-area-inset-left));
  text-shadow: 0 1px 16px rgba(0, 0, 0, .6);
}

.mast a,
.mast button {
  padding: 16px 0;
  border: 0;
  background: none;
  white-space: nowrap;
  color: var(--soft);
  cursor: pointer;
  transition: color .2s ease;
}

.mast a:hover,
.mast button:hover { color: #fff; }

.home {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 18px 0 0 !important;
}

.home svg { display: block; filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .6)); }

.tabs {
  grid-column: 2;
  display: flex;
  gap: 34px;
}

.tabs [aria-current="page"] {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.mast__door {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 26px;
}

/* who is signed in, next to the way out */
.mast__who {
  font-size: 14.5px;
  white-space: nowrap;
  color: var(--dim);
}

.wrap {
  width: min(860px, 100% - var(--edge) * 2);
  margin: 0 auto;
  padding: 0 0 max(80px, env(safe-area-inset-bottom));
}

.wrap--read { width: min(680px, 100% - var(--edge) * 2); }

/* ------------------------------------------------------------ a section */

/* The name, standing on the painting. */
.title {
  padding: clamp(40px, 13vh, 150px) 0 clamp(34px, 8vh, 76px);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .55), 0 1px 3px rgba(0, 0, 0, .35);
}

.title h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(42px, 10.5vw, 104px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: .98;
  text-transform: uppercase;
}

/* The articles of a section: one line per article, the date in the margin, a hairline between. */
.index { border-bottom: 1px solid var(--line); }

.entry {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0 28px;
  padding: 28px 0 30px;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.entry__when {
  padding-top: 6px;
  font-size: 14.5px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--dim);
}

/* date, author, number: one under the other in the margin */
.entry__when > * { display: block; }

.entry h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(21px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.16;
}

a.entry h2 {
  display: inline;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .3s ease;
}

a.entry:hover h2 { background-size: 100% 1px; }

.entry p {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.46;
  color: var(--soft);
}

.entry--full .prose {
  margin-top: 12px;
  font-size: 18.5px;
  line-height: 1.55;
}

.entry--full h2 { font-size: 22px; }

.empty {
  margin: 0;
  padding: 26px 0 28px;
  border-top: 1px solid var(--line);
  font-size: 18px;
  color: var(--soft);
}

/* ------------------------------------------------------------ an article */

.post { padding-top: clamp(30px, 10vh, 120px); }

.post__section {
  color: var(--soft);
  text-shadow: 0 1px 16px rgba(0, 0, 0, .6);
}

.post__section:hover { color: #fff; }

.post h1 {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: clamp(31px, 5.4vw, 54px);
  font-weight: 700;
  line-height: 1.07;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .5);
}

.post__meta {
  margin: 20px 0 0;
  font-size: 15.5px;
  color: var(--soft);
}

/* A thesis opens with the belief it argues against. */
.claim {
  margin: clamp(30px, 6vh, 56px) 0 0;
  border-bottom: 1px solid var(--line);
}

.claim div,
.claim--edit label {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 6px 28px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--line);
}

.claim dt,
.claim--edit span {
  padding-top: 6px;
  color: var(--dim);
}

.claim dd {
  margin: 0;
  font-size: 19.5px;
  line-height: 1.42;
}

.claim div:first-child dd { color: var(--soft); }

.specs {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15.5px;
  color: var(--soft);
}

.specs li { display: inline; }

.specs li + li::before { content: "  ·  "; white-space: pre; }

.specs b {
  margin-right: 7px;
  font-weight: 400;
  color: var(--dim);
}

.prose {
  margin-top: clamp(30px, 6vh, 56px);
  font-size: 20px;
  line-height: 1.64;
  color: rgba(255, 255, 255, .93);
}

.prose > :first-child { margin-top: 0; }

.prose > :last-child { margin-bottom: 0; }

.prose p { margin: 0 0 1.15em; }

.prose h2,
.prose h3 {
  margin: 1.9em 0 .55em;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.2;
}

.prose h2 { font-size: 25px; }

.prose h3 { font-size: 19.5px; }

.prose a {
  text-decoration-color: rgba(255, 255, 255, .5);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 2px 0 2px 22px;
  border-left: 1px solid rgba(255, 255, 255, .6);
  color: var(--soft);
}

.prose ul,
.prose ol {
  margin: 0 0 1.15em;
  padding-left: 1.3em;
}

.prose li { margin-bottom: .35em; }

.prose code {
  font-family: var(--mono);
  font-size: .82em;
  color: #fff;
}

.prose pre {
  overflow-x: auto;
  margin: 1.5em 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prose pre code {
  font-size: 14.5px;
  line-height: 1.55;
}

.prose hr {
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose img {
  display: block;
  max-width: 100%;
  margin: 1.7em auto;
}

.after {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(40px, 8vh, 80px);
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------ signing in */

/* Signing in and joining: a name, two lines to write on and one button, in the middle of the screen. */
.gate {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 56px;
  min-height: calc(100vh - 170px);
  min-height: calc(100svh - 170px);
  padding: 30px 0;
}

.gate__sheet { width: min(360px, 100%); }

.gate__sheet h1,
.gate__sheet h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.02;
  text-transform: uppercase;
}

.gate__sheet h1 { font-size: clamp(34px, 9vw, 44px); }

.gate__sheet h2 { font-size: 22px; }

.gate__sheet > .form__note { margin-top: 16px; }

.form {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.form small {
  margin-left: 6px;
  font-size: 13.5px;
  color: var(--dim);
}

.form__note {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.45;
  color: var(--soft);
}

.form .form__note:empty { display: none; }

.field {
  display: grid;
  gap: 2px;
}

.field > span {
  font-size: 14.5px;
  color: var(--dim);
}

/* a line to write on, not a box */
.field input {
  width: 100%;
  height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .42);
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 19px;
  color: #fff;
  transition: border-color .2s ease;
}

.field input:focus {
  outline: none;
  border-bottom-color: #fff;
}

/* a filled-in password keeps the page's colours */
input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  caret-color: #fff;
  transition: background-color 99999s ease-out 0s;
}

.gate__sheet .link { justify-self: center; }

/* ------------------------------------------------------------ the writing desk */

/* Two lists (articles, people) and one page to write on. The two names are the way between
   the lists: the one you are on is white. */
.desk__tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px clamp(18px, 3.4vw, 36px);
  padding: clamp(30px, 10vh, 110px) 0 clamp(28px, 6vh, 56px);
}

.desk__tabs [data-view] {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--display);
  font-size: clamp(30px, 6.4vw, 52px);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .34);
  cursor: pointer;
  transition: color .2s ease;
}

.desk__tabs [data-view]:hover { color: rgba(255, 255, 255, .7); }

.desk__tabs [aria-current="page"],
.desk__tabs [aria-current="page"]:hover { color: #fff; }

.desk__tabs .button { margin-left: auto; }

.desk .form__note {
  margin: -8px 0 22px;
  min-height: 1px;
}

.desk .form__note:empty { display: none; }

.mine__row {
  display: flex;
  align-items: baseline;
  gap: 22px;
  width: 100%;
  padding: 24px 0 25px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font: inherit;
  text-align: left;
  color: #fff;
  cursor: pointer;
}

.mine__row strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 25px);
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mine__row span {
  flex: none;
  font-size: 15px;
  color: var(--dim);
}

.mine__row:hover strong {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

/* a person or an invitation: not pressed as a whole, its actions stand at the end */
.mine__row--static { cursor: default; }

.mine__row--static:hover strong { text-decoration: none; }

.mine__row--static strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

/* one thing to fill in, on one line: what it is, where to write it, the word that does it */
.line {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.line label {
  font-size: 15px;
  color: var(--dim);
}

.line input {
  width: 100%;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  font-size: 19px;
  color: #fff;
}

.line input::placeholder { color: rgba(255, 255, 255, .36); }

.line input:focus { outline: none; }

/* The page an article is written on. Nothing has a frame: the title is typed where the title
   goes and the text where the text goes, as it will read. */
.sheet {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 10px;
}

/* what can be done with the article, in one line that stays at the top */
.sheet__bar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 26px;
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
}

/* its ground runs the full width of the window */
.sheet__bar::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: -100vw;
  right: -100vw;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 12, .94);
}

.sheet__state {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 15px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--dim);
}

.sheet__state a { color: #fff; }

.sheet__bar .button { padding: 12px 18px 11px; }

/* which section it goes in: three names, the chosen one white and underlined */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin-top: clamp(26px, 6vh, 56px);
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: block;
  padding: 8px 0;
  white-space: nowrap;
  color: rgba(255, 255, 255, .44);
  cursor: pointer;
  transition: color .2s ease;
}

.seg span:hover { color: var(--soft); }

.seg input:checked + span {
  color: #fff;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.seg input:focus-visible + span { outline: 2px solid rgba(255, 255, 255, .9); outline-offset: 4px; }

.sheet textarea,
.sheet__slug input {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  color: #fff;
  resize: none;
  overflow: hidden;
}

.sheet textarea:focus,
.sheet__slug input:focus { outline: none; }

.sheet textarea::placeholder { color: rgba(255, 255, 255, .32); }

.sheet__title {
  margin-top: 26px;
  font-family: var(--display) !important;
  font-size: clamp(31px, 5.4vw, 54px) !important;
  font-weight: 700 !important;
  line-height: 1.07;
}

.sheet__summary {
  margin-top: 18px;
  font-size: 20.5px !important;
  line-height: 1.4;
  color: var(--soft) !important;
}

.claim--edit textarea {
  font-size: 19.5px !important;
  line-height: 1.42;
}

.sheet__body {
  min-height: 46vh;
  margin-top: clamp(30px, 6vh, 56px);
  font-size: 20px !important;
  line-height: 1.64;
}

.preview { min-height: 46vh; }

.sheet__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 28px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sheet__slug {
  display: flex;
  flex: 1 1 260px;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 15.5px;
  color: var(--dim);
}

.sheet__slug span { margin-right: -8px; }

.sheet__slug input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15.5px;
  color: var(--soft);
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .9);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  :root { --edge: 20px; }

  /* on a phone the sections are one step back, on the cards */
  .mast { grid-template-columns: minmax(0, 1fr) auto; }

  .tabs { display: none; }

  .mast__door {
    grid-column: 2;
    gap: 22px;
  }

  .mast__who { display: none; }

  .entry {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 0 24px;
  }

  .entry__when {
    padding: 0 0 8px;
    line-height: 1.4;
  }

  /* on a narrow screen they run on one line above the title */
  .entry__when > * { display: inline; }

  .entry__when > * + *::before { content: " · "; }

  .claim div,
  .claim--edit label { grid-template-columns: minmax(0, 1fr); }

  .claim dt,
  .claim--edit span { padding-top: 0; }

  .prose { font-size: 19px; }

  .gate { min-height: calc(100svh - 150px); }

  .desk__tabs .button {
    flex-basis: 100%;
    margin-left: 0;
    padding: 17px 20px 16px;
  }

  .mine__row {
    flex-wrap: wrap;
    gap: 5px 18px;
    padding: 19px 0 20px;
  }

  .mine__row strong {
    flex-basis: 100%;
    white-space: normal;
  }

  .line {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 18px;
    padding: 14px 0;
  }

  .line label { grid-column: 1 / -1; }

  .sheet__bar { gap: 6px 16px; }

  .sheet__bar .link,
  .sheet__bar .button { font-size: 11.5px; }

  .sheet__bar .button { padding: 12px 14px 11px; }

  /* the way back is the arrow alone; what was last saved stands on its own line */
  #back span { display: none; }

  #back { margin-right: auto; }

  .sheet__state {
    order: 5;
    flex-basis: 100%;
    text-align: left;
  }

  .sheet__state:empty { display: none; }
}
