/* Geist Mono (SIL OFL 1.1, see /assets/fonts/OFL.txt), self-hosted: Latin, plus Latin Extended for ā, ē, ī, ō, ū. */
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/geist-mono-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;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/assets/fonts/geist-mono-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 {
  --bg: #101719;
  --fg: #e6e7e5;
  --soft: #aeb4b9;
  --muted: #747b80;
  --line: rgba(255, 255, 255, 0.18);
  --sheet: rgba(16, 23, 25, 0.9);
  --tile: #172024;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #dbe5e4;
  --fg: #1f2426;
  --soft: #465055;
  --muted: #707a7e;
  --line: rgba(0, 0, 0, 0.2);
  --sheet: rgba(219, 229, 228, 0.92);
  --tile: #cfdad9;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Home is one screen and never scrolls; the other pages scroll over the water. */
html[data-view="home"],
html[data-view="home"] body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html[data-view="home"] body {
  position: fixed;
  inset: 0;
}

#ocean {
  position: fixed;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  /* The large viewport height doesn't change as a phone's address bar slides away. */
  height: 100vh;
  height: 100lvh;
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  touch-action: manipulation;
}

a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 1px dashed var(--soft);
  outline-offset: 3px;
}

/* nav */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px 20px;
  pointer-events: none;
  transition: background-color 0.3s;
}

html[data-view="page"] .nav {
  background: linear-gradient(var(--bg) 55%, transparent);
}

.nav nav {
  display: flex;
  align-items: center;
  gap: 28px;
  pointer-events: auto;
}

.nav a {
  /* Padding offset by margin: a bigger tap target without moving anything. */
  margin: -10px -4px;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.2s;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--soft);
}

.nav a[aria-current] {
  color: var(--fg);
  font-weight: 500;
}

.theme {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -7px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}

.theme:hover {
  color: var(--fg);
}

.theme svg {
  width: 15px;
  height: 15px;
}

.icon-moon,
[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

.tally,
.hint {
  position: fixed;
  z-index: 3;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
  transition: opacity 0.6s;
}

.tally {
  top: max(26px, env(safe-area-inset-top));
  right: 28px;
  font-variant-numeric: tabular-nums;
}

.hint {
  right: 28px;
  bottom: max(24px, env(safe-area-inset-bottom));
  opacity: 0;
}

.hint.show {
  opacity: 1;
}

html[data-view="page"] .tally,
html[data-view="page"] .hint {
  opacity: 0;
}

/* page swaps */

#view {
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

#view.leaving,
#view.entering {
  opacity: 0;
}

#view.leaving {
  transform: translateY(6px);
}

#view.entering {
  transform: translateY(-6px);
}

/* home */

.intro {
  position: fixed;
  z-index: 2;
  left: clamp(20px, 20vw, 320px);
  right: 20px;
  bottom: max(clamp(40px, 13vh, 150px), env(safe-area-inset-bottom));
  max-width: 780px;
  font-size: 14.5px;
  /* A soft halo of water colour keeps the text readable when a bird passes under it. */
  text-shadow:
    0 0 3px var(--bg),
    0 0 8px var(--bg),
    0 0 14px var(--bg);
  pointer-events: none;
}

.intro p {
  width: fit-content;
  max-width: 100%;
  margin: 0;
}

.greeting {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: inherit;
  font-weight: 500;
}

.bio {
  color: var(--soft);
}

.links {
  margin-top: 14px !important;
  color: var(--muted);
}

.intro a {
  pointer-events: auto;
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: -0.17em;
  background: var(--soft);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* inner pages: a sheet floating on the water */

.page {
  position: relative;
  z-index: 1;
  width: min(880px, 100% - 32px);
  margin: 92px auto 48px;
  padding: 34px 40px 28px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.page .label {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}

.page h1 {
  margin: 0 0 14px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

.page h1.name {
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 600;
}

.page h2 {
  margin: 52px 0 12px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
}

.page p {
  max-width: 70ch;
  margin: 0 0 14px;
  color: var(--soft);
}

.page strong {
  color: var(--fg);
  font-weight: 500;
}

.page .lede {
  color: var(--fg);
  font-size: 15px;
}

.who {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
}

.who img {
  display: block;
  width: 112px;
  height: 112px;
  border: 1px solid var(--line);
  background: var(--tile);
  object-fit: cover;
}

.who h1 + p {
  margin: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.stats li {
  padding: 12px 14px;
  border: 1px solid var(--line);
}

.stats b {
  display: block;
  color: var(--fg);
  font-size: 18px;
  font-weight: 600;
}

.stats span {
  color: var(--muted);
  font-size: 12px;
}

blockquote {
  max-width: 70ch;
  margin: 16px 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

blockquote p {
  margin: 0 !important;
}

blockquote footer {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 44px 32px;
  margin-top: 36px;
}

.project img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  border: 1px solid var(--line);
  background: var(--tile);
  object-fit: cover;
}

.project .tags {
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.project h2 {
  margin: 0 0 8px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 600;
}

.project p,
.project .visit {
  font-size: 13.5px;
}

.project blockquote {
  font-size: 13px;
}

/* Contact: the intro sits centred above the booking widget. */
.contact .label,
.contact h1,
.contact h1 + p {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

/* As wide as the text column, centred in the sheet. */
.calendly-inline-widget {
  width: 100%;
  max-width: 70ch;
  min-width: 300px;
  height: 700px;
  margin: 26px auto 0;
}

.page-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 52px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.noscript {
  position: fixed;
  top: 40%;
  left: 20px;
  right: 20px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  /* Calendly stacks its calendar under the details on narrow screens, so it needs the height. */
  .calendly-inline-widget {
    height: 1000px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .intro {
    bottom: 18px;
    font-size: 12px;
  }

  .links {
    margin-top: 6px !important;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 12.5px;
  }

  .nav nav {
    gap: 18px;
  }

  .nav a {
    font-size: 12.5px;
  }

  .intro {
    left: 16px;
    right: 16px;
    bottom: max(56px, env(safe-area-inset-bottom));
    font-size: 12.5px;
  }

  .tally {
    top: auto;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .hint {
    right: auto;
    left: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .page {
    margin-top: 76px;
    padding: 24px 18px 20px;
  }

  .who {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
  }

  #view {
    transition: none;
  }
}
